# cCollisionAABBInternal Class Reference
[Collision Detection]

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:

[legend]

List of all members.

## Public Member Functions
| cCollisionAABBInternal ()
| Default constructor of cCollisionAABBInternal.
virtual | ~cCollisionAABBInternal ()
| Destructor of cCollisionAABBInternal.
void | initialize (unsigned int a_numLeaves, cCollisionAABBLeaf *a_leaves, unsigned int a_depth=-1)
| Initialize internal node.
void | fitBBox (double a_radius=0)
| 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_segmentPointB, cCollisionAABBBox &a_lineBox, cCollisionRecorder &a_recorder, cCollisionSettings &a_settings)
| 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.

## Member Function Documentation

bool cCollisionAABBInternal::computeCollision | ( | cVector3d & | a_segmentPointA,
|  | cVector3d & | a_segmentPointB,
|  | cCollisionAABBBox & | a_lineBox,
|  | cCollisionRecorder & | a_recorder,
|  | cCollisionSettings & | a_settings |
| ) |  |  | `[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_segmentPointB | End point of segment.
  | a_lineBox | A bounding box for the incoming segment, for quick discarding of collision tests.
  | a_recorder | Stores all collision events.
  | a_settings | Contains collision settings information.

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::initialize | ( | unsigned int | a_numLeaves,
|  | cCollisionAABBLeaf * | a_leaves,
|  | unsigned int | a_depth = `-1` |
| ) |  |  |

Initialize internal node.

Initialize 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.

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.

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:

- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/collisions/CCollisionAABBTree.h
- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/collisions/CCollisionAABBTree.cpp

CHAI3D 2.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2009 - CHAI 3D
All Rights Reserved.