MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / computeBottomLevelCount

Method computeBottomLevelCount

physx/source/geomutils/src/mesh/GuRTree.cpp:103–122  ·  view source on GitHub ↗

////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

101
102/////////////////////////////////////////////////////////////////////////
103PxU32 RTree::computeBottomLevelCount(PxU32 multiplier) const
104{
105 PxU32 topCount = 0, curCount = mNumRootPages;
106 const RTreePage* rightMostPage = &mPages[mNumRootPages-1];
107 PX_ASSERT(rightMostPage);
108 for (PxU32 level = 0; level < mNumLevels-1; level++)
109 {
110 topCount += curCount;
111 PxU32 nc = rightMostPage->nodeCount();
112 PX_ASSERT(nc > 0 && nc <= RTREE_N);
113 // old version pointer, up to PX_MESH_VERSION 8
114 PxU32 ptr = (rightMostPage->ptrs[nc-1]) * multiplier;
115 PX_ASSERT(ptr % sizeof(RTreePage) == 0);
116 const RTreePage* rightMostPageNext = mPages + (ptr / sizeof(RTreePage));
117 curCount = PxU32(rightMostPageNext - rightMostPage);
118 rightMostPage = rightMostPageNext;
119 }
120
121 return mTotalPages - topCount;
122}
123
124/////////////////////////////////////////////////////////////////////////
125RTree::RTree(const PxEMPTY)

Callers

nothing calls this directly

Calls 1

nodeCountMethod · 0.80

Tested by

no test coverage detected