A Branch is a node with two children. More...
#include <collisionModel.h>
Public Member Functions | |
const Node * | child1 () const |
const Node * | child2 () const |
virtual int | countRecurse () |
virtual void | getBVRecurse (int currentDepth, int desiredDepth, std::vector< BoundingBox > *bvs) |
bool | isLeaf () const |
virtual void | markRecurse (bool m) const |
void | splitRecurse (int currentDepth, int desiredDepth) |
~Branch () | |
Private Member Functions | |
Branch (Leaf *c1, Leaf *c2, const BoundingBox &box) | |
Private Attributes | |
Node * | mChild1 |
Node * | mChild2 |
Friends | |
Branch * | Leaf::split () |
A Branch is a node with two children.
The Branch is the only type of node to have children.
Definition at line 119 of file collisionModel.h.
Collision::Branch::Branch | ( | Leaf * | c1, | |
Leaf * | c2, | |||
const BoundingBox & | box | |||
) | [inline, private] |
Definition at line 122 of file collisionModel.h.
Collision::Branch::~Branch | ( | ) | [inline] |
Definition at line 128 of file collisionModel.h.
const Node* Collision::Branch::child1 | ( | ) | const [inline] |
Definition at line 150 of file collisionModel.h.
const Node* Collision::Branch::child2 | ( | ) | const [inline] |
Definition at line 151 of file collisionModel.h.
virtual int Collision::Branch::countRecurse | ( | ) | [inline, virtual] |
Reimplemented from Collision::Node.
Definition at line 153 of file collisionModel.h.
void Collision::Branch::getBVRecurse | ( | int | currentDepth, | |
int | desiredDepth, | |||
std::vector< BoundingBox > * | bvs | |||
) | [virtual] |
Reimplemented from Collision::Node.
Definition at line 430 of file collisionModel.cpp.
bool Collision::Branch::isLeaf | ( | ) | const [inline, virtual] |
Implements Collision::Node.
Definition at line 129 of file collisionModel.h.
virtual void Collision::Branch::markRecurse | ( | bool | m | ) | const [inline, virtual] |
Reimplemented from Collision::Node.
Definition at line 154 of file collisionModel.h.
void Collision::Branch::splitRecurse | ( | int | currentDepth, | |
int | desiredDepth | |||
) | [inline] |
Splits both children, then recursively calls splitRecurse() on the resulting branches (if any). Stops recursing when the current depth hits the desired depth, or recurses until no longer possible if desired depth < 0.
Definition at line 135 of file collisionModel.h.
Branch* Leaf::split | ( | ) | [friend] |
Node* Collision::Branch::mChild1 [private] |
Definition at line 121 of file collisionModel.h.
Node * Collision::Branch::mChild2 [private] |
Definition at line 121 of file collisionModel.h.