diff options
author | Dahlia Trimble | 2009-04-07 07:59:32 +0000 |
---|---|---|
committer | Dahlia Trimble | 2009-04-07 07:59:32 +0000 |
commit | eb190905b5462b33695de9c330a434a4b673a0eb (patch) | |
tree | 1642b310ee815553866daf7b328f9ff0ae0e53db /OpenSim/Region | |
parent | * This fixes BulletDotNET so it can now be used on linux. (diff) | |
download | opensim-SC_OLD-eb190905b5462b33695de9c330a434a4b673a0eb.zip opensim-SC_OLD-eb190905b5462b33695de9c330a434a4b673a0eb.tar.gz opensim-SC_OLD-eb190905b5462b33695de9c330a434a4b673a0eb.tar.bz2 opensim-SC_OLD-eb190905b5462b33695de9c330a434a4b673a0eb.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 5 |
1 files changed, 4 insertions, 1 deletions
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 | |||
4277 | { | 4277 | { |
4278 | m_host.AddScriptLPS(1); | 4278 | m_host.AddScriptLPS(1); |
4279 | 4279 | ||
4280 | return (double) Math.Acos(a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s) * 2; | 4280 | double angle = Math.Acos(a.x * b.x + a.y * b.y + a.z * b.z + a.s * b.s) * 2; |
4281 | if (angle < 0) angle = -angle; | ||
4282 | if (angle > Math.PI) return (Math.PI * 2 - angle); | ||
4283 | return angle; | ||
4281 | } | 4284 | } |
4282 | 4285 | ||
4283 | public LSL_String llGetInventoryKey(string name) | 4286 | public LSL_String llGetInventoryKey(string name) |