aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Common')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index a3dcc6d..0773253 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -258,10 +258,11 @@ namespace OpenSim.Region.ScriptEngine.Common
258 return (int)Math.Ceiling(f); 258 return (int)Math.Ceiling(f);
259 } 259 }
260 260
261 // Xantor 01/May/2008 fixed midpointrounding (2.5 becomes 3.0 instead of 2.0, default = ToEven)
261 public int llRound(double f) 262 public int llRound(double f)
262 { 263 {
263 m_host.AddScriptLPS(1); 264 m_host.AddScriptLPS(1);
264 return (int)Math.Round(f, 0); 265 return (int)Math.Round(f, MidpointRounding.AwayFromZero);
265 } 266 }
266 267
267 //This next group are vector operations involving squaring and square root. ckrinke 268 //This next group are vector operations involving squaring and square root. ckrinke
@@ -2926,11 +2927,13 @@ namespace OpenSim.Region.ScriptEngine.Common
2926 return (double)Math.Asin(val); 2927 return (double)Math.Asin(val);
2927 } 2928 }
2928 2929
2930 // Xantor 30/apr/2008
2929 public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) 2931 public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b)
2930 { 2932 {
2931 m_host.AddScriptLPS(1); 2933 m_host.AddScriptLPS(1);
2932 NotImplemented("llAngleBetween"); 2934
2933 return 0; 2935 return (double) Math.Acos(a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s) * 2;
2936// NotImplemented("llAngleBetween");
2934 } 2937 }
2935 2938
2936 public string llGetInventoryKey(string name) 2939 public string llGetInventoryKey(string name)