[ODE] Strange error when using single precision

Peter Thoman peter.thoman at chello.at
Sat Sep 21 06:26:01 2002


Hello fellow ODE users, and of course hello Russ ;)

I'm currently trying to convert my ODE application to single precision 
floats in order to use Tricollider, and in the process I ran into this 
strange bug.
The following function works perfectly fine when linking with an ode.lib 
built with doubles, however if I  switch to singles it gives me an error 
message saying "ODE INTERNAL ERROR 2 - BAD DIRECTION NUMBER" and my 
debugger points me to the dMassSetCappedCylinder line.

void setMass()
{
    dMass m;
    dMassSetCappedCylinder(&m, 20.0f, 3, 1.0f, 2.5f);
    dBodySetMass(mODEBody,&m);
}

The documentation says that "The cylinder's long axis is oriented along 
the body's x, y or z axis according to the value of direction (1=x, 2=y, 
3=z). ", so I have no idea what's going on here.

Thanks in advance for any advices and sorry if I'm missing the obvious.

- Peter