[ODE] dHeightField Float precision problem

tuan kuranes tuan.kuranes at gmail.com
Fri Aug 25 04:09:06 MST 2006


using dSingle
I get assert in in heightfield.cpp:283 with dz or dx values like -0.00002f.

Changing code to

#if defined(dSINGLE)
   #define HeightFieldEpsilon 0.0001f
#elif defined(dDOUBLE)
   #define HeightFieldEpsilon 0.000001
#endif

   dIASSERT( ( dx + HeightFieldEpsilon >= 0.0f ) && ( dx -
HeightFieldEpsilon <= 1.0f ) );
   dIASSERT( ( dz + HeightFieldEpsilon >= 0.0f ) && ( dz -
HeightFieldEpsilon <= 1.0f ) );

Make it works again, but perhaps that not the right way ?


More information about the ODE mailing list