Adds in +, -, and / operators for Rotations (and fixes Mantis 671)
parent
d3515bf22e
commit
6ac21141c6
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue