aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/CM_Api.cs22
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs30
2 files changed, 48 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 }