eng::Volume Class Reference

Abstract Volume. More...

#include <eng_volume.hh>

Inheritance diagram for eng::Volume:

eng::BoxVolume eng::BSPVolume eng::SphereVolume

List of all members.

Public Member Functions

 Volume (void)
virtual ~Volume ()
virtual SphereVolume ToSphereVolume (void) const =0
virtual BoxVolume ToBoxVolume (void) const =0
virtual bool IfInside (const Vector3 &v) const =0
virtual bool IfInside (const Volume &volume) const =0
 
Returns:
True if other volume is entirely inside.

virtual bool IfOutside (const Volume &volume) const =0
 
Returns:
True if other volume is entirely outside.

virtual Vector3 GetPosition (void) const =0
virtual void SetPosition (const Vector3 &position)=0
virtual bool IfOutside (const Vector3 &v) const
virtual bool IfIntersecting (const Volume &volume) const
 
Returns:
True if other volume is partly inside and outside this volume.


Detailed Description

Abstract Volume.

The base Volume class is abstract and space-neutral. Derivatives are:

Unlike the Vector3 variants, the Volume variants of IfInside()/IfOutside() aren't exact opposites. "not IfInside(Volume)" might be either outside or intersecting.

Collision-detection can be performed by Volume::IfOutside(Volume&). If IfOutside() returns false, the other volume is either inside or intersecting.

The reason for the abstract method operator SphereVolume() is so that an implementation of Volume::IfInside/IfOutside(Volume&) can convert the abstract Volume arg into a concrete SphereVolume. SphereVolume serves as a LCD.

Only having Volume::operator SphereVolume() would've inefficiently caused BoxVolume(volume) to convert box to a sphere then back to a box. Volume::operator BoxVolume() added which just does a copy.

Grow() omitted since it's N/A to BSPVolume.


Constructor & Destructor Documentation

eng::Volume::Volume ( void   )  [inline]

virtual eng::Volume::~Volume (  )  [inline, virtual]


Member Function Documentation

virtual SphereVolume eng::Volume::ToSphereVolume ( void   )  const [pure virtual]

Implemented in eng::SphereVolume, and eng::BoxVolume.

virtual BoxVolume eng::Volume::ToBoxVolume ( void   )  const [pure virtual]

Implemented in eng::SphereVolume, and eng::BoxVolume.

virtual bool eng::Volume::IfInside ( const Vector3 &  v  )  const [pure virtual]

Implemented in eng::SphereVolume, and eng::BoxVolume.

virtual bool eng::Volume::IfInside ( const Volume volume  )  const [pure virtual]

Returns:
True if other volume is entirely inside.

Implemented in eng::SphereVolume, and eng::BoxVolume.

virtual bool eng::Volume::IfOutside ( const Volume volume  )  const [pure virtual]

Returns:
True if other volume is entirely outside.

Implemented in eng::SphereVolume, and eng::BoxVolume.

virtual Vector3 eng::Volume::GetPosition ( void   )  const [pure virtual]

Implemented in eng::SphereVolume, and eng::BoxVolume.

virtual void eng::Volume::SetPosition ( const Vector3 &  position  )  [pure virtual]

Implemented in eng::SphereVolume, and eng::BoxVolume.

virtual bool eng::Volume::IfOutside ( const Vector3 &  v  )  const [inline, virtual]

Reimplemented in eng::SphereVolume, and eng::BoxVolume.

virtual bool eng::Volume::IfIntersecting ( const Volume volume  )  const [inline, virtual]

Returns:
True if other volume is partly inside and outside this volume.

Reimplemented in eng::BoxVolume.


The documentation for this class was generated from the following file: Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:25 2007