[ODE] collision_trimesh_trimesh.cpp single precision problem

Jon Watte hplus-ode at mindcontrol.org
Wed Oct 13 09:01:53 MST 2004


> ..\collision_trimesh_trimesh.cpp(404 [and line 416]) : error C2664: 
> 'SimpleUnclippedTest' : cannot convert parameter 6 from 'dReal' to 
> 'double &' A reference that is not to 'const' cannot be bound to a 
> non-lvalue

Yes. A comitter checked in code that BROKE THE COMPILE for people 
using dReal == float a few weeks back. I complained about it, but 
was told that making things compile for people other than whomever 
is currently submitting is not a priority of the ODE maintainer 
community.

This is an implementation bug. The SimpleUnclippedTest() function 
should take a dReal&, not a double&. Thus, change that function to 
take a dReal&, and you'll run again.

I even sent diffs for this problem back then, but they were not 
applied or submitted. They are still available right here:
http://www.speakeasy.net/~hplus/ode-0409.txt



> I didn't think much of it at first, I just cast the depth variable 
> explicitly to (double&) to get it compiled... but now I'm starting 
> trying to get things colliding, whenever I call dCollide in nearCallback 

That's the wrong thing to do. The variable is a float, casting it to 
a double reference won't do the right thing. References are just like 
pointers, except you can't change the pointer value. Would you do this?

  void function( double * d );

  float f = 3;
  function( (double *)&f );

That's basically what you did with your cast.

Cheers,

			/ h+




More information about the ODE mailing list