Cyclone | Cyclone: cyclone::BVHNode< BoundingVolumeClass > Class Template Reference |
#include <collide_coarse.h>
Collaboration diagram for cyclone::BVHNode< BoundingVolumeClass >:
Public Member Functions | |
BVHNode (BVHNode *parent, const BoundingVolumeClass &volume, RigidBody *body=NULL) | |
Creates a new node in the hierarchy with the given parameters. | |
bool | isLeaf () const |
Checks if this node is at the bottom of the hierarchy. | |
unsigned | getPotentialContacts (PotentialContact *contacts, unsigned limit) const |
>QueryBVH | |
void | insert (RigidBody *body, const BoundingVolumeClass &volume) |
>BVHInsert BVHInsert | |
~BVHNode () | |
>BVHRemove BVHRemove | |
Public Attributes | |
BVHNode * | children [2] |
Holds the child nodes of this node. | |
BoundingVolumeClass | volume |
Holds a single bounding volume encompassing all the descendents of this node. | |
RigidBody * | body |
Holds the rigid body at this node of the hierarchy.QueryBVH. | |
BVHNode * | parent |
Holds the node immediately above us in the tree. | |
Protected Member Functions | |
bool | overlaps (const BVHNode< BoundingVolumeClass > *other) const |
>QueryBVH QueryBVH | |
unsigned | getPotentialContactsWith (const BVHNode< BoundingVolumeClass > *other, PotentialContact *contacts, unsigned limit) const |
QueryBVH. | |
void | recalculateBoundingVolume (bool recurse=true) |
For non-leaf nodes, this method recalculates the bounding volume based on the bounding volumes of its children. |
This class uses a binary tree to store the bounding volumes.
|
Creates a new node in the hierarchy with the given parameters.
|
|
>BVHRemove BVHRemove This method deletes the node and all its children (but obviously not the rigid bodies). This also has the effect of deleting the sibling of this node, and changing the parent node so that it contains the data currently in that sibling. Finally it forces the hierarchy above the current node to reconsider its bounding volume. |
|
>QueryBVH Returns the number of potential contacts it found. |
|
QueryBVH. Returns the number of potential contacts it found. |
|
>BVHInsert BVHInsert This may involve the creation of further bounding volume nodes. |
|
Checks if this node is at the bottom of the hierarchy.
|
|
>QueryBVH QueryBVH Note that any bounding volume should have an overlaps method implemented that checks for overlapping with another object of its own type. |
|
For non-leaf nodes, this method recalculates the bounding volume based on the bounding volumes of its children.
|
|
Holds the rigid body at this node of the hierarchy.QueryBVH. Only leaf nodes can have a rigid body defined (see isLeaf). Note that it is possible to rewrite the algorithms in this class to handle objects at all levels of the hierarchy, but the code provided ignores this vector unless firstChild is NULL. |
|
Holds the child nodes of this node.
|
|
Holds the node immediately above us in the tree.
|
|
Holds a single bounding volume encompassing all the descendents of this node.
|
© 2000-2003 Icosagon. All Rights Reserved.
Distributed under licence.
Cyclone Version 2.0.5 (Documentation generated Fri Nov 10 20:44:19 2006). |