chai3d::cCollisionAABBNode Class Reference

This structure implements a tree node inside an AABB collision tree.

#include <CCollisionAABBTree.h>

Public Member Functions

 cCollisionAABBNode ()
 Constructor of cCollisionAABBNode. More...
 
virtual ~cCollisionAABBNode ()
 Destructor of cCollisionAABBNode. More...
 
void fitBBox (double a_radius, cVector3d &a_vertex0)
 This method creates a boundary box for a point. More...
 
void fitBBox (double a_radius, cVector3d &a_vertex0, cVector3d &a_vertex1)
 This method creates a boundary box for a segment. More...
 
void fitBBox (double a_radius, cVector3d &a_vertex0, cVector3d &a_vertex1, cVector3d &a_vertex2)
 This method creates a boundary box for a triangle. More...
 
void render (int a_depth=-1)
 This method draws the edges of the boundary box for this node, if at the given depth. More...
 
bool computeCollision (cGenericObject *a_owner, cVector3d &a_segmentPointA, cVector3d &a_segmentDirection, cCollisionAABBBox &a_lineBox, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
 This method determines whether a line segment intersects any elements covered by this node. More...
 

Public Attributes

cCollisionAABBBox m_bbox
 Bounding box for this node. More...
 
int m_depth
 Depth of this node in the collision tree. More...
 
cAABBNodeType m_nodeType
 Node type. More...
 
int m_leftSubTree
 Left child node index. More...
 
int m_rightSubTree
 Right child node index. More...
 

Constructor & Destructor Documentation

chai3d::cCollisionAABBNode::cCollisionAABBNode ( )

Constructor of cCollisionAABBNode.

virtual chai3d::cCollisionAABBNode::~cCollisionAABBNode ( )
inlinevirtual

Member Function Documentation

void chai3d::cCollisionAABBNode::fitBBox ( double  a_radius,
cVector3d a_vertex0 
)

This method creates a boundary box to enclose a point belonging to the leaf node.

Parameters
a_radiusRadius around the point.
a_vertex0Vertex 0.
void chai3d::cCollisionAABBNode::fitBBox ( double  a_radius,
cVector3d a_vertex0,
cVector3d a_vertex1 
)

This method creates a boundary box to enclose the two vertices of a segment belonging to the leaf node.

Parameters
a_radiusRadius around the segment.
a_vertex0Vertex 0.
a_vertex1Vertex 1.
void chai3d::cCollisionAABBNode::fitBBox ( double  a_radius,
cVector3d a_vertex0,
cVector3d a_vertex1,
cVector3d a_vertex2 
)

This method creates a boundary box to enclose the three vertices of a triangle belonging to the leaf node.

Parameters
a_radiusRadius around the element.
a_vertex0Vertex 0.
a_vertex1Vertex 1.
a_vertex2Vertex 2.
void chai3d::cCollisionAABBNode::render ( int  a_depth = -1)

This method draws the edges of the boundary box for an internal tree node if it is at depth a_depth in the tree, and calls the draw function for its children.

Parameters
a_depthIf a_depth > 0, then only draw nodes at this level in the tree. If a_depth < 0 render all nodes up to this level.
bool chai3d::cCollisionAABBNode::computeCollision ( cGenericObject a_owner,
cVector3d a_segmentPointA,
cVector3d a_segmentDirection,
cCollisionAABBBox a_lineBox,
cCollisionRecorder a_recorder,
cCollisionSettings a_settings 
)

Member Data Documentation

cCollisionAABBBox chai3d::cCollisionAABBNode::m_bbox
int chai3d::cCollisionAABBNode::m_depth
cAABBNodeType chai3d::cCollisionAABBNode::m_nodeType
int chai3d::cCollisionAABBNode::m_leftSubTree
int chai3d::cCollisionAABBNode::m_rightSubTree

The documentation for this class was generated from the following files: