From fcc276a68da1da15fac802725a116b3e8d7f7197 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 8 Nov 2007 15:22:36 +0000 Subject: * Fixed occasional character drift caused by sim not sending the avatar's final resting velocity. * Added Smooth moving prim * Added event to PhysicsActor RequestPhysicsterseUpdate to allow physics plugins to be able to schedule a terse update. --- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 12 ++++++++++++ OpenSim/Region/Environment/Scenes/ScenePresence.cs | 2 ++ 2 files changed, 14 insertions(+) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 0e2b186..f54b52f 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -782,10 +782,15 @@ namespace OpenSim.Region.Environment.Scenes if (UsePhysics) { AddFlag(LLObject.ObjectFlags.Physics); + if (PhysActor != null) + PhysActor.OnRequestTerseUpdate += PhysicsRequestingTerseUpdate; + } else { RemFlag(LLObject.ObjectFlags.Physics); + if (PhysActor != null) + PhysActor.OnRequestTerseUpdate -= PhysicsRequestingTerseUpdate; } if (IsPhantom) @@ -1067,6 +1072,13 @@ namespace OpenSim.Region.Environment.Scenes public virtual void UpdateMovement() { } + #region Events + public void PhysicsRequestingTerseUpdate() + { + SendTerseUpdateToAllClients(); + } + #endregion + public virtual void OnGrab(LLVector3 offsetPos, IClientAPI remoteClient) { diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 789bd68..608efc3 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -386,6 +386,7 @@ namespace OpenSim.Region.Environment.Scenes if (PhysicsActor != null) { m_scene.PhysScene.RemoveAvatar(PhysicsActor); + m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; PhysicsActor = null; } } @@ -1092,6 +1093,7 @@ namespace OpenSim.Region.Environment.Scenes AbsolutePosition.Z); m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec); + m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; } internal void Close() -- cgit v1.1