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/Physics/Manager/PhysicsActor.cs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics/Manager/PhysicsActor.cs') diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 2d8eb9a..049da96 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -36,14 +36,19 @@ namespace OpenSim.Region.Physics.Manager public delegate void OrientationUpdate(Quaternion orientation); + + public abstract class PhysicsActor - { + { + public delegate void RequestTerseUpdate(); + #pragma warning disable 67 public event PositionUpdate OnPositionUpdate; public event VelocityUpdate OnVelocityUpdate; public event OrientationUpdate OnOrientationUpdate; + public event RequestTerseUpdate OnRequestTerseUpdate; #pragma warning restore 67 public static PhysicsActor Null @@ -57,6 +62,19 @@ namespace OpenSim.Region.Physics.Manager { set; } + public virtual void RequestPhysicsterseUpdate() + { + // Make a temporary copy of the event to avoid possibility of + // a race condition if the last subscriber unsubscribes + // immediately after the null check and before the event is raised. + RequestTerseUpdate handler = OnRequestTerseUpdate; + if (handler != null) + { + OnRequestTerseUpdate(); + } + + } + public abstract PhysicsVector Position { get; set; } -- cgit v1.1