#include <CCollisionSpheres.h>
Public Member Functions | |
cCollisionSpheresNode (Plist &a_primList, cCollisionSpheresSphere *a_parent=NULL) | |
Constructor of cCollisionSpheresNode. | |
cCollisionSpheresNode (std::vector< cTriangle > *a_tris, cCollisionSpheresSphere *a_parent=NULL, double a_extendedRadius=0) | |
Constructor of cCollisionSpheresNode. | |
cCollisionSpheresNode () | |
Default constructor of cCollisionSpheresNode. | |
virtual | ~cCollisionSpheresNode () |
Destructor of cCollisionSpheseNode. | |
void | ConstructChildren (Plist &a_primList) |
Create subtrees by splitting primitives into left and right lists. | |
int | isLeaf () |
Return whether the node is a leaf node. (In this class, it is not.). | |
void | draw (int a_depth) |
Draw the collision sphere if at the given depth. | |
Static Public Member Functions | |
static bool | computeCollision (cCollisionSpheresNode *a_sa, cCollisionSpheresSphere *a_sb, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings) |
Check for intersection between given nodes, the first an internal node. | |
static void | swapptr (void **a_a, void **a_b) |
Exchange the two given pointers. | |
Public Attributes | |
cCollisionSpheresSphere * | m_left |
Pointer to the left child in the sphere tree. | |
cCollisionSpheresSphere * | m_right |
Pointer to the right child in the sphere tree. |
cCollisionSpheresNode::cCollisionSpheresNode | ( | Plist & | a_primList, | |
cCollisionSpheresSphere * | a_parent = NULL | |||
) |
Constructor of cCollisionSpheresNode.
Constructor of cCollisionSpheresNode.
a_primList | List of shape primitives to be enclosed in the subtree rooted at this internal node. | |
a_parent | Pointer to the parent of this node in the tree. |
cCollisionSpheresNode::cCollisionSpheresNode | ( | std::vector< cTriangle > * | a_tris, | |
cCollisionSpheresSphere * | a_parent = NULL , |
|||
double | a_extendedRadius = 0 | |||
) |
Constructor of cCollisionSpheresNode.
Constructor of cCollisionSpheresNode.
cCollisionSpheresSphere(a_parent)
a_tris | Pointer to vector of triangles to use for collision detection. | |
a_parent | Pointer to the parent of this node in sphere tree. | |
a_extendedRadius | Bounding radius. |
bool cCollisionSpheresNode::computeCollision | ( | cCollisionSpheresNode * | a_sa, | |
cCollisionSpheresSphere * | a_sb, | |||
cCollisionRecorder & | a_recorder, | |||
cCollisionSettings & | a_settings | |||
) | [static] |
Check for intersection between given nodes, the first an internal node.
Determine whether there is any intersection between the primitives (line and triangles) in the collision subtrees rooted at the two given collision spheres. If so, return (in the output parameters) information about the intersected triangle of the mesh closest to the segment origin.
a_sa | Root of one sphere tree to check for collision. | |
a_sb | Root of other sphere tree to check for collision. | |
a_recorder | Stores all collision events | |
a_settings | Contains collision settings information. |
void cCollisionSpheresNode::ConstructChildren | ( | Plist & | a_primList | ) |
Create subtrees by splitting primitives into left and right lists.
Create subtrees by splitting primitives into left and right lists.
a_primList | List of shape primitives to be split into left and right subtrees. |
void cCollisionSpheresNode::draw | ( | int | a_depth | ) | [virtual] |
Draw the collision sphere if at the given depth.
Draw the collision sphere if at the given depth.
a_depth | Only draw nodes at this depth in the tree. a_depth = -1 renders the complete tree. |
Implements cCollisionSpheresSphere.
void cCollisionSpheresNode::swapptr | ( | void ** | a_a, | |
void ** | a_b | |||
) | [static] |
Exchange the two given pointers.
Exchange the two given pointers.
a_a | First pointer to be swapped. | |
a_b | Second pointer to be swapped. |