|
ACF $AcfVersion:0$
|
Quaternion for representing rotations in 3D space. More...
#include <CQuaternion3d.h>
Public Member Functions | |
| CQuaternion3d () | |
| Default constructor. | |
| CQuaternion3d (double w, double x, double y, double z) | |
| Construct quaternion from components. | |
| double | GetW () const |
| Get W component (scalar part). | |
| void | SetW (double w) |
| Set W component. | |
| double | GetX () const |
| Get X component. | |
| void | SetX (double x) |
| Set X component. | |
| double | GetY () const |
| Get Y component. | |
| void | SetY (double y) |
| Set Y component. | |
| double | GetZ () const |
| Get Z component. | |
| void | SetZ (double z) |
| Set Z component. | |
| CVector3d | GetVectorPart () const |
| Get vector part of quaternion. | |
| double | GetLength () const |
| Calculate length (norm) of quaternion. | |
| double | GetLengthSq () const |
| Calculate squared length of quaternion. | |
| CQuaternion3d | GetNormalized () const |
| Get normalized quaternion (unit quaternion). | |
| void | Normalize () |
| Normalize this quaternion in place. | |
| CQuaternion3d | GetConjugate () const |
| Get conjugate of quaternion. | |
| CQuaternion3d | GetInverse () const |
| Get inverse of quaternion. | |
| CMatrix3d | ToMatrix () const |
| Convert quaternion to rotation matrix. | |
| void | ToAxisAngle (CVector3d &axis, double &angle) const |
| Convert quaternion to axis and angle. | |
| CVector3d | Rotate (const CVector3d &vector) const |
| Rotate vector by this quaternion. | |
| double | GetDotProduct (const CQuaternion3d &other) const |
| Calculate dot product with another quaternion. | |
| bool | Serialize (iser::IArchive &archive) |
| Serialize this quaternion to specified archive. | |
| CQuaternion3d | operator* (const CQuaternion3d &other) const |
| CQuaternion3d | operator* (double scalar) const |
| CQuaternion3d | operator+ (const CQuaternion3d &other) const |
| CQuaternion3d | operator- (const CQuaternion3d &other) const |
| CQuaternion3d & | operator*= (const CQuaternion3d &other) |
| CQuaternion3d & | operator*= (double scalar) |
| bool | operator== (const CQuaternion3d &other) const |
| bool | operator!= (const CQuaternion3d &other) const |
Static Public Member Functions | |
| static CQuaternion3d | FromAxisAngle (const CVector3d &axis, double angle) |
| Construct quaternion from axis and angle. | |
| static CQuaternion3d | FromMatrix (const CMatrix3d &matrix) |
| Construct quaternion from rotation matrix. | |
| static CQuaternion3d | FromEulerAngles (double roll, double pitch, double yaw) |
| Construct quaternion from Euler angles (XYZ order). | |
| static CQuaternion3d | Slerp (const CQuaternion3d &q1, const CQuaternion3d &q2, double t) |
| Spherical linear interpolation (SLERP) between two quaternions. | |
Quaternion for representing rotations in 3D space.
Stored as (w, x, y, z) where w is the scalar part.
Definition at line 20 of file CQuaternion3d.h.
|
inline |
Default constructor.
Creates identity quaternion (no rotation).
Definition at line 189 of file CQuaternion3d.h.
Referenced by GetConjugate().
|
inline |
Construct quaternion from components.
| w | Scalar part. |
| x | X component of vector part. |
| y | Y component of vector part. |
| z | Z component of vector part. |
Definition at line 198 of file CQuaternion3d.h.
|
static |
Construct quaternion from axis and angle.
| axis | Rotation axis (will be normalized). |
| angle | Rotation angle in radians. |
Referenced by i3d::CAffine3d::CreateRotation().
|
static |
Construct quaternion from Euler angles (XYZ order).
| roll | Rotation around X axis in radians. |
| pitch | Rotation around Y axis in radians. |
| yaw | Rotation around Z axis in radians. |
|
static |
Construct quaternion from rotation matrix.
|
inline |
Get conjugate of quaternion.
Definition at line 273 of file CQuaternion3d.h.
References CQuaternion3d().
|
inline |
Calculate dot product with another quaternion.
Definition at line 279 of file CQuaternion3d.h.
| CQuaternion3d i3d::CQuaternion3d::GetInverse | ( | ) | const |
Get inverse of quaternion.
|
inline |
Calculate length (norm) of quaternion.
Definition at line 267 of file CQuaternion3d.h.
References GetLengthSq().
|
inline |
Calculate squared length of quaternion.
Definition at line 261 of file CQuaternion3d.h.
Referenced by GetLength().
| CQuaternion3d i3d::CQuaternion3d::GetNormalized | ( | ) | const |
Get normalized quaternion (unit quaternion).
|
inline |
Get vector part of quaternion.
Definition at line 255 of file CQuaternion3d.h.
|
inline |
Get W component (scalar part).
Definition at line 207 of file CQuaternion3d.h.
|
inline |
Get X component.
Definition at line 219 of file CQuaternion3d.h.
|
inline |
Get Y component.
Definition at line 231 of file CQuaternion3d.h.
|
inline |
Get Z component.
Definition at line 243 of file CQuaternion3d.h.
| void i3d::CQuaternion3d::Normalize | ( | ) |
Normalize this quaternion in place.
|
inline |
Definition at line 294 of file CQuaternion3d.h.
| CQuaternion3d i3d::CQuaternion3d::operator* | ( | const CQuaternion3d & | other | ) | const |
| CQuaternion3d i3d::CQuaternion3d::operator* | ( | double | scalar | ) | const |
| CQuaternion3d & i3d::CQuaternion3d::operator*= | ( | const CQuaternion3d & | other | ) |
| CQuaternion3d & i3d::CQuaternion3d::operator*= | ( | double | scalar | ) |
| CQuaternion3d i3d::CQuaternion3d::operator+ | ( | const CQuaternion3d & | other | ) | const |
| CQuaternion3d i3d::CQuaternion3d::operator- | ( | const CQuaternion3d & | other | ) | const |
|
inline |
Definition at line 285 of file CQuaternion3d.h.
References I_BIG_EPSILON.
Rotate vector by this quaternion.
| bool i3d::CQuaternion3d::Serialize | ( | iser::IArchive & | archive | ) |
Serialize this quaternion to specified archive.
|
inline |
Set W component.
Definition at line 213 of file CQuaternion3d.h.
|
inline |
Set X component.
Definition at line 225 of file CQuaternion3d.h.
|
inline |
Set Y component.
Definition at line 237 of file CQuaternion3d.h.
|
inline |
Set Z component.
Definition at line 249 of file CQuaternion3d.h.
|
static |
Spherical linear interpolation (SLERP) between two quaternions.
| q1 | Start quaternion. |
| q2 | End quaternion. |
| t | Interpolation parameter (0 to 1). |
| void i3d::CQuaternion3d::ToAxisAngle | ( | CVector3d & | axis, |
| double & | angle | ||
| ) | const |
Convert quaternion to axis and angle.
| axis | Output rotation axis. |
| angle | Output rotation angle in radians. |
| CMatrix3d i3d::CQuaternion3d::ToMatrix | ( | ) | const |
Convert quaternion to rotation matrix.
Referenced by i3d::CAffine3d::CreateRotation().