![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cOctree.h>
Public Member Functions | |
cOctree () | |
virtual | ~cOctree () |
void | AddToOctree (cOctreeObject *pObj, const cVector3f &vPos, float fRadius) |
int | TestTree () const |
validates tree structure More... | |
![]() | |
cOctreeNodeCont () noexcept | |
virtual | ~cOctreeNodeCont () |
void | FreeChildNode (CHILDIDX_t ci) |
void | FreeChildNodes () |
UNITTEST_FRIEND (cOctree) | |
run an heavy usage simulation to test More... | |
Static Public Member Functions | |
static CHILDIDX_t | MakeRootIdx (const cVec3i &vPi) noexcept |
Friends | |
class | cOctreeNode |
Additional Inherited Members | |
![]() | |
typedef int | CHILDIDX_t |
0 to 7 k_NodeMax More... | |
![]() | |
static const CHILDIDX_t | k_NodeMax = 8 |
2x2x2 = 8 More... | |
![]() | |
bool | TraverseIntersectHex (ISpatialTestVisitor *pResults, const cHexahedron &frustum, cHexahedron::PLANES_MASK_t planes) |
virtual bool | TraverseIntersectSphere (ISpatialTestVisitor *pResults, const cSpheref &sphere) const override |
virtual bool | TraverseIntersectBounds (ISpatialTestVisitor *pResults, const cBounds3f &bbox) const override |
virtual bool | TraverseIntersectHex (ISpatialTestVisitor *pResults, const cHexahedron &frustum) override |
virtual bool | TraverseIntersectSegment (ISpatialTestVisitor *pResults, const cSegment3f &segment) override |
virtual bool | TraverseAll (ISpatialTestVisitor *pResults) const override |
![]() | |
cOctreeNode * | m_aChildNodes [k_NodeMax] |
container for sparse 2x2x2 possible subdivided children. for each sign octant More... | |
CHILDIDX_t | m_nChildNodes |
Number of actually populated m_aChildNodes. <= 8. More... | |
int | m_iSpatialTestVal |
validation value. incremented periodically (per frame?) More... | |
high performance loose octree implementation it can be thought of as "3d hash table" based on object's positions its very fast - for continuous updates too spatial and object-size leveled - fast spatialization with early rejection of objects by size adaptive hash granularity based on object's sizes multi-thread-safe for reading and not MT-safe for modifying octree objects must be derived from cSpatialObject
Gray3D::cOctree::cOctree | ( | ) |
|
virtual |
void Gray3D::cOctree::AddToOctree | ( | cOctreeObject * | pObj, |
const cVector3f & | vPos, | ||
float | fRadius | ||
) |
Add or replace/move object in octree
|
inlinestaticnoexcept |
Make a Hash ID similar to MakeChildIdx(). based sort of on the sign bit ??
int Gray3D::cOctree::TestTree | ( | ) | const |
validates tree structure
Validate all the nodes in the tree.
|
friend |