-
Notifications
You must be signed in to change notification settings - Fork 283
Quaternion
Adrien GIVRY edited this page Sep 26, 2020
·
3 revisions
Mathematic representation of a Quaternion with float precision
- C++ related class:
OvMaths::FQuaternion
| Name | Type | Description |
|---|---|---|
| x | number |
X component of the Quaternion |
| y | number |
Y component of the Quaternion |
| z | number |
Z component of the Quaternion |
| w | number |
W component of the Quaternion |
| Name | Input | Output | Description |
|---|---|---|---|
| new | Quaternion |
Default Quaternion constructor (Creates an identity quaternion with 1 as w) | |
| new |
number: real |
Quaternion |
Creates an identity quaternion with a defined real value |
| new |
number: xnumber: ynumber: znumber: w |
Quaternion |
Creates a quaternion from a set of 4 floats (x, y, z, w) |
| Name | Input | Output | Description |
|---|---|---|---|
| IsIdentity |
Quaternion: instance |
boolean |
Returns true if the quaternion is Identity (x, y and z components are 0) |
| IsPure |
Quaternion: instance |
boolean |
Returns true if the quaternion is pure (w is 0) |
| IsNormalized |
Quaternion: instance |
boolean |
Returns true if the quaternion is nornalized |
| Dot |
Quaternion: aQuaternion: b |
number |
Calculates the dot product between two quaternions |
| Normalize |
Quaternion: instance |
Quaternion |
Returns the normalized version of the given quaternion |
| Length |
Quaternion: instance |
number |
Returns the length of the given quaternion |
| LengthSquare |
Quaternion: instance |
number |
Returns the squared length of the given quaternion. This function is faster than Quaternion.Length |
| GetAngle |
Quaternion: instance |
number |
Returns the angle of the given quaternion |
| GetRotationAxis |
Quaternion: instance |
Vector3 |
Returns the rotation axis of the given quaternion |
| Inverse |
Quaternion: instance |
Quaternion |
Returns the inverse of the quaternion |
| Conjugate |
Quaternion: instance |
Quaternion |
Returns the conjugate of the quaternion |
| Square |
Quaternion: instance |
Quaternion |
Returns the squared version of this quaternion |
| GetAxisAndAngle |
Quaternion: instance |
Vector3: axisnumber: angle |
Returns the axis and the angle of the given quaternion |
| AngularDistance |
Quaternion: aQuaternion: b |
number |
Returns the angle between two quaternions |
| Lerp |
Quaternion: aQuaternion: bnumber: t |
Quaternion |
Returns the linear interpolation of two quaternions based on the given interpolation coefficient |
| Slerp |
Quaternion: aQuaternion: bnumber: t |
Quaternion |
Returns the spherical linear interpolation of two quaternions based on the given interpolation coefficient |
| Nlerp |
Quaternion: aQuaternion: bnumber: t |
Quaternion |
Returns the nornmalized linear interpolation of two quaternions based on the given interpolation coefficient |
| RotatePoint |
Vector3: pointQuaternion: quaternionVector3: pivot |
Vector3 |
Rotates a point around a pivot using a quaternion |
| EulerAngles |
Quaternion: instance |
Vector |
Returns euler axis angles (In degrees) |
| ToMatrix3 |
Quaternion: instance |
Matrix3 |
Returns a rotation matrix (3x3) out of the given quaternion |
| ToMatrix4 |
Quaternion: instance |
Matrix4 |
Returns a rotation matrix (4x4) out of the given quaternion |
| Operation | Description |
|---|---|
Quaternion + Quaternion |
Adds two Quaternion |
Quaternion - Quaternion |
Substracts two Quaternion |
Quaternion * number |
Multiplies each components of a Quaternion by a number |
Quaternion * Vector3 |
Multiplies a Quaternion by a Vector3 |
Quaternion * Matrix3 |
Multiplies a Quaternion by a Matrix3 |
Quaternion / number |
Divides each component of a Quaternion by a number |
to_string(Quaternion) |
Converts a Quaternion to a string |
