- 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.
0.6.1-post-fixes
Homer Horwitz 2008-12-19 21:06:07 +00:00
parent db0c65ea56
commit 11d0456246
1 changed files with 10 additions and 7 deletions

View File

@ -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);
}