TrinityCore
|
#include <KDTree.h>
Public Member Functions | |
Node () | |
Node (const Node &other) | |
Node (const Array< Handle * > &pt) | |
~Node () | |
bool | isLeaf () const |
void | getHandles (Array< Handle * > &handleArray) const |
void | verifyNode (const Vector3 &lo, const Vector3 &hi) |
Node * | findDeepestContainingNode (const AABox &bounds) |
void | getIntersectingMembers (const AABox &box, const Sphere &sphere, Array< T * > &members, bool useSphere) const |
void | assignSplitBounds (const AABox &myBounds) |
bool | intersects (const Ray &ray, float distance) const |
template<typename RayCallback > | |
void | intersectRay (const Ray &ray, RayCallback &intersectCallback, float &distance, bool intersectCallbackIsFast) const |
Static Public Member Functions | |
static void | serializeStructure (const Node *n, BinaryOutput &bo) |
static Node * | deserializeStructure (BinaryInput &bi) |
Public Attributes | |
AABox | splitBounds |
Vector3::Axis | splitAxis |
float | splitLocation |
Node * | child [2] |
Array< Handle * > | valueArray |
Array< AABox > | boundsArray |
|
inline |
Creates node with NULL children
|
inline |
Doesn't clone children.
|
inline |
Copies the specified subarray of pt into point, NULLs the children. Assumes a second pass will set splitBounds.
|
inline |
Deletes the children (but not the values)
|
inline |
Recurse through the tree, assigning splitBounds fields.
|
inlinestatic |
Clears the member table
|
inline |
Returns the deepest node that completely contains bounds.
|
inline |
Recursively appends all handles and children's handles to the array.
|
inline |
Appends all members that intersect the box. If useSphere is true, members that pass the box test face a second test against the sphere.
|
inline |
|
inline |
Returns true if the ray intersects this node
|
inline |
|
inlinestatic |
Stores the locations of the splitting planes (the structure but not the content) so that the tree can be quickly rebuilt from a previous configuration without calling balance.
|
inline |
Array<AABox> G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::boundsArray |
For each object in the value array, a copy of its bounds. Packing these into an array at the node level instead putting them in the valueArray improves cache coherence, which is about a 3x performance increase when performing intersection computations.
Node* G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::child[2] |
child[0] contains all values strictly smaller than splitLocation along splitAxis.
child[1] contains all values strictly larger.
Both may be NULL if there are not enough values to bother recursing.
Vector3::Axis G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::splitAxis |
AABox G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::splitBounds |
Spatial bounds on all values at this node and its children, based purely on the parent's splitting planes. May be infinite.
float G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::splitLocation |
Location along the specified axis
Array<Handle*> G3D::KDTree< T, BoundsFunc, HashFunc, EqualsFunc >::Node::valueArray |
Array of values at this node (i.e., values straddling the split plane + all values if this is a leaf node).
This is an array of pointers because that minimizes data movement during tree building, which accounts for about 15% of the time cost of tree building.