diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs index 739a7b3570..ff1938405b 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs @@ -607,6 +607,13 @@ namespace OpenSim.Region.PhysicsModule.ODE m_body = pBody; } + internal void Stop() + { + m_lastLinearVelocityVector = Vector3.Zero; + m_lastAngularVelocity = Vector3.Zero; + m_lastPositionVector = d.BodyGetPosition(Body); + } + internal void Step(float pTimestep, OdeScene pParentScene) { if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE) diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs index 82b0999b60..a31110b85b 100644 --- a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs @@ -2676,10 +2676,16 @@ Console.WriteLine(" JointCreateFixed"); m_lastVelocity = _velocity; + + + if(m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) + m_vehicle.Stop(); + if (Body != IntPtr.Zero) { d.BodySetLinearVel(Body, 0, 0, 0); // stop it d.BodySetPosition(Body, _position.X, _position.Y, _position.Z); + enableBodySoft(); } outofBounds = false;