[ODE] Is a variable frame rate possible?

John john at blippygames.com
Mon Dec 5 16:39:07 MST 2005


Hrm, that's what I thought. The hidden problem is that all the collision 
handling must be done on each ODE step (correct?), inverting the loop 
control somewhat, so that ODE ends up steering the whole ship instead of 
the application doing the driving. The ODE step must be small enough so 
that integer multiples of the step will approximate the actual time 
period -- which means lots of steps.

Thanks. -John


Tedd Streibel wrote:
> You can feed ODE whatever simulation time period you want.  The downside is
> that varying time values per frame will give you sometimes unpredictable and
> unstable results.  The generally accepted (and stable) method is an ODE sim
> loop each render frame that runs as many times as necessary to "catch up" to
> the render time.  As a side note, the ODE time period should be as small as
> possible, but the tradeoff is performance.  Typically people run ODE with a
> time period between 0.005 seconds to 0.02 seconds per simulation frame.
> 
> Here is roughly what the pseudo code might look like:
> 
> game loop()
> {
> 	while(accumulated sim time < current time)
> 	{
> 		float sim period = 0.01 --> choose your own value for this
> 		run ODE(sim period)
> 		accumulated sim time += sim period
> 	}
> 	do rendering()
> }
> 
> -----Original Message-----
> From: ode-bounces at q12.org [mailto:ode-bounces at q12.org]On Behalf Of John
> Sent: Monday, December 05, 2005 12:04 PM
> To: ODE at q12.org
> Subject: [ODE] Is a variable frame rate possible?
> 
> 
> Is there any way, hack or otherwise, to have a variable frame rate with
> ODE?
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 



More information about the ODE mailing list