From eb190905b5462b33695de9c330a434a4b673a0eb Mon Sep 17 00:00:00 2001 From: Dahlia Trimble Date: Tue, 7 Apr 2009 07:59:32 +0000 Subject: Thanks Ewe Loon for Mantis #3007 - llAngleBetween is producing numbers greater then Pi Radians. Also modified to use the system constant for Pi and prevent negative results. --- OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index bcbfe96..013ea27 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4277,7 +4277,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { m_host.AddScriptLPS(1); - return (double) Math.Acos(a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s) * 2; + double angle = Math.Acos(a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s) * 2; + if (angle < 0) angle = -angle; + if (angle > Math.PI) return (Math.PI * 2 - angle); + return angle; } public LSL_String llGetInventoryKey(string name) -- cgit v1.1