MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / ~BodySim

Method ~BodySim

physx/source/simulationcontroller/src/ScBodySim.cpp:161–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161BodySim::~BodySim()
162{
163 Scene& scene = getScene();
164 const bool active = isActive();
165
166 getBodyCore().tearDownSimStateData(scene.getSimStateDataPool(), isKinematic() ? true : false);
167
168 PX_ASSERT(!readInternalFlag(BF_ON_DEATHROW)); // Before 3.0 it could happen that destroy could get called twice. Assert to make sure this is fixed.
169 raiseInternalFlag(BF_ON_DEATHROW);
170
171 scene.removeBody(*this);
172 PX_ASSERT(!getConstraintGroup()); // Removing from scene should erase constraint group node if it existed
173
174 if(mArticulation)
175 mArticulation->removeBody(*this);
176
177 //Articulations are represented by a single node, so they must only be removed by the articulation and not the links!
178 if(mArticulation == NULL && mNodeIndex.articulationLinkId() == 0) //If it wasn't an articulation link, then we can remove it
179 scene.getSimpleIslandManager()->removeNode(mNodeIndex);
180
181 PX_ASSERT(mActiveListIndex != SC_NOT_IN_SCENE_INDEX);
182
183 if (active)
184 scene.removeFromActiveBodyList(*this);
185
186 mActiveListIndex = SC_NOT_IN_SCENE_INDEX;
187 mActiveCompoundListIndex = SC_NOT_IN_SCENE_INDEX;
188
189 mCore.setSim(NULL);
190}
191
192void BodySim::updateCached(Cm::BitMapPinned* shapeChangedMap)
193{

Callers

nothing calls this directly

Calls 8

isKinematicFunction · 0.85
raiseInternalFlagFunction · 0.85
tearDownSimStateDataMethod · 0.80
articulationLinkIdMethod · 0.80
removeNodeMethod · 0.80
removeBodyMethod · 0.45
setSimMethod · 0.45

Tested by

no test coverage detected