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

Method destroyPhysicsWorld

testbed/scenes/cubes/CubesScene.cpp:126–146  ·  view source on GitHub ↗

Destroy the physics world

Source from the content-addressed store, hash-verified

124
125// Destroy the physics world
126void CubesScene::destroyPhysicsWorld() {
127
128 if (mPhysicsWorld != nullptr) {
129
130 // Destroy all the cubes of the scene
131 for (std::vector<Box*>::iterator it = mBoxes.begin(); it != mBoxes.end(); ++it) {
132
133 // Destroy the cube
134 delete (*it);
135 }
136 mBoxes.clear();
137
138 // Destroy the floor
139 delete mFloor;
140
141 mPhysicsObjects.clear();
142
143 mPhysicsCommon.destroyPhysicsWorld(mPhysicsWorld);
144 mPhysicsWorld = nullptr;
145 }
146}
147
148// Reset the scene
149void CubesScene::reset() {

Callers

nothing calls this directly

Calls 3

beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected