[ODE] AutoDisable

Megan Fox shalinor at gmail.com
Thu Dec 16 20:59:21 MST 2004


If you have one body disabled and one body enabled, the contact
between them would be capable of waking the sleeping body up - so yes,
you'll want to add that contact.

However, if you have two sleeping/disabled objects, there should
typically never be a valid contact between them - and so you can
early-out of your callback.

If you work this right, you can get the same check to early-out on
static/static geometry collision attempts as well (which will never
result in anything useful, since neither has a body).  The code would
look something like:

dBodyID body1, body2
bool obj1Active = false, obj2Active = false

body1 = dGeomGetBody(geom1)
body2 = dGeomGetBody(geom2)

if (body1)
  obj1Active = GetBodyDisabled(body1)
if (body2)
  obj2Active = GetBodyDisabled(body2)

if (!obj1Active && !obj2Active)
   return


Hope that helps,
-Megan Fox

> First of all: "Great dynamics engine". Thx for the good lib, Open
> Sourcerers.... Anyways, I managed
> to get the AutoDisable going and inside my nearCollide function 
>  
>         if (lBody1 && !dBodyIsEnabled (lBody1))
>         {
>             LOG<12> () << "resting 1";
>         }
>  
> this line gets printed after a while. My question is if I should still
> create a contact joint or just return from 
> nearcallback when this is true.... 
>  
> Cheers
> Jochen
> 
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 
> 
>


More information about the ODE mailing list