From b63076c303c380ac119cb608499b9ac54d524f05 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Fri, 16 Nov 2007 08:53:37 +0000 Subject: * ODE step two on the way to separate dynamic space allocation ( One more to go ) --- OpenSim/Region/Physics/Manager/PhysicsActor.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (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 84b451f..cdb5ae2 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -99,6 +99,7 @@ namespace OpenSim.Region.Physics.Manager { public delegate void RequestTerseUpdate(); public delegate void CollisionUpdate(EventArgs e); + public delegate void OutOfBounds(PhysicsVector pos); #pragma warning disable 67 public event PositionUpdate OnPositionUpdate; @@ -106,6 +107,7 @@ namespace OpenSim.Region.Physics.Manager public event OrientationUpdate OnOrientationUpdate; public event RequestTerseUpdate OnRequestTerseUpdate; public event CollisionUpdate OnCollisionUpdate; + public event OutOfBounds OnOutOfBounds; #pragma warning restore 67 public static PhysicsActor Null @@ -131,6 +133,18 @@ namespace OpenSim.Region.Physics.Manager } } + public virtual void RaiseOutOfBounds(PhysicsVector pos) + { + // 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. + OutOfBounds handler = OnOutOfBounds; + if (handler != null) + { + OnOutOfBounds(pos); + } + + } public virtual void SendCollisionUpdate(EventArgs e) { CollisionUpdate handler = OnCollisionUpdate; -- cgit v1.1