From f3b61c9616925ccdaa56c48f8cd1c42a9e8dcf40 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Thu, 5 Jul 2012 06:28:10 +0000 Subject: [PATCH] test: refine physics timestep. --- test/BtPhysTest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/BtPhysTest.cpp b/test/BtPhysTest.cpp index 8c37da1b..dfcb9c41 100644 --- a/test/BtPhysTest.cpp +++ b/test/BtPhysTest.cpp @@ -208,7 +208,9 @@ void BtPhysTest::TickGame(float seconds) ///step the simulation if (m_bt_world) { - m_bt_world->stepSimulation(seconds); + int steps = (int)(seconds / 0.005f); + for (int i = 0; i < steps; i++) + m_bt_world->stepSimulation(seconds / steps); //optional but useful: debug drawing //m_bt_world->debugDrawWorld(); }