18 IEquatable<LeapQuaternion> {
61 return "(" +
x +
", " +
y +
", " +
z +
", " +
w +
")";
69 return x.NearlyEquals(v.
x) &&
y.NearlyEquals(v.
y) &&
z.NearlyEquals(v.
z) &&
w.NearlyEquals(v.
w);
81 return !(
float.IsNaN(
x) ||
float.IsInfinity(
x) ||
82 float.IsNaN(
y) ||
float.IsInfinity(
y) ||
83 float.IsNaN(
z) ||
float.IsInfinity(
z) ||
84 float.IsNaN(
w) ||
float.IsInfinity(
w));
97 get {
return (
float)
Math.Sqrt(
x *
x +
y *
y +
z *
z +
w *
w); }
105 get {
return x *
x +
y *
y +
z *
z +
w *
w; }
115 if (denom <= Constants.EPSILON) {
118 denom = 1.0f / (float)
Math.Sqrt(denom);
130 w * rhs.
x +
x * rhs.
w +
y * rhs.
z -
z * rhs.
y,
131 w * rhs.
y +
y * rhs.
w +
z * rhs.
x -
x * rhs.
z,
132 w * rhs.
z +
z * rhs.
w +
x * rhs.
y -
y * rhs.
x,
133 w * rhs.
w -
x * rhs.
x -
y * rhs.
y -
z * rhs.
z);
146 hash = hash * 23 +
x.GetHashCode();
147 hash = hash * 23 +
y.GetHashCode();
148 hash = hash * 23 +
z.GetHashCode();
149 hash = hash * 23 +
w.GetHashCode();
The LeapQuaternion struct represents a rotation in three-dimensional space.
LeapQuaternion Multiply(LeapQuaternion rhs)
Concatenates the rotation described by this quaternion with the one provided and returns the result.
float MagnitudeSquared
The square of the magnitude, or length, of this quaternion.
LeapQuaternion Normalized
A normalized copy of this quaternion.
bool Equals(LeapQuaternion v)
Compare LeapQuaternion equality component-wise.
LeapQuaternion(LeapInternal.LEAP_QUATERNION quaternion)
Copies the specified LEAP_QUATERNION.
LeapQuaternion(LeapQuaternion quaternion)
Copies the specified LeapQuaternion.
static readonly LeapQuaternion Identity
The identity quaternion.
float Magnitude
The magnitude, or length, of this quaternion.
LeapQuaternion(float x, float y, float z, float w)
Creates a new LeapQuaternion with the specified component values.
bool IsValid()
Returns true if all of the quaternion's components are finite. If any component is NaN or infinite,...
override string ToString()
Returns a string containing this quaternion in a human readable format: (x, y, z).
override bool Equals(Object obj)
override int GetHashCode()