[ODE] Resetting a moving vehicle
Cristian Bianchi
cris at cris.hspace.name
Wed Oct 13 18:40:23 MST 2004
Hi
did you remember to set also each joint velocity to 0? you shouldn't have
problems with torque and forces because these are set to zero by ode after
each simulation step, and remain zero if don't use dBodyAdd*** functions.
Also... if you keep the joints alive (not detaching/re-attaching), you must
take care to position and orient the attached bodies in a consistent state.
You must take care to perform the "next" simulation step starting from a
joint-bodies state which satisfies all the joints, otherwise, you will
certainly observe a scenic explosion! ;)
Cheers,
Cris
Cristian Bianchi
Software Designer - DIESGroup, Rome - Italy
----- Original Message -----
From: "Lukas Henschke" <henschke at 4head.de>
To: "ode" <ode at q12.org>
Sent: Wednesday, October 13, 2004 5:34 PM
Subject: [ODE] Resetting a moving vehicle
> 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
>
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
>
More information about the ODE
mailing list