[ODE] Empty bodies crash with trimesh
Remi Ricard
remi.ricard at simlog.com
Tue Aug 29 11:18:41 MST 2006
Jeff Kershner wrote:
> My scene has a room (box) and a sphere. The box is created with a trimesh
> and the sphere is just a sphere geom.
>
> For some reason, when my sphere hits the ground of the box, dCollide crashes
> in my NearCallback function.
>
> dBodyID b1 is valid
> dBodyID b2 is NULL (probably the ground that doesn't have a body attached to
> it)
>
> The geoms for b1 and b2 look like valid pointers.
>
> What am I doing wrong?
>
If you take the example
nearCallback (void *data, dGeomID o1, dGeomID o2)
{
...
// Before we add the following lines but they were not returning
// the good body (returning null instead) when dealing with composite
// object
// dJointAttach(c,
// dGeomGetBody(contact[i].geom.g1),
// dGeomGetBody(contact[i].geom.g2));
// So I'm doing instead
dBodyID bodyID1 = dGeomGetBody(o1);
dBodyID bodyID2 = dGeomGetBody(o2);
dJointAttach(c, bodyID1, bodyID2);
...
}
>
> -----Original Message-----
> From: Remi Ricard [mailto:remi.ricard at simlog.com]
> Sent: Monday, August 28, 2006 1:23 PM
> To: Jeff Kershner; ODE Mailing List (E-mail)
> Subject: Re: [ODE] Empty bodies crash with trimesh
>
> Hi Jeff,
>
>
>
>> My physics geometry for a non-moveable test world is a single node in
>> OSG with 4 "geometries." I create these 4 geometries as trimeshes and
>> do not associate bodies with them.
>>
>> The problem is that in the NearCallback function, dBodyID b1 and
>> dBodyID b2 are both NULL and dCollide crashes.
>>
>> I think this has to do with a wall intersecting a floor and both don't
>> have bBodyIDs.
>>
>> Do I need to check for b1 and b2 both being null and exit that
>> collision callback function?
>>
>>
>
> Yes and no.
>
> If you set your collide and category bits correctly you should not go to
> this function (with a wall and a florr) since there are not movable and
> should not collide.
>
> But You should always check if they are both null you never know.
>
>
>
Remi
More information about the ODE
mailing list