osx ode trimesh bugreport

i have a curious thing when compiling panda under osx. As you may have read ode’s trimesh collisions do not work when using macports ode without a fix.

in panda/ode/src/odeTriMeshData.h:

...
protected:
  struct StridedVertex{
    float Vertex[3];
  }; 
  struct StridedTri{
...

i actually dont understand why i needed to define it as float, because dReal (the default) is defined by ode/common.h as:

/* floating point data type, vector, matrix and quaternion types */

#if defined(dSINGLE)
typedef float dReal;
#ifdef dDOUBLE
#error You can only #define dSINGLE or dDOUBLE, not both.
#endif // dDOUBLE
#elif defined(dDOUBLE)
typedef double dReal;
#else
#error You must #define dSINGLE or dDOUBLE
#endif

and ode/config.h defines:

#define dDOUBLE

so ode seems to be compiled with double precision, but panda only works if i define the values sent to ode as single…

The thing is, it works here (my ODE lib is single-precision, so are the thirdparty ones I compiled), because dReal is typedeffed as float here.
The fact that _Hypnos and his double-precision build could only make it work by making it a float, that sounds very much like this really ought to be a float. Can anyone confirm this? If so, that’s one bug less in Panda3D :slight_smile: