[ODE] optimization for disabled objects

Adam D. Moss adam at gimp.org
Sat Sep 18 11:06:44 MST 2004


Peter wrote:
> ~~
> b1 = dGeomGetBody(o1);
> b2 = dGeomGetBody(o2);
> ~~
> 
> //  exit without doing anything if they're both dynamic bodys and both
> asleep
>    b1awake=0;
>    b2awake=0;
>    if (b1)
>    {
>       b1awake=dBodyIsEnabled(b1);
>    }
>    if (b2)
>    {
>       b2awake=dBodyIsEnabled(b2);
>    }
>    if (b1awake==0 && b2awake==0) return;

Yup, I use this one.  It works well.  Actually I do something like:
if ((b1awake==0 || !b1) && (b2awake==0 || !b2)) return;

--adam


More information about the ODE mailing list