diff options
author | SignpostMarv | 2012-08-18 15:19:15 +0100 |
---|---|---|
committer | Melanie | 2012-08-18 18:30:00 +0100 |
commit | d72d59905668d881c98f35c7f0c9783d6744084d (patch) | |
tree | 42afc44812ce7ec42d448806ac29374c6018b4f6 /OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |
parent | Rot2Quaternion is now redundant (diff) | |
download | opensim-SC_OLD-d72d59905668d881c98f35c7f0c9783d6744084d.zip opensim-SC_OLD-d72d59905668d881c98f35c7f0c9783d6744084d.tar.gz opensim-SC_OLD-d72d59905668d881c98f35c7f0c9783d6744084d.tar.bz2 opensim-SC_OLD-d72d59905668d881c98f35c7f0c9783d6744084d.tar.xz |
integrating redundant code into operator
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index bdc7d70..9d9df9c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -417,7 +417,12 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
417 | 417 | ||
418 | public static implicit operator OMV_Quaternion(Quaternion rot) | 418 | public static implicit operator OMV_Quaternion(Quaternion rot) |
419 | { | 419 | { |
420 | return new OMV_Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); | 420 | // LSL quaternions can normalize to 0, normal Quaternions can't. |
421 | if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0) | ||
422 | rot.z = 1; // ZERO_ROTATION = 0,0,0,1 | ||
423 | OMV_Quaternion omvrot = new OMV_Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); | ||
424 | omvrot.Normalize(); | ||
425 | return omvrot; | ||
421 | } | 426 | } |
422 | 427 | ||
423 | public static implicit operator Quaternion(OMV_Quaternion rot) | 428 | public static implicit operator Quaternion(OMV_Quaternion rot) |