[ODE] AutoDisable and cylinders
Aras Pranckevicius
nearaz at interamotion.com
Tue Aug 19 22:39:02 2003
> I've been trying to get the AutoDisable stuff working,
> but it seems some of it hasn't been implemented in the release
> and not in CVS either. I then found this post from Aras P.:
> http://www.q12.org/pipermail/ode/2003-July/009359.html
> I did as he suggested and it broke my simulation (nothing appeared to be
> colliding or resolving from collisions). I blame my own incompetence,
> but I was unable to get it to work.
Actually, it did work for me back when I plugged it into ODE 0.35... But
hey, now ODE is 0.39, and I don't know what could have changed there
(haven't tested the auto-disable with it). Plus, I may have missed something
and didn't include that into the email :)
> Is there somewhere that this code is implemented and I'm just not seeing
it?
Officially - no.
I might give a quick explanation, on "how to make auto-disable" (I don't
know whether that's right or wrong way to do it, though):
* Every body (dxBody) should have the "counter" that counts world steps:
"the amount of time I'm being mostly idle". This is needed because you can't
just disable bodies when they become idle - eg. boxes colliding into
something tend to be idle for some time, and then fall to the side. So
instead, we disable the bodies, that have been idle for some steps already.
* The world (dxWorld) should have the steps threshold member (after how many
steps it disables idle bodies), and "movement is idle" threshold.
* Add code to dxBody and dxWorld creation routines to actually initialize
these members. Plus, add functions that set world's members (steps and
threshold).
* In the main body processing loop, before processing each non-disabled
body: check it's linear and angular velocities, if both are less than a
threshold - then the body must be idle. So, increment it's "I'm being idle"
counter; if the counter exceeds the "auto disable steps", disable the body.
If the body isn't idle, reset it's coutner to zero.
* Plus, I needed to add reset for body disable steps somewhere laterz :)
Aras Pranckevicius aka NeARAZ
http://www.gim.ktu.lt/nesnausk/nearaz/