![]() |
TrinityCore
|
#include <BoundingIntervalHierarchy.h>
Classes | |
| struct | buildData |
| class | BuildStats |
| struct | StackNode |
Public Member Functions | |
| BIH () | |
| template<class BoundsFunc , class PrimArray > | |
| void | build (PrimArray const &primitives, BoundsFunc const &getBounds, uint32 leafSize=3, bool printStats=false) |
| uint32 | primCount () const |
| G3D::AABox const & | bound () const |
| template<typename RayCallback > | |
| void | intersectRay (G3D::Ray const &r, RayCallback &intersectCallback, float &maxDist, bool stopAtFirst=false) const |
| template<typename IsectCallback > | |
| void | intersectPoint (G3D::Vector3 const &p, IsectCallback &intersectCallback) const |
| bool | writeToFile (FILE *wf) const |
| bool | readFromFile (FILE *rf) |
Protected Member Functions | |
| void | buildHierarchy (std::vector< uint32 > &tempTree, buildData &dat, BuildStats &stats) const |
Static Protected Member Functions | |
| static void | createNode (std::vector< uint32 > &tempTree, int nodeIndex, uint32 left, uint32 right) |
| static void | subdivide (int left, int right, std::vector< uint32 > &tempTree, buildData &dat, AABound &gridBox, AABound &nodeBox, int nodeIndex, int depth, BuildStats &stats) |
Protected Attributes | |
| std::vector< uint32 > | tree |
| std::vector< uint32 > | objects |
| G3D::AABox | bounds |
Private Member Functions | |
| void | init_empty () |
Bounding Interval Hierarchy Class. Building and Ray-Intersection functions based on BIH from Sunflow, a Java Raytracer, released under MIT/X11 License http://sunflow.sourceforge.net/ Copyright (c) 2003-2007 Christopher Kulla
Definition at line 42 of file BoundingIntervalHierarchy.h.
|
inline |
Definition at line 54 of file BoundingIntervalHierarchy.h.
|
inline |
Definition at line 87 of file BoundingIntervalHierarchy.h.
Referenced by VMAP::WorldModel::GetLocationInfo(), and VMAP::GroupModel::IsInsideObject().
|
inline |
Definition at line 56 of file BoundingIntervalHierarchy.h.
References BIH::buildData::indices, BIH::buildData::maxPrims, BIH::buildData::numPrims, BIH::buildData::primBound, and BIH::BuildStats::printStats().
Referenced by BIHWrap< T, BoundsFunc >::balance(), VMAP::TileAssembler::convertMap(), VMAP::WorldModel::setGroupModels(), and VMAP::GroupModel::setMeshData().
|
protected |
Definition at line 21 of file BoundingIntervalHierarchy.cpp.
References bounds, AABound::lo, BIH::buildData::numPrims, and subdivide().
|
inlinestaticprotected |
Definition at line 366 of file BoundingIntervalHierarchy.h.
Referenced by subdivide().
|
inlineprivate |
Definition at line 45 of file BoundingIntervalHierarchy.h.
|
inline |
Definition at line 232 of file BoundingIntervalHierarchy.h.
References MAX_STACK_SIZE, and BIH::StackNode::node.
Referenced by VMAP::StaticMapTree::GetLocationInfo(), and BIHWrap< T, BoundsFunc >::intersectPoint().
|
inline |
Definition at line 90 of file BoundingIntervalHierarchy.h.
References MAX_STACK_SIZE, BIH::StackNode::node, BIH::StackNode::tfar, and BIH::StackNode::tnear.
Referenced by VMAP::StaticMapTree::getIntersectionTime(), VMAP::WorldModel::GetLocationInfo(), VMAP::GroupModel::IntersectRay(), VMAP::WorldModel::IntersectRay(), and BIHWrap< T, BoundsFunc >::intersectRay().
|
inline |
Definition at line 86 of file BoundingIntervalHierarchy.h.
Referenced by VMAP::StaticMapTree::InitMap().
| bool BIH::readFromFile | ( | FILE * | rf | ) |
Definition at line 263 of file BoundingIntervalHierarchy.cpp.
References bounds, objects, and tree.
Referenced by VMAP::StaticMapTree::InitMap(), VMAP::WorldModel::readFile(), and VMAP::GroupModel::readFromFile().
|
staticprotected |
Definition at line 33 of file BoundingIntervalHierarchy.cpp.
References createNode(), AABound::hi, BIH::buildData::indices, AABound::lo, MAX_STACK_SIZE, BIH::buildData::maxPrims, BIH::buildData::primBound, subdivide(), BIH::BuildStats::updateBVH2(), BIH::BuildStats::updateInner(), and BIH::BuildStats::updateLeaf().
Referenced by buildHierarchy(), and subdivide().
| bool BIH::writeToFile | ( | FILE * | wf | ) | const |
Definition at line 249 of file BoundingIntervalHierarchy.cpp.
References bounds, objects, and tree.
Referenced by VMAP::TileAssembler::convertMap(), VMAP::WorldModel::writeFile(), and VMAP::GroupModel::writeToFile().
|
protected |
Definition at line 319 of file BoundingIntervalHierarchy.h.
Referenced by buildHierarchy(), readFromFile(), and writeToFile().
|
protected |
Definition at line 318 of file BoundingIntervalHierarchy.h.
Referenced by readFromFile(), and writeToFile().
|
protected |
Definition at line 317 of file BoundingIntervalHierarchy.h.
Referenced by readFromFile(), and writeToFile().