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

Method updateMapping

physx/source/scenequery/src/SqCompoundPruner.cpp:90–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88///////////////////////////////////////////////////////////////////////////////////////////////
89
90void BVHCompoundPruner::updateMapping(const PoolIndex poolIndex, IncrementalAABBTreeNode* node)
91{
92 // resize mapping if needed
93 if(mMainTreeUpdateMap.size() <= poolIndex)
94 {
95 const PxU32 resizeSize = mMainTreeUpdateMap.size() * 2;
96 mMainTreeUpdateMap.resize(resizeSize);
97 mPoolActorMap.resize(resizeSize);
98 }
99
100 // if a node was split we need to update the node indices and also the sibling indices
101 if(!mChangedLeaves.empty())
102 {
103 if(node && node->isLeaf())
104 {
105 for(PxU32 j = 0; j < node->getNbPrimitives(); j++)
106 {
107 mMainTreeUpdateMap[node->getPrimitives(NULL)[j]] = node;
108 }
109 }
110
111 for(PxU32 i = 0; i < mChangedLeaves.size(); i++)
112 {
113 IncrementalAABBTreeNode* changedNode = mChangedLeaves[i];
114 PX_ASSERT(changedNode->isLeaf());
115
116 for(PxU32 j = 0; j < changedNode->getNbPrimitives(); j++)
117 {
118 mMainTreeUpdateMap[changedNode->getPrimitives(NULL)[j]] = changedNode;
119 }
120 }
121 }
122 else
123 {
124 mMainTreeUpdateMap[poolIndex] = node;
125 }
126}
127
128///////////////////////////////////////////////////////////////////////////////////////////////
129

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.45
resizeMethod · 0.45
emptyMethod · 0.45
isLeafMethod · 0.45
getNbPrimitivesMethod · 0.45
getPrimitivesMethod · 0.45

Tested by

no test coverage detected