Destroy the physics world
| 249 | |
| 250 | // Destroy the physics world |
| 251 | void 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 |
| 274 | void PileScene::reset() { |
| 275 |