I show the debug lines like this:
- Code: Select all
DebugRenderDebugInfo();
DebugRenderWorldCollision(newtonPtr->getWorld());
for(int i = 0; i < NewtonWorldGetBodyCount(newtonPtr->getWorld()); i++)
{
NewtonBody* body0 = NewtonWorldGetFirstBody(newtonPtr->getWorld());
NewtonCollision* collision = NewtonBodyGetCollision(body0);
dMatrix matrix;
NewtonBodyGetMatrix(body0, &matrix[0][0]);
DebugDrawCollision(collision, matrix, dVector (1.0f, 1.0f, 1.0f, 1.0f));
DebugDrawLine (matrix.m_posit, matrix.m_posit + matrix.m_front, dVector (1, 0, 0));
DebugDrawLine (matrix.m_posit, matrix.m_posit + matrix.m_up, dVector (0, 1, 0));
DebugDrawLine (matrix.m_posit, matrix.m_posit + matrix.m_right, dVector (0, 0, 1));
}
If thats not the way of doing it for all the bodies, please show me how its done! Because as far as i know, i don't apply any transformations to the lines.
@Julio,
I changed the transform matrix as you suggested, i'll also change the convexhull for normal primitives, like the cube and sphere.
About the mesh that might be parented, the meshes are created like this:
- Code: Select all
IAnimatedMesh* mesh = irrPtr->getSceneManager()->getMesh(filename);
ISceneNode* node = irrPtr->getSceneManager()->addAnimatedMeshSceneNode(mesh);
node->setMaterialFlag(EMF_LIGHTING, false);
IMeshManipulator* mm = irrPtr->getSceneManager()->getMeshManipulator();
mm->scaleMesh(mesh, vector3df(20.0, 20.0, 20.0));
The mesh and the node are at all times at the same position (as far as i can see in the demo).
This seriously needs to be fixed.
Any idea's where i need to look into, for example, the matrixes or something?
[EDIT]
It looks like there is not collision between the bodies when i use the normal primitives for collision. However, the primitives do collide against the floor collision which mismatches the position of the graphics object of the floor.
[/EDIT]