From 038ec133e648ab99643f5738e4ab85e450e5aa45 Mon Sep 17 00:00:00 2001 From: Revolution Date: Sun, 10 Jan 2010 14:28:53 -0600 Subject: Adds land collision events. CRs cleaned from patch Signed-off-by: Melanie --- .../Region/ScriptEngine/XEngine/EventManager.cs | 71 ++++++++++++++++------ 1 file changed, 54 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 8195f33..b2eab45 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -63,6 +63,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; myScriptEngine.World.EventManager.OnScriptColliding += collision; myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end; + myScriptEngine.World.EventManager.OnScriptLandColliderStart += land_collision_start; + myScriptEngine.World.EventManager.OnScriptLandColliding += land_collision; + myScriptEngine.World.EventManager.OnScriptLandColliderEnd += land_collision_end; IMoneyModule money=myScriptEngine.World.RequestModuleInterface(); if (money != null) { @@ -285,29 +288,63 @@ namespace OpenSim.Region.ScriptEngine.XEngine det.ToArray())); } - public void land_collision_start(uint localID, UUID itemID) - { - myScriptEngine.PostObjectEvent(localID, new EventParams( - "land_collision_start", - new object[0], - new DetectParams[0])); + public void land_collision_start(uint localID, ColliderArgs col) + { + List det = new List(); + + foreach (DetectedObject detobj in col.Colliders) + { + DetectParams d = new DetectParams(); + d.Position = new LSL_Types.Vector3(detobj.posVector.X, + detobj.posVector.Y, + detobj.posVector.Z); + d.Populate(myScriptEngine.World); + det.Add(d); + myScriptEngine.PostObjectEvent(localID, new EventParams( + "land_collision_start", + new Object[] { new LSL_Types.Vector3(d.Position) }, + det.ToArray())); + } + } - public void land_collision(uint localID, UUID itemID) + public void land_collision(uint localID, ColliderArgs col) { - myScriptEngine.PostObjectEvent(localID, new EventParams( - "land_collision", - new object[0], - new DetectParams[0])); + List det = new List(); + + foreach (DetectedObject detobj in col.Colliders) + { + DetectParams d = new DetectParams(); + d.Position = new LSL_Types.Vector3(detobj.posVector.X, + detobj.posVector.Y, + detobj.posVector.Z); + d.Populate(myScriptEngine.World); + det.Add(d); + myScriptEngine.PostObjectEvent(localID, new EventParams( + "land_collision", + new Object[] { new LSL_Types.Vector3(d.Position) }, + det.ToArray())); + } } - public void land_collision_end(uint localID, UUID itemID) + public void land_collision_end(uint localID, ColliderArgs col) { - myScriptEngine.PostObjectEvent(localID, new EventParams( - "land_collision_end", - new object[0], - new DetectParams[0])); - } + List det = new List(); + + foreach (DetectedObject detobj in col.Colliders) + { + DetectParams d = new DetectParams(); + d.Position = new LSL_Types.Vector3(detobj.posVector.X, + detobj.posVector.Y, + detobj.posVector.Z); + d.Populate(myScriptEngine.World); + det.Add(d); + myScriptEngine.PostObjectEvent(localID, new EventParams( + "land_collision_end", + new Object[] { new LSL_Types.Vector3(d.Position) }, + det.ToArray())); + } + } // timer: not handled here // listen: not handled here -- cgit v1.1 From a0859754c03324be9a4a2b9c9f26928e64cb5a6f Mon Sep 17 00:00:00 2001 From: Revolution Date: Sun, 10 Jan 2010 20:20:00 -0600 Subject: Adds llRotTarget and the events at_rot_target and not_at_rot_target. Signed-off-by: Melanie --- .../Region/ScriptEngine/XEngine/EventManager.cs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index b2eab45..ce22ba5 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -58,7 +58,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine myScriptEngine.World.EventManager.OnObjectDeGrab += touch_end; myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; - myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; + myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; + myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target; + myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target; myScriptEngine.World.EventManager.OnScriptControlEvent += control; myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; myScriptEngine.World.EventManager.OnScriptColliding += collision; @@ -388,16 +390,20 @@ namespace OpenSim.Region.ScriptEngine.XEngine myScriptEngine.PostObjectEvent(localID, new EventParams( "not_at_target",new object[0], new DetectParams[0])); - } - - public void at_rot_target(uint localID, UUID itemID) - { - myScriptEngine.PostObjectEvent(localID, new EventParams( - "at_rot_target",new object[0], + } + + public void at_rot_target(uint localID, uint handle, Quaternion targetrot, + Quaternion atrot) + { + myScriptEngine.PostObjectEvent(localID, new EventParams( + "at_rot_target", new object[] { + new LSL_Types.LSLInteger(handle), + new LSL_Types.Quaternion(targetrot.X,targetrot.Y,targetrot.Z,targetrot.W), + new LSL_Types.Quaternion(atrot.X,atrot.Y,atrot.Z,atrot.W) }, new DetectParams[0])); } - public void not_at_rot_target(uint localID, UUID itemID) + public void not_at_rot_target(uint localID) { myScriptEngine.PostObjectEvent(localID, new EventParams( "not_at_rot_target",new object[0], -- cgit v1.1 From 2320b17ca92d0c922d78ad72933fe3903f2108d0 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 11 Jan 2010 02:04:05 +0000 Subject: Whitespace cleanup --- OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/XEngine') diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index ce22ba5..16309ef 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -58,9 +58,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine myScriptEngine.World.EventManager.OnObjectDeGrab += touch_end; myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; - myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; - myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target; - myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target; + myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; + myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target; + myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target; myScriptEngine.World.EventManager.OnScriptControlEvent += control; myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; myScriptEngine.World.EventManager.OnScriptColliding += collision; @@ -390,16 +390,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine myScriptEngine.PostObjectEvent(localID, new EventParams( "not_at_target",new object[0], new DetectParams[0])); - } - - public void at_rot_target(uint localID, uint handle, Quaternion targetrot, - Quaternion atrot) - { - myScriptEngine.PostObjectEvent(localID, new EventParams( + } + + public void at_rot_target(uint localID, uint handle, Quaternion targetrot, + Quaternion atrot) + { + myScriptEngine.PostObjectEvent(localID, new EventParams( "at_rot_target", new object[] { new LSL_Types.LSLInteger(handle), new LSL_Types.Quaternion(targetrot.X,targetrot.Y,targetrot.Z,targetrot.W), - new LSL_Types.Quaternion(atrot.X,atrot.Y,atrot.Z,atrot.W) }, + new LSL_Types.Quaternion(atrot.X,atrot.Y,atrot.Z,atrot.W) }, new DetectParams[0])); } -- cgit v1.1