From 6ac21141c6ae66d9cdbf8a00645f130496edd7ee Mon Sep 17 00:00:00 2001
From: alondria
Date: Fri, 21 Mar 2008 21:31:18 +0000
Subject: Adds in +, -, and / operators for Rotations (and fixes Mantis 671)

---
 OpenSim/Region/ScriptEngine/Common/LSL_Types.cs | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
index 6fb568c..292950c 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
@@ -322,6 +322,23 @@ namespace OpenSim.Region.ScriptEngine.Common
 
             #endregion
 
+            public static Quaternion operator +(Quaternion a, Quaternion b)
+            {
+                return new Quaternion(a.x + b.x, a.y + b.y, a.z + b.z, a.s + b.s);
+            }
+
+            public static Quaternion operator /(Quaternion a, Quaternion b)
+            {
+                Quaternion c = a * b;
+                c.s = c.s * -1;
+                return c;
+            }
+
+            public static Quaternion operator -(Quaternion a, Quaternion b)
+            {
+                return new Quaternion(a.x - b.x, a.y - b.y, a.z - b.z, a.s - b.s);
+            }
+
             public static Quaternion operator *(Quaternion a, Quaternion b)
             {
                 Quaternion c;
-- 
cgit v1.1