[ODE] TriMesh Collision

Bob Cober AzCoder at cox.net
Sat Jun 12 07:08:04 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.

Thanks again for any help....


Joe Ante wrote:

>> Thanks in advance for any help - this is driving me nuts:
>>
>>I am getting a segfault whenever a box collides with a trimesh.  The
>>actual error is in OpCode, although I am certain it is caused by my code.
>>
>>Opcode::OBBCollider::InitQuery(Opcode::OBBCache&, IceMaths::OBB const&,
>>IceMaths::Matrix4x4 const*, IceMaths::Matrix4x4 const*) (this=0x8123160,
>>cache=@0x8123500, box=@0xbffff1d0, worldb=0x0, worldm=0xbffff180) at
>>OPC_Common.h:96
>>
>>I have noticed that during the collision callback, dGeomGetBody returns
>>0 for o2.  Should a dGeometBody() be returning 0 for a Trimesh?
>>    
>>
>If you assigned a body to the geom it does not return 0.
>
>  
>
>>Thanks again for your time...
>>
>>
>>Here is the simplified code:
>>float vertices[]=
>>{0.0f,1000.0f,0.0f,
>> 6000.0f,1000.0f,6000.0f,
>> 6000.0f,1000.0f,0.0f};
>>
>>float indices[]={0,1,2};
>>    
>>
>You are using floats as indices. Might not be that great of an idea.
>
>Joe Ante
>
>_______________________________________________
>ODE mailing list
>ODE at q12.org
>http://q12.org/mailman/listinfo/ode
>
>  
>




More information about the ODE mailing list