[ODE] TriMesh Collision

Joe Ante joe at uti.is
Sat Jun 12 16:53:37 MST 2004


> Thanks Joe - That seems to be a step in the right direction, I no longer
> get any segfaults.  But I still have a problem - the collisions with the
> trimesh never happen.  :-(
> 
> While troubleshooting this, I have come up with a conceptual questions I
> don't understand.
> 
> 1)  Why is the collision callback is called with the second dGeomID==0?
> For example given:
> 
> void nearCallback (void *data, dGeomID o1, dGeomID o2)
> {
> int i;
> dBodyID b1 = dGeomGetBody(o1);
> dBodyID b2 = dGeomGetBody(o2);
> //if ((b1==0)||(b2==0))return;
> if (b1 && b2 && dAreConnectedExcluding (b1,b2,dJointTypeContact))
> return;//bbb
> ...
> }
> 
> When a box collides with a plane, this is called with o2==0.  If I
> discard any calls where one of the dGeomIDs is 0(the commented out line
> above), then no collision with the plane occurs.
You have a plane. The plane is a collider only. It is not attached to a
rigid body thus the dGeomGetBody is NULL.
You have another collider it has a rigid body. dGeomGetBody is not NULL.

Since you want the rigid body to rest on the plane, you have to generate the
contacts for collision between the plane and the rigidbody with collider.

Static colliders vs rigidbody with attached collider is something you don¹t
want to ignore.

Joe Ante




More information about the ODE mailing list