[ODE] How to use the rotation matrix returned by dGeomGetRotation

scott scott+ode at escherichia.net
Mon Oct 11 17:14:21 MST 2004


On Mon, Oct 11, 2004 at 12:18:29PM -0700, Jon Watte wrote:
> conversion code? 1.875 seems too "good" a floating point value 
> to be just random data, so it has to come from somewhere...
> 
> Cheers,
> 
> 			/ h+
> 

Indeed. 1.875 is way too good.  Is there a chance you are using ODE in
double precision mode?  A double '1' memcpy'd into an array of floats
would give you 1.875 in the second float.  

Try this code:

    double xxx[2];
    xxx[0] = 1.;
    xxx[1] = 0.;
    float woo[4];
    memset( woo, 0, sizeof(woo) );
    memcpy( woo, xxx, sizeof(woo) );

scott


-- 
-----------------------------------------------------------------
scott jacobs                            scott+ode at escherichia.net
-----------------------------------------------------------------


More information about the ODE mailing list