Untold Engine
Beta v0.0.16
docs
|
The U4DQuaternion class is responsible for implementing Quaternion operations in the engine. These operations include: Quaternion addition, subtraction, multiplication, normalization, etc. More...
Public Member Functions | |
U4DQuaternion () | |
Default Constructor which creates a Real Quaternion. That is, it creates a quaternion with a scalar equal to 1.0 and a zero vector. | |
U4DQuaternion (float uS, U4DVector3n &uV) | |
Quaternion constructor which creates a quaternion with given scalar and vector component. | |
~U4DQuaternion () | |
Default quaternion destructor. | |
U4DQuaternion (const U4DQuaternion &value) | |
Quaternion Copy Constructor. More... | |
U4DQuaternion & | operator= (const U4DQuaternion &value) |
Quaternion Copy Constructor. More... | |
void | operator+= (const U4DQuaternion &q) |
Method which adds two quaternions. More... | |
U4DQuaternion | operator+ (const U4DQuaternion &q) const |
Method which adds two quaternions. More... | |
void | operator-= (const U4DQuaternion &q) |
Method which subtracts two quaternions. More... | |
U4DQuaternion | operator- (const U4DQuaternion &q) const |
Method which subtracts two quaternions. More... | |
void | operator*= (const U4DQuaternion &q) |
Method which multiplies two quaternions. More... | |
U4DQuaternion | operator* (const U4DQuaternion &q) const |
Method which multiplies two quaternions. More... | |
U4DQuaternion | multiply (const U4DQuaternion &q) const |
Method which multiplies two quaternions. More... | |
U4DQuaternion | operator* (const U4DVector3n &uValue) const |
Method which multiplies a quaternion times a 3D vector. More... | |
float | dot (U4DQuaternion &q) |
Method which computes the dot product between two quaternions. More... | |
void | operator*= (const float value) |
Method which computes the multiplication between a quaternion and scalar. More... | |
U4DQuaternion | operator* (const float value) const |
Method which computes the multiplication between a quaternion and scalar. More... | |
float | norm () |
Method which computes the norm of the quaternion. More... | |
void | normalize () |
Method which normalizes the quaternion. | |
U4DQuaternion | conjugate () |
Method which computes the conjugate of the quaternion. More... | |
U4DQuaternion | inverse () |
Method which computes the inverse of the quaternion. More... | |
void | inverse (U4DQuaternion &q) |
Method which computes the inverse of the quaternion. More... | |
void | convertToUnitNormQuaternion () |
Method which converts the quaternion into a Unit-Norm quaternion. | |
U4DMatrix3n | transformQuaternionToMatrix3n () |
Method that computes the 3x3 matrix representation of the quaternion. More... | |
void | transformEulerAnglesToQuaternion (float x, float y, float z) |
Method that computes a quaternion representation from an Euler angle. More... | |
U4DVector3n | transformQuaternionToEulerAngles () |
Method which computes a quaternion to its Euler angle representation. More... | |
void | transformMatrix3nToQuaternion (U4DMatrix3n &uMatrix) |
Method that computes a quaternion from its 3x3 matrix representation. More... | |
U4DQuaternion | slerp (U4DQuaternion &q, float time) |
Method that computes the slerp of a quaternion. More... | |
void | show () |
Method which prints the quaternion components to the window console log. | |
Public Attributes | |
float | s |
Scalar component of quaternion. | |
U4DVector3n | v |
Vector component of quaternion. | |
The U4DQuaternion class is responsible for implementing Quaternion operations in the engine. These operations include: Quaternion addition, subtraction, multiplication, normalization, etc.
U4DEngine::U4DQuaternion::U4DQuaternion | ( | const U4DQuaternion & | value | ) |
Quaternion Copy Constructor.
value | Quaternion to copy |
U4DQuaternion U4DEngine::U4DQuaternion::conjugate | ( | ) |
Method which computes the conjugate of the quaternion.
float U4DEngine::U4DQuaternion::dot | ( | U4DQuaternion & | q | ) |
Method which computes the dot product between two quaternions.
q | Quaternion to compute the dot product with |
U4DQuaternion U4DEngine::U4DQuaternion::inverse | ( | ) |
Method which computes the inverse of the quaternion.
void U4DEngine::U4DQuaternion::inverse | ( | U4DQuaternion & | q | ) |
Method which computes the inverse of the quaternion.
q | Quaternion to compute the inverse |
U4DQuaternion U4DEngine::U4DQuaternion::multiply | ( | const U4DQuaternion & | q | ) | const |
Method which multiplies two quaternions.
q | Quaternion to multiply |
float U4DEngine::U4DQuaternion::norm | ( | ) |
Method which computes the norm of the quaternion.
U4DQuaternion U4DEngine::U4DQuaternion::operator* | ( | const float | value | ) | const |
Method which computes the multiplication between a quaternion and scalar.
value | Scalar to multiply the quaternion |
U4DQuaternion U4DEngine::U4DQuaternion::operator* | ( | const U4DQuaternion & | q | ) | const |
Method which multiplies two quaternions.
q | Quaternion to multiply |
U4DQuaternion U4DEngine::U4DQuaternion::operator* | ( | const U4DVector3n & | uValue | ) | const |
Method which multiplies a quaternion times a 3D vector.
uValue | 3D vector to multiply |
void U4DEngine::U4DQuaternion::operator*= | ( | const float | value | ) |
Method which computes the multiplication between a quaternion and scalar.
value | Scalar to multiply the quaternion |
void U4DEngine::U4DQuaternion::operator*= | ( | const U4DQuaternion & | q | ) |
Method which multiplies two quaternions.
q | Quaternion to multiply |
U4DQuaternion U4DEngine::U4DQuaternion::operator+ | ( | const U4DQuaternion & | q | ) | const |
Method which adds two quaternions.
q | Quaternion to add |
void U4DEngine::U4DQuaternion::operator+= | ( | const U4DQuaternion & | q | ) |
Method which adds two quaternions.
q | Quaternion to add |
U4DQuaternion U4DEngine::U4DQuaternion::operator- | ( | const U4DQuaternion & | q | ) | const |
Method which subtracts two quaternions.
q | Quaternion to subtract |
void U4DEngine::U4DQuaternion::operator-= | ( | const U4DQuaternion & | q | ) |
Method which subtracts two quaternions.
q | Quaternion to subtract |
U4DQuaternion & U4DEngine::U4DQuaternion::operator= | ( | const U4DQuaternion & | value | ) |
Quaternion Copy Constructor.
value | Quaternion to copy |
U4DQuaternion U4DEngine::U4DQuaternion::slerp | ( | U4DQuaternion & | q, |
float | time | ||
) |
Method that computes the slerp of a quaternion.
U4DQuaternion&q | Quaternion to compute the slerp |
time | Time value |
void U4DEngine::U4DQuaternion::transformEulerAnglesToQuaternion | ( | float | x, |
float | y, | ||
float | z | ||
) |
Method that computes a quaternion representation from an Euler angle.
x | The x component of the euler angle |
y | The y component of the euler angle |
z | The z component of the euler angle |
void U4DEngine::U4DQuaternion::transformMatrix3nToQuaternion | ( | U4DMatrix3n & | uMatrix | ) |
Method that computes a quaternion from its 3x3 matrix representation.
uMatrix | 3x3 matrix to convert |
U4DVector3n U4DEngine::U4DQuaternion::transformQuaternionToEulerAngles | ( | ) |
Method which computes a quaternion to its Euler angle representation.
U4DMatrix3n U4DEngine::U4DQuaternion::transformQuaternionToMatrix3n | ( | ) |
Method that computes the 3x3 matrix representation of the quaternion.
You need to convert the quaternion to a Unit Norm quaternion before using this method.