![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cOctreeNode.h>
Public Member Functions | |
cOctreeNode () | |
virtual | ~cOctreeNode () |
float | get_StepF () const noexcept |
CHILDIDX_t | get_RootIdx () const |
CHILDIDX_t | get_ChildIdx () const |
cBounds3f | get_BoundBox () const |
cSpheref | get_BoundSphere () const |
GINTERSECT_TYPE | GetIntersectTestNode (const cSpheref &rSphere) const |
virtual bool | TraverseIntersectSphere (ISpatialTestVisitor *tif, const cSpheref &frustum) const override |
virtual bool | TraverseIntersectBounds (ISpatialTestVisitor *tif, const cBounds3f &bbox) const override |
virtual bool | TraverseIntersectHex (ISpatialTestVisitor *tif, const cHexahedron &frustum, cHexahedron::PLANES_MASK_t planes) |
virtual bool | TraverseIntersectSegment (ISpatialTestVisitor *tif, const cSegment3f &segment) override |
virtual bool | TraverseAll (ISpatialTestVisitor *tif) const override |
int | TestTree (const cOctree *pTree, CHILDIDX_t rootIdx) const |
bool | isPoolNodeValid (UINT_PTR uCheckParent=0) const |
![]() | |
cOctreeObject * | GetAt (ITERATE_t index) const |
cOctreeObject * | get_Head () const |
cOctreeObject * | get_Tail () const |
![]() | |
cListBase () noexcept | |
virtual | ~cListBase () |
virtual void | InsertListNode (cListNodeBase *pNodeNew, cListNodeBase *pNodePrev=nullptr) |
void | InsertList (cListBase *pListSrc, cListNodeBase *pNodePrev=nullptr) |
void | InsertBefore (cListNodeBase *pNodeNew, const cListNodeBase *pNodeNext) |
void | InsertHead (cListNodeBase *pNodeNew) |
void | InsertTail (cListNodeBase *pNodeNew) |
void | DisposeAll () |
void | Empty () |
cListNodeBase * | get_Head (void) const noexcept |
cListNodeBase * | get_Tail (void) const noexcept |
ITERATE_t | get_Count () const noexcept |
bool | isEmpty () const noexcept |
cListNodeBase * | GetAt (ITERATE_t index) const |
iterate the linked list. More... | |
bool | IsMyChild (const cListNodeBase *pNode) const noexcept |
![]() | |
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 | MakeChildIdx (const cVec3i &vPi) |
Protected Member Functions | |
constexpr bool | IsInsideNode (const cVec3i &vPi) const noexcept |
void | onDetachSpatialObject (cOctreeObject *pObj) |
HRESULT | DisposeThis () |
void | FreeThisNode () |
bool | CollapseLeafCheck () |
bool | CollapseLeafAndTrimRootCheck () |
![]() | |
virtual void | RemoveListNode (cListNodeBase *pNode) |
allow Override of this. called when child pObRec removed from list. More... | |
![]() | |
bool | TraverseIntersectHex (ISpatialTestVisitor *pResults, const cHexahedron &frustum, cHexahedron::PLANES_MASK_t planes) |
virtual bool | TraverseIntersectHex (ISpatialTestVisitor *pResults, const cHexahedron &frustum) override |
Static Protected Member Functions | |
static constexpr bool | IsInsideNode (int v) noexcept |
Protected Attributes | |
int | m_iLevel |
node step = powf( 2, level ). this is stepping between nodes, size is 2x times bigger, overlap = step More... | |
cVec3i | m_vTreePos |
integer node position in m_iLevel steps. (not world coords) More... | |
cOctree * | m_pTree |
my parent system. nullptr = free node in pool. More... | |
cOctreeNode * | m_pParentNode |
my parent node, nullptr = in m_pTree->m_aChildNodes. root node. More... | |
![]() | |
ITERATE_t | m_iCount |
how many children? nice to get read only direct access to this for scripting. More... | |
![]() | |
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... | |
Friends | |
class | cOctree |
class | cOctreeObject |
class | cOctreeNodeCont |
class | cOctreeNodePool |
Additional Inherited Members | |
![]() | |
typedef int | CHILDIDX_t |
0 to 7 k_NodeMax More... | |
![]() | |
static const CHILDIDX_t | k_NodeMax = 8 |
2x2x2 = 8 More... | |
A node in the octree can contain list of cOctreeObject/cSpatialObject(s). and 8 child cOctreeNode(s) cListT<cOctreeObject> = the list of spatial objects in this node.
Gray3D::cOctreeNode::cOctreeNode | ( | ) |
|
virtual |
|
protected |
if this node has <=1 child then collapse.
|
inlineprotected |
If this leaf/node is empty then delete it.
|
protected |
|
inlineprotected |
|
inline |
get the bounds of this node.
|
inline |
get the bounding sphere of this node.
|
inline |
Assume m_pParentNode will be set.
|
inline |
|
inlinenoexcept |
|
inline |
does rSphere intersect this node? GINTERSECT_In2 = Node fully in rSphere
|
inlineconstexprprotectednoexcept |
|
inlinestaticconstexprprotectednoexcept |
bool Gray3D::cOctreeNode::isPoolNodeValid | ( | UINT_PTR | uCheckParent = 0 | ) | const |
in s_OctreeNodes
|
inlinestatic |
Make Hash ID similar to MakeRootIdx()
|
protected |
remove pObj from this node.
int Gray3D::cOctreeNode::TestTree | ( | const cOctree * | pTree, |
CHILDIDX_t | rootIdx | ||
) | const |
|
overridevirtual |
short cut to traverse all with out re-checking. GINTERSECT_In
Reimplemented from Gray3D::cOctreeNodeCont.
|
overridevirtual |
Reimplemented from Gray3D::cOctreeNodeCont.
|
virtual |
|
overridevirtual |
Ray = A subset of bounds.
Reimplemented from Gray3D::cOctreeNodeCont.
|
overridevirtual |
Reimplemented from Gray3D::cOctreeNodeCont.
|
friend |
|
friend |
|
friend |
|
friend |
|
protected |
node step = powf( 2, level ). this is stepping between nodes, size is 2x times bigger, overlap = step
|
protected |
my parent node, nullptr = in m_pTree->m_aChildNodes. root node.
|
protected |
my parent system. nullptr = free node in pool.
|
protected |
integer node position in m_iLevel steps. (not world coords)