I'm trying to get OgreNewt running with new Ogre2.1. I'm stuck with the OgreNewtDebugger, as there is the callback function:
- Code: Select all
void _CDECL Debugger::newtonPerPoly(void* userData, int vertexCount, const dFloat* faceVertec, int id)
which is called inside newton in ShowDebugPolygon. But the issue is:
Since Ogre2.1 each manual object needs indices, but Its not possible to get them from newton, even there are available inside ShowDebugPolygon. But the callback is called with those parameters:
- Code: Select all
data.m_callback (data.m_userData, indexCount, &triplex[0].m_x, indexArray[-1]);
Where the index array is wrong and has wrong dimension. E.g. if indexCount is 4, the index array should also have 4 values.
See code in OgreNewt:
- Code: Select all
void _CDECL Debugger::newtonPerPoly(void* userData, int vertexCount, const dFloat* faceVertec, int id)
{
Ogre::ManualObject* lines = (Ogre::ManualObject*)userData;
Ogre::Vector3 p0, p1;
if (vertexCount < 2)
return;
int i = vertexCount - 1;
p0 = Ogre::Vector3(faceVertec[(i * 3) + 0], faceVertec[(i * 3) + 1], faceVertec[(i * 3) + 2]);
for (i = 0; i < vertexCount; i++)
{
p1 = Ogre::Vector3(faceVertec[(i * 3) + 0], faceVertec[(i * 3) + 1], faceVertec[(i * 3) + 2]);
lines->position(p0);
lines->position(p1);
lines->line(?, ?);
p0 = p1;
}
}
So what sould be the indices for lines->line ?
Any idea, how to fix this?
Regards
Lax