[ODE] Valid uses of dInfinity?

Russ Smith russ at q12.org
Sun Dec 8 16:29:01 2002


> I am wondering about the valid use of dInfinity throughout ODE. It is
> mentioned explicitly by a few functions, but it is never made clear
> whether it is a well defined global equal to the largest practical
> number storable in a dReal, or whether it is some special value (e.g.
> NaN) that gives ODE a wink and a nod that it need not do certain
> calculations, or that some calculations can be done in a different
> manner. Or perhaps it is both?

dInfinity is a double/float, but it is not a finite number an not a NaN.
it is the IEEE754 positive infinity, so it should have the following
properties:

  any_finite_number < dInfinity
  any_finite_number > -dInfinity
  -dInfinity < dInfinity

ODE relies on these properties. C/C++ has no portable way to create a
number that is infinite (unless you count 'dReal inf=1.0/0.0', which may
have other consequences), hence there is a certain amount of trickery to
find a dInfinity value in the configurator.

> And, in conclusion, is the following valid:
> 
> dJointSetHinge2Param(... dParamFMax2, dInfinity);

yes.

russ.

-- 
Russell Smith
http://www.q12.org