demo_buggy question in ODE

Recommended Posts

I am modifying the demo_buggy sample in ODE to experiment with triangle meshes collision. For the moment, I have replaced the ground plane, (0,0,1,0), with a triangle mesh ( quad with 2 tris ) and noticed the buggy penetrates the mesh ( without falling through it ), unlike the scene with the plane, when it works fine. I guess the normals are fine, but, for checking, I have added the 2 indices arrays to switch the direction of normals. I am new to ODE and I would like to understand the reason behind this. Bellow you can find the modified code ( best way - backup the old file and copy this one over, then run the sample ).

// lock back wheels along the steering axis
for (i=0; i<4; i++)
{
// set stops to make sure wheels always stay in alignment
dJointSetHinge2Param (buggy_joint[i],dParamLoStop,0);
dJointSetHinge2Param (buggy_joint[i],dParamHiStop,0);
// the following alternative method is no good as the wheels may get out
// of alignment:
// dJointSetHinge2Param (joint[i],dParamVel,0);
// dJointSetHinge2Param (joint[i],dParamFMax,dInfinity);
}