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

Method initTree

physx/source/scenequery/src/SqAABBTree.cpp:161–176  ·  view source on GitHub ↗

Initialize nodes/indices from the input tree merge data

Source from the content-addressed store, hash-verified

159
160// Initialize nodes/indices from the input tree merge data
161void AABBTree::initTree(const AABBTreeMergeData& tree)
162{
163 PX_ASSERT(mIndices == NULL);
164 PX_ASSERT(mRuntimePool == NULL);
165 PX_ASSERT(mParentIndices == NULL);
166
167 // allocate,copy indices
168 mIndices = reinterpret_cast<PxU32*>(PX_ALLOC(sizeof(PxU32)*tree.mNbIndices, "AABB tree indices"));
169 mNbIndices = tree.mNbIndices;
170 PxMemCopy(mIndices, tree.mIndices, sizeof(PxU32)*tree.mNbIndices);
171
172 // allocate,copy nodes
173 mRuntimePool = PX_NEW(AABBTreeRuntimeNode)[tree.mNbNodes];
174 mTotalNbNodes = tree.mNbNodes;
175 PxMemCopy(mRuntimePool, tree.mNodes, sizeof(AABBTreeRuntimeNode)*tree.mNbNodes);
176}
177
178// Shift indices of the tree by offset. Used for merged trees, when initial indices needs to be shifted to match indices in current pruning pool
179void AABBTree::shiftIndices(PxU32 offset)

Callers 1

addTreeMethod · 0.80

Calls 1

PxMemCopyFunction · 0.85

Tested by

no test coverage detected