My Project
Loading...
Searching...
No Matches
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.
 
virtual ~cCollisionAABBNode ()
 Destructor of cCollisionAABBNode.
 
void fitBBox (double a_radius, cVector3d &a_vertex0)
 This method creates a boundary box for a point.
 
void fitBBox (double a_radius, cVector3d &a_vertex0, cVector3d &a_vertex1)
 This method creates a boundary box for a segment.
 
void fitBBox (double a_radius, cVector3d &a_vertex0, cVector3d &a_vertex1, cVector3d &a_vertex2)
 This method creates a boundary box for a triangle.
 
void render (int a_depth=-1)
 This method draws the edges of the boundary box for this node, if at the given depth.
 
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.
 

Public Attributes

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

Constructor & Destructor Documentation

◆ cCollisionAABBNode()

chai3d::cCollisionAABBNode::cCollisionAABBNode ( )

Constructor of cCollisionAABBNode.

◆ ~cCollisionAABBNode()

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

Member Function Documentation

◆ fitBBox() [1/3]

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.

◆ fitBBox() [2/3]

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.

◆ fitBBox() [3/3]

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.

◆ render()

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.

◆ computeCollision()

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

◆ m_bbox

cCollisionAABBBox chai3d::cCollisionAABBNode::m_bbox

◆ m_depth

int chai3d::cCollisionAABBNode::m_depth

◆ m_nodeType

cAABBNodeType chai3d::cCollisionAABBNode::m_nodeType

◆ m_leftSubTree

int chai3d::cCollisionAABBNode::m_leftSubTree

◆ m_rightSubTree

int chai3d::cCollisionAABBNode::m_rightSubTree

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