stop the Vehicle AFTER fixing position not before, bc stop code also updates position (old ode)
parent
395d160c41
commit
019d057563
|
@ -2676,18 +2676,17 @@ Console.WriteLine(" JointCreateFixed");
|
||||||
|
|
||||||
m_lastVelocity = _velocity;
|
m_lastVelocity = _velocity;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
|
|
||||||
m_vehicle.Stop();
|
|
||||||
|
|
||||||
if (Body != IntPtr.Zero)
|
if (Body != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
|
d.BodySetLinearVel(Body, 0, 0, 0); // stop it
|
||||||
d.BodySetPosition(Body, _position.X, _position.Y, _position.Z);
|
d.BodySetPosition(Body, _position.X, _position.Y, _position.Z);
|
||||||
enableBodySoft();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
|
||||||
|
m_vehicle.Stop(); // this also updates vehicle last position from the body position
|
||||||
|
|
||||||
|
enableBodySoft();
|
||||||
|
|
||||||
outofBounds = false;
|
outofBounds = false;
|
||||||
base.RequestPhysicsterseUpdate();
|
base.RequestPhysicsterseUpdate();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue