Struct Quaternion
- Namespace
- Alis.Core.Aspect.Math.Util
- Assembly
- Alis.dll
The quaternion
public struct Quaternion
Inherited Members
Constructors
Quaternion(float, float, float, float)
Constructs a quaternion from the specified components.
public Quaternion(float x, float y, float z, float w)
Parameters
x
float-
The value to assign to the X component of the quaternion.
y
float-
The value to assign to the Y component of the quaternion.
z
float-
The value to assign to the Z component of the quaternion.
w
float-
The value to assign to the W component of the quaternion.
Fields
Count
The count
internal const int Count = 4
Field Value
hashCode
The hash code
private readonly int hashCode
Field Value
Properties
W
The rotation component of the quaternion.
public float W { readonly get; private set; }
Property Value
X
The X value of the vector component of the quaternion.
public float X { readonly get; private set; }
Property Value
Y
The Y value of the vector component of the quaternion.
public float Y { readonly get; private set; }
Property Value
Z
The Z value of the vector component of the quaternion.
public float Z { readonly get; private set; }
Property Value
Zero
Gets a quaternion that represents a zero.
private static Quaternion Zero { get; }
Property Value
Methods
Equals(object)
Returns a value that indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object obj)
Parameters
obj
object-
The object to compare with the current instance.
Returns
- bool
-
true if the current instance and
obj
are equal; otherwise, false. Ifobj
is null, the method returns false.
Remarks
The current instance and obj
are equal if obj
is a
Alis.Core.Aspect.Math.Util.Quaternion object and the corresponding components of each matrix are equal.
Equals(Quaternion)
Returns a value that indicates whether this instance and another quaternion are equal.
private readonly bool Equals(Quaternion other)
Parameters
other
Quaternion-
The other quaternion.
Returns
Remarks
Two quaternions are equal if each of their corresponding components is equal.
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
-
The hash code.
ToString()
Returns a string that represents this quaternion.
public override readonly string ToString()
Returns
- string
-
The string representation of this quaternion.
Remarks
The numeric values in the returned string are formatted by using the conventions of the current culture. For
example, for the en-US culture, the returned string might appear as {X:1.1 Y:2.2 Z:3.3 W:4.4}
.
Operators
operator +(Quaternion, Quaternion)
Adds each element in one quaternion with its corresponding element in a second quaternion.
public static Quaternion operator +(Quaternion value1, Quaternion value2)
Parameters
value1
Quaternion-
The first quaternion.
value2
Quaternion-
The second quaternion.
Returns
- Quaternion
-
The quaternion that contains the summed values of
value1
andvalue2
.
Remarks
The Alis.Core.Aspect.Math.Util.Quaternion.op_Addition(Alis.Core.Aspect.Math.Util.Quaternion,Alis.Core.Aspect.Math.Util.Quaternion) method defines the operation of the addition operator for Alis.Core.Aspect.Math.Util.Quaternion objects.
operator /(Quaternion, Quaternion)
Divides one quaternion by a second quaternion.
public static Quaternion operator /(Quaternion value1, Quaternion value2)
Parameters
value1
Quaternion-
The dividend.
value2
Quaternion-
The divisor.
Returns
- Quaternion
-
The quaternion that results from dividing
value1
byvalue2
.
Remarks
The Alis.Core.Aspect.Math.Util.Quaternion.op_Division(Alis.Core.Aspect.Math.Util.Quaternion,Alis.Core.Aspect.Math.Util.Quaternion) method defines the division operation for Alis.Core.Aspect.Math.Util.Quaternion objects.
operator ==(Quaternion, Quaternion)
Returns a value that indicates whether two quaternions are equal.
public static bool operator ==(Quaternion value1, Quaternion value2)
Parameters
value1
Quaternion-
The first quaternion to compare.
value2
Quaternion-
The second quaternion to compare.
Returns
Remarks
Two quaternions are equal if each of their corresponding components is equal. The Alis.Core.Aspect.Math.Util.Quaternion.op_Equality(Alis.Core.Aspect.Math.Util.Quaternion,Alis.Core.Aspect.Math.Util.Quaternion) method defines the operation of the equality operator for Alis.Core.Aspect.Math.Util.Quaternion objects.
operator !=(Quaternion, Quaternion)
Returns a value that indicates whether two quaternions are not equal.
public static bool operator !=(Quaternion value1, Quaternion value2)
Parameters
value1
Quaternion-
The first quaternion to compare.
value2
Quaternion-
The second quaternion to compare.
Returns
operator *(Quaternion, Quaternion)
Returns the quaternion that results from multiplying two quaternions together.
public static Quaternion operator *(Quaternion value1, Quaternion value2)
Parameters
value1
Quaternion-
The first quaternion.
value2
Quaternion-
The second quaternion.
Returns
- Quaternion
-
The product quaternion.
operator *(Quaternion, float)
Returns the quaternion that results from scaling all the components of a specified quaternion by a scalar factor.
public static Quaternion operator *(Quaternion value1, float value2)
Parameters
value1
Quaternion-
The source quaternion.
value2
float-
The scalar value.
Returns
- Quaternion
-
The scaled quaternion.
operator -(Quaternion, Quaternion)
Subtracts each element in a second quaternion from its corresponding element in a first quaternion.
public static Quaternion operator -(Quaternion value1, Quaternion value2)
Parameters
value1
Quaternion-
The first quaternion.
value2
Quaternion-
The second quaternion.
Returns
- Quaternion
-
The quaternion containing the values that result from subtracting each element in
value2
from its corresponding element invalue1
.
Remarks
The Alis.Core.Aspect.Math.Util.Quaternion.op_Subtraction(Alis.Core.Aspect.Math.Util.Quaternion,Alis.Core.Aspect.Math.Util.Quaternion) method defines the operation of the subtraction operator for Alis.Core.Aspect.Math.Util.Quaternion objects.
operator -(Quaternion)
Reverses the sign of each component of the quaternion.
public static Quaternion operator -(Quaternion value)
Parameters
value
Quaternion-
The quaternion to negate.
Returns
- Quaternion
-
The negated quaternion.
Remarks
The Alis.Core.Aspect.Math.Util.Quaternion.op_UnaryNegation(Alis.Core.Aspect.Math.Util.Quaternion) method defines the operation of the unary negation operator for Alis.Core.Aspect.Math.Util.Quaternion objects.