#include <BIHNode.hpp>
Public Member Functions | |
B () | |
B (const AABB &bbox, std::vector< T * > *trList, int left, int right, int depth=0, int singleD=0) | |
virtual | ~BIHNode () |
virtual Intersection | intersect (Ray &r, const float &tMin, const float &tMax) const |
bool | isLeaf () const |
bool | isSingle () const |
bool | isEmpty () const |
std::vector< T * > * | getTraceables () |
Static Public Member Functions | |
static BIHSplit | getSplitPlane (const AABB &box) |
Private Member Functions | |
Intersection | leafIntersect (Ray &r, const float &tMin, const float &tMax) const |
void | initNodeAsLeaf (std::vector< T * > *trList, int left, int right) |
void | initNode (const AABB &bbox, std::vector< T * > *trList, int left, int right, int depth, int singleDepth=0) |
Private Attributes | |
BIHNode< T > * | children [2] |
std::vector< T * > * | traceables |
int | leftIndex |
int | rightIndex |
float | clip [2] |
Axis | splitAxis |
Definition at line 35 of file BIHNode.hpp.
virtual rcrt::BIHNode< T >::~BIHNode | ( | ) | [inline, virtual] |
Definition at line 253 of file BIHNode.hpp.
Intersection rcrt::BIHNode< T >::leafIntersect | ( | Ray & | r, | |
const float & | tMin, | |||
const float & | tMax | |||
) | const [inline, private] |
r | the ray | |
tMin | minimum distance | |
tMax | maximum distance |
Definition at line 80 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::intersect().
void rcrt::BIHNode< T >::initNodeAsLeaf | ( | std::vector< T * > * | trList, | |
int | left, | |||
int | right | |||
) | [inline, private] |
trList | the vector of objects in this BIH. | |
left | the index of the leftmost object in the vector that is part of this leaf node. | |
right | the index of the rightmost object in the vector that is part of this leaf node. |
Definition at line 111 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode().
void rcrt::BIHNode< T >::initNode | ( | const AABB & | bbox, | |
std::vector< T * > * | trList, | |||
int | left, | |||
int | right, | |||
int | depth, | |||
int | singleDepth = 0 | |||
) | [inline, private] |
Actual construction code implementation.
bbox | Bounding Box in which to check for split planes. | |
trList | vector of objects in this tree | |
left | index to leftmost object in the current range | |
right | index to rightmost object in the current range | |
depth | tree depth | |
singleDepth | depth of single nodes(those that clip in the nonstandard way, see clip member documentation). There is a maximum on this depth. |
Definition at line 129 of file BIHNode.hpp.
rcrt::BIHNode< T >::B | ( | ) | [inline] |
rcrt::BIHNode< T >::B | ( | const AABB & | bbox, | |
std::vector< T * > * | trList, | |||
int | left, | |||
int | right, | |||
int | depth = 0 , |
|||
int | singleD = 0 | |||
) | [inline] |
This constructor creates a node of the tree.
bbox | Bounding Box in which to check for split planes. | |
trList | vector of objects in this tree | |
left | index to leftmost object in the current range | |
right | index to rightmost object in the current range | |
depth | tree depth | |
singleDepth | depth of single nodes(those that clip in the nonstandard way, see clip member documentation). There is a maximum on this depth. |
virtual Intersection rcrt::BIHNode< T >::intersect | ( | Ray & | r, | |
const float & | tMin, | |||
const float & | tMax | |||
) | const [inline, virtual] |
Definition at line 260 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::intersect().
bool rcrt::BIHNode< T >::isLeaf | ( | ) | const [inline] |
Definition at line 352 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::intersect().
bool rcrt::BIHNode< T >::isSingle | ( | ) | const [inline] |
Definition at line 357 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::intersect().
bool rcrt::BIHNode< T >::isEmpty | ( | ) | const [inline] |
Definition at line 362 of file BIHNode.hpp.
std::vector<T*>* rcrt::BIHNode< T >::getTraceables | ( | ) | [inline] |
Definition at line 367 of file BIHNode.hpp.
static BIHSplit rcrt::BIHNode< T >::getSplitPlane | ( | const AABB & | box | ) | [inline, static] |
Definition at line 372 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode().
BIHNode<T>* rcrt::BIHNode< T >::children[2] [private] |
The left and right child of this node. Will be NULL for a leaf. There are special nodes which clip in another way (see clip member documentation) for which children[1] will be 0 and children[0] another BIHNode.
Definition at line 43 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), rcrt::BIHNode< rcrt::Traceable >::intersect(), rcrt::BIHNode< rcrt::Traceable >::isLeaf(), rcrt::BIHNode< rcrt::Traceable >::isSingle(), and rcrt::BIHNode< rcrt::Traceable >::~BIHNode().
std::vector<T*>* rcrt::BIHNode< T >::traceables [private] |
A pointer to the vector of traceable objects contained in this BIH.
Definition at line 48 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::getTraceables(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), rcrt::BIHNode< rcrt::Traceable >::isEmpty(), and rcrt::BIHNode< rcrt::Traceable >::leafIntersect().
int rcrt::BIHNode< T >::leftIndex [private] |
Index to the leftmost element in the vector of traceables that is contained by this node.
Definition at line 53 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), and rcrt::BIHNode< rcrt::Traceable >::leafIntersect().
int rcrt::BIHNode< T >::rightIndex [private] |
Index to the rightmost element in the vector of traceables that is contained by this node.
Definition at line 58 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), and rcrt::BIHNode< rcrt::Traceable >::leafIntersect().
float rcrt::BIHNode< T >::clip[2] [private] |
This encodes the intervals of this node. The left interval is (-infinity,clip[0]], the right interval [clip[1],infinity). In a special case a node clips [clip[0], clip[1]] to cut away empty space on both sides of tightly packed objects.
Definition at line 66 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), and rcrt::BIHNode< rcrt::Traceable >::intersect().
Axis rcrt::BIHNode< T >::splitAxis [private] |
The axis along which this BIHNode clips.
Definition at line 71 of file BIHNode.hpp.
Referenced by rcrt::BIHNode< rcrt::Traceable >::initNode(), rcrt::BIHNode< rcrt::Traceable >::initNodeAsLeaf(), and rcrt::BIHNode< rcrt::Traceable >::intersect().