[ODE] Cycle time 0.0

Martin C. Martin martin at metahuman.org
Fri Sep 27 20:57:01 2002


I'd argue that dWorldStep() should check for this, even in release mode,
and either return an error code or simply return without doing anything. 
This isn't a significant performance hit -- if the timestep is always > 0,
then you add the cost of a single comparison per call to dWorldStep().

There's a notion that safety checks (including asserts) should be used
when debugging, but removed in release code.  It has been said that this
is like wearing a life vest when learning to sail close to shore, then
taking it off when you hit the high seas.  :)  In a case where the
performance hit is negligible, I can think of no good reason not to
include the check.

Just a thought,
Martin

Russ Smith wrote:
> 
> > I have seen that if a value of 0.0 is provided to dWorldStep in the
> > first iteration, even other values such as 0.05 are provided in the
> > next iterations, the action doesn't start in the buggy demo. To
> > demonstrate the issue, I have modified the buggy demo as follows :
> 
> if you make that change to the buggy and then run it with ODE in
> debugging mode you will immediately get the error:
> 
>   "ODE INTERNAL ERROR 2: stepsize must be > 0 in dWorldStep()"
> 
> this error is not there just to annoy ... dWorldStep() uses the quantity
> 1/stepsize in various important places, so providing 0 is not going to
> work, ever. when using the release mode build of ODE the buggy in fact
> disappears instantly - those 1/0's infect the entire system state.
> 
> russ.
> 
> --
> Russell Smith
> http://www.q12.org
> _______________________________________________
> ODE mailing list
> ODE@q12.org
> http://q12.org/mailman/listinfo/ode