From bea8439052267ce131becb9889b39d0e0c53dd55 Mon Sep 17 00:00:00 2001 From: hikerstk Date: Mon, 18 Feb 2008 02:03:06 +0000 Subject: [PATCH] Enabled up to three internal substeps for the physics, which means that we could work with framerates as low as 20 FPS without getting noticeable changes in the physics. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1510 178a84e3-b1eb-0310-8ba1-8eac791a3b58 --- src/physics.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/physics.cpp b/src/physics.cpp index ebbb86db3..65488be3e 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -91,7 +91,10 @@ void Physics::update(float dt) // are stored in a vector, but only one entry per collision pair // of objects. m_all_collisions.clear(); - m_dynamics_world->stepSimulation(dt); + + // Maximum of three substeps. This will work for framerate down to + // 20 FPS (bullet default frequency is 60 HZ). + m_dynamics_world->stepSimulation(dt, 3); // Now handle the actual collision. Note: rockets can not be removed // inside of this loop, since the same rocket might hit more than one @@ -216,7 +219,7 @@ btScalar Physics::solveGroup(btCollisionObject** bodies, int numBodies, #if defined(WIN32) && !defined(__CYGWIN__) 0 // avoid VS compiler warning while the above statement is commented out #endif - ; + ; } // 2) object a is a kart // =====================