Quaternion Structure |
Defines a four dimensional mathematical Quaternion.
A default constructed one is Zero.
You are unlikely to ever directly construct one, you'd use one of the static methods returning a Quaternion, e.g. RotationAxis(Vector3, Double)
[SerializableAttribute] public struct Quaternion : IEquatable<Quaternion>
The Quaternion type exposes the following members.
| Name | Description | |
|---|---|---|
| Quaternion(Quaternion) | Initializes a new instance of the Quaternion struct. | |
| Quaternion(Vector2) | Initializes a new instance of the Quaternion struct. | |
| Quaternion(Vector3) | Initializes a new instance of the Quaternion struct. | |
| Quaternion(Vector3, Double) | Initializes a new instance of the Quaternion struct. | |
| Quaternion(Double, Double, Double, Double) | Initializes a new instance of the Quaternion struct. |
| Name | Description | |
|---|---|---|
| Angle | Extract the rotation angle from Quaternion | |
| AngleD | Extract the rotation angle from Quaternion | |
| Axis | Extract the rotation axis from Quaternion | |
| Conjugated | Quaternion conjugation | |
| Identity | The "Identity" Quaternion representing no rotation. | |
| Inverted | Quaternion inversion | |
| Normalized | Quaternion normalization - make its length be 1 | |
| Zero | A Quaternion with all of its components set to zero. |
| Name | Description | |
|---|---|---|
| Add(Quaternion) | Quaternion addition | |
| Add(Quaternion, Quaternion) | Quaternion addition | |
| Conjugate | Quaternion conjugation | |
| Conjugate(Quaternion) | Quaternion conjugation | |
| Dot(Quaternion) | Dot product of two Quaternions | |
| Dot(Quaternion, Quaternion) | Dot product of two Quaternions | |
| DotD(Quaternion) | Dot product of two Quaternions | |
| DotD(Quaternion, Quaternion) | Dot product of two Quaternions | |
| Equals(Object) | Quaternion exact equality - see EQ(Quaternion, Quaternion) for alternative
(Overrides ValueTypeEquals(Object)) | |
| Equals(Quaternion) | Quaternion exact equality - see EQ(Quaternion, Quaternion) for alternative | |
| GetHashCode |
Returns the hash code for the current Quaternion.
(Overrides ValueTypeGetHashCode) | |
| Invert | Quaternion inversion | |
| Invert(Quaternion) | Quaternion inversion | |
| Length | Length of Quaternion | |
| Length(Quaternion) | Length of Quaternion | |
| LengthD | Length of Quaternion | |
| LengthD(Quaternion) | Length of Quaternion | |
| LengthSq | Length squared of Quaternion | |
| LengthSq(Quaternion) | Length squared of Quaternion | |
| LengthSqD | Length squared of Quaternion | |
| LengthSqD(Quaternion) | Length squared of Quaternion | |
| Multiply(Quaternion) | Quaternion multiplication | |
| Multiply(Quaternion, Quaternion) | Quaternion multiplication | |
| Negate | Quaternion in-place negation. | |
| Normalize | Quaternion normalization - make its length be 1 | |
| Normalize(Quaternion) | Quaternion normalization - make its length be 1 | |
| RotationAxis | Form a rotation Quaternion rotating about given axis | |
| RotationAxisDegrees | Form a rotation Quaternion rotating about given axis | |
| RotationMatrix | Create a rotation Quaternion from a rotation Matrix | |
| RotationX | Form a rotation Quaternion rotating about the X-Axis | |
| RotationXDegrees | Form a rotation Quaternion rotating about the X-Axis | |
| RotationY | Form a rotation Quaternion rotating about the Y-Axis | |
| RotationYawPitchRoll | Form a rotation Quaternion from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation) | |
| RotationYawPitchRollDegrees | Form a rotation Quaternion from Yaw (Y-Axis rotation), Pitch (X-Axis rotation) and Roll (Z-Axis rotation) | |
| RotationYDegrees | Form a rotation Quaternion rotating about the Y-Axis | |
| RotationZ | Form a rotation Quaternion rotating about the Z-Axis | |
| RotationZDegrees | Form a rotation Quaternion rotating about the Z-Axis | |
| Slerp(Quaternion, Double) |
Spherical interpolation between this Quaternion and another Quaternion This is most commonly used to find an intermediate rotation between between a start and an end rotation. When t = 0 returns this. When t = 1 returns b. When t = 0.5 returns a rotation "midway" between this and b. | |
| Slerp(Quaternion, Quaternion, Double) |
Spherical interpolation between two Quaternions
This is most commonly used to find an intermediate rotation between between a start and an end rotation. When t = 0 returns a. When t = 1 returns b. When t = 0.5 returns a rotation "midway" between a and b. | |
| Subtract(Quaternion) | Quaternion subtraction | |
| Subtract(Quaternion, Quaternion) | Quaternion subtraction | |
| ToAxisAngle(Quaternion, Vector3, Double) | Extract axis and angle from Quaternion | |
| ToAxisAngle(Quaternion, Vector3, Single) | Extract axis and angle from Quaternion | |
| ToString |
Returns a string that represents the current Quaternion.
(Overrides ValueTypeToString) | |
| TransformNormal(Vector2) | Transform Vector2 normal by this Quaternion | |
| TransformNormal(Vector3) | Transform Vector3 normal by this Quaternion |
| Name | Description | |
|---|---|---|
| Addition(Quaternion, Quaternion) | Quaternion addition | |
| Equality(Quaternion, Quaternion) | Quaternion exact equality - see EQ(Quaternion, Quaternion) for alternative | |
| Inequality(Quaternion, Quaternion) | Quaternion exact inequality - see EQ(Quaternion, Quaternion) for alternative | |
| Multiply(Quaternion, Quaternion) | Quaternion multiplication | |
| Subtraction(Quaternion, Quaternion) | Quaternion subtraction | |
| UnaryNegation(Quaternion) | Quaternion unary negation |
| Name | Description | |
|---|---|---|
| RotationX0 | Equivalent to Identity | |
| RotationX180 | Precomputed rotation Quaternion of 180 degrees (or -180 degrees) about the X-Axis | |
| RotationX270 | Precomputed rotation Quaternion of 270 degrees (or -90 degrees) about the X-Axis | |
| RotationX360 | Equivalent to -Identity | |
| RotationX90 | Precomputed rotation Quaternion of 90 degrees (or -270 degrees) about the X-Axis | |
| RotationY0 | Equivalent to Identity | |
| RotationY180 | Precomputed rotation Quaternion of 180 degrees (or -180 degrees) about the Y-Axis | |
| RotationY270 | Precomputed rotation Quaternion of 270 degrees (or -90 degrees) about the Y-Axis | |
| RotationY360 | Equivalent to -Identity | |
| RotationY90 | Precomputed rotation Quaternion of 90 degrees (or -270 degrees) about the Y-Axis | |
| RotationZ0 | Equivalent to Identity | |
| RotationZ180 | Precomputed rotation Quaternion of 180 degrees (or -180 degrees) about the Z-Axis | |
| RotationZ270 | Precomputed rotation Quaternion of 270 degrees (or -90 degrees) about the Z-Axis | |
| RotationZ360 | Equivalent to -Identity | |
| RotationZ90 | Precomputed rotation Quaternion of 90 degrees (or -270 degrees) about the Z-Axis |