ODE Idle/Auto-disable behavior

26 views
Skip to first unread message

Léna Piquet (Froyok)

unread,
Aug 17, 2024, 2:28:12 AM8/17/24
to ode-users
Hi,

I wanted to add support for physics in my game engine and decided to use ODE for this (needed a C API to interface with Lua/FFI).

I have a single world and space, I added a plane and a sphere. The sphere bounce a few times until it sits down on the plane (serving at the world floor). Just like in this example: https://ode.org/wiki/index.php/Simple_Bouncing_Sphere .

I added a call to dWorldSetAutoDisableFlag( MyWorld, 1 ) in order to enable the possibility for an object to become disabled when it doesn't move anymore (aka idling).

However I noticed that:

- The callback used by dSpaceCollide() still triggers all the time
- While the bodies inside the callback are marked as disabled after a while, their parent geometry aren't.

What is the nuance between a disable geom and a disabled body ?

Also I'm surprised that the collide "near" callback still run in this case, but I'm guessing it makes sense in case a body needs to wake up ? However the wiki says the following:

"Disabled bodies do not consume CPU time, therefore to speed up the simulation bodies should be disabled when they come to rest. This can be done automatically with the auto-disable feature."
https://ode.org/wiki/index.php/Manual#Automatic_Enabling_and_Disabling

So why do bodies still trigger the callback in this case ? What's the cost of it ? Can it be safely ignored ?

Thanks in advance,
Cheers.
Reply all
Reply to author
Forward
0 new messages