[ODE] Vehicle Speed (Generic Units to Real World Units)

Jeff Weber jeffreyweber at hotmail.com
Wed Jul 30 11:40:02 2003


Ok, I compared my accumulated time being sent to dWorldStep with real 
clock-time and as you guessed, they were not 1-1.


As a test, I simplified my loop so that every render loop I simply called 
dWorldStep once and sent it the time elapsed since last render.  This time, 
simuated time matched real clock-time perfectly as would be expected.

Problem is, the value I send to dWorldStep is too low for my render speed. I 
think I need to call dWorldStep multiple times per RenderLoop like I was 
before, but I'm not sure how to do this while at the same time keeping 
simulator time and real time in synch.

I also need to be frame-rate independent. Is it possible to have a 
render-loop that keeps sim-time and real-time in synch and that is 
frame-rate independent? By frame-rate independent, I mean things need to 
look the same and act the same at a variety of frame-rates (not counting 
rates that are VERY low)

Anybody have any suggetions.

-j


----Original Message Follows----
From: "Martin C. Martin" <martin@metahuman.org>
To: Jeff Weber <jeffreyweber@hotmail.com>
CC: ode@q12.org
Subject: Re: [ODE] Vehicle Speed (Generic Units to Real World Units)
Date: Wed, 30 Jul 2003 11:41:01 -0400

 > I am calling dWorldStep() with a constant .015.  Currently, I calculate 
how
 > many .015 steps I need to match the time that has elapsed since last 
render.

Maybe there's a bug in that code, from the way you're describing it, it
doesn't take into account the physics time.

Try this: when your app starts, record the wall clock time.  Each time you
call dWorldStep(), add the time you pass to it to an accumulator.  Then
make sure that the time that's passed since the app started is roughly the
same as the total simulated time, i.e. the value in the accumulator.  In
that case, the ratio of times is 1:1.  1:1 will be by far the easiest
choice for debugging.

- Martin
_______________________________________________
ODE mailing list
ODE@q12.org
http://q12.org/mailman/listinfo/ode

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail