MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / update

Method update

testbed/src/SceneDemo.cpp:131–153  ·  view source on GitHub ↗

Update the scene

Source from the content-addressed store, hash-verified

129
130// Update the scene
131void 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
155void SceneDemo::rotateCameraAnimation() {
156

Callers 1

updatePhysicsMethod · 0.45

Calls 4

beginMethod · 0.45
endMethod · 0.45
updateTransformMethod · 0.45

Tested by

no test coverage detected