diff options
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) |