| 159 | } |
| 160 | |
| 161 | BodySim::~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 | |
| 192 | void BodySim::updateCached(Cm::BitMapPinned* shapeChangedMap) |
| 193 | { |
nothing calls this directly
no test coverage detected