aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs28
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs272
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/EventManager.cs71
3 files changed, 277 insertions, 94 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 68e73b1..3e49691 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -189,6 +189,10 @@ namespace OpenSim.Region.Framework.Scenes
189 public event ScriptColliding OnScriptColliding; 189 public event ScriptColliding OnScriptColliding;
190 public event ScriptColliding OnScriptCollidingEnd; 190 public event ScriptColliding OnScriptCollidingEnd;
191 191
192 public event ScriptColliding OnScriptLandColliderStart;
193 public event ScriptColliding OnScriptLandColliding;
194 public event ScriptColliding OnScriptLandColliderEnd;
195
192 public delegate void OnMakeChildAgentDelegate(ScenePresence presence); 196 public delegate void OnMakeChildAgentDelegate(ScenePresence presence);
193 public event OnMakeChildAgentDelegate OnMakeChildAgent; 197 public event OnMakeChildAgentDelegate OnMakeChildAgent;
194 198
@@ -445,6 +449,9 @@ namespace OpenSim.Region.Framework.Scenes
445 private ScriptColliding handlerCollidingStart = null; 449 private ScriptColliding handlerCollidingStart = null;
446 private ScriptColliding handlerColliding = null; 450 private ScriptColliding handlerColliding = null;
447 private ScriptColliding handlerCollidingEnd = null; 451 private ScriptColliding handlerCollidingEnd = null;
452 private ScriptColliding handlerLandCollidingStart = null;
453 private ScriptColliding handlerLandColliding = null;
454 private ScriptColliding handlerLandCollidingEnd = null;
448 private GetScriptRunning handlerGetScriptRunning = null; 455 private GetScriptRunning handlerGetScriptRunning = null;
449 456
450 private SunLindenHour handlerCurrentTimeAsLindenSunHour = null; 457 private SunLindenHour handlerCurrentTimeAsLindenSunHour = null;
@@ -1058,6 +1065,27 @@ namespace OpenSim.Region.Framework.Scenes
1058 handlerCollidingEnd(localId, colliders); 1065 handlerCollidingEnd(localId, colliders);
1059 } 1066 }
1060 1067
1068 public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders)
1069 {
1070 handlerLandCollidingStart = OnScriptLandColliderStart;
1071 if (handlerLandCollidingStart != null)
1072 handlerLandCollidingStart(localId, colliders);
1073 }
1074
1075 public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders)
1076 {
1077 handlerLandColliding = OnScriptLandColliding;
1078 if (handlerLandColliding != null)
1079 handlerLandColliding(localId, colliders);
1080 }
1081
1082 public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders)
1083 {
1084 handlerLandCollidingEnd = OnScriptLandColliderEnd;
1085 if (handlerLandCollidingEnd != null)
1086 handlerLandCollidingEnd(localId, colliders);
1087 }
1088
1061 public void TriggerSetRootAgentScene(UUID agentID, Scene scene) 1089 public void TriggerSetRootAgentScene(UUID agentID, Scene scene)
1062 { 1090 {
1063 handlerSetRootAgentScene = OnSetRootAgentScene; 1091 handlerSetRootAgentScene = OnSetRootAgentScene;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index ff4abf9..7906138 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -139,15 +139,15 @@ namespace OpenSim.Region.Framework.Scenes
139 public uint TimeStampTerse; 139 public uint TimeStampTerse;
140 140
141 [XmlIgnore] 141 [XmlIgnore]
142 public UUID FromItemID; 142 public UUID FromItemID;
143 143
144 [XmlIgnore] 144 [XmlIgnore]
145 public int STATUS_ROTATE_X; 145 public int STATUS_ROTATE_X;
146 146
147 [XmlIgnore] 147 [XmlIgnore]
148 public int STATUS_ROTATE_Y; 148 public int STATUS_ROTATE_Y;
149 149
150 [XmlIgnore] 150 [XmlIgnore]
151 public int STATUS_ROTATE_Z; 151 public int STATUS_ROTATE_Z;
152 152
153 [XmlIgnore] 153 [XmlIgnore]
@@ -1684,19 +1684,19 @@ namespace OpenSim.Region.Framework.Scenes
1684 return false; 1684 return false;
1685 1685
1686 return m_parentGroup.RootPart.DIE_AT_EDGE; 1686 return m_parentGroup.RootPart.DIE_AT_EDGE;
1687 } 1687 }
1688 1688
1689 public int GetAxisRotation(int axis) 1689 public int GetAxisRotation(int axis)
1690 { 1690 {
1691 //Cannot use ScriptBaseClass constants as no referance to it currently. 1691 //Cannot use ScriptBaseClass constants as no referance to it currently.
1692 if (axis == 2)//STATUS_ROTATE_X 1692 if (axis == 2)//STATUS_ROTATE_X
1693 return STATUS_ROTATE_X; 1693 return STATUS_ROTATE_X;
1694 if (axis == 4)//STATUS_ROTATE_Y 1694 if (axis == 4)//STATUS_ROTATE_Y
1695 return STATUS_ROTATE_Y; 1695 return STATUS_ROTATE_Y;
1696 if (axis == 8)//STATUS_ROTATE_Z 1696 if (axis == 8)//STATUS_ROTATE_Z
1697 return STATUS_ROTATE_Z; 1697 return STATUS_ROTATE_Z;
1698 1698
1699 return 0; 1699 return 0;
1700 } 1700 }
1701 1701
1702 public double GetDistanceTo(Vector3 a, Vector3 b) 1702 public double GetDistanceTo(Vector3 a, Vector3 b)
@@ -1862,16 +1862,12 @@ namespace OpenSim.Region.Framework.Scenes
1862 // and build up list of colliders this time 1862 // and build up list of colliders this time
1863 foreach (uint localid in collissionswith.Keys) 1863 foreach (uint localid in collissionswith.Keys)
1864 { 1864 {
1865 if (localid != 0) 1865 thisHitColliders.Add(localid);
1866 if (!m_lastColliders.Contains(localid))
1866 { 1867 {
1867 thisHitColliders.Add(localid); 1868 startedColliders.Add(localid);
1868 if (!m_lastColliders.Contains(localid))
1869 {
1870 startedColliders.Add(localid);
1871 }
1872
1873 //m_log.Debug("[OBJECT]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString());
1874 } 1869 }
1870 //m_log.Debug("[OBJECT]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString());
1875 } 1871 }
1876 1872
1877 // calculate things that ended colliding 1873 // calculate things that ended colliding
@@ -1913,6 +1909,8 @@ namespace OpenSim.Region.Framework.Scenes
1913 List<DetectedObject> colliding = new List<DetectedObject>(); 1909 List<DetectedObject> colliding = new List<DetectedObject>();
1914 foreach (uint localId in startedColliders) 1910 foreach (uint localId in startedColliders)
1915 { 1911 {
1912 if (localId == 0)
1913 return;
1916 // always running this check because if the user deletes the object it would return a null reference. 1914 // always running this check because if the user deletes the object it would return a null reference.
1917 if (m_parentGroup == null) 1915 if (m_parentGroup == null)
1918 return; 1916 return;
@@ -1945,24 +1943,24 @@ namespace OpenSim.Region.Framework.Scenes
1945 else 1943 else
1946 { 1944 {
1947 } 1945 }
1948 } 1946 }
1949 else 1947 else
1950 { 1948 {
1951 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); 1949 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
1952 //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work 1950 //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
1953 if (!found) 1951 if (!found)
1954 { 1952 {
1955 DetectedObject detobj = new DetectedObject(); 1953 DetectedObject detobj = new DetectedObject();
1956 detobj.keyUUID = obj.UUID; 1954 detobj.keyUUID = obj.UUID;
1957 detobj.nameStr = obj.Name; 1955 detobj.nameStr = obj.Name;
1958 detobj.ownerUUID = obj._ownerID; 1956 detobj.ownerUUID = obj._ownerID;
1959 detobj.posVector = obj.AbsolutePosition; 1957 detobj.posVector = obj.AbsolutePosition;
1960 detobj.rotQuat = obj.GetWorldRotation(); 1958 detobj.rotQuat = obj.GetWorldRotation();
1961 detobj.velVector = obj.Velocity; 1959 detobj.velVector = obj.Velocity;
1962 detobj.colliderType = 0; 1960 detobj.colliderType = 0;
1963 detobj.groupUUID = obj._groupID; 1961 detobj.groupUUID = obj._groupID;
1964 colliding.Add(detobj); 1962 colliding.Add(detobj);
1965 } 1963 }
1966 } 1964 }
1967 } 1965 }
1968 else 1966 else
@@ -1974,7 +1972,7 @@ namespace OpenSim.Region.Framework.Scenes
1974 ScenePresence av = avlist[i]; 1972 ScenePresence av = avlist[i];
1975 1973
1976 if (av.LocalId == localId) 1974 if (av.LocalId == localId)
1977 { 1975 {
1978 if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) 1976 if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name))
1979 { 1977 {
1980 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); 1978 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
@@ -1996,24 +1994,24 @@ namespace OpenSim.Region.Framework.Scenes
1996 else 1994 else
1997 { 1995 {
1998 } 1996 }
1999 } 1997 }
2000 else 1998 else
2001 { 1999 {
2002 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); 2000 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
2003 //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work 2001 //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
2004 if (!found) 2002 if (!found)
2005 { 2003 {
2006 DetectedObject detobj = new DetectedObject(); 2004 DetectedObject detobj = new DetectedObject();
2007 detobj.keyUUID = av.UUID; 2005 detobj.keyUUID = av.UUID;
2008 detobj.nameStr = av.ControllingClient.Name; 2006 detobj.nameStr = av.ControllingClient.Name;
2009 detobj.ownerUUID = av.UUID; 2007 detobj.ownerUUID = av.UUID;
2010 detobj.posVector = av.AbsolutePosition; 2008 detobj.posVector = av.AbsolutePosition;
2011 detobj.rotQuat = av.Rotation; 2009 detobj.rotQuat = av.Rotation;
2012 detobj.velVector = av.Velocity; 2010 detobj.velVector = av.Velocity;
2013 detobj.colliderType = 0; 2011 detobj.colliderType = 0;
2014 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 2012 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
2015 colliding.Add(detobj); 2013 colliding.Add(detobj);
2016 } 2014 }
2017 } 2015 }
2018 2016
2019 } 2017 }
@@ -2048,7 +2046,7 @@ namespace OpenSim.Region.Framework.Scenes
2048 { 2046 {
2049 // always running this check because if the user deletes the object it would return a null reference. 2047 // always running this check because if the user deletes the object it would return a null reference.
2050 if (localId == 0) 2048 if (localId == 0)
2051 continue; 2049 return;
2052 2050
2053 if (m_parentGroup == null) 2051 if (m_parentGroup == null)
2054 return; 2052 return;
@@ -2110,7 +2108,7 @@ namespace OpenSim.Region.Framework.Scenes
2110 ScenePresence av = avlist[i]; 2108 ScenePresence av = avlist[i];
2111 2109
2112 if (av.LocalId == localId) 2110 if (av.LocalId == localId)
2113 { 2111 {
2114 if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) 2112 if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name))
2115 { 2113 {
2116 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); 2114 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
@@ -2180,7 +2178,7 @@ namespace OpenSim.Region.Framework.Scenes
2180 foreach (uint localId in endedColliders) 2178 foreach (uint localId in endedColliders)
2181 { 2179 {
2182 if (localId == 0) 2180 if (localId == 0)
2183 continue; 2181 return;
2184 2182
2185 // always running this check because if the user deletes the object it would return a null reference. 2183 // always running this check because if the user deletes the object it would return a null reference.
2186 if (m_parentGroup == null) 2184 if (m_parentGroup == null)
@@ -2241,7 +2239,7 @@ namespace OpenSim.Region.Framework.Scenes
2241 ScenePresence av = avlist[i]; 2239 ScenePresence av = avlist[i];
2242 2240
2243 if (av.LocalId == localId) 2241 if (av.LocalId == localId)
2244 { 2242 {
2245 if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) 2243 if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name))
2246 { 2244 {
2247 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); 2245 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
@@ -2301,7 +2299,121 @@ namespace OpenSim.Region.Framework.Scenes
2301 m_parentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage); 2299 m_parentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage);
2302 } 2300 }
2303 } 2301 }
2304 } 2302 }
2303 if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.land_collision_start) != 0)
2304 {
2305 if (startedColliders.Count > 0)
2306 {
2307 ColliderArgs LandStartCollidingMessage = new ColliderArgs();
2308 List<DetectedObject> colliding = new List<DetectedObject>();
2309 foreach (uint localId in startedColliders)
2310 {
2311 if (localId == 0)
2312 {
2313 //Hope that all is left is ground!
2314 DetectedObject detobj = new DetectedObject();
2315 detobj.keyUUID = UUID.Zero;
2316 detobj.nameStr = "";
2317 detobj.ownerUUID = UUID.Zero;
2318 detobj.posVector = m_parentGroup.RootPart.AbsolutePosition;
2319 detobj.rotQuat = Quaternion.Identity;
2320 detobj.velVector = Vector3.Zero;
2321 detobj.colliderType = 0;
2322 detobj.groupUUID = UUID.Zero;
2323 colliding.Add(detobj);
2324 }
2325 }
2326
2327 if (colliding.Count > 0)
2328 {
2329 LandStartCollidingMessage.Colliders = colliding;
2330 // always running this check because if the user deletes the object it would return a null reference.
2331 if (m_parentGroup == null)
2332 return;
2333
2334 if (m_parentGroup.Scene == null)
2335 return;
2336
2337 m_parentGroup.Scene.EventManager.TriggerScriptLandCollidingStart(LocalId, LandStartCollidingMessage);
2338 }
2339 }
2340 }
2341 if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.land_collision) != 0)
2342 {
2343 if (m_lastColliders.Count > 0)
2344 {
2345 ColliderArgs LandCollidingMessage = new ColliderArgs();
2346 List<DetectedObject> colliding = new List<DetectedObject>();
2347 foreach (uint localId in startedColliders)
2348 {
2349 if (localId == 0)
2350 {
2351 //Hope that all is left is ground!
2352 DetectedObject detobj = new DetectedObject();
2353 detobj.keyUUID = UUID.Zero;
2354 detobj.nameStr = "";
2355 detobj.ownerUUID = UUID.Zero;
2356 detobj.posVector = m_parentGroup.RootPart.AbsolutePosition;
2357 detobj.rotQuat = Quaternion.Identity;
2358 detobj.velVector = Vector3.Zero;
2359 detobj.colliderType = 0;
2360 detobj.groupUUID = UUID.Zero;
2361 colliding.Add(detobj);
2362 }
2363 }
2364
2365 if (colliding.Count > 0)
2366 {
2367 LandCollidingMessage.Colliders = colliding;
2368 // always running this check because if the user deletes the object it would return a null reference.
2369 if (m_parentGroup == null)
2370 return;
2371
2372 if (m_parentGroup.Scene == null)
2373 return;
2374
2375 m_parentGroup.Scene.EventManager.TriggerScriptLandColliding(LocalId, LandCollidingMessage);
2376 }
2377 }
2378 }
2379 if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.land_collision_end) != 0)
2380 {
2381 if (endedColliders.Count > 0)
2382 {
2383 ColliderArgs LandEndCollidingMessage = new ColliderArgs();
2384 List<DetectedObject> colliding = new List<DetectedObject>();
2385 foreach (uint localId in startedColliders)
2386 {
2387 if (localId == 0)
2388 {
2389 //Hope that all is left is ground!
2390 DetectedObject detobj = new DetectedObject();
2391 detobj.keyUUID = UUID.Zero;
2392 detobj.nameStr = "";
2393 detobj.ownerUUID = UUID.Zero;
2394 detobj.posVector = m_parentGroup.RootPart.AbsolutePosition;
2395 detobj.rotQuat = Quaternion.Identity;
2396 detobj.velVector = Vector3.Zero;
2397 detobj.colliderType = 0;
2398 detobj.groupUUID = UUID.Zero;
2399 colliding.Add(detobj);
2400 }
2401 }
2402
2403 if (colliding.Count > 0)
2404 {
2405 LandEndCollidingMessage.Colliders = colliding;
2406 // always running this check because if the user deletes the object it would return a null reference.
2407 if (m_parentGroup == null)
2408 return;
2409
2410 if (m_parentGroup.Scene == null)
2411 return;
2412
2413 m_parentGroup.Scene.EventManager.TriggerScriptLandCollidingEnd(LocalId, LandEndCollidingMessage);
2414 }
2415 }
2416 }
2305 } 2417 }
2306 2418
2307 public void PhysicsOutOfBounds(Vector3 pos) 2419 public void PhysicsOutOfBounds(Vector3 pos)
@@ -2769,13 +2881,13 @@ namespace OpenSim.Region.Framework.Scenes
2769 if (m_parentGroup != null) 2881 if (m_parentGroup != null)
2770 { 2882 {
2771 m_parentGroup.SetAxisRotation(axis, rotate); 2883 m_parentGroup.SetAxisRotation(axis, rotate);
2772 } 2884 }
2773 //Cannot use ScriptBaseClass constants as no referance to it currently. 2885 //Cannot use ScriptBaseClass constants as no referance to it currently.
2774 if (axis == 2)//STATUS_ROTATE_X 2886 if (axis == 2)//STATUS_ROTATE_X
2775 STATUS_ROTATE_X = rotate; 2887 STATUS_ROTATE_X = rotate;
2776 if (axis == 4)//STATUS_ROTATE_Y 2888 if (axis == 4)//STATUS_ROTATE_Y
2777 STATUS_ROTATE_Y = rotate; 2889 STATUS_ROTATE_Y = rotate;
2778 if (axis == 8)//STATUS_ROTATE_Z 2890 if (axis == 8)//STATUS_ROTATE_Z
2779 STATUS_ROTATE_Z = rotate; 2891 STATUS_ROTATE_Z = rotate;
2780 } 2892 }
2781 2893
@@ -3709,6 +3821,9 @@ namespace OpenSim.Region.Framework.Scenes
3709 ((AggregateScriptEvents & scriptEvents.collision) != 0) || 3821 ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
3710 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || 3822 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
3711 ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || 3823 ((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
3824 ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
3825 ((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
3826 ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
3712 (CollisionSound != UUID.Zero) 3827 (CollisionSound != UUID.Zero)
3713 ) 3828 )
3714 { 3829 {
@@ -3913,6 +4028,9 @@ namespace OpenSim.Region.Framework.Scenes
3913 ((AggregateScriptEvents & scriptEvents.collision) != 0) || 4028 ((AggregateScriptEvents & scriptEvents.collision) != 0) ||
3914 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || 4029 ((AggregateScriptEvents & scriptEvents.collision_end) != 0) ||
3915 ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || 4030 ((AggregateScriptEvents & scriptEvents.collision_start) != 0) ||
4031 ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) ||
4032 ((AggregateScriptEvents & scriptEvents.land_collision) != 0) ||
4033 ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) ||
3916 (CollisionSound != UUID.Zero) 4034 (CollisionSound != UUID.Zero)
3917 ) 4035 )
3918 { 4036 {
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
63 myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; 63 myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start;
64 myScriptEngine.World.EventManager.OnScriptColliding += collision; 64 myScriptEngine.World.EventManager.OnScriptColliding += collision;
65 myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end; 65 myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end;
66 myScriptEngine.World.EventManager.OnScriptLandColliderStart += land_collision_start;
67 myScriptEngine.World.EventManager.OnScriptLandColliding += land_collision;
68 myScriptEngine.World.EventManager.OnScriptLandColliderEnd += land_collision_end;
66 IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); 69 IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>();
67 if (money != null) 70 if (money != null)
68 { 71 {
@@ -285,29 +288,63 @@ namespace OpenSim.Region.ScriptEngine.XEngine
285 det.ToArray())); 288 det.ToArray()));
286 } 289 }
287 290
288 public void land_collision_start(uint localID, UUID itemID) 291 public void land_collision_start(uint localID, ColliderArgs col)
289 { 292 {
290 myScriptEngine.PostObjectEvent(localID, new EventParams( 293 List<DetectParams> det = new List<DetectParams>();
291 "land_collision_start", 294
292 new object[0], 295 foreach (DetectedObject detobj in col.Colliders)
293 new DetectParams[0])); 296 {
297 DetectParams d = new DetectParams();
298 d.Position = new LSL_Types.Vector3(detobj.posVector.X,
299 detobj.posVector.Y,
300 detobj.posVector.Z);
301 d.Populate(myScriptEngine.World);
302 det.Add(d);
303 myScriptEngine.PostObjectEvent(localID, new EventParams(
304 "land_collision_start",
305 new Object[] { new LSL_Types.Vector3(d.Position) },
306 det.ToArray()));
307 }
308
294 } 309 }
295 310
296 public void land_collision(uint localID, UUID itemID) 311 public void land_collision(uint localID, ColliderArgs col)
297 { 312 {
298 myScriptEngine.PostObjectEvent(localID, new EventParams( 313 List<DetectParams> det = new List<DetectParams>();
299 "land_collision", 314
300 new object[0], 315 foreach (DetectedObject detobj in col.Colliders)
301 new DetectParams[0])); 316 {
317 DetectParams d = new DetectParams();
318 d.Position = new LSL_Types.Vector3(detobj.posVector.X,
319 detobj.posVector.Y,
320 detobj.posVector.Z);
321 d.Populate(myScriptEngine.World);
322 det.Add(d);
323 myScriptEngine.PostObjectEvent(localID, new EventParams(
324 "land_collision",
325 new Object[] { new LSL_Types.Vector3(d.Position) },
326 det.ToArray()));
327 }
302 } 328 }
303 329
304 public void land_collision_end(uint localID, UUID itemID) 330 public void land_collision_end(uint localID, ColliderArgs col)
305 { 331 {
306 myScriptEngine.PostObjectEvent(localID, new EventParams( 332 List<DetectParams> det = new List<DetectParams>();
307 "land_collision_end", 333
308 new object[0], 334 foreach (DetectedObject detobj in col.Colliders)
309 new DetectParams[0])); 335 {
310 } 336 DetectParams d = new DetectParams();
337 d.Position = new LSL_Types.Vector3(detobj.posVector.X,
338 detobj.posVector.Y,
339 detobj.posVector.Z);
340 d.Populate(myScriptEngine.World);
341 det.Add(d);
342 myScriptEngine.PostObjectEvent(localID, new EventParams(
343 "land_collision_end",
344 new Object[] { new LSL_Types.Vector3(d.Position) },
345 det.ToArray()));
346 }
347 }
311 348
312 // timer: not handled here 349 // timer: not handled here
313 // listen: not handled here 350 // listen: not handled here