7 #include "OctreeDebugModel.h" 8 #include "imstkLooseOctree.h" 25 bool rendered[8]{
false,
false,
false,
false,
26 false,
false,
false,
false };
29 for (
int i = 0; i < 8; i++)
39 renderCount +=
static_cast<int>(rendered[i]);
70 if (!m_drawNonEmptyParents)
73 return renderCount > 0;
86 for (
int i = 0; i < 8; i++)
88 if ((i & 1) && (!rendered[i] || !rendered[i - 1]))
90 addLine(vertices[i], vertices[i - 1]);
92 if ((i & 2) && (!rendered[i] || !rendered[i - 2]))
94 addLine(vertices[i], vertices[i - 2]);
96 if ((i & 4) && (!rendered[i] || !rendered[i - 4]))
98 addLine(vertices[i], vertices[i - 4]);
109 m_drawNonEmptyParents = drawNonEmptyParents;
114 if (m_looseOctree !=
nullptr)
LooseOctree * m_pTree
Pointer to the octree, used to request children from memory pool during splitting node...
int m_maxDisplayDepth
Maximum level of nodes that will be rendered during debug rendering.
const uint32_t m_Depth
Depth of this node (depth > 0, depth = 1 starting at the root node)
OctreeNodeBlock * m_pChildren
Pointer to a memory block containing 8 children nodes.
void debugUpdate(int maxDisplayDepth, bool drawNonEmptyParents=true)
Update the geometry.
const Vec3d m_Center
Center of this node.
void addLine(const Vec3d &a, const Vec3d &b)
Adds a line to the debug lines with default color.
bool updateGeom(OctreeNode *node)
Recursively update debug geometry by adding lines drawing bounding boxes of the active nodes...
const double m_HalfWidth
Half width of the node AABB.
OctreeNode * getRootNode() const
Get the root node.
bool isLeaf() const
Check if this node is a leaf node.
uint32_t m_PrimitiveCounts[OctreePrimitiveType::NumPrimitiveTypes]
Count the number of (classified) primitives stored in this node.
void clear()
Clears all primitives.