diff options
Diffstat (limited to '')
7 files changed, 402 insertions, 28 deletions
diff --git a/OpenSim/Framework/ColliderData.cs b/OpenSim/Framework/ColliderData.cs new file mode 100644 index 0000000..075a4e0 --- /dev/null +++ b/OpenSim/Framework/ColliderData.cs | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using libsecondlife; | ||
31 | using System.Collections.Generic; | ||
32 | |||
33 | namespace OpenSim.Framework | ||
34 | { | ||
35 | public class DetectedObject | ||
36 | { | ||
37 | public DetectedObject() { } | ||
38 | public LLUUID groupUUID = LLUUID.Zero; | ||
39 | public LLUUID ownerUUID = LLUUID.Zero; | ||
40 | public LLUUID keyUUID = LLUUID.Zero; | ||
41 | public LLVector3 posVector = LLVector3.Zero; | ||
42 | public LLQuaternion rotQuat = LLQuaternion.Identity; | ||
43 | public LLVector3 velVector = LLVector3.Zero; | ||
44 | public string nameStr = String.Empty; | ||
45 | public int colliderType = 0; | ||
46 | } | ||
47 | |||
48 | public class ColliderArgs : EventArgs | ||
49 | { | ||
50 | public ColliderArgs() { } | ||
51 | public List<DetectedObject> Colliders = new List<DetectedObject>(); | ||
52 | |||
53 | } | ||
54 | } | ||
diff --git a/OpenSim/Region/Environment/Scenes/EventManager.cs b/OpenSim/Region/Environment/Scenes/EventManager.cs index eee4e4a..5c750e4 100644 --- a/OpenSim/Region/Environment/Scenes/EventManager.cs +++ b/OpenSim/Region/Environment/Scenes/EventManager.cs | |||
@@ -158,9 +158,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
158 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; | 158 | public event ScriptAtTargetEvent OnScriptAtTargetEvent; |
159 | 159 | ||
160 | public delegate void ScriptNotAtTargetEvent(uint localID); | 160 | public delegate void ScriptNotAtTargetEvent(uint localID); |
161 | 161 | ||
162 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; | 162 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; |
163 | 163 | ||
164 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); | ||
165 | |||
166 | public event ScriptColliding OnScriptColliderStart; | ||
167 | public event ScriptColliding OnScriptColliding; | ||
168 | public event ScriptColliding OnScriptCollidingEnd; | ||
169 | |||
170 | |||
171 | |||
164 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); | 172 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); |
165 | public event OnMakeChildAgentDelegate OnMakeChildAgent; | 173 | public event OnMakeChildAgentDelegate OnMakeChildAgent; |
166 | 174 | ||
@@ -293,6 +301,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
293 | } | 301 | } |
294 | } | 302 | } |
295 | 303 | ||
304 | |||
305 | |||
296 | public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); | 306 | public delegate void MoneyTransferEvent(Object sender, MoneyTransferArgs e); |
297 | 307 | ||
298 | public delegate void LandBuy(Object sender, LandBuyArgs e); | 308 | public delegate void LandBuy(Object sender, LandBuyArgs e); |
@@ -357,6 +367,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
357 | private ScriptTimerEvent handlerScriptTimerEvent = null; | 367 | private ScriptTimerEvent handlerScriptTimerEvent = null; |
358 | private EstateToolsTimeUpdate handlerEstateToolsTimeUpdate = null; | 368 | private EstateToolsTimeUpdate handlerEstateToolsTimeUpdate = null; |
359 | 369 | ||
370 | private ScriptColliding handlerCollidingStart = null; | ||
371 | private ScriptColliding handlerColliding = null; | ||
372 | private ScriptColliding handlerCollidingEnd = null; | ||
373 | |||
374 | |||
360 | private SunLindenHour handlerSunGetLindenHour = null; | 375 | private SunLindenHour handlerSunGetLindenHour = null; |
361 | 376 | ||
362 | public void TriggerOnScriptChangedEvent(uint localID, uint change) | 377 | public void TriggerOnScriptChangedEvent(uint localID, uint change) |
@@ -838,5 +853,26 @@ namespace OpenSim.Region.Environment.Scenes | |||
838 | } | 853 | } |
839 | return 6; | 854 | return 6; |
840 | } | 855 | } |
856 | |||
857 | public void TriggerScriptCollidingStart(uint localId, ColliderArgs colliders) | ||
858 | { | ||
859 | handlerCollidingStart = OnScriptColliderStart; | ||
860 | if (handlerCollidingStart != null) | ||
861 | handlerCollidingStart(localId, colliders); | ||
862 | } | ||
863 | public void TriggerScriptColliding(uint localId, ColliderArgs colliders) | ||
864 | { | ||
865 | |||
866 | handlerColliding = OnScriptColliding; | ||
867 | if (handlerColliding != null) | ||
868 | handlerColliding(localId, colliders); | ||
869 | } | ||
870 | public void TriggerScriptCollidingEnd(uint localId, ColliderArgs colliders) | ||
871 | { | ||
872 | handlerCollidingEnd = OnScriptCollidingEnd; | ||
873 | if (handlerCollidingEnd != null) | ||
874 | handlerCollidingEnd(localId, colliders); | ||
875 | } | ||
876 | |||
841 | } | 877 | } |
842 | } | 878 | } |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index ce7497d..532d003 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -113,6 +113,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
113 | public Int32 CreationDate; | 113 | public Int32 CreationDate; |
114 | public uint ParentID = 0; | 114 | public uint ParentID = 0; |
115 | 115 | ||
116 | private List<uint> m_lastColliders = new List<uint>(); | ||
117 | |||
116 | private PhysicsVector m_lastRotationalVelocity = PhysicsVector.Zero; | 118 | private PhysicsVector m_lastRotationalVelocity = PhysicsVector.Zero; |
117 | private Vector3 m_sitTargetPosition = new Vector3(0, 0, 0); | 119 | private Vector3 m_sitTargetPosition = new Vector3(0, 0, 0); |
118 | private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1); | 120 | private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1); |
@@ -2807,21 +2809,181 @@ namespace OpenSim.Region.Environment.Scenes | |||
2807 | } | 2809 | } |
2808 | public void PhysicsCollision(EventArgs e) | 2810 | public void PhysicsCollision(EventArgs e) |
2809 | { | 2811 | { |
2810 | return; | 2812 | //return; |
2811 | 2813 | ||
2812 | // | 2814 | // single threaded here |
2813 | //if (e == null) | 2815 | if (e == null) |
2814 | //{ | 2816 | { |
2815 | // return; | 2817 | return; |
2816 | //} | 2818 | } |
2817 | //CollisionEventUpdate a = (CollisionEventUpdate)e; | 2819 | |
2818 | //Dictionary<uint, float> collissionswith = a.m_objCollisionList; | 2820 | CollisionEventUpdate a = (CollisionEventUpdate)e; |
2819 | //foreach (uint localid in collissionswith.Keys) | 2821 | Dictionary<uint, float> collissionswith = a.m_objCollisionList; |
2820 | //{ | 2822 | List<uint> thisHitColliders = new List<uint>(); |
2821 | // m_log.Debug("[OBJECT]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString()); | 2823 | List<uint> endedColliders = new List<uint>(); |
2822 | //} | 2824 | List<uint> startedColliders = new List<uint>(); |
2825 | |||
2826 | // calculate things that started colliding this time | ||
2827 | // and build up list of colliders this time | ||
2828 | foreach (uint localid in collissionswith.Keys) | ||
2829 | { | ||
2830 | if (localid != 0) | ||
2831 | { | ||
2832 | thisHitColliders.Add(localid); | ||
2833 | if (!m_lastColliders.Contains(localid)) | ||
2834 | { | ||
2835 | startedColliders.Add(localid); | ||
2836 | } | ||
2837 | |||
2838 | |||
2839 | //m_log.Debug("[OBJECT]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString()); | ||
2840 | } | ||
2841 | } | ||
2842 | |||
2843 | // calculate things that ended colliding | ||
2844 | foreach (uint localID in m_lastColliders) | ||
2845 | { | ||
2846 | if (!thisHitColliders.Contains(localID)) | ||
2847 | { | ||
2848 | endedColliders.Add(localID); | ||
2849 | } | ||
2850 | } | ||
2851 | // remove things that ended colliding from the last colliders list | ||
2852 | foreach (uint localID in endedColliders) | ||
2853 | { | ||
2854 | m_lastColliders.Remove(localID); | ||
2855 | } | ||
2856 | |||
2857 | //add the items that started colliding this time to the last colliders list. | ||
2858 | foreach (uint localID in startedColliders) | ||
2859 | { | ||
2860 | m_lastColliders.Add(localID); | ||
2861 | } | ||
2862 | // do event notification | ||
2863 | if (startedColliders.Count > 0) | ||
2864 | { | ||
2865 | ColliderArgs StartCollidingMessage = new ColliderArgs(); | ||
2866 | List<DetectedObject> colliding = new List<DetectedObject>(); | ||
2867 | foreach (uint localId in startedColliders) | ||
2868 | { | ||
2869 | // always running this check because if the user deletes the object it would return a null reference. | ||
2870 | if (m_parentGroup == null) | ||
2871 | return; | ||
2872 | if (m_parentGroup.Scene == null) | ||
2873 | return; | ||
2874 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | ||
2875 | if (obj != null) | ||
2876 | { | ||
2877 | DetectedObject detobj = new DetectedObject(); | ||
2878 | detobj.keyUUID = obj.UUID; | ||
2879 | detobj.nameStr = obj.Name; | ||
2880 | detobj.ownerUUID = obj.OwnerID; | ||
2881 | detobj.posVector = obj.AbsolutePosition; | ||
2882 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2883 | detobj.velVector = obj.Velocity; | ||
2884 | detobj.colliderType = 0; | ||
2885 | detobj.groupUUID = obj.GroupID; | ||
2886 | colliding.Add(detobj); | ||
2887 | } | ||
2888 | } | ||
2889 | if (colliding.Count > 0) | ||
2890 | { | ||
2891 | StartCollidingMessage.Colliders = colliding; | ||
2892 | // always running this check because if the user deletes the object it would return a null reference. | ||
2893 | if (m_parentGroup == null) | ||
2894 | return; | ||
2895 | if (m_parentGroup.Scene == null) | ||
2896 | return; | ||
2897 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); | ||
2898 | } | ||
2899 | |||
2900 | } | ||
2901 | if (m_lastColliders.Count > 0) | ||
2902 | { | ||
2903 | ColliderArgs CollidingMessage = new ColliderArgs(); | ||
2904 | List<DetectedObject> colliding = new List<DetectedObject>(); | ||
2905 | foreach (uint localId in m_lastColliders) | ||
2906 | { | ||
2907 | // always running this check because if the user deletes the object it would return a null reference. | ||
2908 | if (localId == 0) | ||
2909 | continue; | ||
2910 | |||
2911 | if (m_parentGroup == null) | ||
2912 | return; | ||
2913 | if (m_parentGroup.Scene == null) | ||
2914 | return; | ||
2915 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | ||
2916 | if (obj != null) | ||
2917 | { | ||
2918 | DetectedObject detobj = new DetectedObject(); | ||
2919 | detobj.keyUUID = obj.UUID; | ||
2920 | detobj.nameStr = obj.Name; | ||
2921 | detobj.ownerUUID = obj.OwnerID; | ||
2922 | detobj.posVector = obj.AbsolutePosition; | ||
2923 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2924 | detobj.velVector = obj.Velocity; | ||
2925 | detobj.colliderType = 0; | ||
2926 | detobj.groupUUID = obj.GroupID; | ||
2927 | colliding.Add(detobj); | ||
2928 | } | ||
2929 | } | ||
2930 | if (colliding.Count > 0) | ||
2931 | { | ||
2932 | CollidingMessage.Colliders = colliding; | ||
2933 | // always running this check because if the user deletes the object it would return a null reference. | ||
2934 | if (m_parentGroup == null) | ||
2935 | return; | ||
2936 | if (m_parentGroup.Scene == null) | ||
2937 | return; | ||
2938 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, CollidingMessage); | ||
2939 | } | ||
2940 | |||
2941 | } | ||
2942 | if (endedColliders.Count > 0) | ||
2943 | { | ||
2944 | ColliderArgs EndCollidingMessage = new ColliderArgs(); | ||
2945 | List<DetectedObject> colliding = new List<DetectedObject>(); | ||
2946 | foreach (uint localId in endedColliders) | ||
2947 | { | ||
2948 | if (localId == 0) | ||
2949 | continue; | ||
2950 | |||
2951 | // always running this check because if the user deletes the object it would return a null reference. | ||
2952 | if (m_parentGroup == null) | ||
2953 | return; | ||
2954 | if (m_parentGroup.Scene == null) | ||
2955 | return; | ||
2956 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | ||
2957 | if (obj != null) | ||
2958 | { | ||
2959 | DetectedObject detobj = new DetectedObject(); | ||
2960 | detobj.keyUUID = obj.UUID; | ||
2961 | detobj.nameStr = obj.Name; | ||
2962 | detobj.ownerUUID = obj.OwnerID; | ||
2963 | detobj.posVector = obj.AbsolutePosition; | ||
2964 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2965 | detobj.velVector = obj.Velocity; | ||
2966 | detobj.colliderType = 0; | ||
2967 | detobj.groupUUID = obj.GroupID; | ||
2968 | colliding.Add(detobj); | ||
2969 | } | ||
2970 | } | ||
2971 | if (colliding.Count > 0) | ||
2972 | { | ||
2973 | EndCollidingMessage.Colliders = colliding; | ||
2974 | // always running this check because if the user deletes the object it would return a null reference. | ||
2975 | if (m_parentGroup == null) | ||
2976 | return; | ||
2977 | if (m_parentGroup.Scene == null) | ||
2978 | return; | ||
2979 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, EndCollidingMessage); | ||
2980 | } | ||
2981 | |||
2982 | } | ||
2823 | } | 2983 | } |
2824 | 2984 | ||
2985 | |||
2986 | |||
2825 | public void SetDieAtEdge(bool p) | 2987 | public void SetDieAtEdge(bool p) |
2826 | { | 2988 | { |
2827 | if (m_parentGroup == null) | 2989 | if (m_parentGroup == null) |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 663ac0c..4c58e36 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -562,6 +562,25 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
562 | return resolveName(SensedUUID); | 562 | return resolveName(SensedUUID); |
563 | } | 563 | } |
564 | } | 564 | } |
565 | else | ||
566 | { | ||
567 | ScriptManager sm; | ||
568 | IScript script = null; | ||
569 | |||
570 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) | ||
571 | { | ||
572 | if (sm.Scripts.ContainsKey(m_localID)) | ||
573 | { | ||
574 | if ((script = sm.GetScript(m_localID, m_itemID)) != null) | ||
575 | { | ||
576 | if (script.llDetectParams._bool.Length > number && script.llDetectParams._bool[number]) | ||
577 | { | ||
578 | return script.llDetectParams._string[number]; | ||
579 | } | ||
580 | } | ||
581 | } | ||
582 | } | ||
583 | } | ||
565 | return String.Empty; | 584 | return String.Empty; |
566 | } | 585 | } |
567 | 586 | ||
@@ -587,9 +606,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
587 | { | 606 | { |
588 | if ((script = sm.GetScript(m_localID, m_itemID)) != null) | 607 | if ((script = sm.GetScript(m_localID, m_itemID)) != null) |
589 | { | 608 | { |
590 | if (script.llDetectParams._key[0]) | 609 | if (script.llDetectParams._bool.Length > number && script.llDetectParams._bool[number]) |
591 | { | 610 | { |
592 | return new LLUUID(script.llDetectParams._key[0]); | 611 | LLUUID returnUUID = LLUUID.Zero; |
612 | Helpers.TryParse(script.llDetectParams._key[number], out returnUUID); | ||
613 | |||
614 | return returnUUID; | ||
593 | } | 615 | } |
594 | } | 616 | } |
595 | } | 617 | } |
@@ -614,6 +636,35 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
614 | return SensedObject; | 636 | return SensedObject; |
615 | } | 637 | } |
616 | } | 638 | } |
639 | else | ||
640 | { | ||
641 | ScriptManager sm; | ||
642 | IScript script = null; | ||
643 | |||
644 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) | ||
645 | { | ||
646 | if (sm.Scripts.ContainsKey(m_localID)) | ||
647 | { | ||
648 | if ((script = sm.GetScript(m_localID, m_itemID)) != null) | ||
649 | { | ||
650 | if (script.llDetectParams._key[number]) | ||
651 | { | ||
652 | EntityBase SensedObject = null; | ||
653 | LLUUID SensedUUID = LLUUID.Zero; | ||
654 | Helpers.TryParse(script.llDetectParams._key.ToString(), out SensedUUID); | ||
655 | if (SensedUUID == LLUUID.Zero) | ||
656 | return null; | ||
657 | lock (World.Entities) | ||
658 | { | ||
659 | World.Entities.TryGetValue(SensedUUID, out SensedObject); | ||
660 | } | ||
661 | return SensedObject; | ||
662 | |||
663 | } | ||
664 | } | ||
665 | } | ||
666 | } | ||
667 | } | ||
617 | return null; | 668 | return null; |
618 | } | 669 | } |
619 | 670 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index 5ef4a6b..ae84f65 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | |||
@@ -26,9 +26,12 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | ||
29 | using libsecondlife; | 30 | using libsecondlife; |
30 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
31 | using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; | 32 | using OpenSim.Region.Environment.Modules.Avatar.Currency.SampleMoney; |
33 | using OpenSim.Region.Environment; | ||
34 | using OpenSim.Region; | ||
32 | using OpenSim.Region.Environment.Scenes; | 35 | using OpenSim.Region.Environment.Scenes; |
33 | using OpenSim.Region.Environment.Interfaces; | 36 | using OpenSim.Region.Environment.Interfaces; |
34 | 37 | ||
@@ -74,6 +77,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
74 | myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; | 77 | myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; |
75 | myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; | 78 | myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; |
76 | myScriptEngine.World.EventManager.OnScriptControlEvent += control; | 79 | myScriptEngine.World.EventManager.OnScriptControlEvent += control; |
80 | myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; | ||
81 | myScriptEngine.World.EventManager.OnScriptColliding += collision; | ||
82 | myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end; | ||
77 | 83 | ||
78 | // TODO: HOOK ALL EVENTS UP TO SERVER! | 84 | // TODO: HOOK ALL EVENTS UP TO SERVER! |
79 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); | 85 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); |
@@ -171,19 +177,82 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
171 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) }); | 177 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) }); |
172 | } | 178 | } |
173 | 179 | ||
174 | public void collision_start(uint localID, LLUUID itemID) | 180 | public void collision_start(uint localID, ColliderArgs col) |
175 | { | 181 | { |
176 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_start", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) }); | 182 | EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); |
183 | detstruct._string = new string[col.Colliders.Count]; | ||
184 | detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; | ||
185 | detstruct._int = new int[col.Colliders.Count]; | ||
186 | detstruct._key = new LSL_Types.key[col.Colliders.Count]; | ||
187 | detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; | ||
188 | detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; | ||
189 | detstruct._bool = new bool[col.Colliders.Count]; | ||
190 | |||
191 | int i = 0; | ||
192 | foreach (DetectedObject detobj in col.Colliders) | ||
193 | { | ||
194 | detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); | ||
195 | detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W); | ||
196 | detstruct._string[i] = detobj.nameStr; | ||
197 | detstruct._int[i] = detobj.colliderType; | ||
198 | detstruct._Vector3[i] = new LSL_Types.Vector3(detobj.posVector.X, detobj.posVector.Y, detobj.posVector.Z); | ||
199 | detstruct._Vector32[i] = new LSL_Types.Vector3(detobj.velVector.X, detobj.velVector.Y, detobj.velVector.Z); | ||
200 | detstruct._bool[i] = true; // Apparently the script engine uses this to see if this is a valid entry... | ||
201 | i++; | ||
202 | } | ||
203 | |||
204 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "collision_start", detstruct, new object[] { new LSL_Types.LSLInteger(col.Colliders.Count) }); | ||
177 | } | 205 | } |
178 | 206 | ||
179 | public void collision(uint localID, LLUUID itemID) | 207 | public void collision(uint localID, ColliderArgs col) |
180 | { | 208 | { |
181 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) }); | 209 | EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); |
210 | detstruct._string = new string[col.Colliders.Count]; | ||
211 | detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; | ||
212 | detstruct._int = new int[col.Colliders.Count]; | ||
213 | detstruct._key = new LSL_Types.key[col.Colliders.Count]; | ||
214 | detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; | ||
215 | detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; | ||
216 | detstruct._bool = new bool[col.Colliders.Count]; | ||
217 | |||
218 | int i = 0; | ||
219 | foreach (DetectedObject detobj in col.Colliders) | ||
220 | { | ||
221 | detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); | ||
222 | detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W); | ||
223 | detstruct._string[i] = detobj.nameStr; | ||
224 | detstruct._int[i] = detobj.colliderType; | ||
225 | detstruct._Vector3[i] = new LSL_Types.Vector3(detobj.posVector.X, detobj.posVector.Y, detobj.posVector.Z); | ||
226 | detstruct._Vector32[i] = new LSL_Types.Vector3(detobj.velVector.X, detobj.velVector.Y, detobj.velVector.Z); | ||
227 | detstruct._bool[i] = true; // Apparently the script engine uses this to see if this is a valid entry... i++; | ||
228 | } | ||
229 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "collision", detstruct, new object[] { new LSL_Types.LSLInteger(col.Colliders.Count) }); | ||
182 | } | 230 | } |
183 | 231 | ||
184 | public void collision_end(uint localID, LLUUID itemID) | 232 | public void collision_end(uint localID, ColliderArgs col) |
185 | { | 233 | { |
186 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_end", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(1) }); | 234 | EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); |
235 | detstruct._string = new string[col.Colliders.Count]; | ||
236 | detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; | ||
237 | detstruct._int = new int[col.Colliders.Count]; | ||
238 | detstruct._key = new LSL_Types.key[col.Colliders.Count]; | ||
239 | detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; | ||
240 | detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; | ||
241 | detstruct._bool = new bool[col.Colliders.Count]; | ||
242 | |||
243 | int i = 0; | ||
244 | foreach (DetectedObject detobj in col.Colliders) | ||
245 | { | ||
246 | detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); | ||
247 | detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W); | ||
248 | detstruct._string[i] = detobj.nameStr; | ||
249 | detstruct._int[i] = detobj.colliderType; | ||
250 | detstruct._Vector3[i] = new LSL_Types.Vector3(detobj.posVector.X, detobj.posVector.Y, detobj.posVector.Z); | ||
251 | detstruct._Vector32[i] = new LSL_Types.Vector3(detobj.velVector.X, detobj.velVector.Y, detobj.velVector.Z); | ||
252 | detstruct._bool[i] = true; // Apparently the script engine uses this to see if this is a valid entry... | ||
253 | i++; | ||
254 | } | ||
255 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "collision_end", EventQueueManager.llDetectNull, new object[] { new LSL_Types.LSLInteger(col.Colliders.Count) }); | ||
187 | } | 256 | } |
188 | 257 | ||
189 | public void land_collision_start(uint localID, LLUUID itemID) | 258 | public void land_collision_start(uint localID, LLUUID itemID) |
@@ -191,9 +260,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
191 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_start", EventQueueManager.llDetectNull); | 260 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_start", EventQueueManager.llDetectNull); |
192 | } | 261 | } |
193 | 262 | ||
194 | public void land_collision(uint localID, LLUUID itemID) | 263 | public void land_collision(uint localID, ColliderArgs col) |
195 | { | 264 | { |
196 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision", EventQueueManager.llDetectNull); | 265 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "land_collision", EventQueueManager.llDetectNull); |
197 | } | 266 | } |
198 | 267 | ||
199 | public void land_collision_end(uint localID, LLUUID itemID) | 268 | public void land_collision_end(uint localID, LLUUID itemID) |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index 7cbbd4f..c6eebf1 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | |||
@@ -155,7 +155,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
155 | // should be fixed to something better :) | 155 | // should be fixed to something better :) |
156 | public LSL_Types.key[] _key; | 156 | public LSL_Types.key[] _key; |
157 | public LSL_Types.Quaternion[] _Quaternion; | 157 | public LSL_Types.Quaternion[] _Quaternion; |
158 | public LSL_Types.Vector3[] _Vector3; | 158 | public LSL_Types.Vector3[] _Vector3; // Pos |
159 | public LSL_Types.Vector3[] _Vector32; // Vel | ||
159 | public bool[] _bool; | 160 | public bool[] _bool; |
160 | public int[] _int; | 161 | public int[] _int; |
161 | public string[] _string; | 162 | public string[] _string; |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs index be42539..59f828d 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs | |||
@@ -31,6 +31,7 @@ using OpenSim.Framework; | |||
31 | using OpenSim.Region.Environment.Scenes; | 31 | using OpenSim.Region.Environment.Scenes; |
32 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | 32 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; |
33 | 33 | ||
34 | |||
34 | namespace OpenSim.Region.ScriptEngine.Common | 35 | namespace OpenSim.Region.ScriptEngine.Common |
35 | { | 36 | { |
36 | public class ScriptServerInterfaces | 37 | public class ScriptServerInterfaces |
@@ -43,11 +44,11 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
43 | void state_exit(uint localID); | 44 | void state_exit(uint localID); |
44 | void touch(uint localID, LLUUID itemID); | 45 | void touch(uint localID, LLUUID itemID); |
45 | void touch_end(uint localID, LLUUID itemID); | 46 | void touch_end(uint localID, LLUUID itemID); |
46 | void collision_start(uint localID, LLUUID itemID); | 47 | void collision_start(uint localID, ColliderArgs col); |
47 | void collision(uint localID, LLUUID itemID); | 48 | void collision(uint localID, ColliderArgs col); |
48 | void collision_end(uint localID, LLUUID itemID); | 49 | void collision_end(uint localID, ColliderArgs col); |
49 | void land_collision_start(uint localID, LLUUID itemID); | 50 | void land_collision_start(uint localID, LLUUID itemID); |
50 | void land_collision(uint localID, LLUUID itemID); | 51 | void land_collision(uint localID, ColliderArgs col); |
51 | void land_collision_end(uint localID, LLUUID itemID); | 52 | void land_collision_end(uint localID, LLUUID itemID); |
52 | void timer(uint localID, LLUUID itemID); | 53 | void timer(uint localID, LLUUID itemID); |
53 | void listen(uint localID, LLUUID itemID); | 54 | void listen(uint localID, LLUUID itemID); |