Adds in +, -, and / operators for Rotations (and fixes Mantis 671)

0.6.0-stable
alondria 2008-03-21 21:31:18 +00:00
parent d3515bf22e
commit 6ac21141c6
1 changed files with 17 additions and 0 deletions

View File

@ -322,6 +322,23 @@ namespace OpenSim.Region.ScriptEngine.Common
#endregion #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) public static Quaternion operator *(Quaternion a, Quaternion b)
{ {
Quaternion c; Quaternion c;