Destroy the physics world
| 124 | |
| 125 | // Destroy the physics world |
| 126 | void 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 |
| 149 | void CubesScene::reset() { |