diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fe051e6299..0f7d03992f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -4277,8 +4277,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); 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); + if (angle < 0) angle = -angle; + if (angle > Math.PI) return (Math.PI * 2 - angle); return angle; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs index 336cc12212..cde772baf4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiTest.cs @@ -45,7 +45,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests public class LSL_ApiTest { - private const double ANGLE_ACCURACY_IN_RADIANS = 1E-7; + private const double ANGLE_ACCURACY_IN_RADIANS = 1E-6; private LSL_Api lslApi; [SetUp] @@ -73,22 +73,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Tests TestllAngleBetween(new Vector3(1, 0, 0), 0); TestllAngleBetween(new Vector3(1, 0, 0), 90); TestllAngleBetween(new Vector3(1, 0, 0), 180); - //TestllAngleBetween(new Vector3(1, 0, 0), 270); // angles cant be larger than 180 TestllAngleBetween(new Vector3(0, 1, 0), 0); TestllAngleBetween(new Vector3(0, 1, 0), 90); TestllAngleBetween(new Vector3(0, 1, 0), 180); - //TestllAngleBetween(new Vector3(0, 1, 0), 270); TestllAngleBetween(new Vector3(0, 0, 1), 0); TestllAngleBetween(new Vector3(0, 0, 1), 90); TestllAngleBetween(new Vector3(0, 0, 1), 180); - //TestllAngleBetween(new Vector3(0, 0, 1), 270); TestllAngleBetween(new Vector3(1, 1, 1), 0); TestllAngleBetween(new Vector3(1, 1, 1), 90); TestllAngleBetween(new Vector3(1, 1, 1), 180); - //TestllAngleBetween(new Vector3(1, 1, 1), 270); } private void TestllAngleBetween(Vector3 axis,float originalAngle)