diff options
author | SignpostMarv | 2012-08-18 14:49:10 +0100 |
---|---|---|
committer | Melanie | 2012-08-18 18:29:59 +0100 |
commit | 2b0c8bc48008b8ce38c99d5c3135633b0d4f8e87 (patch) | |
tree | dd3c8d90b28da4530c22a803d5a3cb1bd51826e5 /OpenSim | |
parent | Fix the whitespace formatting error introduced by the last patch (diff) | |
download | opensim-SC_OLD-2b0c8bc48008b8ce38c99d5c3135633b0d4f8e87.zip opensim-SC_OLD-2b0c8bc48008b8ce38c99d5c3135633b0d4f8e87.tar.gz opensim-SC_OLD-2b0c8bc48008b8ce38c99d5c3135633b0d4f8e87.tar.bz2 opensim-SC_OLD-2b0c8bc48008b8ce38c99d5c3135633b0d4f8e87.tar.xz |
Implementing operators & constructors for Quaternion
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index d18efe0..bdc7d70 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -361,6 +361,14 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
361 | s = 1; | 361 | s = 1; |
362 | } | 362 | } |
363 | 363 | ||
364 | public Quaternion(OMV_Quaternion rot) | ||
365 | { | ||
366 | x = rot.X; | ||
367 | y = rot.Y; | ||
368 | z = rot.Z; | ||
369 | s = rot.W; | ||
370 | } | ||
371 | |||
364 | #endregion | 372 | #endregion |
365 | 373 | ||
366 | #region Overriders | 374 | #region Overriders |
@@ -407,6 +415,16 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
407 | return new list(new object[] { r }); | 415 | return new list(new object[] { r }); |
408 | } | 416 | } |
409 | 417 | ||
418 | public static implicit operator OMV_Quaternion(Quaternion rot) | ||
419 | { | ||
420 | return new OMV_Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); | ||
421 | } | ||
422 | |||
423 | public static implicit operator Quaternion(OMV_Quaternion rot) | ||
424 | { | ||
425 | return new Quaternion(rot); | ||
426 | } | ||
427 | |||
410 | public static bool operator ==(Quaternion lhs, Quaternion rhs) | 428 | public static bool operator ==(Quaternion lhs, Quaternion rhs) |
411 | { | 429 | { |
412 | // Return true if the fields match: | 430 | // Return true if the fields match: |