Tizen Native API
5.0
|
The Quaternion class encapsulates the mathematics of the quaternion. More...
Public Member Functions | |
Quaternion () | |
Default Constructor. | |
Quaternion (float cosThetaBy2, float iBySineTheta, float jBySineTheta, float kBySineTheta) | |
Constructs from a quaternion represented by floats. | |
Quaternion (const Vector4 &vector) | |
Constructs from a quaternion represented by a vector. | |
Quaternion (Radian angle, const Vector3 &axis) | |
Constructor from an axis and angle. | |
Quaternion (Radian pitch, Radian yaw, Radian roll) | |
Constructs from Euler angles. | |
Quaternion (const Matrix &matrix) | |
Constructs from a matrix. | |
Quaternion (const Vector3 &xAxis, const Vector3 &yAxis, const Vector3 &zAxis) | |
Constructs from 3 orthonormal axes. | |
Quaternion (const Vector3 &v0, const Vector3 &v1) | |
Constructs quaternion which describes minimum rotation to align v0 with v1. | |
~Quaternion () | |
Destructor, nonvirtual as this is not a base class. | |
bool | IsIdentity () const |
Helper to check if this is an identity quaternion. | |
bool | ToAxisAngle (Vector3 &axis, Radian &angle) const |
Converts the quaternion to an axis/angle pair. | |
const Vector4 & | AsVector () const |
Returns the quaternion as a vector. | |
void | SetEuler (Radian pitch, Radian yaw, Radian roll) |
SetEuler sets the quaternion from the Euler angles applied in x, y, z order. | |
Vector4 | EulerAngles () const |
Returns the Euler angles from a rotation Quaternion. | |
const Quaternion | operator+ (const Quaternion &other) const |
Addition operator. | |
const Quaternion | operator- (const Quaternion &other) const |
Subtraction operator. | |
const Quaternion | operator* (const Quaternion &other) const |
Multiplication operator. | |
Vector3 | operator* (const Vector3 &other) const |
Multiplication operator. | |
const Quaternion | operator/ (const Quaternion &other) const |
Division operator. | |
const Quaternion | operator* (float scale) const |
Scale operator. | |
const Quaternion | operator/ (float scale) const |
Scale operator. | |
Quaternion | operator- () const |
Unary Negation operator. | |
const Quaternion & | operator+= (const Quaternion &other) |
Addition with Assignment operator. | |
const Quaternion & | operator-= (const Quaternion &other) |
Subtraction with Assignment operator. | |
const Quaternion & | operator*= (const Quaternion &other) |
Multiplication with Assignment operator. | |
const Quaternion & | operator*= (float scale) |
Scale with Assignment operator. | |
const Quaternion & | operator/= (float scale) |
Scale with Assignment operator. | |
bool | operator== (const Quaternion &rhs) const |
Equality operator. | |
bool | operator!= (const Quaternion &rhs) const |
Inequality operator. | |
float | Length () const |
Returns the length of the quaternion. | |
float | LengthSquared () const |
Returns the squared length of the quaternion. | |
void | Normalize () |
Normalizes this to unit length. | |
Quaternion | Normalized () const |
Normalized. | |
void | Conjugate () |
Conjugates this quaternion. | |
void | Invert () |
Inverts this quaternion. | |
Quaternion | Log () const |
Performs the logarithm of a Quaternion = v*a where q = (cos(a),v*sin(a)). | |
Quaternion | Exp () const |
Performs an exponent e^Quaternion = Exp(v*a) = (cos(a),vsin(a)). | |
Vector4 | Rotate (const Vector4 &vector) const |
Rotates v by this Quaternion (Quaternion must be unit). | |
Vector3 | Rotate (const Vector3 &vector) const |
Rotates v by this Quaternion (Quaternion must be unit). | |
Static Public Member Functions | |
static float | Dot (const Quaternion &q1, const Quaternion &q2) |
Returns the dot product of two quaternions. | |
static Quaternion | Lerp (const Quaternion &q1, const Quaternion &q2, float t) |
Linear Interpolation (using a straight line between the two quaternions). | |
static Quaternion | Slerp (const Quaternion &q1, const Quaternion &q2, float progress) |
Spherical Linear Interpolation (using the shortest arc of a great circle between the two quaternions). | |
static Quaternion | SlerpNoInvert (const Quaternion &q1, const Quaternion &q2, float t) |
This version of Slerp, used by Squad, does not check for theta > 90. | |
static Quaternion | Squad (const Quaternion &start, const Quaternion &end, const Quaternion &ctrl1, const Quaternion &ctrl2, float t) |
Spherical Cubic Interpolation. | |
static float | AngleBetween (const Quaternion &q1, const Quaternion &q2) |
Returns the shortest angle between two quaternions in Radians. | |
Public Attributes | |
Vector4 | mVector |
Static Public Attributes | |
static const Quaternion | IDENTITY |
(0.0f,0.0f,0.0f,1.0f) |
The Quaternion class encapsulates the mathematics of the quaternion.
Default Constructor.
Dali::Quaternion::Quaternion | ( | float | cosThetaBy2, |
float | iBySineTheta, | ||
float | jBySineTheta, | ||
float | kBySineTheta | ||
) |
Constructs from a quaternion represented by floats.
[in] | cosThetaBy2 | |
[in] | iBySineTheta | |
[in] | jBySineTheta | |
[in] | kBySineTheta |
Dali::Quaternion::Quaternion | ( | const Vector4 & | vector | ) | [explicit] |
Constructs from a quaternion represented by a vector.
[in] | vector | x,y,z fields represent i,j,k coefficients, w represents cos(theta/2) |
Dali::Quaternion::Quaternion | ( | Radian | angle, |
const Vector3 & | axis | ||
) |
Constructor from an axis and angle.
[in] | angle | The angle around the axis |
[in] | axis | The vector of the axis |
Dali::Quaternion::Quaternion | ( | Radian | pitch, |
Radian | yaw, | ||
Radian | roll | ||
) |
Constructs from Euler angles.
[in] | pitch | |
[in] | yaw | |
[in] | roll |
Dali::Quaternion::Quaternion | ( | const Matrix & | matrix | ) | [explicit] |
Constructs from a matrix.
[in] | matrix |
Dali::Quaternion::Quaternion | ( | const Vector3 & | xAxis, |
const Vector3 & | yAxis, | ||
const Vector3 & | zAxis | ||
) | [explicit] |
Constructs from 3 orthonormal axes.
[in] | xAxis | The X axis |
[in] | yAxis | The Y axis |
[in] | zAxis | The Z axis |
Dali::Quaternion::Quaternion | ( | const Vector3 & | v0, |
const Vector3 & | v1 | ||
) | [explicit] |
Constructs quaternion which describes minimum rotation to align v0 with v1.
[in] | v0 | First normalized vector |
[in] | v1 | Second normalized vector |
Destructor, nonvirtual as this is not a base class.
static float Dali::Quaternion::AngleBetween | ( | const Quaternion & | q1, |
const Quaternion & | q2 | ||
) | [static] |
Returns the shortest angle between two quaternions in Radians.
[in] | q1 | The first quaternion |
[in] | q2 | The second quaternion |
const Vector4& Dali::Quaternion::AsVector | ( | ) | const |
Returns the quaternion as a vector.
void Dali::Quaternion::Conjugate | ( | ) |
Conjugates this quaternion.
static float Dali::Quaternion::Dot | ( | const Quaternion & | q1, |
const Quaternion & | q2 | ||
) | [static] |
Returns the dot product of two quaternions.
[in] | q1 | The first quaternion |
[in] | q2 | The second quaternion |
Vector4 Dali::Quaternion::EulerAngles | ( | ) | const |
Returns the Euler angles from a rotation Quaternion.
Quaternion Dali::Quaternion::Exp | ( | ) | const |
Performs an exponent e^Quaternion = Exp(v*a) = (cos(a),vsin(a)).
void Dali::Quaternion::Invert | ( | ) |
Inverts this quaternion.
bool Dali::Quaternion::IsIdentity | ( | ) | const |
Helper to check if this is an identity quaternion.
float Dali::Quaternion::Length | ( | ) | const |
Returns the length of the quaternion.
float Dali::Quaternion::LengthSquared | ( | ) | const |
Returns the squared length of the quaternion.
static Quaternion Dali::Quaternion::Lerp | ( | const Quaternion & | q1, |
const Quaternion & | q2, | ||
float | t | ||
) | [static] |
Linear Interpolation (using a straight line between the two quaternions).
[in] | q1 | The start quaternion |
[in] | q2 | The end quaternion |
[in] | t | A progress value between 0 and 1 |
Quaternion Dali::Quaternion::Log | ( | ) | const |
Performs the logarithm of a Quaternion = v*a where q = (cos(a),v*sin(a)).
void Dali::Quaternion::Normalize | ( | ) |
Normalizes this to unit length.
Quaternion Dali::Quaternion::Normalized | ( | ) | const |
Normalized.
bool Dali::Quaternion::operator!= | ( | const Quaternion & | rhs | ) | const |
Inequality operator.
[in] | rhs | The quaternion to compare with |
const Quaternion Dali::Quaternion::operator* | ( | const Quaternion & | other | ) | const |
Multiplication operator.
[in] | other | The quaternion to multiply |
Multiplication operator.
[in] | other | The vector to multiply |
const Quaternion Dali::Quaternion::operator* | ( | float | scale | ) | const |
Scale operator.
[in] | scale | A value to scale by |
const Quaternion& Dali::Quaternion::operator*= | ( | const Quaternion & | other | ) |
Multiplication with Assignment operator.
[in] | other | The quaternion to multiply |
const Quaternion& Dali::Quaternion::operator*= | ( | float | scale | ) |
Scale with Assignment operator.
[in] | scale | the value to scale by |
const Quaternion Dali::Quaternion::operator+ | ( | const Quaternion & | other | ) | const |
Addition operator.
[in] | other | The quaternion to add |
const Quaternion& Dali::Quaternion::operator+= | ( | const Quaternion & | other | ) |
Addition with Assignment operator.
[in] | other | The quaternion to add |
const Quaternion Dali::Quaternion::operator- | ( | const Quaternion & | other | ) | const |
Subtraction operator.
[in] | other | The quaternion to subtract |
Quaternion Dali::Quaternion::operator- | ( | ) | const |
Unary Negation operator.
const Quaternion& Dali::Quaternion::operator-= | ( | const Quaternion & | other | ) |
Subtraction with Assignment operator.
[in] | other | The quaternion to subtract |
const Quaternion Dali::Quaternion::operator/ | ( | const Quaternion & | other | ) | const |
Division operator.
[in] | other | A quaternion to divide by |
const Quaternion Dali::Quaternion::operator/ | ( | float | scale | ) | const |
Scale operator.
[in] | scale | A value to scale by |
const Quaternion& Dali::Quaternion::operator/= | ( | float | scale | ) |
Scale with Assignment operator.
[in] | scale | The value to scale by |
bool Dali::Quaternion::operator== | ( | const Quaternion & | rhs | ) | const |
Equality operator.
[in] | rhs | The quaternion to compare with |
Vector4 Dali::Quaternion::Rotate | ( | const Vector4 & | vector | ) | const |
Rotates v by this Quaternion (Quaternion must be unit).
[in] | vector | A vector to rotate |
Vector3 Dali::Quaternion::Rotate | ( | const Vector3 & | vector | ) | const |
Rotates v by this Quaternion (Quaternion must be unit).
[in] | vector | A vector to rotate |
void Dali::Quaternion::SetEuler | ( | Radian | pitch, |
Radian | yaw, | ||
Radian | roll | ||
) |
SetEuler sets the quaternion from the Euler angles applied in x, y, z order.
[in] | pitch | |
[in] | yaw | |
[in] | roll |
static Quaternion Dali::Quaternion::Slerp | ( | const Quaternion & | q1, |
const Quaternion & | q2, | ||
float | progress | ||
) | [static] |
Spherical Linear Interpolation (using the shortest arc of a great circle between the two quaternions).
[in] | q1 | The start quaternion |
[in] | q2 | The end quaternion |
[in] | progress | A progress value between 0 and 1 |
static Quaternion Dali::Quaternion::SlerpNoInvert | ( | const Quaternion & | q1, |
const Quaternion & | q2, | ||
float | t | ||
) | [static] |
This version of Slerp, used by Squad, does not check for theta > 90.
[in] | q1 | The start quaternion |
[in] | q2 | The end quaternion |
[in] | t | A progress value between 0 and 1 |
static Quaternion Dali::Quaternion::Squad | ( | const Quaternion & | start, |
const Quaternion & | end, | ||
const Quaternion & | ctrl1, | ||
const Quaternion & | ctrl2, | ||
float | t | ||
) | [static] |
Spherical Cubic Interpolation.
[in] | start | The start quaternion |
[in] | end | The end quaternion |
[in] | ctrl1 | The control quaternion for q1 |
[in] | ctrl2 | The control quaternion for q2 |
[in] | t | A progress value between 0 and 1 |
bool Dali::Quaternion::ToAxisAngle | ( | Vector3 & | axis, |
Radian & | angle | ||
) | const |
Converts the quaternion to an axis/angle pair.
[out] | axis | |
[out] | angle | Angle in radians |
w component is s ( = cos(theta/2.0) )