- Main Page
- Classes
- Files
- Directories

- Class List
- Class Hierarchy
- Class Members

# cCollisionAABBInternal Class Reference

cCollisionAABBInternal contains methods to set up internal nodes of an AABB tree and to use them to detect for collision with a line. More...

`#include <CCollisionAABBTree.h>`

Inheritance diagram for cCollisionAABBInternal:

List of all members.

## Public Member Functions
| cCollisionAABBInternal ()
| Default constructor of cCollisionAABBInternal.
| cCollisionAABBInternal (unsigned int a_numLeaves, cCollisionAABBLeaf *a_leaves, unsigned int a_depth=-1)
| Constructor of cCollisionAABBInternal.
virtual | ~cCollisionAABBInternal ()
| Destructor of cCollisionAABBInternal.
void | fitBBox ()
| Size the bounding box for this node to enclose its children.
void | render (int a_depth=-1)
| Draw the edges of the bounding box for this node if it is at depth a_depth.
bool | computeCollision (cVector3d &a_segmentPointA, cVector3d &a_segmentDirection, cCollisionAABBBox &a_lineBox, cTriangle *&a_colTriangle, cVector3d &a_colPoint, double &a_colSquareDistance)
| Determine whether given line intersects the tree rooted at this node.
virtual bool | contains_triangle (int a_tag)
| Return true if this node contains the specified triangle tag.
virtual void | setParent (cCollisionAABBNode *a_parent, int a_recursive)
| Return parent node and optionally propagate the assignment to children.
## Public Attributes
cCollisionAABBNode * | m_leftSubTree
| The root of this node's left subtree.
cCollisionAABBNode * | m_rightSubTree
| The root of this node's right subtree.
bool | m_testLineBox
| Test box for collision with ray itself (as compared to line's box)?

## Detailed Description

cCollisionAABBInternal contains methods to set up internal nodes of an AABB tree and to use them to detect for collision with a line.

## Constructor & Destructor Documentation

cCollisionAABBInternal::cCollisionAABBInternal | ( | unsigned int | a_numLeaves,
|  | cCollisionAABBLeaf * | a_leaves,
|  | unsigned int | a_depth = `-1` |
| ) |  |  |

Constructor of cCollisionAABBInternal.

Create an internal AABB tree node.

Parameters:

  | a_numLeaves | Number of leaves in subtree rooted at this node.
  | a_leaves | Pointer to the location in the array of leafs for the first leaf under this internal node.
  | a_depth | Depth of this node in the collision tree.

Returns:
  Return a pointer to a new cCollisionAABBInternal node.

cCollisionAABBInternal::~cCollisionAABBInternal | ( |  | ) | `[virtual]`

Destructor of cCollisionAABBInternal.

Destructor of cCollisionAABBInternal.

## Member Function Documentation

void cCollisionAABBInternal::render | ( | int | a_depth = `-1` | ) | `[virtual]`

Draw the edges of the bounding box for this node if it is at depth a_depth.

Draw the edges of the bounding box for an internal tree node if it is at depth a_depth in the tree, and call the draw function for its children.

Parameters:

  | a_depth | Only draw nodes at this level in the tree. a_depth < 0 render _up to_ this level.

Implements cCollisionAABBNode.

bool cCollisionAABBInternal::computeCollision | ( | cVector3d & | a_segmentPointA,
|  | cVector3d & | a_segmentDirection,
|  | cCollisionAABBBox & | a_lineBox,
|  | cTriangle *& | a_colTriangle,
|  | cVector3d & | a_colPoint,
|  | double & | a_colSquareDistance |
| ) |  |  | `[virtual]`

Determine whether given line intersects the tree rooted at this node.

Determine whether the given line intersects the mesh covered by the AABB Tree rooted at this internal node. If so, return (in the output parameters) information about the intersected triangle of the mesh closest to the segment origin.

Parameters:

  | a_segmentPointA | Initial point of segment.
  | a_segmentDirection | Direction of ray from first to second segment points (i.e., proxy to goal).
  | a_lineBox | A bounding box for the incoming segment, for quick discarding of collision tests.
  | a_colTriangle | Returns pointer to nearest collided triangle.
  | a_colPoint | Returns position of nearest collision.
  | a_colSquareDistance | Returns distance between ray origin and collision point.

Returns:
  Return true if line segment intersects a triangle in the subtree.

Implements cCollisionAABBNode.

bool cCollisionAABBInternal::contains_triangle | ( | int | tag | ) | `[virtual]`

Return true if this node contains the specified triangle tag.

Return whether this node contains the specified triangle tag.

Parameters:

  | tag | Tag to inquire about

Implements cCollisionAABBNode.

void cCollisionAABBInternal::setParent | ( | cCollisionAABBNode * | a_parent,
|  | int | a_recursive |
| ) |  |  | `[virtual]`

Return parent node and optionally propagate the assignment to children.

Sets this node's parent pointer and optionally propagate assignments to its children (setting their parent pointers to this node).

Parameters:

  | a_parent | Pointer to this node's parent.
  | a_recursive | Propagate assignment down the tree?

Implements cCollisionAABBNode.

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

- chai3d/src/collisions/CCollisionAABBTree.h
- chai3d/src/collisions/CCollisionAABBTree.cpp