Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

BoundingVolume Class Reference

#include <boundingvolume.h>

Inheritance diagram for BoundingVolume:

Inheritance graph
[legend]
Collaboration diagram for BoundingVolume:

Collaboration graph
[legend]
List of all members.

Detailed Description

Base class for bounding volumes All bounding objects (AABB, OBB, Sphere, Capsule) inherit from this base class, and implement specific collision and intersection tests.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Types

enum  BOUNDINGVOLUMETYPE { BV_AABB, BV_OBB, BV_SPHERE, BV_CAPSULE }
 Bounding volume type identifiers. More...


Public Member Functions

 BoundingVolume ()
 BoundingVolume (const BoundingVolume &rkVolume)
virtual bool Intersection (AABB *pkAABB, ContactSet *pkContactSet=0, bool bInvertNormal=false)=0
virtual bool Intersection (OBB *pkOBB, ContactSet *pkContactSet=0, bool bInvertNormal=false)=0
virtual bool Intersection (Sphere *pkSphere, ContactSet *pkContactSet=0, bool bInvertNormal=false)=0
virtual bool Intersection (Capsule *pkCapsule, ContactSet *pkContactSet=0, bool bInvertNormal=false)=0
virtual bool Intersection (Frustum *pkFrustum)=0
virtual bool Intersection (const Vector3d &rkV0, const Vector3d &rkV1, const Vector3d &rkV2, ContactSet *pkContactSet=0, bool bForceTriNormal=true, const Vector3d &rkNormal=Vector3d::ZERO)=0
virtual bool Intersection (BoundingVolume *pkObj, ContactSet *pkContactSet=0, bool bInvertNormal=false)=0
virtual bool Intersection (const Vector3d &rkPoint)=0
virtual bool Intersection (const Ray &rkRay, ContactSet *pkContactSet=0)=0
virtual bool Intersection (const Line &rkLine)=0
virtual bool Intersection (const Plane &rkPlane)=0
virtual void Generate (AABB *pkAABB)=0
virtual void Generate (OBB *pkOBB)=0
virtual void Generate (Sphere *pkSphere)=0
virtual void Generate (Capsule *pkCapsule)=0
void Generate (BoundingVolume *pkObj)
virtual void Generate (VertexBufferPtr &pkVertexBuffer)=0
virtual void Merge (AABB *pkAABB)=0
virtual void Merge (OBB *pkOBB)=0
virtual void Merge (Sphere *pkSphere)=0
virtual void Merge (Capsule *pkCapsule)=0
void Merge (BoundingVolume *pkObj)
virtual BOUNDINGVOLUMETYPE GetType ()=0
virtual BoundingVolumeDuplicate () const=0
virtual void RenderOutlines (const Color &rkColor=Color::GREEN) const=0
const Vector3dGetTranslation () const
const QuaternionGetRotation () const
float GetScaling () const
void Translate (const Vector3d &rkTranslation, bool bNotifyUpdate=true)
void TranslateWorld (const Vector3d &rkTranslation, bool bNotifyUpdate=true)
void Rotate (const Quaternion &rkRotation, bool bNotifyUpdate=true)
void RotateWorld (const Quaternion &rkRotation, bool bNotifyUpdate=true)
void Scale (float fScaling, bool bNotifyUpdate=true)
virtual void SetTranslation (const Vector3d &rkTranslation, bool bNotifyUpdate=true)
virtual void SetRotation (const Quaternion &rkRotation, bool bNotifyUpdate=true)
virtual void SetScaling (float fScaling, bool bNotifyUpdate=true)

Protected Attributes

float m_fScaling
Quaternion m_kRotation
Vector3d m_kTranslation


Member Enumeration Documentation

enum BOUNDINGVOLUMETYPE
 

Bounding volume type identifiers.

Enumeration values:
BV_AABB  Axis-aligned bounding box
BV_OBB  Oriented bounding box
BV_SPHERE  Sphere
BV_CAPSULE  Capsule


Constructor & Destructor Documentation

BoundingVolume  )  [inline]
 

BoundingVolume const BoundingVolume rkVolume  )  [inline]
 

Create from reference object

Parameters:
rkVolume Reference volume object


Member Function Documentation

virtual bool Intersection AABB pkAABB,
ContactSet pkContactSet = 0,
bool  bInvertNormal = false
[pure virtual]
 

Intersection with AABB

Parameters:
pkAABB AABB
pkContactSet Contact set object receiving collision contact data, 0 if not needed
bInvertNormal If false, collision normal will point from passed object to this. If true, normal will point in other direction
Returns:
true if the AABB intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection OBB pkOBB,
ContactSet pkContactSet = 0,
bool  bInvertNormal = false
[pure virtual]
 

