diff options
author | Melanie | 2013-06-11 21:01:58 +0100 |
---|---|---|
committer | Melanie | 2013-06-11 21:01:58 +0100 |
commit | 400f876d98d71ba8480ab5b3af040c4bae7c5009 (patch) | |
tree | 1444058a9f65e43bb481693d5bb361fe4788311b /OpenSim/Region/ScriptEngine | |
parent | Merge branch 'master' into careminster (diff) | |
parent | * Adds KeyFrameMotion storage support to SQLite, just a note, seems that ... (diff) | |
download | opensim-SC_OLD-400f876d98d71ba8480ab5b3af040c4bae7c5009.zip opensim-SC_OLD-400f876d98d71ba8480ab5b3af040c4bae7c5009.tar.gz opensim-SC_OLD-400f876d98d71ba8480ab5b3af040c4bae7c5009.tar.bz2 opensim-SC_OLD-400f876d98d71ba8480ab5b3af040c4bae7c5009.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 4 |
2 files changed, 8 insertions, 13 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index c315d03..9744526 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -5136,6 +5136,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5136 | else | 5136 | else |
5137 | { | 5137 | { |
5138 | double invS = 1.0 / s; | 5138 | double invS = 1.0 / s; |
5139 | if (rot.s < 0) invS = -invS; | ||
5139 | return new LSL_Vector(rot.x * invS, rot.y * invS, rot.z * invS); | 5140 | return new LSL_Vector(rot.x * invS, rot.y * invS, rot.z * invS); |
5140 | } | 5141 | } |
5141 | } | 5142 | } |
@@ -5146,19 +5147,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5146 | { | 5147 | { |
5147 | m_host.AddScriptLPS(1); | 5148 | m_host.AddScriptLPS(1); |
5148 | 5149 | ||
5149 | if (rot.s > 1) // normalization needed | 5150 | if (Math.Abs(rot.s) > 1) // normalization needed |
5150 | { | 5151 | rot.Normalize(); |
5151 | double length = Math.Sqrt(rot.x * rot.x + rot.y * rot.y + | ||
5152 | rot.z * rot.z + rot.s * rot.s); | ||
5153 | |||
5154 | rot.x /= length; | ||
5155 | rot.y /= length; | ||
5156 | rot.z /= length; | ||
5157 | rot.s /= length; | ||
5158 | } | ||
5159 | 5152 | ||
5160 | double angle = 2 * Math.Acos(rot.s); | 5153 | double angle = 2 * Math.Acos(rot.s); |
5161 | if ((double.IsNaN(angle)) || double.IsInfinity(angle)) angle = 0; | 5154 | if (angle > Math.PI) |
5155 | angle = 2 * Math.PI - angle; | ||
5156 | |||
5162 | return angle; | 5157 | return angle; |
5163 | } | 5158 | } |
5164 | 5159 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index c685afb..4ba0e64 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -377,10 +377,10 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
377 | double length = Math.Sqrt(x * x + y * y + z * z + s * s); | 377 | double length = Math.Sqrt(x * x + y * y + z * z + s * s); |
378 | if (length < float.Epsilon) | 378 | if (length < float.Epsilon) |
379 | { | 379 | { |
380 | x = 1; | 380 | x = 0; |
381 | y = 0; | 381 | y = 0; |
382 | z = 0; | 382 | z = 0; |
383 | s = 0; | 383 | s = 1; |
384 | } | 384 | } |
385 | else | 385 | else |
386 | { | 386 | { |