[ODE] Question about variable step size and collision detection
boernerb at web.de
Sun Dec 17 14:54:29 MST 2006
something to this part:
*Per Bull Holmen wrote:*
> 2) Is it possible to use ODE in a more low level kind
> of way? Then I could move the objects around myself
> according to speed, direction, torque etc. Whenever a
> collision is detected, I might call ODE to make it
> compute the collision response. I'm worried about that
> type of solution cause I think I've read that ODE
> discourages to manipulate the objects positions on
> your own (not sure though). Is this true?
As far as i know is setting the positions of objects no problem.
There are only two things to attend:
1. If you put an object deep in a wall by setting the position,
it will be pushed out very fast by the ODE-collision-response (stepping-functions).
2. If you enable gravity, objects get the gravity-force added each simulation-step.
And if you always directly set objects "in air" with its position, the gravity force would accumulate itself.
But if you don't step (only collision-detection) this is no problem.
> Also, if I
> just call ODE's dWorldQuickStep() function to have
> this done, I'm actually making guesses about how the
> engine is implemented (which isn't the proper OO way
> do to something): I'm guessing that it only takes the
> objects present position and collision info into
> account, and not for instance previous positions and
> previous calculations done by ODE's dWorldQuickStep()
> or similar functions. Is it possible, or not, to use
> ODE this way?
I think taking the last "world-status" to improve physics is the part of
ODE Collisiondetection is not yet so good that it care about something
or approximated position in the future of the simulation.
It is always collisiondetection and after this "response".
Perhaps it is a crazy idea, but if you do this:
1. save the current world-state.
2. dWorldQuickStep the world to move objetcs to their new position.
3 make collisiondetection to examine where objetcs will be in the future.
4. reload the saved worldstate
5. add contactjoints from the collisiondetection (you will have to
modifiy your Callback)
6. step the world with dWorldQuickStep (or something else...) using the
collisionresults of the collision "from the future"
I don't know how this works, no guarantee ;-)
More information about the ODE