[ODE] Resetting a moving vehicle

Lukas Henschke henschke at 4head.de
Wed Oct 13 17:34:06 MST 2004


I have a serious problem with our racing game. When the car lies upside down or goes off the track it should be automatically reset to the race track.
First I tried to just set the new position to the single objects (the car and its wheels) which ended in desaster because some velocities or forces were still stored and caused the vehicle to "explode". I tried to set each single velocity and force to null, before and after the resetting, but nothing changed.
As I could not find the reason I ended up detaching all joints, destroying all elements and rebuilding the whole car on the new position but this worked only for certain angles.
My last try was to hide the car and move it slowly to the wanted position but even this didn´t work. At a certain angle the car flipped and started to "explode" again.

Has anyone experience with this issue ? Does anyone know a way how to realy set all velocities and forces to null ? I am missing a function like FreeObjectFromAllForces() or so to be able to set it to an arbitrary position/rotation and kind of start the simulation for this object from the beginning of the next frame.

thanks for any hints
Lukas Henschke



More information about the ODE mailing list