Visualization Library 2.0.0
A lightweight C++ OpenGL middleware for 2D/3D graphics
|
[Download] [Tutorials] [All Classes] [Grouped Classes] |
Implements a Quaternion usually used to represent rotations and orientations. More...
#include <Quaternion.hpp>
Public Types | |
typedef T_Scalar | scalar_type |
Public Member Functions | |
Quaternion () | |
Constructor. More... | |
template<typename T > | |
Quaternion (const Quaternion< T > &quat) | |
Copy-constructor. More... | |
Quaternion (T_Scalar x, T_Scalar y, T_Scalar z, T_Scalar w) | |
Constructor. More... | |
Quaternion (T_Scalar degrees, const Vector3< T_Scalar > &axis) | |
Axis-angle constructor. More... | |
Quaternion (const Vector4< T_Scalar > &v) | |
Constructor from vec4. More... | |
Quaternion & | operator= (const Quaternion &q) |
Assignment operator. More... | |
Quaternion & | operator= (const Vector4< T_Scalar > &v) |
Assignment operator for vec4. More... | |
bool | operator== (const Quaternion &q) const |
bool | operator!= (const Quaternion &q) const |
bool | operator< (const Quaternion &other) const |
Lexicographic ordering. More... | |
const Vector4< T_Scalar > & | xyzw () const |
Returns the internal vec4 used to contain the xyzw the quaternion components. More... | |
Vector4< T_Scalar > & | xyzw () |
Returns the internal vec4 used to contain the xyzw the quaternion components. More... | |
T_Scalar & | x () |
T_Scalar & | y () |
T_Scalar & | z () |
T_Scalar & | w () |
const T_Scalar & | x () const |
const T_Scalar & | y () const |
const T_Scalar & | z () const |
const T_Scalar & | w () const |
Quaternion | operator* (T_Scalar val) const |
Quaternion & | operator*= (T_Scalar val) |
Quaternion | operator/ (T_Scalar val) const |
Quaternion & | operator/= (T_Scalar val) |
Quaternion | operator+ (const Quaternion &q) const |
Quaternion & | operator+= (const Quaternion &q) |
Quaternion | operator- (const Quaternion &q) const |
Quaternion & | operator-= (const Quaternion &q) |
Quaternion | operator- () const |
Returns the negated quaternion. More... | |
Quaternion & | setZero () |
Sets all the components of the quaternion to zero. More... | |
Quaternion & | setNoRotation () |
Set the quaternion to no-rotation, i.e. Quaternion(0,0,0,1). More... | |
Quaternion & | setFromVectors (const Vector3< T_Scalar > &from, const Vector3< T_Scalar > &to) |
Sets the quaternion to represent the rotation transforming from into to . More... | |
Quaternion & | setFromMatrix (const Matrix4< T_Scalar > &m) |
Creates a quaternion representing the given rotation matrix. More... | |
Quaternion & | setFromMatrix (const Matrix3< T_Scalar > &m) |
Creates a quaternion representing the given rotation matrix. More... | |
Quaternion & | setFromEulerXYZ (T_Scalar degX, T_Scalar degY, T_Scalar degZ) |
Quaternion & | setFromEulerZYX (T_Scalar degZ, T_Scalar degY, T_Scalar degX) |
Quaternion & | setFromAxisAngle (const Vector3< T_Scalar > &axis, T_Scalar degrees) |
void | toAxisAngle (Vector3< T_Scalar > &axis, T_Scalar °rees) const |
Converts a quaternion to an axis-angle representation. More... | |
Matrix4< T_Scalar > | toMatrix4 () const |
Converts a quaternion to a 4x4 rotation matrix. More... | |
Matrix4< T_Scalar > & | toMatrix4 (Matrix4< T_Scalar > &) const |
Converts a quaternion to a 4x4 rotation matrix. More... | |
Matrix3< T_Scalar > | toMatrix3 () const |
Converts a quaternion to a 3x3 rotation matrix. More... | |
Matrix3< T_Scalar > & | toMatrix3 (Matrix3< T_Scalar > &) const |
Converts a quaternion to a 3x3 rotation matrix. More... | |
T_Scalar | dot (const Quaternion &q) const |
Returns the dot product between a quaternion and the given quaternion. More... | |
T_Scalar | length () const |
Returns the length of a quaternion. More... | |
Quaternion & | normalize (T_Scalar *len=NULL) |
Normalizes a quaternion. More... | |
Quaternion | getNormalized (T_Scalar *len=NULL) const |
Returns the normalized version of a quaternion. More... | |
Quaternion & | getNormalized (Quaternion &q, T_Scalar *len=NULL) const |
Returns the normalized version of a quaternion. More... | |
T_Scalar | lengthSquared () const |
Returns the squared length of a quaternion. More... | |
Quaternion | getConjugate () const |
Returns the conjugate of a quaternion. More... | |
Quaternion & | getConjugate (Quaternion &q) const |
Returns the conjugate of a quaternion. More... | |
Quaternion | getInverse () const |
Returns the inverse of a quaternion. More... | |
Quaternion & | getInverse (Quaternion &q) const |
Returns the inverse of a quaternion. More... | |
Static Public Member Functions | |
static Quaternion | getZero () |
Returns the zero quaternion. More... | |
static Quaternion & | getZero (Quaternion &q) |
Returns the zero quaternion. More... | |
static Quaternion | getNoRotation () |
Returns the no-rotation quaternion, i.e. Quaternion(0,0,0,1). More... | |
static Quaternion & | getNoRotation (Quaternion &q) |
Returns the no-rotation quaternion, i.e. Quaternion(0,0,0,1). More... | |
static Quaternion | getFromVectors (const Vector3< T_Scalar > &from, const Vector3< T_Scalar > &to) |
Sets the quaternion to represent the rotation transforming from into to . More... | |
static Quaternion & | getFromVectors (Quaternion &q, const Vector3< T_Scalar > &from, const Vector3< T_Scalar > &to) |
Sets the quaternion to represent the rotation transforming from into to . More... | |
static Quaternion | getFromMatrix (const Matrix4< T_Scalar > &m) |
Converts the given rotation matrix into a quaternion. More... | |
static Quaternion & | getFromMatrix (Quaternion &q, const Matrix4< T_Scalar > &m) |
Converts the given rotation matrix into a quaternion. More... | |
static Quaternion | getFromMatrix (const Matrix3< T_Scalar > &m) |
Converts the given rotation matrix into a quaternion. More... | |
static Quaternion & | getFromMatrix (Quaternion &q, const Matrix3< T_Scalar > &m) |
Converts the given rotation matrix into a quaternion. More... | |
static Quaternion | getFromEulerXYZ (T_Scalar degX, T_Scalar degY, T_Scalar degZ) |
static Quaternion & | getFromEulerXYZ (Quaternion &q, T_Scalar degX, T_Scalar degY, T_Scalar degZ) |
static Quaternion | getFromEulerZYX (T_Scalar degZ, T_Scalar degY, T_Scalar degX) |
static Quaternion & | getFromEulerZYX (Quaternion &q, T_Scalar degZ, T_Scalar degY, T_Scalar degX) |
static Quaternion | getFromAxisAngle (const Vector3< T_Scalar > &axis, T_Scalar degrees) |
static Quaternion & | getFromAxisAngle (Quaternion &q, const Vector3< T_Scalar > &axis, T_Scalar degrees) |
static Quaternion | getSlerp (T_Scalar t, const Quaternion &a, const Quaternion &b) |
Spherical linear interpolation of two quaternions. More... | |
static Quaternion & | getSlerp (Quaternion &out, T_Scalar t, const Quaternion &a, const Quaternion &b) |
Spherical linear interpolation of two quaternions. More... | |
static Quaternion | getSquad (T_Scalar t, const Quaternion &a, const Quaternion &p, const Quaternion &q, const Quaternion &b) |
Spherical cubic interpolation of two quaternions. More... | |
static Quaternion & | getSquad (Quaternion &out, T_Scalar t, const Quaternion &a, const Quaternion &p, const Quaternion &q, const Quaternion &b) |
Spherical cubic interpolation of two quaternions. More... | |
static Quaternion | getNlerp (T_Scalar t, const Quaternion &a, const Quaternion &b) |
Normalized spherical interpolation of two quaternions. More... | |
static Quaternion & | getNlerp (Quaternion &out, T_Scalar t, const Quaternion &a, const Quaternion &b) |
Normalized spherical interpolation of two quaternions. More... | |
Protected Attributes | |
Vector4< T_Scalar > | mXYZW |
Implements a Quaternion usually used to represent rotations and orientations.
Definition at line 44 of file Quaternion.hpp.
typedef T_Scalar vl::Quaternion< T_Scalar >::scalar_type |
Definition at line 47 of file Quaternion.hpp.
|
inline |
Constructor.
Definition at line 50 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::setNoRotation().
Referenced by vl::Quaternion< T_Scalar >::getConjugate(), vl::Quaternion< T_Scalar >::getFromAxisAngle(), vl::Quaternion< T_Scalar >::getFromEulerXYZ(), vl::Quaternion< T_Scalar >::getFromEulerZYX(), vl::Quaternion< T_Scalar >::getFromMatrix(), vl::Quaternion< T_Scalar >::getFromVectors(), vl::Quaternion< T_Scalar >::getNoRotation(), vl::Quaternion< T_Scalar >::getZero(), and vl::Quaternion< T_Scalar >::operator-().
|
inlineexplicit |
Copy-constructor.
Definition at line 57 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW, and vl::Quaternion< T_Scalar >::xyzw().
|
inlineexplicit |
Constructor.
Definition at line 66 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW, vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inlineexplicit |
Axis-angle constructor.
Definition at line 75 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::setFromAxisAngle().
|
inlineexplicit |
Constructor from vec4.
Definition at line 81 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW, vl::Vector4< T_Scalar >::w(), vl::Vector4< T_Scalar >::x(), vl::Vector4< T_Scalar >::y(), and vl::Vector4< T_Scalar >::z().
|
inline |
Returns the dot product between a quaternion and the given quaternion.
Definition at line 381 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
Referenced by vl::Quaternion< T_Scalar >::getSlerp().
|
inline |
Returns the conjugate of a quaternion.
Definition at line 408 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion(), vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
Referenced by vl::Quaternion< T_Scalar >::getInverse().
|
inline |
Returns the conjugate of a quaternion.
Definition at line 414 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion(), vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inlinestatic |
Definition at line 355 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion().
|
inlinestatic |
Definition at line 360 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::setFromAxisAngle(), vl::Quaternion< T_Scalar >::toAxisAngle(), vl::Quaternion< T_Scalar >::toMatrix3(), and vl::Quaternion< T_Scalar >::toMatrix4().
|
inlinestatic |
Definition at line 331 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion().
|
inlinestatic |
Definition at line 336 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::setFromEulerXYZ(), and vl::Quaternion< T_Scalar >::setFromEulerZYX().
|
inlinestatic |
Definition at line 343 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion().
|
inlinestatic |
Definition at line 348 of file Quaternion.hpp.
References vl::degrees(), vl::Quaternion< T_Scalar >::setFromAxisAngle(), and vl::Quaternion< T_Scalar >::setFromEulerZYX().
|
inlinestatic |
Converts the given rotation matrix into a quaternion.
Definition at line 302 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion().
|
inlinestatic |
Converts the given rotation matrix into a quaternion.
Definition at line 308 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::setFromMatrix().
|
inlinestatic |
Converts the given rotation matrix into a quaternion.
Definition at line 318 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion().
|
inlinestatic |
Converts the given rotation matrix into a quaternion.
Definition at line 324 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::setFromEulerXYZ(), and vl::Quaternion< T_Scalar >::setFromMatrix().
|
inlinestatic |
Sets the quaternion to represent the rotation transforming from
into to
.
Definition at line 286 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion().
|
inlinestatic |
Sets the quaternion to represent the rotation transforming from
into to
.
Definition at line 292 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::setFromMatrix(), and vl::Quaternion< T_Scalar >::setFromVectors().
|
inline |
Returns the inverse of a quaternion.
Definition at line 421 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::getConjugate(), and vl::Quaternion< T_Scalar >::lengthSquared().
|
inline |
Returns the inverse of a quaternion.
Definition at line 427 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::getConjugate(), vl::Quaternion< T_Scalar >::getSlerp(), and vl::Quaternion< T_Scalar >::lengthSquared().
|
inlinestatic |
Normalized spherical interpolation of two quaternions.
See also http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/
Properties: YES commutative, YES torque-minimal, NO constant velocity.
Definition at line 458 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::normalize().
|
inlinestatic |
Normalized spherical interpolation of two quaternions.
See also http://number-none.com/product/Understanding%20Slerp,%20Then%20Not%20Using%20It/
Properties: YES commutative, YES torque-minimal, NO constant velocity.
Definition at line 468 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::normalize().
|
inline |
Returns the normalized version of a quaternion.
len
returns the original length of the quaternion.
Definition at line 395 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::normalize().
|
inline |
Returns the normalized version of a quaternion.
len
returns the original length of the quaternion.
Definition at line 399 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::normalize().
|
inlinestatic |
Returns the no-rotation quaternion, i.e. Quaternion(0,0,0,1).
Definition at line 271 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion().
|
inlinestatic |
Returns the no-rotation quaternion, i.e. Quaternion(0,0,0,1).
Definition at line 277 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::setFromVectors(), and vl::Quaternion< T_Scalar >::setNoRotation().
|
static |
Spherical linear interpolation of two quaternions.
See also http://www.gamasutra.com/features/19980703/quaternions_01.htm
Properties: NO commutative, YES torque-minimal, YES constant velocity.
Definition at line 686 of file Quaternion.hpp.
Referenced by vl::Quaternion< T_Scalar >::getInverse(), and vl::Quaternion< T_Scalar >::getSquad().
|
static |
Spherical linear interpolation of two quaternions.
See also http://www.gamasutra.com/features/19980703/quaternions_01.htm
Properties: NO commutative, YES torque-minimal, YES constant velocity.
Definition at line 694 of file Quaternion.hpp.
References vl::acos(), vl::Quaternion< T_Scalar >::dot(), vl::sin(), and VL_CHECK.
|
inlinestatic |
Spherical cubic interpolation of two quaternions.
Definition at line 444 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::getSlerp().
|
inlinestatic |
Spherical cubic interpolation of two quaternions.
Definition at line 450 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::getSlerp().
|
inlinestatic |
Returns the zero quaternion.
Definition at line 249 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion().
|
inlinestatic |
Returns the zero quaternion.
Definition at line 255 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::setZero().
|
inline |
Returns the length of a quaternion.
Definition at line 387 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
|
inline |
Returns the squared length of a quaternion.
Definition at line 402 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
Referenced by vl::Quaternion< T_Scalar >::getInverse().
|
inline |
Normalizes a quaternion.
len
returns the original length of the quaternion.
Definition at line 391 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
Referenced by vl::Quaternion< T_Scalar >::getNlerp(), and vl::Quaternion< T_Scalar >::getNormalized().
|
inline |
Definition at line 114 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::operator==().
|
inline |
Definition at line 154 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Definition at line 164 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Definition at line 194 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Definition at line 204 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Definition at line 213 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Returns the negated quaternion.
Definition at line 233 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::Quaternion(), vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Definition at line 223 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Definition at line 173 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Definition at line 184 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Lexicographic ordering.
Definition at line 120 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Assignment operator.
Definition at line 90 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW, vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Assignment operator for vec4.
Definition at line 100 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW, vl::Vector4< T_Scalar >::w(), vl::Vector4< T_Scalar >::x(), vl::Vector4< T_Scalar >::y(), and vl::Vector4< T_Scalar >::z().
|
inline |
Definition at line 109 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
Referenced by vl::Quaternion< T_Scalar >::operator!=().
Quaternion< T_Scalar > & vl::Quaternion< T_Scalar >::setFromAxisAngle | ( | const Vector3< T_Scalar > & | axis, |
T_Scalar | degrees | ||
) |
Definition at line 596 of file Quaternion.hpp.
References vl::cos(), vl::dDEG_TO_RAD, vl::Quaternion< T_Scalar >::mXYZW, vl::Vector3< T_Scalar >::normalize(), vl::sin(), vl::Vector3< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), and vl::Vector3< T_Scalar >::z().
Referenced by vl::Quaternion< T_Scalar >::getFromAxisAngle(), vl::Quaternion< T_Scalar >::getFromEulerZYX(), vl::Quaternion< T_Scalar >::Quaternion(), and vl::Quaternion< T_Scalar >::setFromVectors().
Quaternion< T_Scalar > & vl::Quaternion< T_Scalar >::setFromEulerXYZ | ( | T_Scalar | degX, |
T_Scalar | degY, | ||
T_Scalar | degZ | ||
) |
Definition at line 527 of file Quaternion.hpp.
Referenced by vl::Quaternion< T_Scalar >::getFromEulerXYZ(), and vl::Quaternion< T_Scalar >::getFromMatrix().
Quaternion< T_Scalar > & vl::Quaternion< T_Scalar >::setFromEulerZYX | ( | T_Scalar | degZ, |
T_Scalar | degY, | ||
T_Scalar | degX | ||
) |
Definition at line 534 of file Quaternion.hpp.
Referenced by vl::Quaternion< T_Scalar >::getFromEulerXYZ(), and vl::Quaternion< T_Scalar >::getFromEulerZYX().
Quaternion< T_Scalar > & vl::Quaternion< T_Scalar >::setFromMatrix | ( | const Matrix4< T_Scalar > & | m | ) |
Creates a quaternion representing the given rotation matrix.
see also http://www.gamasutra.com/features/19980703/quaternions_01.htm
Definition at line 541 of file Quaternion.hpp.
References vl::Matrix4< T_Scalar >::get3x3().
Referenced by vl::Quaternion< T_Scalar >::getFromMatrix(), and vl::Quaternion< T_Scalar >::getFromVectors().
Quaternion< T_Scalar > & vl::Quaternion< T_Scalar >::setFromMatrix | ( | const Matrix3< T_Scalar > & | m | ) |
Creates a quaternion representing the given rotation matrix.
see also http://www.gamasutra.com/features/19980703/quaternions_01.htm
Definition at line 547 of file Quaternion.hpp.
References vl::Matrix3< T_Scalar >::e(), vl::sqrt(), vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
Quaternion< T_Scalar > & vl::Quaternion< T_Scalar >::setFromVectors | ( | const Vector3< T_Scalar > & | from, |
const Vector3< T_Scalar > & | to | ||
) |
Sets the quaternion to represent the rotation transforming from
into to
.
Definition at line 729 of file Quaternion.hpp.
References vl::acos(), vl::clamp(), vl::cross(), vl::dot(), vl::dRAD_TO_DEG, vl::Vector3< T_Scalar >::normalize(), vl::Quaternion< T_Scalar >::setFromAxisAngle(), and vl::Quaternion< T_Scalar >::setNoRotation().
Referenced by vl::Quaternion< T_Scalar >::getFromVectors(), and vl::Quaternion< T_Scalar >::getNoRotation().
|
inline |
Set the quaternion to no-rotation, i.e. Quaternion(0,0,0,1).
Definition at line 261 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
Referenced by vl::Quaternion< T_Scalar >::getNoRotation(), vl::Quaternion< T_Scalar >::Quaternion(), and vl::Quaternion< T_Scalar >::setFromVectors().
|
inline |
Sets all the components of the quaternion to zero.
Definition at line 239 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
Referenced by vl::Quaternion< T_Scalar >::getZero().
void vl::Quaternion< T_Scalar >::toAxisAngle | ( | Vector3< T_Scalar > & | axis, |
T_Scalar & | degrees | ||
) | const |
Converts a quaternion to an axis-angle representation.
Definition at line 610 of file Quaternion.hpp.
References vl::acos(), vl::clamp(), vl::dRAD_TO_DEG, vl::sqrt(), VL_CHECK, vl::Quaternion< T_Scalar >::w(), vl::Vector3< T_Scalar >::x(), vl::Quaternion< T_Scalar >::x(), vl::Vector3< T_Scalar >::y(), vl::Quaternion< T_Scalar >::y(), vl::Vector3< T_Scalar >::z(), and vl::Quaternion< T_Scalar >::z().
Referenced by vl::Quaternion< T_Scalar >::getFromAxisAngle().
Matrix3< T_Scalar > vl::Quaternion< T_Scalar >::toMatrix3 | ( | ) | const |
Converts a quaternion to a 3x3 rotation matrix.
Definition at line 679 of file Quaternion.hpp.
Referenced by vl::Quaternion< T_Scalar >::getFromAxisAngle().
Matrix3< T_Scalar > & vl::Quaternion< T_Scalar >::toMatrix3 | ( | Matrix3< T_Scalar > & | out | ) | const |
Converts a quaternion to a 3x3 rotation matrix.
Definition at line 660 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
Matrix4< T_Scalar > vl::Quaternion< T_Scalar >::toMatrix4 | ( | ) | const |
Converts a quaternion to a 4x4 rotation matrix.
Definition at line 653 of file Quaternion.hpp.
Referenced by vl::Quaternion< T_Scalar >::getFromAxisAngle().
Matrix4< T_Scalar > & vl::Quaternion< T_Scalar >::toMatrix4 | ( | Matrix4< T_Scalar > & | out | ) | const |
Converts a quaternion to a 4x4 rotation matrix.
Definition at line 633 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
|
inline |
Definition at line 144 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
Referenced by vl::Quaternion< T_Scalar >::dot(), vl::Quaternion< T_Scalar >::getConjugate(), vl::Quaternion< T_Scalar >::lengthSquared(), vl::Quaternion< T_Scalar >::operator*(), vl::operator*(), vl::Quaternion< T_Scalar >::operator*=(), vl::Quaternion< T_Scalar >::operator+(), vl::Quaternion< T_Scalar >::operator+=(), vl::Quaternion< T_Scalar >::operator-(), vl::Quaternion< T_Scalar >::operator-=(), vl::Quaternion< T_Scalar >::operator/(), vl::Quaternion< T_Scalar >::operator/=(), vl::Quaternion< T_Scalar >::operator<(), vl::Quaternion< T_Scalar >::operator=(), vl::Quaternion< T_Scalar >::operator==(), vl::Quaternion< T_Scalar >::Quaternion(), vl::Quaternion< T_Scalar >::setFromMatrix(), vl::Quaternion< T_Scalar >::toAxisAngle(), vl::Quaternion< T_Scalar >::toMatrix3(), and vl::Quaternion< T_Scalar >::toMatrix4().
|
inline |
Definition at line 152 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
|
inline |
Definition at line 138 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
Referenced by vl::Quaternion< T_Scalar >::dot(), vl::Quaternion< T_Scalar >::getConjugate(), vl::Quaternion< T_Scalar >::lengthSquared(), vl::Quaternion< T_Scalar >::operator*(), vl::operator*(), vl::Quaternion< T_Scalar >::operator*=(), vl::Quaternion< T_Scalar >::operator+(), vl::Quaternion< T_Scalar >::operator+=(), vl::Quaternion< T_Scalar >::operator-(), vl::Quaternion< T_Scalar >::operator-=(), vl::Quaternion< T_Scalar >::operator/(), vl::Quaternion< T_Scalar >::operator/=(), vl::Quaternion< T_Scalar >::operator<(), vl::Quaternion< T_Scalar >::operator=(), vl::Quaternion< T_Scalar >::operator==(), vl::Quaternion< T_Scalar >::Quaternion(), vl::Quaternion< T_Scalar >::setFromMatrix(), vl::Quaternion< T_Scalar >::toAxisAngle(), vl::Quaternion< T_Scalar >::toMatrix3(), and vl::Quaternion< T_Scalar >::toMatrix4().
|
inline |
Definition at line 146 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
|
inline |
Returns the internal vec4 used to contain the xyzw the quaternion components.
Definition at line 133 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
Referenced by vl::Quaternion< T_Scalar >::Quaternion().
|
inline |
Returns the internal vec4 used to contain the xyzw the quaternion components.
Definition at line 136 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
|
inline |
Definition at line 140 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
Referenced by vl::Quaternion< T_Scalar >::dot(), vl::Quaternion< T_Scalar >::getConjugate(), vl::Quaternion< T_Scalar >::lengthSquared(), vl::Quaternion< T_Scalar >::operator*(), vl::operator*(), vl::Quaternion< T_Scalar >::operator*=(), vl::Quaternion< T_Scalar >::operator+(), vl::Quaternion< T_Scalar >::operator+=(), vl::Quaternion< T_Scalar >::operator-(), vl::Quaternion< T_Scalar >::operator-=(), vl::Quaternion< T_Scalar >::operator/(), vl::Quaternion< T_Scalar >::operator/=(), vl::Quaternion< T_Scalar >::operator<(), vl::Quaternion< T_Scalar >::operator=(), vl::Quaternion< T_Scalar >::operator==(), vl::Quaternion< T_Scalar >::Quaternion(), vl::Quaternion< T_Scalar >::setFromMatrix(), vl::Quaternion< T_Scalar >::toAxisAngle(), vl::Quaternion< T_Scalar >::toMatrix3(), and vl::Quaternion< T_Scalar >::toMatrix4().
|
inline |
Definition at line 148 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
|
inline |
Definition at line 142 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
Referenced by vl::Quaternion< T_Scalar >::dot(), vl::Quaternion< T_Scalar >::getConjugate(), vl::Quaternion< T_Scalar >::lengthSquared(), vl::Quaternion< T_Scalar >::operator*(), vl::operator*(), vl::Quaternion< T_Scalar >::operator*=(), vl::Quaternion< T_Scalar >::operator+(), vl::Quaternion< T_Scalar >::operator+=(), vl::Quaternion< T_Scalar >::operator-(), vl::Quaternion< T_Scalar >::operator-=(), vl::Quaternion< T_Scalar >::operator/(), vl::Quaternion< T_Scalar >::operator/=(), vl::Quaternion< T_Scalar >::operator<(), vl::Quaternion< T_Scalar >::operator=(), vl::Quaternion< T_Scalar >::operator==(), vl::Quaternion< T_Scalar >::Quaternion(), vl::Quaternion< T_Scalar >::setFromMatrix(), vl::Quaternion< T_Scalar >::toAxisAngle(), vl::Quaternion< T_Scalar >::toMatrix3(), and vl::Quaternion< T_Scalar >::toMatrix4().
|
inline |
Definition at line 150 of file Quaternion.hpp.
References vl::Quaternion< T_Scalar >::mXYZW.
|
protected |
Definition at line 477 of file Quaternion.hpp.
Referenced by vl::Quaternion< T_Scalar >::length(), vl::Quaternion< T_Scalar >::normalize(), vl::Quaternion< T_Scalar >::operator=(), vl::Quaternion< T_Scalar >::Quaternion(), vl::Quaternion< T_Scalar >::setFromAxisAngle(), vl::Quaternion< T_Scalar >::setNoRotation(), vl::Quaternion< T_Scalar >::setZero(), vl::Quaternion< T_Scalar >::w(), vl::Quaternion< T_Scalar >::x(), vl::Quaternion< T_Scalar >::xyzw(), vl::Quaternion< T_Scalar >::y(), and vl::Quaternion< T_Scalar >::z().
Visualization Library 2.0.0 Reference Documentation
Updated on Wed Dec 23 2020 12:44:10.
© Copyright Michele Bosi. All rights reserved.