diff options
Adjust output of llRot2Axis and llRot2Angle to match domains SL(tm) uses. Addresses Mantis #0006671
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 39bac82..e1630b3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4678,6 +4678,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4678 | else | 4678 | else |
4679 | { | 4679 | { |
4680 | double invS = 1.0 / s; | 4680 | double invS = 1.0 / s; |
4681 | if (rot.s < 0) invS = -invS; | ||
4681 | return new LSL_Vector(rot.x * invS, rot.y * invS, rot.z * invS); | 4682 | return new LSL_Vector(rot.x * invS, rot.y * invS, rot.z * invS); |
4682 | } | 4683 | } |
4683 | } | 4684 | } |
@@ -4692,6 +4693,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4692 | rot.Normalize(); | 4693 | rot.Normalize(); |
4693 | 4694 | ||
4694 | double angle = 2 * Math.Acos(rot.s); | 4695 | double angle = 2 * Math.Acos(rot.s); |
4696 | if (angle > Math.PI) | ||
4697 | angle = 2 * Math.PI - angle; | ||
4695 | 4698 | ||
4696 | return angle; | 4699 | return angle; |
4697 | } | 4700 | } |