Destroy the physics world
| 207 | |
| 208 | // Destroy the physics world |
| 209 | void BridgeScene::destroyPhysicsWorld() { |
| 210 | |
| 211 | if (mPhysicsWorld != nullptr) { |
| 212 | |
| 213 | // Destroy all the physics objects of the scene |
| 214 | for (std::vector<PhysicsObject*>::iterator it = mPhysicsObjects.begin(); it != mPhysicsObjects.end(); ++it) { |
| 215 | |
| 216 | // Destroy the object |
| 217 | delete (*it); |
| 218 | } |
| 219 | |
| 220 | mHingeJoints.clear(); |
| 221 | mPhysicsObjects.clear(); |
| 222 | |
| 223 | mPhysicsCommon.destroyPhysicsWorld(mPhysicsWorld); |
| 224 | mPhysicsWorld = nullptr; |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | // Reset the scene |
| 229 | void BridgeScene::reset() { |