From 11d04562463764e3e5562794c79ba6ac63e3a473 Mon Sep 17 00:00:00 2001 From: Homer Horwitz Date: Fri, 19 Dec 2008 21:06:07 +0000 Subject: - Set acceleration and rotational velocity to 0, too - Pull it up a bit, so the physics is notified of it, too, before being switched off. --- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 8905c18..c54f8f8 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -1425,6 +1425,16 @@ if (m_shape != null) { PhysActor.delink(); } + if (!UsePhysics) + { + // reset velocity to 0 on physics switch-off. Without that, the client thinks the + // prim still has velocity and continues to interpolate its position along the old + // velocity-vector. + Velocity = new Vector3(0, 0, 0); + Acceleration = new Vector3(0, 0, 0); + AngularVelocity = new Vector3(0, 0, 0); + } + PhysActor.IsPhysical = UsePhysics; @@ -1450,13 +1460,6 @@ if (m_shape != null) { } } } - - if (!UsePhysics) - { - // reset velocity to 0. Without that, the client thinks the prim still has velocity and - // continues to interpolate its position along the old velocity-vector. - Velocity = new Vector3(0, 0, 0); - } } m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor); } -- cgit v1.1