aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs14
1 files changed, 3 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c48285a..39bac82 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4688,19 +4688,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4688 { 4688 {
4689 m_host.AddScriptLPS(1); 4689 m_host.AddScriptLPS(1);
4690 4690
4691 if (rot.s > 1) // normalization needed 4691 if (Math.Abs(rot.s) > 1) // normalization needed
4692 { 4692 rot.Normalize();
4693 double length = Math.Sqrt(rot.x * rot.x + rot.y * rot.y +
4694 rot.z * rot.z + rot.s * rot.s);
4695
4696 rot.x /= length;
4697 rot.y /= length;
4698 rot.z /= length;
4699 rot.s /= length;
4700 }
4701 4693
4702 double angle = 2 * Math.Acos(rot.s); 4694 double angle = 2 * Math.Acos(rot.s);
4703 if ((double.IsNaN(angle)) || double.IsInfinity(angle)) angle = 0; 4695
4704 return angle; 4696 return angle;
4705 } 4697 }
4706 4698