Update the physics world (take a simulation step) Can be called several times per frame
| 161 | // Update the physics world (take a simulation step) |
| 162 | // Can be called several times per frame |
| 163 | void SceneDemo::updatePhysics() { |
| 164 | |
| 165 | // Clear contacts points |
| 166 | mSnapshotsContactPoints.clear(); |
| 167 | |
| 168 | if (mIsPhysicsWorldSimulated) { |
| 169 | |
| 170 | // Take a simulation step |
| 171 | mPhysicsWorld->update(mEngineSettings.timeStep.count()); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | // Render the scene (in multiple passes for shadow mapping) |
| 176 | void SceneDemo::render() { |