diff options
Diffstat (limited to '')
4 files changed, 317 insertions, 111 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 2a9ad0a..614726e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | |||
@@ -2860,137 +2860,224 @@ namespace OpenSim.Region.Environment.Scenes | |||
2860 | endedColliders.Add(localID); | 2860 | endedColliders.Add(localID); |
2861 | } | 2861 | } |
2862 | } | 2862 | } |
2863 | // remove things that ended colliding from the last colliders list | 2863 | |
2864 | foreach (uint localID in endedColliders) | ||
2865 | { | ||
2866 | m_lastColliders.Remove(localID); | ||
2867 | } | ||
2868 | 2864 | ||
2869 | //add the items that started colliding this time to the last colliders list. | 2865 | //add the items that started colliding this time to the last colliders list. |
2870 | foreach (uint localID in startedColliders) | 2866 | foreach (uint localID in startedColliders) |
2871 | { | 2867 | { |
2872 | m_lastColliders.Add(localID); | 2868 | m_lastColliders.Add(localID); |
2873 | } | 2869 | } |
2874 | // do event notification | 2870 | // remove things that ended colliding from the last colliders list |
2875 | if (startedColliders.Count > 0) | 2871 | foreach (uint localID in endedColliders) |
2876 | { | 2872 | { |
2877 | ColliderArgs StartCollidingMessage = new ColliderArgs(); | 2873 | m_lastColliders.Remove(localID); |
2878 | List<DetectedObject> colliding = new List<DetectedObject>(); | 2874 | } |
2879 | foreach (uint localId in startedColliders) | 2875 | if (m_parentGroup == null) |
2876 | return; | ||
2877 | if (m_parentGroup.RootPart == null) | ||
2878 | return; | ||
2879 | |||
2880 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_start) != 0) | ||
2881 | { | ||
2882 | // do event notification | ||
2883 | if (startedColliders.Count > 0) | ||
2880 | { | 2884 | { |
2881 | // always running this check because if the user deletes the object it would return a null reference. | 2885 | ColliderArgs StartCollidingMessage = new ColliderArgs(); |
2882 | if (m_parentGroup == null) | 2886 | List<DetectedObject> colliding = new List<DetectedObject>(); |
2883 | return; | 2887 | foreach (uint localId in startedColliders) |
2884 | if (m_parentGroup.Scene == null) | ||
2885 | return; | ||
2886 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | ||
2887 | if (obj != null) | ||
2888 | { | 2888 | { |
2889 | DetectedObject detobj = new DetectedObject(); | 2889 | // always running this check because if the user deletes the object it would return a null reference. |
2890 | detobj.keyUUID = obj.UUID; | 2890 | if (m_parentGroup == null) |
2891 | detobj.nameStr = obj.Name; | 2891 | return; |
2892 | detobj.ownerUUID = obj.OwnerID; | 2892 | if (m_parentGroup.Scene == null) |
2893 | detobj.posVector = obj.AbsolutePosition; | 2893 | return; |
2894 | detobj.rotQuat = obj.GetWorldRotation(); | 2894 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
2895 | detobj.velVector = obj.Velocity; | 2895 | if (obj != null) |
2896 | detobj.colliderType = 0; | 2896 | { |
2897 | detobj.groupUUID = obj.GroupID; | 2897 | DetectedObject detobj = new DetectedObject(); |
2898 | colliding.Add(detobj); | 2898 | detobj.keyUUID = obj.UUID; |
2899 | detobj.nameStr = obj.Name; | ||
2900 | detobj.ownerUUID = obj.OwnerID; | ||
2901 | detobj.posVector = obj.AbsolutePosition; | ||
2902 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2903 | detobj.velVector = obj.Velocity; | ||
2904 | detobj.colliderType = 0; | ||
2905 | detobj.groupUUID = obj.GroupID; | ||
2906 | colliding.Add(detobj); | ||
2907 | } | ||
2908 | else | ||
2909 | { | ||
2910 | List<ScenePresence> avlist = m_parentGroup.Scene.GetScenePresences(); | ||
2911 | if (avlist != null) | ||
2912 | { | ||
2913 | foreach (ScenePresence av in avlist) | ||
2914 | { | ||
2915 | if (av.LocalId == localId) | ||
2916 | { | ||
2917 | DetectedObject detobj = new DetectedObject(); | ||
2918 | detobj.keyUUID = av.UUID; | ||
2919 | detobj.nameStr = av.ControllingClient.Name; | ||
2920 | detobj.ownerUUID = av.UUID; | ||
2921 | detobj.posVector = av.AbsolutePosition; | ||
2922 | detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); | ||
2923 | detobj.velVector = av.Velocity; | ||
2924 | detobj.colliderType = 0; | ||
2925 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2926 | colliding.Add(detobj); | ||
2927 | } | ||
2928 | } | ||
2929 | |||
2930 | } | ||
2931 | } | ||
2932 | } | ||
2933 | if (colliding.Count > 0) | ||
2934 | { | ||
2935 | StartCollidingMessage.Colliders = colliding; | ||
2936 | // always running this check because if the user deletes the object it would return a null reference. | ||
2937 | if (m_parentGroup == null) | ||
2938 | return; | ||
2939 | if (m_parentGroup.Scene == null) | ||
2940 | return; | ||
2941 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); | ||
2899 | } | 2942 | } |
2900 | } | ||
2901 | if (colliding.Count > 0) | ||
2902 | { | ||
2903 | StartCollidingMessage.Colliders = colliding; | ||
2904 | // always running this check because if the user deletes the object it would return a null reference. | ||
2905 | if (m_parentGroup == null) | ||
2906 | return; | ||
2907 | if (m_parentGroup.Scene == null) | ||
2908 | return; | ||
2909 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); | ||
2910 | } | ||
2911 | 2943 | ||
2944 | } | ||
2912 | } | 2945 | } |
2913 | if (m_lastColliders.Count > 0) | 2946 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision) != 0) |
2914 | { | 2947 | { |
2915 | ColliderArgs CollidingMessage = new ColliderArgs(); | 2948 | if (m_lastColliders.Count > 0) |
2916 | List<DetectedObject> colliding = new List<DetectedObject>(); | ||
2917 | foreach (uint localId in m_lastColliders) | ||
2918 | { | 2949 | { |
2919 | // always running this check because if the user deletes the object it would return a null reference. | 2950 | ColliderArgs CollidingMessage = new ColliderArgs(); |
2920 | if (localId == 0) | 2951 | List<DetectedObject> colliding = new List<DetectedObject>(); |
2921 | continue; | 2952 | foreach (uint localId in m_lastColliders) |
2953 | { | ||
2954 | // always running this check because if the user deletes the object it would return a null reference. | ||
2955 | if (localId == 0) | ||
2956 | continue; | ||
2957 | |||
2958 | if (m_parentGroup == null) | ||
2959 | return; | ||
2960 | if (m_parentGroup.Scene == null) | ||
2961 | return; | ||
2962 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | ||
2963 | if (obj != null) | ||
2964 | { | ||
2965 | DetectedObject detobj = new DetectedObject(); | ||
2966 | detobj.keyUUID = obj.UUID; | ||
2967 | detobj.nameStr = obj.Name; | ||
2968 | detobj.ownerUUID = obj.OwnerID; | ||
2969 | detobj.posVector = obj.AbsolutePosition; | ||
2970 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2971 | detobj.velVector = obj.Velocity; | ||
2972 | detobj.colliderType = 0; | ||
2973 | detobj.groupUUID = obj.GroupID; | ||
2974 | colliding.Add(detobj); | ||
2975 | } | ||
2976 | else | ||
2977 | { | ||
2978 | List<ScenePresence> avlist = m_parentGroup.Scene.GetScenePresences(); | ||
2979 | if (avlist != null) | ||
2980 | { | ||
2981 | foreach (ScenePresence av in avlist) | ||
2982 | { | ||
2983 | if (av.LocalId == localId) | ||
2984 | { | ||
2985 | DetectedObject detobj = new DetectedObject(); | ||
2986 | detobj.keyUUID = av.UUID; | ||
2987 | detobj.nameStr = av.Name; | ||
2988 | detobj.ownerUUID = av.UUID; | ||
2989 | detobj.posVector = av.AbsolutePosition; | ||
2990 | detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); | ||
2991 | detobj.velVector = av.Velocity; | ||
2992 | detobj.colliderType = 0; | ||
2993 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2994 | colliding.Add(detobj); | ||
2995 | } | ||
2996 | } | ||
2922 | 2997 | ||
2923 | if (m_parentGroup == null) | 2998 | } |
2924 | return; | 2999 | } |
2925 | if (m_parentGroup.Scene == null) | 3000 | } |
2926 | return; | 3001 | if (colliding.Count > 0) |
2927 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | ||
2928 | if (obj != null) | ||
2929 | { | 3002 | { |
2930 | DetectedObject detobj = new DetectedObject(); | 3003 | CollidingMessage.Colliders = colliding; |
2931 | detobj.keyUUID = obj.UUID; | 3004 | // always running this check because if the user deletes the object it would return a null reference. |
2932 | detobj.nameStr = obj.Name; | 3005 | if (m_parentGroup == null) |
2933 | detobj.ownerUUID = obj.OwnerID; | 3006 | return; |
2934 | detobj.posVector = obj.AbsolutePosition; | 3007 | if (m_parentGroup.Scene == null) |
2935 | detobj.rotQuat = obj.GetWorldRotation(); | 3008 | return; |
2936 | detobj.velVector = obj.Velocity; | 3009 | m_parentGroup.Scene.EventManager.TriggerScriptColliding(LocalId, CollidingMessage); |
2937 | detobj.colliderType = 0; | ||
2938 | detobj.groupUUID = obj.GroupID; | ||
2939 | colliding.Add(detobj); | ||
2940 | } | 3010 | } |
2941 | } | ||
2942 | if (colliding.Count > 0) | ||
2943 | { | ||
2944 | CollidingMessage.Colliders = colliding; | ||
2945 | // always running this check because if the user deletes the object it would return a null reference. | ||
2946 | if (m_parentGroup == null) | ||
2947 | return; | ||
2948 | if (m_parentGroup.Scene == null) | ||
2949 | return; | ||
2950 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, CollidingMessage); | ||
2951 | } | ||
2952 | 3011 | ||
3012 | } | ||
2953 | } | 3013 | } |
2954 | if (endedColliders.Count > 0) | 3014 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.collision_end) != 0) |
2955 | { | 3015 | { |
2956 | ColliderArgs EndCollidingMessage = new ColliderArgs(); | 3016 | if (endedColliders.Count > 0) |
2957 | List<DetectedObject> colliding = new List<DetectedObject>(); | ||
2958 | foreach (uint localId in endedColliders) | ||
2959 | { | 3017 | { |
2960 | if (localId == 0) | 3018 | ColliderArgs EndCollidingMessage = new ColliderArgs(); |
2961 | continue; | 3019 | List<DetectedObject> colliding = new List<DetectedObject>(); |
3020 | foreach (uint localId in endedColliders) | ||
3021 | { | ||
3022 | if (localId == 0) | ||
3023 | continue; | ||
3024 | |||
3025 | // always running this check because if the user deletes the object it would return a null reference. | ||
3026 | if (m_parentGroup == null) | ||
3027 | return; | ||
3028 | if (m_parentGroup.Scene == null) | ||
3029 | return; | ||
3030 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | ||
3031 | if (obj != null) | ||
3032 | { | ||
3033 | DetectedObject detobj = new DetectedObject(); | ||
3034 | detobj.keyUUID = obj.UUID; | ||
3035 | detobj.nameStr = obj.Name; | ||
3036 | detobj.ownerUUID = obj.OwnerID; | ||
3037 | detobj.posVector = obj.AbsolutePosition; | ||
3038 | detobj.rotQuat = obj.GetWorldRotation(); | ||
3039 | detobj.velVector = obj.Velocity; | ||
3040 | detobj.colliderType = 0; | ||
3041 | detobj.groupUUID = obj.GroupID; | ||
3042 | colliding.Add(detobj); | ||
3043 | } | ||
3044 | else | ||
3045 | { | ||
3046 | List<ScenePresence> avlist = m_parentGroup.Scene.GetScenePresences(); | ||
3047 | if (avlist != null) | ||
3048 | { | ||
3049 | foreach (ScenePresence av in avlist) | ||
3050 | { | ||
3051 | if (av.LocalId == localId) | ||
3052 | { | ||
3053 | DetectedObject detobj = new DetectedObject(); | ||
3054 | detobj.keyUUID = av.UUID; | ||
3055 | detobj.nameStr = av.Name; | ||
3056 | detobj.ownerUUID = av.UUID; | ||
3057 | detobj.posVector = av.AbsolutePosition; | ||
3058 | detobj.rotQuat = new LLQuaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); | ||
3059 | detobj.velVector = av.Velocity; | ||
3060 | detobj.colliderType = 0; | ||
3061 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
3062 | colliding.Add(detobj); | ||
3063 | } | ||
3064 | } | ||
2962 | 3065 | ||
2963 | // always running this check because if the user deletes the object it would return a null reference. | 3066 | } |
2964 | if (m_parentGroup == null) | 3067 | } |
2965 | return; | 3068 | } |
2966 | if (m_parentGroup.Scene == null) | 3069 | if (colliding.Count > 0) |
2967 | return; | ||
2968 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | ||
2969 | if (obj != null) | ||
2970 | { | 3070 | { |
2971 | DetectedObject detobj = new DetectedObject(); | 3071 | EndCollidingMessage.Colliders = colliding; |
2972 | detobj.keyUUID = obj.UUID; | 3072 | // always running this check because if the user deletes the object it would return a null reference. |
2973 | detobj.nameStr = obj.Name; | 3073 | if (m_parentGroup == null) |
2974 | detobj.ownerUUID = obj.OwnerID; | 3074 | return; |
2975 | detobj.posVector = obj.AbsolutePosition; | 3075 | if (m_parentGroup.Scene == null) |
2976 | detobj.rotQuat = obj.GetWorldRotation(); | 3076 | return; |
2977 | detobj.velVector = obj.Velocity; | 3077 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingEnd(LocalId, EndCollidingMessage); |
2978 | detobj.colliderType = 0; | ||
2979 | detobj.groupUUID = obj.GroupID; | ||
2980 | colliding.Add(detobj); | ||
2981 | } | 3078 | } |
2982 | } | ||
2983 | if (colliding.Count > 0) | ||
2984 | { | ||
2985 | EndCollidingMessage.Colliders = colliding; | ||
2986 | // always running this check because if the user deletes the object it would return a null reference. | ||
2987 | if (m_parentGroup == null) | ||
2988 | return; | ||
2989 | if (m_parentGroup.Scene == null) | ||
2990 | return; | ||
2991 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, EndCollidingMessage); | ||
2992 | } | ||
2993 | 3079 | ||
3080 | } | ||
2994 | } | 3081 | } |
2995 | } | 3082 | } |
2996 | 3083 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 2ac074f..688354c 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -563,6 +563,32 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
563 | return resolveName(SensedUUID); | 563 | return resolveName(SensedUUID); |
564 | } | 564 | } |
565 | } | 565 | } |
566 | else | ||
567 | { | ||
568 | ScriptManager sm; | ||
569 | IScript script = null; | ||
570 | |||
571 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) | ||
572 | { | ||
573 | if (sm.Scripts.ContainsKey(m_localID)) | ||
574 | { | ||
575 | if ((script = sm.GetScript(m_localID, m_itemID)) != null) | ||
576 | { | ||
577 | //System.Console.WriteLine(number + " - " + script.llDetectParams._key.Length); | ||
578 | if (script.llDetectParams._string != null) | ||
579 | { | ||
580 | if (script.llDetectParams._string.Length > number) | ||
581 | { | ||
582 | if (script.llDetectParams._string[number] != null) | ||
583 | { | ||
584 | return script.llDetectParams._string[number]; | ||
585 | } | ||
586 | } | ||
587 | } | ||
588 | } | ||
589 | } | ||
590 | } | ||
591 | } | ||
566 | return String.Empty; | 592 | return String.Empty; |
567 | } | 593 | } |
568 | 594 | ||
@@ -588,9 +614,13 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
588 | { | 614 | { |
589 | if ((script = sm.GetScript(m_localID, m_itemID)) != null) | 615 | if ((script = sm.GetScript(m_localID, m_itemID)) != null) |
590 | { | 616 | { |
591 | if (script.llDetectParams._key[0]) | 617 | //System.Console.WriteLine(number + " - " + script.llDetectParams._key.Length); |
618 | if (script.llDetectParams._key.Length > number) | ||
592 | { | 619 | { |
593 | return new LLUUID(script.llDetectParams._key[0]); | 620 | if (script.llDetectParams._key[number]) |
621 | { | ||
622 | return new LLUUID(script.llDetectParams._key[number]); | ||
623 | } | ||
594 | } | 624 | } |
595 | } | 625 | } |
596 | } | 626 | } |
@@ -615,6 +645,36 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
615 | return SensedObject; | 645 | return SensedObject; |
616 | } | 646 | } |
617 | } | 647 | } |
648 | else | ||
649 | { | ||
650 | ScriptManager sm; | ||
651 | IScript script = null; | ||
652 | |||
653 | if ((sm = m_ScriptEngine.m_ScriptManager) != null) | ||
654 | { | ||
655 | if (sm.Scripts.ContainsKey(m_localID)) | ||
656 | { | ||
657 | if ((script = sm.GetScript(m_localID, m_itemID)) != null) | ||
658 | { | ||
659 | //System.Console.WriteLine(number + " - " + script.llDetectParams._key.Length); | ||
660 | if (script.llDetectParams._key.Length > number) | ||
661 | { | ||
662 | if (script.llDetectParams._key[number]) | ||
663 | { | ||
664 | LLUUID SensedUUID = new LLUUID(script.llDetectParams._key[number]); | ||
665 | EntityBase SensedObject = null; | ||
666 | lock (World.Entities) | ||
667 | { | ||
668 | World.Entities.TryGetValue(SensedUUID, out SensedObject); | ||
669 | } | ||
670 | return SensedObject; | ||
671 | } | ||
672 | } | ||
673 | } | ||
674 | } | ||
675 | } | ||
676 | } | ||
677 | |||
618 | return null; | 678 | return null; |
619 | } | 679 | } |
620 | 680 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index ae84f65..c51e66b 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | |||
@@ -121,7 +121,33 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
121 | // Add to queue for all scripts in ObjectID object | 121 | // Add to queue for all scripts in ObjectID object |
122 | EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); | 122 | EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); |
123 | detstruct._key = new LSL_Types.key[1]; | 123 | detstruct._key = new LSL_Types.key[1]; |
124 | detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | 124 | detstruct._key2 = new LSL_Types.key[1]; |
125 | detstruct._string = new string[1]; | ||
126 | detstruct._Vector3 = new LSL_Types.Vector3[1]; | ||
127 | detstruct._Vector32 = new LSL_Types.Vector3[1]; | ||
128 | detstruct._Quaternion = new LSL_Types.Quaternion[1]; | ||
129 | detstruct._int = new int[1]; | ||
130 | ScenePresence av = myScriptEngine.World.GetScenePresence(remoteClient.AgentId); | ||
131 | if (av != null) | ||
132 | { | ||
133 | detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | ||
134 | detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | ||
135 | detstruct._string[0] = remoteClient.Name; | ||
136 | detstruct._int[0] = 0; | ||
137 | detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.x,av.Rotation.y,av.Rotation.z,av.Rotation.w); | ||
138 | detstruct._Vector3[0] = new LSL_Types.Vector3(av.AbsolutePosition.X,av.AbsolutePosition.Y,av.AbsolutePosition.Z); | ||
139 | detstruct._Vector32[0] = new LSL_Types.Vector3(av.Velocity.X,av.Velocity.Y,av.Velocity.Z); | ||
140 | } | ||
141 | else | ||
142 | { | ||
143 | detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | ||
144 | detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | ||
145 | detstruct._string[0] = remoteClient.Name; | ||
146 | detstruct._int[0] = 0; | ||
147 | detstruct._Quaternion[0] = new LSL_Types.Quaternion(0, 0, 0, 1); | ||
148 | detstruct._Vector3[0] = new LSL_Types.Vector3(0, 0, 0); | ||
149 | detstruct._Vector32[0] = new LSL_Types.Vector3(0, 0, 0); | ||
150 | } | ||
125 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", detstruct, new object[] { new LSL_Types.LSLInteger(1) }); | 151 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", detstruct, new object[] { new LSL_Types.LSLInteger(1) }); |
126 | } | 152 | } |
127 | 153 | ||
@@ -130,7 +156,33 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
130 | // Add to queue for all scripts in ObjectID object | 156 | // Add to queue for all scripts in ObjectID object |
131 | EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); | 157 | EventQueueManager.Queue_llDetectParams_Struct detstruct = new EventQueueManager.Queue_llDetectParams_Struct(); |
132 | detstruct._key = new LSL_Types.key[1]; | 158 | detstruct._key = new LSL_Types.key[1]; |
133 | detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | 159 | detstruct._key2 = new LSL_Types.key[1]; |
160 | detstruct._string = new string[1]; | ||
161 | detstruct._Vector3 = new LSL_Types.Vector3[1]; | ||
162 | detstruct._Vector32 = new LSL_Types.Vector3[1]; | ||
163 | detstruct._Quaternion = new LSL_Types.Quaternion[1]; | ||
164 | detstruct._int = new int[1]; | ||
165 | ScenePresence av = myScriptEngine.World.GetScenePresence(remoteClient.AgentId); | ||
166 | if (av != null) | ||
167 | { | ||
168 | detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | ||
169 | detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | ||
170 | detstruct._string[0] = remoteClient.Name; | ||
171 | detstruct._int[0] = 0; | ||
172 | detstruct._Quaternion[0] = new LSL_Types.Quaternion(av.Rotation.x, av.Rotation.y, av.Rotation.z, av.Rotation.w); | ||
173 | detstruct._Vector3[0] = new LSL_Types.Vector3(av.AbsolutePosition.X, av.AbsolutePosition.Y, av.AbsolutePosition.Z); | ||
174 | detstruct._Vector32[0] = new LSL_Types.Vector3(av.Velocity.X, av.Velocity.Y, av.Velocity.Z); | ||
175 | } | ||
176 | else | ||
177 | { | ||
178 | detstruct._key[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | ||
179 | detstruct._key2[0] = new LSL_Types.key(remoteClient.AgentId.ToString()); | ||
180 | detstruct._string[0] = remoteClient.Name; | ||
181 | detstruct._int[0] = 0; | ||
182 | detstruct._Quaternion[0] = new LSL_Types.Quaternion(0, 0, 0, 1); | ||
183 | detstruct._Vector3[0] = new LSL_Types.Vector3(0, 0, 0); | ||
184 | detstruct._Vector32[0] = new LSL_Types.Vector3(0, 0, 0); | ||
185 | } | ||
134 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) }); | 186 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_end", detstruct, new object[] { new LSL_Types.LSLInteger(1) }); |
135 | } | 187 | } |
136 | 188 | ||
@@ -184,6 +236,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
184 | detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; | 236 | detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; |
185 | detstruct._int = new int[col.Colliders.Count]; | 237 | detstruct._int = new int[col.Colliders.Count]; |
186 | detstruct._key = new LSL_Types.key[col.Colliders.Count]; | 238 | detstruct._key = new LSL_Types.key[col.Colliders.Count]; |
239 | detstruct._key2 = new LSL_Types.key[col.Colliders.Count]; | ||
187 | detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; | 240 | detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; |
188 | detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; | 241 | detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; |
189 | detstruct._bool = new bool[col.Colliders.Count]; | 242 | detstruct._bool = new bool[col.Colliders.Count]; |
@@ -192,6 +245,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
192 | foreach (DetectedObject detobj in col.Colliders) | 245 | foreach (DetectedObject detobj in col.Colliders) |
193 | { | 246 | { |
194 | detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); | 247 | detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); |
248 | detstruct._key2[i] = new LSL_Types.key(detobj.ownerUUID.ToString()); | ||
195 | detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W); | 249 | 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; | 250 | detstruct._string[i] = detobj.nameStr; |
197 | detstruct._int[i] = detobj.colliderType; | 251 | detstruct._int[i] = detobj.colliderType; |
@@ -211,6 +265,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
211 | detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; | 265 | detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; |
212 | detstruct._int = new int[col.Colliders.Count]; | 266 | detstruct._int = new int[col.Colliders.Count]; |
213 | detstruct._key = new LSL_Types.key[col.Colliders.Count]; | 267 | detstruct._key = new LSL_Types.key[col.Colliders.Count]; |
268 | detstruct._key2 = new LSL_Types.key[col.Colliders.Count]; | ||
214 | detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; | 269 | detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; |
215 | detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; | 270 | detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; |
216 | detstruct._bool = new bool[col.Colliders.Count]; | 271 | detstruct._bool = new bool[col.Colliders.Count]; |
@@ -219,6 +274,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
219 | foreach (DetectedObject detobj in col.Colliders) | 274 | foreach (DetectedObject detobj in col.Colliders) |
220 | { | 275 | { |
221 | detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); | 276 | detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); |
277 | detstruct._key2[i] = new LSL_Types.key(detobj.ownerUUID.ToString()); | ||
222 | detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W); | 278 | 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; | 279 | detstruct._string[i] = detobj.nameStr; |
224 | detstruct._int[i] = detobj.colliderType; | 280 | detstruct._int[i] = detobj.colliderType; |
@@ -236,6 +292,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
236 | detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; | 292 | detstruct._Quaternion = new LSL_Types.Quaternion[col.Colliders.Count]; |
237 | detstruct._int = new int[col.Colliders.Count]; | 293 | detstruct._int = new int[col.Colliders.Count]; |
238 | detstruct._key = new LSL_Types.key[col.Colliders.Count]; | 294 | detstruct._key = new LSL_Types.key[col.Colliders.Count]; |
295 | detstruct._key2 = new LSL_Types.key[col.Colliders.Count]; | ||
239 | detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; | 296 | detstruct._Vector3 = new LSL_Types.Vector3[col.Colliders.Count]; |
240 | detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; | 297 | detstruct._Vector32 = new LSL_Types.Vector3[col.Colliders.Count]; |
241 | detstruct._bool = new bool[col.Colliders.Count]; | 298 | detstruct._bool = new bool[col.Colliders.Count]; |
@@ -244,6 +301,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
244 | foreach (DetectedObject detobj in col.Colliders) | 301 | foreach (DetectedObject detobj in col.Colliders) |
245 | { | 302 | { |
246 | detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); | 303 | detstruct._key[i] = new LSL_Types.key(detobj.keyUUID.ToString()); |
304 | detstruct._key2[i] = new LSL_Types.key(detobj.ownerUUID.ToString()); | ||
247 | detstruct._Quaternion[i] = new LSL_Types.Quaternion(detobj.rotQuat.X, detobj.rotQuat.Y, detobj.rotQuat.Z, detobj.rotQuat.W); | 305 | 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; | 306 | detstruct._string[i] = detobj.nameStr; |
249 | detstruct._int[i] = detobj.colliderType; | 307 | detstruct._int[i] = detobj.colliderType; |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index c6eebf1..79c1dde 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | |||
@@ -153,7 +153,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
153 | { | 153 | { |
154 | // More or less just a placeholder for the actual moving of additional data | 154 | // More or less just a placeholder for the actual moving of additional data |
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; // detected key |
157 | public LSL_Types.key[] _key2; // ownerkey | ||
157 | public LSL_Types.Quaternion[] _Quaternion; | 158 | public LSL_Types.Quaternion[] _Quaternion; |
158 | public LSL_Types.Vector3[] _Vector3; // Pos | 159 | public LSL_Types.Vector3[] _Vector3; // Pos |
159 | public LSL_Types.Vector3[] _Vector32; // Vel | 160 | public LSL_Types.Vector3[] _Vector32; // Vel |