made demos working for realtime

This commit is contained in:
ejcoumans
2006-10-18 04:32:00 +00:00
parent 33b3ec94f1
commit 940e753086
3 changed files with 11 additions and 4 deletions

View File

@@ -188,7 +188,10 @@ void ColladaDemo::clientMoveAndDisplay()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
m_dynamicsWorld->stepSimulation(deltaTime);
float dt = m_clock.getTimeMilliseconds() * 0.001f;
m_clock.reset();
m_dynamicsWorld->stepSimulation(dt);
renderme();

View File

@@ -95,9 +95,11 @@ void ConstraintDemo::clientMoveAndDisplay()
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
float deltaTime = 1.f/60.f;
float dt = m_clock.getTimeMilliseconds() * 0.001f;
m_clock.reset();
m_dynamicsWorld->stepSimulation(deltaTime);
m_dynamicsWorld->stepSimulation(dt);
renderme();
glFlush();

View File

@@ -295,8 +295,10 @@ void ConvexDecompositionDemo::clientMoveAndDisplay()
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
float dt = m_clock.getTimeMilliseconds() * 0.001f;
m_clock.reset();
m_dynamicsWorld->stepSimulation(deltaTime);
m_dynamicsWorld->stepSimulation(dt);
renderme();