[ODE] collision_trimesh_trimesh.cpp single precision problem

Colin Bonstead colin at cyan.com
Wed Oct 13 08:48:42 MST 2004


The problem is that you're casting a float reference to a double 
reference.  Since a float is smaller, you're going to be reading out of 
uninitialized data.  To fix it on my build I just changed the double& to 
dReal&.

-----Original Message-----
From: Duncan Frostick <duncanf at f2s.com>
Sent: Wed, 13 Oct 2004 16:29:11 +0100
To: 'ODE mailing list' <ode at q12.org>
Subject: [ODE] collision_trimesh_trimesh.cpp single precision problem

Ello all, cheers for the help with the matrices, works a treat now - but
in the process of fixing it one of the things I did was to recompile ODE
into it's single precision version, which threw up a compile error in
collision_trimesh_trimesh.cpp:

..\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

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
I get this in debug:

Run-Time Check Failure #2 - Stack around the variable 'depth' was 
corrupted.

I knew immediately it had something to do with my ugly hack and after
stepping through my code and ODE's it was the lines I'd changed causing
the trouble.

So, how can I get single precision ODE to compile and not cause the
trouble with stack corruption? The code I'm using is the latest CVS
snapshot (ode-040926).

Cheers, Duncan
_______________________________________________
ODE mailing list
ODE at q12.org
http://q12.org/mailman/listinfo/ode






More information about the ODE mailing list