Intersection with OBB

Parameters:
pkOBB OBB
pkContactSet Contact set object receiving collision contact data, 0 if not needed
bInvertNormal If false, collision normal will point from passed object to this. If true, normal will point in other direction
Returns:
true if OBB intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection Sphere pkSphere,
ContactSet pkContactSet = 0,
bool  bInvertNormal = false
[pure virtual]
 

Intersection with sphere

Parameters:
pkSphere Sphere
pkContactSet Contact set object receiving collision contact data, 0 if not needed
bInvertNormal If false, collision normal will point from passed object to this. If true, normal will point in other direction
Returns:
true if sphere intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection Capsule pkCapsule,
ContactSet pkContactSet = 0,
bool  bInvertNormal = false
[pure virtual]
 

Intersection with capsule

Parameters:
pkCapsule Capsule
pkContactSet Contact set object receiving collision contact data, 0 if not needed
bInvertNormal If false, collision normal will point from passed object to this. If true, normal will point in other direction
Returns:
true if capsule intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection Frustum pkFrustum  )  [pure virtual]
 

Intersection with frustum

Parameters:
pkFrustum Frustum
Returns:
true if frustum intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection const Vector3d rkV0,
const Vector3d rkV1,
const Vector3d rkV2,
ContactSet pkContactSet = 0,
bool  bForceTriNormal = true,
const Vector3d rkNormal = Vector3d::ZERO
[pure virtual]
 

Intersection with polygon

Parameters:
rkV0 First corner
rkV1 Second corner
rkV2 Third corner
pkContactSet Contact set object receiving collision contact data, 0 if not needed
bForceTriNormal If true force use of triangle normal as separating plane when calculating contact points and depths
rkNormal Optional precalculated normal
Returns:
true if polygon intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection BoundingVolume pkObj,
ContactSet pkContactSet = 0,
bool  bInvertNormal = false
[pure virtual]
 

Intersection test with unknown object type

Parameters:
pkObj Bounding volume object to test for intersection with
pkContactSet Contact set object receiving collision contact data, 0 if not needed
bInvertNormal If false, collision normal will point from passed object to this. If true, normal will point in other direction
Returns:
true if volumes intersect, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection const Vector3d rkPoint  )  [pure virtual]
 

Intersection with point

Parameters:
rkPoint Point
Returns:
true if point intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection const Ray rkRay,
ContactSet pkContactSet = 0
[pure virtual]
 

Intersection with ray

Parameters:
rkRay Ray
pkContactSet Contact set object receiving collision contact data, 0 if not needed
Returns:
true if ray intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection const Line rkLine  )  [pure virtual]
 

Intersection with line

Parameters:
rkLine Line
Returns:
true if line intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual bool Intersection const Plane rkPlane  )  [pure virtual]
 

Intersection with plane

Parameters:
rkPlane Plane
Returns:
true if plane intersects with this object, false if not

Implemented in AABB, Capsule, OBB, and Sphere.

virtual void Generate AABB pkAABB  )  [pure virtual]
 

Generate from AABB

Parameters:
pkAABB Source AABB object

Implemented in AABB, Capsule, OBB, and Sphere.

virtual void Generate OBB pkOBB  )  [pure virtual]
 

Generate from OBB

Parameters:
pkOBB Source OBB object

Implemented in AABB, Capsule, OBB, and Sphere.

virtual void Generate Sphere pkSphere  )  [pure virtual]
 

Generate from sphere

Parameters:
pkSphere Source sphere object

Implemented in AABB, Capsule, OBB, and Sphere.

virtual void Generate Capsule pkCapsule  )  [pure virtual]
 

Generate from capsule

Parameters:
pkCapsule Source capsule object

Implemented in AABB, Capsule, OBB, and Sphere.

void Generate BoundingVolume pkObj  )  [inline]
 

Generate from unknown object

Parameters:
pkObj Source object

virtual void Generate VertexBufferPtr pkVertexBuffer  )  [pure virtual]
 

Generate from vertex soup

Parameters:
pkVertexBuffer Vertex buffer

Implemented in AABB, Capsule, OBB, and Sphere.

virtual void Merge AABB pkAABB  )  [pure virtual]
 

Merge with AABB

Parameters:
pkAABB Source AABB object

Implemented in AABB, Capsule, OBB, and Sphere.

virtual void Merge OBB pkOBB  )  [pure virtual]
 

Merge with OBB

Parameters:
pkOBB Source OBB object

Implemented in AABB, Capsule, OBB, and Sphere.

virtual void Merge Sphere pkSphere  )  [pure virtual]
 

Merge with sphere

Parameters:
pkSphere Source sphere object

