PixelLightAPI
.
|
#include <Quaternion.h>
Public Types | |
enum | Component { W = 0, X = 1, Y = 2, Z = 3 } |
Component. More... | |
Public Member Functions | |
Quaternion () | |
Default constructor setting an identity quaternion. | |
Quaternion (float fW, float fX, float fY, float fZ) | |
Quaternion (const float fQ[]) | |
Quaternion (const Quaternion &qQ) | |
Quaternion (const Vector3 &vAxis, float fAngle) | |
PLMATH_API | Quaternion (const Matrix3x3 &mRot) |
PLMATH_API | Quaternion (const Matrix3x4 &mRot) |
PLMATH_API | Quaternion (const Matrix4x4 &mRot) |
~Quaternion () | |
Quaternion | operator+ (const Quaternion &qQ) const |
Quaternion & | operator+= (const Quaternion &qQ) |
Quaternion | operator- () const |
Quaternion | operator- (const Quaternion &qQ) const |
Quaternion & | operator-= (const Quaternion &qQ) |
Quaternion | operator* (float f) const |
Quaternion & | operator*= (float f) |
Quaternion | operator* (const Quaternion &qQ) const |
Quaternion & | operator*= (const Quaternion &qQ) |
Vector3 | operator* (const Vector3 &vV) const |
Vector4 | operator* (const Vector4 &vV) const |
Quaternion | operator/ (float f) const |
Quaternion & | operator/= (float f) |
Quaternion & | operator= (const Quaternion &qQ) |
bool | operator== (const Quaternion &qQ) const |
bool | operator!= (const Quaternion &qQ) const |
operator float * () | |
operator const float * () const | |
Quaternion & | SetWXYZ (float fW, float fX, float fY, float fZ) |
Sets the component of the quaternion. | |
Quaternion & | SetWXYZ (const float fValues[]) |
Sets the component of the quaternion. | |
PLMATH_API void | ToAxisAngle (float &fX, float &fY, float &fZ, float &fAngle) const |
Returns a selected axis and angle from the rotation quaternion. | |
PLMATH_API Quaternion & | FromAxisAngle (float fX, float fY, float fZ, float fAngle) |
Sets a rotation quaternion by using a selected axis and angle. | |
PLMATH_API Vector3 | GetXAxis () const |
Returns the x (left) axis. | |
PLMATH_API Vector3 | GetYAxis () const |
Returns the y (up) axis. | |
PLMATH_API Vector3 | GetZAxis () const |
Returns the z (forward) axis. | |
PLMATH_API void | ToRotationMatrix (Matrix3x3 &mRot) const |
Returns the rotation quaternion as 3x3 matrix. | |
PLMATH_API Quaternion & | FromRotationMatrix (const Matrix3x3 &mRot) |
Sets a rotation quaternion by using a 3x3 rotation matrix. | |
PLMATH_API void | ToRotationMatrix (Matrix3x4 &mRot) const |
Returns the rotation quaternion as 3x4 matrix. | |
PLMATH_API Quaternion & | FromRotationMatrix (const Matrix3x4 &mRot) |
Sets a rotation quaternion by using a 3x4 rotation matrix. | |
PLMATH_API void | ToRotationMatrix (Matrix4x4 &mRot) const |
Returns the rotation quaternion as 4x4 matrix. | |
PLMATH_API Quaternion & | FromRotationMatrix (const Matrix4x4 &mRot) |
Sets a rotation quaternion by using a 4x4 rotation matrix. | |
bool | Compare (const Quaternion &qQ, float fEpsilon=Math::Epsilon) const |
Compares two quaternions using an epsilon environment. | |
float | GetLength () const |
Returns the length (also called magnitude) of the quaternion. | |
float | GetSquaredLength () const |
Returns the squared length (norm) of the quaternion. | |
float | DotProduct (const Quaternion &qQ) const |
Returns the dot product of this quaternion and another one. | |
Quaternion & | Normalize () |
Normalizes the quaternion. | |
Quaternion | GetNormalized () const |
Returns a normalized quaternion. | |
void | Conjugate () |
Conjugates the quaternion. | |
Quaternion | GetConjugated () const |
Returns the conjugated of the quaternion. | |
void | Invert () |
Inverts the quaternion. | |
Quaternion | GetInverted () const |
Returns the inverted quaternion. | |
void | UnitInvert () |
Inverts the normalized quaternion. | |
Quaternion | GetUnitInverted () const |
Returns the inverted normalized quaternion. | |
Quaternion & | Exp () |
Calculates the exponential of the quaternion. | |
Quaternion | GetExp () const |
Returns the exponential of the quaternion. | |
Quaternion & | Log () |
Quaternion | GetLog () const |
Quaternion & | Power (float fPower) |
Calculates the power of the quaternion. | |
Quaternion | GetPower (float fPower) const |
Returns the power of the quaternion. | |
PLMATH_API void | Slerp (const Quaternion &qQ1, const Quaternion &qQ2, float fTime) |
Computes spherical linear interpolation between qQ1 and qQ2 with time 0-1. | |
PLMATH_API PLCore::String | ToString () const |
To string. | |
PLMATH_API bool | FromString (const PLCore::String &sString) |
From string. | |
Public Attributes | |
union { | |
float fQ [4] | |
struct { | |
float w | |
float x | |
float y | |
float z | |
} | |
}; | |
Some direct quaternion element accesses. | |
Static Public Attributes | |
static PLMATH_API const Quaternion | Zero |
static PLMATH_API const Quaternion | Identity |
PLMath::Quaternion::Quaternion | ( | ) | [inline] |
Default constructor setting an identity quaternion.
PLMath::Quaternion::Quaternion | ( | float | fW, |
float | fX, | ||
float | fY, | ||
float | fZ | ||
) | [inline] |
PLMath::Quaternion::Quaternion | ( | const float | fQ[] | ) | [inline] |
PLMath::Quaternion::Quaternion | ( | const Quaternion & | ) | [inline] |
PLMath::Quaternion::Quaternion | ( | const Vector3 & | vAxis, |
float | fAngle | ||
) | [inline] |
PLMATH_API PLMath::Quaternion::Quaternion | ( | const Matrix3x3 & | mRot | ) |
PLMATH_API PLMath::Quaternion::Quaternion | ( | const Matrix3x4 & | mRot | ) |
PLMATH_API PLMath::Quaternion::Quaternion | ( | const Matrix4x4 & | mRot | ) |
PLMath::Quaternion::~Quaternion | ( | ) | [inline] |
Quaternion PLMath::Quaternion::operator+ | ( | const Quaternion & | ) | const [inline] |
Quaternion & PLMath::Quaternion::operator+= | ( | const Quaternion & | ) | [inline] |
Quaternion PLMath::Quaternion::operator- | ( | ) | const [inline] |
Quaternion PLMath::Quaternion::operator- | ( | const Quaternion & | ) | const [inline] |
Quaternion & PLMath::Quaternion::operator-= | ( | const Quaternion & | ) | [inline] |
Quaternion PLMath::Quaternion::operator* | ( | float | f | ) | const [inline] |
Quaternion & PLMath::Quaternion::operator*= | ( | float | f | ) | [inline] |
Quaternion PLMath::Quaternion::operator* | ( | const Quaternion & | ) | const [inline] |
Quaternion & PLMath::Quaternion::operator*= | ( | const Quaternion & | ) | [inline] |
Quaternion PLMath::Quaternion::operator/ | ( | float | f | ) | const [inline] |
Quaternion & PLMath::Quaternion::operator/= | ( | float | f | ) | [inline] |
Quaternion & PLMath::Quaternion::operator= | ( | const Quaternion & | ) | [inline] |
bool PLMath::Quaternion::operator== | ( | const Quaternion & | ) | const [inline] |
bool PLMath::Quaternion::operator!= | ( | const Quaternion & | ) | const [inline] |
PLMath::Quaternion::operator float * | ( | ) | [inline] |
PLMath::Quaternion::operator const float * | ( | ) | const [inline] |
Quaternion & PLMath::Quaternion::SetWXYZ | ( | float | fW, |
float | fX, | ||
float | fY, | ||
float | fZ | ||
) | [inline] |
Sets the component of the quaternion.
[in] | fW | W component |
[in] | fX | X component |
[in] | fY | Y component |
[in] | fZ | Z component |
Quaternion & PLMath::Quaternion::SetWXYZ | ( | const float | fValues[] | ) | [inline] |
Sets the component of the quaternion.
[in] | fValues | Array of at least 4 floats |
PLMATH_API void PLMath::Quaternion::ToAxisAngle | ( | float & | fX, |
float & | fY, | ||
float & | fZ, | ||
float & | fAngle | ||
) | const |
Returns a selected axis and angle from the rotation quaternion.
[out] | fX | Will receive the x component of the selected axis |
[out] | fY | Will receive the y component of the selected axis |
[out] | fZ | Will receive the z component of the selected axis |
[out] | fAngle | Will receive the rotation angle around the selected axis (in radian, between [0, Math::Pi]) |
PLMATH_API Quaternion& PLMath::Quaternion::FromAxisAngle | ( | float | fX, |
float | fY, | ||
float | fZ, | ||
float | fAngle | ||
) |
Sets a rotation quaternion by using a selected axis and angle.
[in] | fX | X component of the selected axis |
[in] | fY | Y component of the selected axis |
[in] | fZ | Z component of the selected axis |
[in] | fAngle | Rotation angle around the selected axis (in radian, between [0, Math::Pi]) |
PLMATH_API Vector3 PLMath::Quaternion::GetXAxis | ( | ) | const |
Returns the x (left) axis.
PLMATH_API Vector3 PLMath::Quaternion::GetYAxis | ( | ) | const |
Returns the y (up) axis.
PLMATH_API Vector3 PLMath::Quaternion::GetZAxis | ( | ) | const |
Returns the z (forward) axis.
PLMATH_API void PLMath::Quaternion::ToRotationMatrix | ( | Matrix3x3 & | mRot | ) | const |
Returns the rotation quaternion as 3x3 matrix.
[out] | mRot | Will receive the rotation matrix |
PLMATH_API Quaternion& PLMath::Quaternion::FromRotationMatrix | ( | const Matrix3x3 & | mRot | ) |
Sets a rotation quaternion by using a 3x3 rotation matrix.
[in] | mRot | Rotation matrix |
PLMATH_API void PLMath::Quaternion::ToRotationMatrix | ( | Matrix3x4 & | mRot | ) | const |
Returns the rotation quaternion as 3x4 matrix.
[out] | mRot | Will receive the rotation matrix |
PLMATH_API Quaternion& PLMath::Quaternion::FromRotationMatrix | ( | const Matrix3x4 & | mRot | ) |
Sets a rotation quaternion by using a 3x4 rotation matrix.
[in] | mRot | Rotation matrix |
PLMATH_API void PLMath::Quaternion::ToRotationMatrix | ( | Matrix4x4 & | mRot | ) | const |
Returns the rotation quaternion as 4x4 matrix.
[out] | mRot | Will receive the rotation matrix |
PLMATH_API Quaternion& PLMath::Quaternion::FromRotationMatrix | ( | const Matrix4x4 & | mRot | ) |
Sets a rotation quaternion by using a 4x4 rotation matrix.
[in] | mRot | Rotation matrix |
bool PLMath::Quaternion::Compare | ( | const Quaternion & | qQ, |
float | fEpsilon = Math::Epsilon |
||
) | const [inline] |
Compares two quaternions using an epsilon environment.
[in] | Quaternion to compare with | |
[in] | fEpsilon | Epsilon environment |
float PLMath::Quaternion::GetLength | ( | ) | const [inline] |
Returns the length (also called magnitude) of the quaternion.
float PLMath::Quaternion::GetSquaredLength | ( | ) | const [inline] |
Returns the squared length (norm) of the quaternion.
float PLMath::Quaternion::DotProduct | ( | const Quaternion & | ) | const [inline] |
Returns the dot product of this quaternion and another one.
[in] | Second quaternion |
Quaternion & PLMath::Quaternion::Normalize | ( | ) | [inline] |
Normalizes the quaternion.
Normalizes the vector.
Quaternion PLMath::Quaternion::GetNormalized | ( | ) | const [inline] |
Returns a normalized quaternion.
void PLMath::Quaternion::Conjugate | ( | ) | [inline] |
Conjugates the quaternion.
Quaternion PLMath::Quaternion::GetConjugated | ( | ) | const [inline] |
Returns the conjugated of the quaternion.
void PLMath::Quaternion::Invert | ( | ) | [inline] |
Inverts the quaternion.
Quaternion PLMath::Quaternion::GetInverted | ( | ) | const [inline] |
Returns the inverted quaternion.
void PLMath::Quaternion::UnitInvert | ( | ) | [inline] |
Inverts the normalized quaternion.
Quaternion PLMath::Quaternion::GetUnitInverted | ( | ) | const [inline] |
Returns the inverted normalized quaternion.
Quaternion & PLMath::Quaternion::Exp | ( | ) | [inline] |
Calculates the exponential of the quaternion.
Quaternion PLMath::Quaternion::GetExp | ( | ) | const [inline] |
Returns the exponential of the quaternion.
Quaternion & PLMath::Quaternion::Log | ( | ) | [inline] |
Quaternion PLMath::Quaternion::GetLog | ( | ) | const [inline] |
Quaternion & PLMath::Quaternion::Power | ( | float | fPower | ) | [inline] |
Calculates the power of the quaternion.
[in] | fPower | Power to calculate |
Quaternion PLMath::Quaternion::GetPower | ( | float | fPower | ) | const [inline] |
Returns the power of the quaternion.
[in] | fPower | Power to calculate |
PLMATH_API void PLMath::Quaternion::Slerp | ( | const Quaternion & | qQ1, |
const Quaternion & | qQ2, | ||
float | fTime | ||
) |
Computes spherical linear interpolation between qQ1 and qQ2 with time 0-1.
[in] | qQ1 | Start quaternion (time: 0) |
[in] | qQ2 | End quaternion (time: 1) |
[in] | fTime | Time from 0-1 |
PLMATH_API PLCore::String PLMath::Quaternion::ToString | ( | ) | const |
To string.
PLMATH_API bool PLMath::Quaternion::FromString | ( | const PLCore::String & | sString | ) |
From string.
[in] | sString | String with the data |
PLMATH_API const Quaternion PLMath::Quaternion::Zero [static] |
0.0, 0.0, 0.0, 0.0
PLMATH_API const Quaternion PLMath::Quaternion::Identity [static] |
1.0, 0.0, 0.0, 0.0
float PLMath::Quaternion::fQ[4] |
float PLMath::Quaternion::w |
float PLMath::Quaternion::x |
float PLMath::Quaternion::y |
float PLMath::Quaternion::z |
union { ... } |
Some direct quaternion element accesses.
|