[Opensim-dev] Terrain ---> Height field code || altering ODE.dll to remove the ((nMinX < nMaxX || nMinZ < nMaxZ)) error
Teravus Ovares
teravus at gmail.com
Sat Nov 3 16:41:31 UTC 2007
Dan
Looking at the ODE stability issue.. Excessive forces cause an error in
int dCollideHeightfield( dxGeom *o1, dxGeom *o2, int flags, dContactGeom*
contact, int skip ) in heightfield.cpp in ODE.
The error occurs on line 1741.
However.. looking at the code in heightfield.cpp, nMinX nMaxX, nMinZ and
nMaxZ are derived from the terrain. So, next steps on this bug parhaps are
to find out if our terrain--> heightfield code has errors, or if there's
some kind of error in heightfield.cpp that we can simply ignore and continue
by returning an int 0, for number of collisions.
CodeSample from heightfield.cpp;
nMinX = int(dFloor(o2->aabb[0] * terrain->m_p_data->m_fInvSampleWidth));
nMaxX = int(dFloor(o2->aabb[1] * terrain->m_p_data->m_fInvSampleWidth))
+ 1;
nMinZ = int(dFloor(o2->aabb[4] * terrain->m_p_data->m_fInvSampleDepth));
nMaxZ = int(dFloor(o2->aabb[5] * terrain->m_p_data->m_fInvSampleDepth))
+ 1;
if ( !wrapped )
{
nMinX = dMAX( nMinX, 0 );
nMaxX = dMIN( nMaxX, terrain->m_p_data->m_nWidthSamples - 1 );
nMinZ = dMAX( nMinZ, 0 );
nMaxZ = dMIN( nMaxZ, terrain->m_p_data->m_nDepthSamples - 1 );
dIASSERT ((nMinX < nMaxX) || (nMinZ < nMaxZ)) // <---- Generates
the error
}
Best Regards
Teravus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20071103/53dc0cb9/attachment-0001.html>
More information about the Opensim-dev
mailing list