Implemented in AABB, Capsule, OBB, and Sphere.

virtual void Merge Capsule pkCapsule  )  [pure virtual]
 

Merge with capsule

Parameters:
pkCapsule Source capsule object

Implemented in AABB, Capsule, OBB, and Sphere.

void Merge BoundingVolume pkObj  )  [inline]
 

Merge with unknown object

Parameters:
pkObj Source object

virtual BOUNDINGVOLUMETYPE GetType  )  [pure virtual]
 

Returns:
Bounding volume type identifier

Implemented in AABB, Capsule, OBB, and Sphere.

virtual BoundingVolume* Duplicate  )  const [pure virtual]
 

Duplicate volume

Returns:
New volume object that is exact copy of this

Implemented in AABB, Capsule, OBB, and Sphere.

virtual void RenderOutlines const Color rkColor = Color::GREEN  )  const [pure virtual]
 

Render volume outlines

Parameters:
rkColor Color of outlines

Implemented in AABB, Capsule, OBB, and Sphere.

const Vector3d& GetTranslation  )  const [inline, inherited]
 

Returns:
Translation of this node

const Quaternion& GetRotation  )  const [inline, inherited]
 

Returns:
Rotation of this node

float GetScaling  )  const [inline, inherited]
 

Returns:
Uniform scaling factor

void Translate const Vector3d rkTranslation,
bool  bNotifyUpdate = true
[inline, inherited]
 

Translate node from current position, in local (along current rotated axes) coordinate system. Will call SetTranslation() for setting new translation of node, derived classes do not need to overload this method directly. Not affected by current scaling.

Parameters:
rkTranslation Translation offset vector
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

void TranslateWorld const Vector3d rkTranslation,
bool  bNotifyUpdate = true
[inline, inherited]
 

Translate node from current position, in world (along unrotated axes) coordinate system. Will call SetTranslation() for setting new translation of node, derived classes do not need to overload this method directly. Not affected by current scaling.

Parameters:
rkTranslation Translation offset vector
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

void Rotate const Quaternion rkRotation,
bool  bNotifyUpdate = true
[inline, inherited]
 

Rotate node in local (current rotation) coordinate system. Will call SetRotation() for setting new rotation of node, derived classes do not need to overload this method directly. Not affected by current scaling.

Parameters:
rkRotation Rotation quaternion
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

void RotateWorld const Quaternion rkRotation,
bool  bNotifyUpdate = true
[inline, inherited]
 

Rotate node in world (unrotated) coordinate system. Will call SetRotation() for setting new rotation of node, derived classes do not need to overload this method directly. Not affected by current scaling.

Parameters:
rkRotation Rotation quaternion
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

void Scale float  fScaling,
bool  bNotifyUpdate = true
[inline, inherited]
 

Scale node by uniform factor. Will use SetScaling for setting new scaling of node, derived classes do not need to overload this method directly. Must be >0, where a value of 1.0f indicates no scaling

Parameters:
fScaling Uniform scaling factor
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

virtual void SetTranslation const Vector3d rkTranslation,
bool  bNotifyUpdate = true
[inline, virtual, inherited]
 

Set translation for node. Derived classes used in hierarchy trees can overload this method and implement caching of world data, or use flag to indicate update needed later.

Parameters:
rkTranslation New translation for node
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree

Reimplemented in HierarchyNode, HierarchyNode< Bone >, and HierarchyNode< SceneNode >.

virtual void SetRotation const Quaternion rkRotation,
bool  bNotifyUpdate = true
[inline, virtual, inherited]
 

Set rotation for node. Derived classes used in hierarchy trees can overload this method and implement caching of world data, or use flag to indicate update needed later.

Parameters:
rkRotation New rotation for node
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

Reimplemented in AABB, HierarchyNode, HierarchyNode< Bone >, and HierarchyNode< SceneNode >.

virtual void SetScaling float  fScaling,
bool  bNotifyUpdate = true
[inline, virtual, inherited]
 

Set uniform scaling for node. Derived classes used in hierarchy trees can overload this method and implement caching of world data, or use flag to indicate update needed later. A value of 1.0f indicates no scaling.

Parameters:
fScaling New uniform scaling factor
bNotifyUpdate Used by derived classes to indicate if to set update flag to child tree (true default, use false with caution)

Reimplemented in HierarchyNode, HierarchyNode< Bone >, and HierarchyNode< SceneNode >.


Member Data Documentation

float m_fScaling [protected, inherited]
 

Uniform scaling factor (must be >0, default 1)

Quaternion m_kRotation [protected, inherited]
 

Rotation

Vector3d m_kTranslation [protected, inherited]
 

Translation


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:10 2004 for NeoEngine by doxygen 1.3.5