47#ifndef CCollisionAABBH
48#define CCollisionAABBH
86 enum cCollisionAABBState
88 C_AABB_STATE_TEST_CURRENT_NODE,
89 C_AABB_STATE_TEST_LEFT_NODE,
90 C_AABB_STATE_TEST_RIGHT_NODE,
91 C_AABB_STATE_POP_STACK
94 struct cCollisionAABBStack
97 cCollisionAABBState m_state;
134 const double a_radius = 0.0);
144 int buildTree(
const int a_indexFirstNode,
const int a_indexLastNode,
const int a_depth);
Implements an axis-aligned bounding box collision tree (AABB)
Implements a base class for programming collision detectors that identify intersections between segme...
Implements general math utility functions.
This class implements an axis-aligned bounding box collision detector.
Definition CCollisionAABB.h:85
virtual ~cCollisionAABB()
Destructor of cCollisionAABB.
Definition CCollisionAABB.cpp:89
std::vector< cCollisionAABBNode > m_nodes
List of nodes.
Definition CCollisionAABB.h:163
cCollisionAABB()
Constructor of cCollisionAABB.
Definition CCollisionAABB.cpp:63
cGenericArrayPtr m_elements
Pointer to the list of elements in the object.
Definition CCollisionAABB.h:160
void initialize(const cGenericArrayPtr a_elements, const double a_radius=0.0)
This method initializes and builds the AABB collision tree.
Definition CCollisionAABB.cpp:111
virtual bool computeCollision(cGenericObject *a_object, cVector3d &a_segmentPointA, cVector3d &a_segmentPointB, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
This method computes all collisions between a segment passed as argument and the attributed 3D object...
Definition CCollisionAABB.cpp:393
int m_numElements
Number of elements inside tree.
Definition CCollisionAABB.h:157
int buildTree(const int a_indexFirstNode, const int a_indexLastNode, const int a_depth)
Definition CCollisionAABB.cpp:262
int m_rootIndex
Index number of root node.
Definition CCollisionAABB.h:166
int m_maxDepth
Maximum depth of tree.
Definition CCollisionAABB.h:169
double m_radius
Collision shell radius around elements.
Definition CCollisionAABB.h:154
virtual void update()
This methods updates the collision detector and should be called if the 3D model it represents is mod...
Definition CCollisionAABB.cpp:246
virtual void render(cRenderOptions &a_options)
This method renders a visual representation of the collision tree.
Definition CCollisionAABB.cpp:543
This class implements a collision detection recorder that stores all collision events that are report...
Definition CCollisionBasics.h:186
This class implements a base class for collision detection.
Definition CGenericCollision.h:102
This class implements a base class for all 2D or 3D objects in CHAI3D.
Definition CGenericObject.h:113
Definition CAudioBuffer.cpp:57
std::shared_ptr< cGenericArray > cGenericArrayPtr
Definition CGenericArray.h:71
This structure stores the collision settings that are passed to a collision detector when querying fo...
Definition CCollisionBasics.h:243
This structures provide a containers for storing rendering options that are passed through the sceneg...
Definition CRenderOptions.h:83
This class implements a 3D vector.
Definition CVector3d.h:89