MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / destroyPhysicsWorld

Method destroyPhysicsWorld

testbed/scenes/pile/PileScene.cpp:251–272  ·  view source on GitHub ↗

Destroy the physics world

Source from the content-addressed store, hash-verified

249
250// Destroy the physics world
251void PileScene::destroyPhysicsWorld() {
252
253 if (mPhysicsWorld != nullptr) {
254
255 // Destroy all the physics objects of the scene
256 for (std::vector<PhysicsObject*>::iterator it = mPhysicsObjects.begin(); it != mPhysicsObjects.end(); ++it) {
257
258 // Destroy the object
259 delete (*it);
260 }
261 mBoxes.clear();
262 mSpheres.clear();
263 mCapsules.clear();
264 mConvexMeshes.clear();
265 mDumbbells.clear();
266
267 mPhysicsObjects.clear();
268
269 mPhysicsCommon.destroyPhysicsWorld(mPhysicsWorld);
270 mPhysicsWorld = nullptr;
271 }
272}
273/// Reset the scene
274void PileScene::reset() {
275

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected