aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs30
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs1
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs1
5 files changed, 54 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
index 880ca1b..07cba60 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs
@@ -113,6 +113,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
113 } 113 }
114 114
115 /// <summary> 115 /// <summary>
116 /// Like osGetAgents but returns enough info for a radar
117 /// </summary>
118 /// <returns>Strided list of the UUID, position and name of each avatar in the region</returns>
119 public LSL_List cmGetAvatarList()
120 {
121 LSL_List result = new LSL_List();
122 World.ForEachScenePresence(delegate (ScenePresence avatar)
123 {
124 if (avatar.UUID != m_host.OwnerID)
125 {
126 if (avatar.IsChildAgent == false)
127 {
128 result.Add(avatar.UUID);
129 result.Add(avatar.PhysicsActor.Position);
130 result.Add(avatar.Name);
131 }
132 }
133 });
134 return result;
135 }
136
137 /// <summary>
116 /// Get the current Windlight scene 138 /// Get the current Windlight scene
117 /// </summary> 139 /// </summary>
118 /// <returns>List of windlight parameters</returns> 140 /// <returns>List of windlight parameters</returns>
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 3f630f4..228e9b8 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2881,6 +2881,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2881 2881
2882 public void llLookAt(LSL_Vector target, double strength, double damping) 2882 public void llLookAt(LSL_Vector target, double strength, double damping)
2883 { 2883 {
2884 /*
2884 m_host.AddScriptLPS(1); 2885 m_host.AddScriptLPS(1);
2885 // Determine where we are looking from 2886 // Determine where we are looking from
2886 LSL_Vector from = llGetPos(); 2887 LSL_Vector from = llGetPos();
@@ -2900,12 +2901,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2900 // the angles of rotation in radians into rotation value 2901 // the angles of rotation in radians into rotation value
2901 2902
2902 LSL_Types.Quaternion rot = llEuler2Rot(angle); 2903 LSL_Types.Quaternion rot = llEuler2Rot(angle);
2903 /* 2904
2904 Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); 2905 // This would only work if your physics system contains an APID controller:
2905 m_host.startLookAt(rotation, (float)damping, (float)strength); 2906 // Quaternion rotation = new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
2906 This would only work if your physics system contains an APID controller */ 2907 // m_host.startLookAt(rotation, (float)damping, (float)strength);
2908
2907 // Orient the object to the angle calculated 2909 // Orient the object to the angle calculated
2908 llSetRot(rot); 2910 llSetRot(rot);
2911 */
2912
2913 //The above code, while nice, doesn't replicate the behaviour of SL and tends to "roll" the object.
2914 //There's probably a smarter way of doing this, my rotation math-fu is weak.
2915 // http://bugs.meta7.com/view.php?id=28
2916 // - Tom
2917
2918 LSL_Rotation newrot = llGetRot() * llRotBetween(new LSL_Vector(1.0d, 0.0d, 0.0d) * llGetRot(), new LSL_Vector(0.0d, 0.0d, -1.0d));
2919 llSetRot(newrot * llRotBetween(new LSL_Vector(0.0d,0.0d,1.0d) * newrot, target - llGetPos()));
2920
2909 } 2921 }
2910 2922
2911 public void llRotLookAt(LSL_Rotation target, double strength, double damping) 2923 public void llRotLookAt(LSL_Rotation target, double strength, double damping)
@@ -6222,6 +6234,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6222 tempf = (float)rules.GetLSLFloatItem(i + 1); 6234 tempf = (float)rules.GetLSLFloatItem(i + 1);
6223 prules.OuterAngle = (float)tempf; 6235 prules.OuterAngle = (float)tempf;
6224 break; 6236 break;
6237
6238 case (int)ScriptBaseClass.PSYS_SRC_INNERANGLE:
6239 tempf = (float)rules.GetLSLFloatItem(i + 1);
6240 prules.InnerAngle = (float)tempf;
6241 break;
6242
6243 case (int)ScriptBaseClass.PSYS_SRC_OUTERANGLE:
6244 tempf = (float)rules.GetLSLFloatItem(i + 1);
6245 prules.OuterAngle = (float)tempf;
6246 break;
6225 } 6247 }
6226 6248
6227 } 6249 }
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs
index f13b6e5..fba27f9 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ICM_Api.cs
@@ -44,5 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
44 LSL_List cmGetWindlightScene(LSL_List rules); 44 LSL_List cmGetWindlightScene(LSL_List rules);
45 int cmSetWindlightScene(LSL_List rules); 45 int cmSetWindlightScene(LSL_List rules);
46 int cmSetWindlightSceneTargeted(LSL_List rules, key target); 46 int cmSetWindlightSceneTargeted(LSL_List rules, key target);
47 LSL_List cmGetAvatarList();
47 } 48 }
48} 49}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs
index c0edaae..aaffbe4 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/CM_Stub.cs
@@ -72,5 +72,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
72 { 72 {
73 return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target); 73 return m_CM_Functions.cmSetWindlightSceneTargeted(rules, target);
74 } 74 }
75 public LSL_List cmGetAvatarList()
76 {
77 return m_CM_Functions.cmGetAvatarList();
78 }
75 } 79 }
76} 80}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index ee35fa4..b3e4740 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -274,6 +274,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
274 public const int CHANGED_ALLOWED_DROP = 64; 274 public const int CHANGED_ALLOWED_DROP = 64;
275 public const int CHANGED_OWNER = 128; 275 public const int CHANGED_OWNER = 128;
276 public const int CHANGED_REGION_RESTART = 256; 276 public const int CHANGED_REGION_RESTART = 256;
277 public const int CHANGED_REGION_START = 256; //LL Changed the constant from CHANGED_REGION_RESTART
277 public const int CHANGED_REGION = 512; 278 public const int CHANGED_REGION = 512;
278 public const int CHANGED_TELEPORT = 1024; 279 public const int CHANGED_TELEPORT = 1024;
279 public const int CHANGED_ANIMATION = 16384; 280 public const int CHANGED_ANIMATION = 16384;