The Open Toolkit library
1.0
|
Represents a Quaternion. More...
Inherits IEquatable< Quaternion >.
Public Member Functions | |
Quaternion (Vector3 v, float w) | |
Construct a new Quaternion from vector and w components More... | |
Quaternion (float x, float y, float z, float w) | |
Construct a new Quaternion More... | |
void | ToAxisAngle (out Vector3 axis, out float angle) |
Convert the current quaternion to axis angle representation More... | |
Vector4 | ToAxisAngle () |
Convert this instance to an axis-angle representation. More... | |
Quaternion | Normalized () |
Returns a copy of the Quaternion scaled to unit length. More... | |
void | Invert () |
Reverses the rotation angle of this Quaterniond. More... | |
Quaternion | Inverted () |
Returns a copy of this Quaterniond with its rotation angle reversed. More... | |
void | Normalize () |
Scales the Quaternion to unit length. More... | |
void | Conjugate () |
Inverts the Vector3 component of this Quaternion. More... | |
override string | ToString () |
Returns a System.String that represents the current Quaternion. More... | |
override bool | Equals (object other) |
Compares this object instance to another object for equality. More... | |
override int | GetHashCode () |
Provides the hash code for this object. More... | |
bool | Equals (Quaternion other) |
Compares this Quaternion instance to another Quaternion for equality. More... | |
Static Public Member Functions | |
static Quaternion | Add (Quaternion left, Quaternion right) |
Add two quaternions More... | |
static void | Add (ref Quaternion left, ref Quaternion right, out Quaternion result) |
Add two quaternions More... | |
static Quaternion | Sub (Quaternion left, Quaternion right) |
Subtracts two instances. More... | |
static void | Sub (ref Quaternion left, ref Quaternion right, out Quaternion result) |
Subtracts two instances. More... | |
static Quaternion | Mult (Quaternion left, Quaternion right) |
Multiplies two instances. More... | |
static void | Mult (ref Quaternion left, ref Quaternion right, out Quaternion result) |
Multiplies two instances. More... | |
static Quaternion | Multiply (Quaternion left, Quaternion right) |
Multiplies two instances. More... | |
static void | Multiply (ref Quaternion left, ref Quaternion right, out Quaternion result) |
Multiplies two instances. More... | |
static void | Multiply (ref Quaternion quaternion, float scale, out Quaternion result) |
Multiplies an instance by a scalar. More... | |
static Quaternion | Multiply (Quaternion quaternion, float scale) |
Multiplies an instance by a scalar. More... | |
static Quaternion | Conjugate (Quaternion q) |
Get the conjugate of the given quaternion More... | |
static void | Conjugate (ref Quaternion q, out Quaternion result) |
Get the conjugate of the given quaternion More... | |
static Quaternion | Invert (Quaternion q) |
Get the inverse of the given quaternion More... | |
static void | Invert (ref Quaternion q, out Quaternion result) |
Get the inverse of the given quaternion More... | |
static Quaternion | Normalize (Quaternion q) |
Scale the given quaternion to unit length More... | |
static void | Normalize (ref Quaternion q, out Quaternion result) |
Scale the given quaternion to unit length More... | |
static Quaternion | FromAxisAngle (Vector3 axis, float angle) |
Build a quaternion from the given axis and angle More... | |
static Quaternion | FromMatrix (Matrix3 matrix) |
Builds a quaternion from the given rotation matrix More... | |
static void | FromMatrix (ref Matrix3 matrix, out Quaternion result) |
Builds a quaternion from the given rotation matrix More... | |
static Quaternion | Slerp (Quaternion q1, Quaternion q2, float blend) |
Do Spherical linear interpolation between two quaternions More... | |
static Quaternion | operator+ (Quaternion left, Quaternion right) |
Adds two instances. More... | |
static Quaternion | operator- (Quaternion left, Quaternion right) |
Subtracts two instances. More... | |
static Quaternion | operator* (Quaternion left, Quaternion right) |
Multiplies two instances. More... | |
static Quaternion | operator* (Quaternion quaternion, float scale) |
Multiplies an instance by a scalar. More... | |
static Quaternion | operator* (float scale, Quaternion quaternion) |
Multiplies an instance by a scalar. More... | |
static bool | operator== (Quaternion left, Quaternion right) |
Compares two instances for equality. More... | |
static bool | operator!= (Quaternion left, Quaternion right) |
Compares two instances for inequality. More... | |
Public Attributes | |
Vector3 | xyz |
float | w |
Static Public Attributes | |
static readonly Quaternion | Identity = new Quaternion(0, 0, 0, 1) |
Defines the identity quaternion. More... | |
Properties | |
Vector3 | XYZ [get, set] |
Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance. More... | |
Vector3 | Xyz [get, set] |
Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance. More... | |
float | X [get, set] |
Gets or sets the X component of this instance. More... | |
float | Y [get, set] |
Gets or sets the Y component of this instance. More... | |
float | Z [get, set] |
Gets or sets the Z component of this instance. More... | |
float | W [get, set] |
Gets or sets the W component of this instance. More... | |
float | Length [get] |
Gets the length (magnitude) of the quaternion. More... | |
float | LengthSquared [get] |
Gets the square of the quaternion length (magnitude). More... | |
Represents a Quaternion.
OpenTK.Quaternion.Quaternion | ( | Vector3 | v, |
float | w | ||
) |
Construct a new Quaternion from vector and w components
v | The vector part |
w | The w part |
OpenTK.Quaternion.Quaternion | ( | float | x, |
float | y, | ||
float | z, | ||
float | w | ||
) |
Construct a new Quaternion
x | The x component |
y | The y component |
z | The z component |
w | The w component |
|
static |
Add two quaternions
left | The first operand |
right | The second operand |
|
static |
Add two quaternions
left | The first operand |
right | The second operand |
result | The result of the addition |
void OpenTK.Quaternion.Conjugate | ( | ) |
Inverts the Vector3 component of this Quaternion.
|
static |
Get the conjugate of the given quaternion
q | The quaternion |
|
static |
Get the conjugate of the given quaternion
q | The quaternion |
result | The conjugate of the given quaternion |
override bool OpenTK.Quaternion.Equals | ( | object | other | ) |
Compares this object instance to another object for equality.
other | The other object to be used in the comparison. |
bool OpenTK.Quaternion.Equals | ( | Quaternion | other | ) |
Compares this Quaternion instance to another Quaternion for equality.
other | The other Quaternion to be used in the comparison. |
|
static |
Build a quaternion from the given axis and angle
axis | The axis to rotate about |
angle | The rotation angle in radians |
|
static |
Builds a quaternion from the given rotation matrix
matrix | A rotation matrix |
|
static |
Builds a quaternion from the given rotation matrix
matrix | A rotation matrix |
result | The equivalent quaternion |
override int OpenTK.Quaternion.GetHashCode | ( | ) |
Provides the hash code for this object.
void OpenTK.Quaternion.Invert | ( | ) |
Reverses the rotation angle of this Quaterniond.
|
static |
Get the inverse of the given quaternion
q | The quaternion to invert |
|
static |
Get the inverse of the given quaternion
q | The quaternion to invert |
result | The inverse of the given quaternion |
Quaternion OpenTK.Quaternion.Inverted | ( | ) |
Returns a copy of this Quaterniond with its rotation angle reversed.
|
static |
Multiplies two instances.
left | The first instance. |
right | The second instance. |
|
static |
Multiplies two instances.
left | The first instance. |
right | The second instance. |
result | A new instance containing the result of the calculation. |
|
static |
Multiplies two instances.
left | The first instance. |
right | The second instance. |
|
static |
Multiplies two instances.
left | The first instance. |
right | The second instance. |
result | A new instance containing the result of the calculation. |
|
static |
Multiplies an instance by a scalar.
quaternion | The instance. |
scale | The scalar. |
result | A new instance containing the result of the calculation. |
|
static |
Multiplies an instance by a scalar.
quaternion | The instance. |
scale | The scalar. |
void OpenTK.Quaternion.Normalize | ( | ) |
Scales the Quaternion to unit length.
|
static |
Scale the given quaternion to unit length
q | The quaternion to normalize |
|
static |
Scale the given quaternion to unit length
q | The quaternion to normalize |
result | The normalized quaternion |
Quaternion OpenTK.Quaternion.Normalized | ( | ) |
Returns a copy of the Quaternion scaled to unit length.
|
static |
Compares two instances for inequality.
left | The first instance. |
right | The second instance. |
|
static |
Multiplies two instances.
left | The first instance. |
right | The second instance. |
|
static |
Multiplies an instance by a scalar.
quaternion | The instance. |
scale | The scalar. |
|
static |
Multiplies an instance by a scalar.
quaternion | The instance. |
scale | The scalar. |
|
static |
Adds two instances.
left | The first instance. |
right | The second instance. |
|
static |
Subtracts two instances.
left | The first instance. |
right | The second instance. |
|
static |
Compares two instances for equality.
left | The first instance. |
right | The second instance. |
|
static |
Do Spherical linear interpolation between two quaternions
q1 | The first quaternion |
q2 | The second quaternion |
blend | The blend factor |
|
static |
Subtracts two instances.
left | The left instance. |
right | The right instance. |
|
static |
Subtracts two instances.
left | The left instance. |
right | The right instance. |
result | The result of the operation. |
void OpenTK.Quaternion.ToAxisAngle | ( | out Vector3 | axis, |
out float | angle | ||
) |
Convert the current quaternion to axis angle representation
axis | The resultant axis |
angle | The resultant angle |
Vector4 OpenTK.Quaternion.ToAxisAngle | ( | ) |
Convert this instance to an axis-angle representation.
override string OpenTK.Quaternion.ToString | ( | ) |
Returns a System.String that represents the current Quaternion.
|
static |
Defines the identity quaternion.
|
get |
Gets the length (magnitude) of the quaternion.
|
get |
Gets the square of the quaternion length (magnitude).
|
getset |
Gets or sets the W component of this instance.
|
getset |
Gets or sets the X component of this instance.
|
getset |
Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance.
|
getset |
Gets or sets an OpenTK.Vector3 with the X, Y and Z components of this instance.
|
getset |
Gets or sets the Y component of this instance.
|
getset |
Gets or sets the Z component of this instance.