Update the scene
| 129 | |
| 130 | // Update the scene |
| 131 | void SceneDemo::update() { |
| 132 | |
| 133 | mPhysicsWorld->getDebugRenderer().setIsDebugItemDisplayed(rp3d::DebugRenderer::DebugItem::CONTACT_POINT, mAreContactPointsDisplayed); |
| 134 | mPhysicsWorld->getDebugRenderer().setIsDebugItemDisplayed(rp3d::DebugRenderer::DebugItem::CONTACT_NORMAL, mAreContactNormalsDisplayed); |
| 135 | mPhysicsWorld->getDebugRenderer().setIsDebugItemDisplayed(rp3d::DebugRenderer::DebugItem::COLLIDER_BROADPHASE_AABB, mAreBroadPhaseAABBsDisplayed); |
| 136 | mPhysicsWorld->getDebugRenderer().setIsDebugItemDisplayed(rp3d::DebugRenderer::DebugItem::COLLIDER_AABB, mAreCollidersAABBsDisplayed); |
| 137 | mPhysicsWorld->getDebugRenderer().setIsDebugItemDisplayed(rp3d::DebugRenderer::DebugItem::COLLISION_SHAPE, mAreCollisionShapesDisplayed); |
| 138 | mPhysicsWorld->getDebugRenderer().setIsDebugItemDisplayed(rp3d::DebugRenderer::DebugItem::COLLISION_SHAPE_NORMAL, mAreCollisionShapesNormalsDisplayed); |
| 139 | |
| 140 | // Update the contact points |
| 141 | updateSnapshotContactPoints(); |
| 142 | |
| 143 | // Update the position and orientation of the physics objects |
| 144 | for (std::vector<PhysicsObject*>::iterator it = mPhysicsObjects.begin(); it != mPhysicsObjects.end(); ++it) { |
| 145 | |
| 146 | // Update the transform used for the rendering |
| 147 | (*it)->updateTransform(mInterpolationFactor); |
| 148 | } |
| 149 | |
| 150 | if (mIsCameraRotationAnimationEnabled) { |
| 151 | rotateCameraAnimation(); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | void SceneDemo::rotateCameraAnimation() { |
| 156 |
no test coverage detected