[ODE] Simulations running in real time?

Rodrigo Hernandez kwizatz at aeongames.com
Mon Mar 28 11:53:01 MST 2005


I am wondering the same thing, I have a timer on my engine, it has a 
function that returns the amount of seconds since the last call to the 
function (this usually returns a number below 1.0), my question is, what 
exactly does the stepsize value represent? I mean does it means advance 
simulation by stepsize seconds/miliseconds/etc? or does it mean advance 
a percentage of a "step" (whatever that is) 1.0 being 100%, 0.5 50% etc.

if it means advance simulation x seconds then all I would have to do is 
feed my DeltaTime to WorldStep right?

Thanks.

Chris Royce wrote:

> Yeh i figgured i could do that, ie could have something like.
>
> if(timeSinceLastUpdate > 0.5ms)
> {
>    do simulation
> }
>
> I understand how to do the get time and get the difference etc.
> The question I have is if I wanted to say update it every 0.5ms, what 
> would I use for a worldStep value? assuming it was going to be called 
> at the rate of every 0.5ms ?
>
> when I am placing dWorldTimeStep at 0.5 does that mean each time that 
> it is called it does so at 0.5ms increments. that said if i had it 
> being called every 0.5ms and had timestep at 0.5 would that be real 
> time ?
>
> Cheers
>
>
> ----- Original Message ----- From: "Mark Wayland" <mwayland at torus.com.au>
> To: "Chris Royce" <croyce at ntlworld.com>; <ode at q12.org>
> Sent: Monday, March 28, 2005 3:31 PM
> Subject: Re: [ODE] Simulations running in real time?
>
>
>> Using a fixed timeslice for world stepping simply means the 
>> simulation is
>> advanced by that amount of time in each call to the stepping code. On 
>> fast
>> computers, that call will be more frequent than on slow ones. Simply
>> throttle your application using any one of the million examples out 
>> there on
>> the 'net - for example you may wish to use QueryPerformanceCounter 
>> and/or
>> timeGetTime on Windows (note that there's a bug in some PCI 
>> components that
>> make QueryPerformanceCounter jump ahead or back 5 seconds or something -
>> there's a Microsoft tech note on how to address it, should you wish 
>> your sim
>> to be robust on all Win32 systems).
>>
>> Cheers,
>> Mark
>>
>> ----- Original Message ----- From: "Chris Royce" <croyce at ntlworld.com>
>> To: "ode" <ode at q12.org>
>> Sent: Monday, March 28, 2005 11:10 PM
>> Subject: [ODE] Simulations running in real time?
>>
>>
>> Hello there I'm trying to get my simulation to run in real time,
>>
>> Basically the problem I'm having at the moment is that the simulation is
>> running at different speeds on different computers. I'm working in 
>> C++ and
>> using the drawStuff interface.
>>
>> I'm also noticing that by changing the dWorldStep value the motion 
>> varies
>> quite considerably, whereas I'd expected to run simply faster or 
>> slower ?
>>
>> Thanks for any advice
>>
>> Chris
>>
>>
>> ---------------------------------------------------------------------------- 
>>
>> ----
>>
>>
>>> _______________________________________________
>>> ODE mailing list
>>> ODE at q12.org
>>> http://q12.org/mailman/listinfo/ode
>>>
>>
>>
>
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
>



More information about the ODE mailing list