[ODE] AutoDisable optimization

Mark Wayland mwayland at torus.com.au
Wed May 26 21:42:33 MST 2004


When you "Check if body avel and lvel are big enough" I presume this is
performed when the object is in resting contact? Otherwise you might make an
object come to rest prematurely... for example a box is thrown upwards with
some velocity. You have gravity acting downwards. At some point, the
velocity will change direction wrt to the gravity direction (at the top of
its "arc" of movement) - it is here, at the top of the arc, that the linear
velocity is almost zero (if not zero for one frame)... you most certainly
don't want it coming to rest in the air. What a waste of potential energy
;-)

Cheers,
Mark

----- Original Message ----- 
From: "Nguyen Binh" <ngbinh at glassegg.com>
To: "Ode" <ode at q12.org>
Cc: "Russ Smith" <russ at q12.org>
Sent: Wednesday, May 26, 2004 7:26 PM
Subject: [ODE] AutoDisable optimization


> Hi Russ,
>
>    I saw a way to improve ODE's performance by implement a more
>    correct way of auto-disable feature.
>
>    1. We have a limit for a body to sleep so we should have a limit
>    for a body to wake up.
>
>    Now, in ODE:
>        a) Check if bodies should be slept
>        b) Update physics for enabled bodies and bodies connected to
>        enabled bodies.
>        c) Re-enable all bodies in the island
>
>    The problem is with step c). Quote from the code:
>
>     // what we've just done may have altered the body/joint tag values.
>     // we must make sure that these tags are nonzero.
>     // also make sure all bodies are in the enabled state.
>
>     for (i=0; i<bcount; i++)
>         {
>       body[i]->tag = 1;
>       body[i]->flags &= ~dxBodyDisabled;
>     }
>
>     So we enabled bodies that are "might" be changed in b). Actually
>     we could know exactly what bodies are being changed, what are not
>     (under a limit). We could easily do that in where we move bodies
>     dxStepBody :
>
>         Check if body avel and lvel are big enough
>         If no
>           if body is disable
>             So that change is not enough, just early quit, don't
>             bother update the body's state
>           endif
>         endif
>
>         Continue to normal update...
>
>     And we should remove the code
>        body[i]->flags &= ~dxBodyDisabled;
>     in original code and let the waking up decide by dxStepBody
>
>     I had implemented this thing and it helps a lot, especially for
>     the case where a small geom (sphere?) touches a huge stacks of
>     geoms. With original code, all bodies in that huge stack are wake
>     up and thus put a lot of work (that will result a very small
>     change - actually should be left out) to the solver. But with the
>     new code, just a small portion of bodies are re-enabled.
>
>
>     To Russ, I could send you the code but I couldn't deal with the
>     body's tag stuff so I get assert false in the checking code in
>     dxProcessIslands(). Note: I had removed those check without any
>     problem.
>
> -- 
> Best regards,
>
> ---------------------------------------------------------------------
>    Nguyen Binh
>    Software Engineer
>    Glass Egg Digital Media
>
>    E.Town Building
>    7th Floor, 364 CongHoa Street
>    Tan Binh District,
>    HoChiMinh City,
>    VietNam,
>
>    Phone : +84 8 8109018
>    Fax   : +84 8 8109013
>
>      www.glassegg.com
> ---------------------------------------------------------------------
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode



More information about the ODE mailing list