AGX Dynamics  2.35.0.1
agx::QuatT< T > Class Template Reference

The object holding quaternions and providing operations on these. More...

#include <QuatTemplate.h>

Public Types

typedef T Type
 

Public Member Functions

 QuatT ()
 Default constructor. Create a Quaternion with an identity rotation. More...
 
 QuatT (const AffineMatrix4x4T< T > &matrix)
 Create a Quaternion based on the rotation part in the specified Affine 4x4 transformation matrix. More...
 
 QuatT (const EulerAngles &euler)
 Create a Quaternion based on the rotation from euler specified as a EulerAngle. More...
 
 QuatT (const QuatT< T > &copy)=default
 Copy constructor. More...
 
template<typename T2 >
 QuatT (const QuatT< T2 > &copy)
 Copy constructor for other types. More...
 
 QuatT (const Vec3T< T > &from, const Vec3T< T > &to)
 Create a Quaternion which maps the rotation from vector from to the vector to. More...
 
 QuatT (const Vec4T< T > &v)
 Create a Quaternion based on the 4D vector (x,y,z,w) More...
 
 QuatT (T angle, const Vec3T< T > &axis)
 Create a Quaternion calculated from a rotation of angle radians around the rotation axis axis. More...
 
 QuatT (T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3)
 Create a Quaternion based on the concatenation between the three specified angle and axis. More...
 
 QuatT (T x, T y, T z, T w)
 Create a Quaternion with the specified scalar values. More...
 
Vec3T< T > asVec3 () const
 
Vec4T< T > asVec4 () const
 
T at (size_t i)
 
QuatT< T > conj () const
 
void get (AffineMatrix4x4T< T > &matrix) const
 Set the Rotational part of matrix from this quaternion. More...
 
void get (EulerAngles &euler) const
 Convert this quaternion to an EulerAngles representation. More...
 
void get (OrthoMatrix3x3 &matrix) const
 Set an OrthoMatrix3x3 to represent the same rotation as the quaternion. More...
 
void get (T &angle, agx::Vec3T< T > &axis) const
 Convert a Quaternion to an axis and angle representation. More...
 
agx::Real getAngle () const
 Get the rotation angle represented by the quaternion. More...
 
Vec3T< T > getAsEulerAngles (agx::EulerConvention::Convention convention=agx::EulerConvention::Convention::DEFAULT_CONVENTION) const
 Convert to Euler anglers. More...
 
void getRotate (T &angle, T &x, T &y, T &z) const
 Get the angle and vector components represented by the quaternion. More...
 
void getRotate (T &angle, Vec3T< T > &vec) const
 Get the angle and vector represented by the quaternion. More...
 
agx::Vec3T< T > getUnitVector () const
 Get the rotation unit vector represented by the quaternion. More...
 
QuatT< T > inverse () const
 Multiplicative inverse method: q^(-1) = q^*‍/(q.q^*) More...
 
const QuatT< T > leftMult (const QuatT< T > &rhs) const
 Binary left multiplication: q = p * rhs; results in the OTHER WAY AROUND: q = rhs quatmultiply p;. More...
 
T length () const
 
T length2 () const
 
T normalize ()
 Normalize the quat so that it has unit length. More...
 
bool operator!= (const QuatT< T > &v) const
 
const QuatT< T > operator* (const QuatT< T > &rhs) const
 Binary LEFT multiply: result is q = rhs quatmultiply this, even though the notation is q = this * rhs ;. More...
 
Vec3T< T > operator* (const Vec3T< T > &v) const
 Rotate a vector by this quaternion. More...
 
const QuatT< T > operator* (T rhs) const
 Multiply by scalar rhs. More...
 
QuatT< T > & operator*= (const QuatT< T > &rhs)
 Unary LEFT multiply: result is this = rhs quatmultiply this, which makes sense since the notation suggests this = rhs * this ;. More...
 
QuatT< T > & operator*= (T rhs)
 Unary multiply by scalar rhs. More...
 
const QuatT< T > operator+ (const QuatT< T > &rhs) const
 Binary addition. More...
 
QuatT< T > & operator+= (const QuatT< T > &rhs)
 Unary addition. More...
 
const QuatT< T > operator- () const
 Negation operator - returns the negative of the quaternion. More...
 
const QuatT< T > operator- (const QuatT< T > &rhs) const
 Binary subtraction. More...
 
QuatT< T > & operator-= (const QuatT< T > &rhs)
 Unary subtraction. More...
 
const QuatT< T > operator/ (const QuatT< T > &denom) const
 Binary divide. More...
 
QuatT< T > operator/ (T rhs) const
 Divide by scalar rhs. More...
 
QuatT< T > & operator/= (const QuatT< T > &denom)
 Unary divide. More...
 
QuatT< T > & operator/= (T rhs)
 Unary divide by scalar rhs. More...
 
QuatT< T > & operator= (const QuatT< T > &v)
 Assignment operator. More...
 
bool operator== (const QuatT< T > &v) const
 Test for equality. More...
 
T & operator[] (size_t i)
 
T operator[] (size_t i) const
 
T * ptr ()
 
const T * ptr () const
 
const QuatT< T > rightMult (const QuatT< T > &rhs) const
 Binary RIGHT multiplication: q = p * rhs ; results in q = p quatmultiply rhs ;. More...
 
QuatT< T > & set (const AffineMatrix4x4T< T > &matrix)
 Set this quaternion with the rotational part of matrix. More...
 
QuatT< T > & set (const EulerAngles &euler)
 Set this quaternion with the rotation described by the EulerAngles representation. More...
 
QuatT< T > & set (const OrthoMatrix3x3 &matrix)
 Set this quaternion with the rotation described by a OrthoMatrix3x3. More...
 
void set (const Vec4T< T > &v)
 Set the four elements of the quaternion as an Vec4. More...
 
void set (T val, size_t i)
 Set the value of element i. Mainly for accessing QuatT<T> in Lua. More...
 
void set (T x, T y, T z, T w)
 Set the 4 elements of the quaternion as 4 scalars. More...
 
void setRotate (const Vec3T< T > &from, const Vec3T< T > &to)
 Make a rotation QuatT<T> which will rotate from to to Generally take a dot product to get the angle between these and then use a cross product to get the rotation axis Watch out for the two special cases when the vectors are co-incident or opposite in direction. More...
 
void setRotate (T angle, const Vec3T< T > &vec)
 Set the rotation of this Quaternion as a rotation angle radians around the vector vec. More...
 
void setRotate (T angle, T x, T y, T z)
 Set the rotation of the Quaternion as a rotation angle radians around the vector (x, y, z) More...
 
void setRotate (T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3)
 Set the rotation of this Quaternion as a concatenation of the three angle/axis rotations: More...
 
void slerp (T t, const QuatT< T > &from, const QuatT< T > &to)
 Spherical Linear Interpolation. More...
 
T & w ()
 
T w () const
 
T & x ()
 
T x () const
 
T & y ()
 
T y () const
 
T & z ()
 
T z () const
 
bool zeroRotation () const
 

Static Public Member Functions

static QuatT< T > rotate (const Vec3T< T > &from, const Vec3T< T > &to)
 Static method which constructs and returns a Quaternion from rotating vector from to vector to. More...
 
static QuatT< T > rotate (T angle, const Vec3T< T > &vec)
 Static method which constructs and returns a Quaternion from a rotation given as angle radians around the vector vec. More...
 
static QuatT< T > rotate (T angle, T x, T y, T z)
 Static method which constructs and returns a Quaternion from a rotation given as angle radians around the vector (x, y, z) More...
 
static QuatT< T > rotate (T angle1, const Vec3T< T > &axis1, T angle2, const Vec3T< T > &axis2, T angle3, const Vec3T< T > &axis3)
 Static method which constructs and returns a Quaternion from a rotation given as a concatenation of the three angle/axis rotations: More...
 

Protected Attributes

T m_data [4]
 

Detailed Description

template<typename T>
class agx::QuatT< T >

The object holding quaternions and providing operations on these.

The quaternion class holds a representation of quaternion objects and provides simple arithmetic as well as conversion utilities. In addition, the class can compute the 3x4 matrices for converting angular velocities to quaternion velocities and vice versa. The class can also convert from and to a 3x3 orthonormal matrix.

The convention adopted for quaternions is that they map a moving frame to the fixed global reference.

Definition at line 56 of file QuatTemplate.h.

Member Typedef Documentation

◆ Type

template<typename T >
typedef T agx::QuatT< T >::Type

Definition at line 60 of file QuatTemplate.h.

Constructor & Destructor Documentation

◆ QuatT() [1/10]

template<typename T >
agx::QuatT< T >::QuatT

Default constructor. Create a Quaternion with an identity rotation.

Definition at line 415 of file QuatTemplate.h.

◆ QuatT() [2/10]

template<typename T >
agx::QuatT< T >::QuatT ( T  x,
T  y,
T  z,
T  w 
)

Create a Quaternion with the specified scalar values.

Definition at line 424 of file QuatTemplate.h.

◆ QuatT() [3/10]

template<typename T >
agx::QuatT< T >::QuatT ( const Vec4T< T > &  v)
explicit

Create a Quaternion based on the 4D vector (x,y,z,w)

Definition at line 433 of file QuatTemplate.h.

References agx::Vec4T< T >::w(), agx::Vec4T< T >::x(), agx::Vec4T< T >::y(), and agx::Vec4T< T >::z().

◆ QuatT() [4/10]

template<typename T >
agx::QuatT< T >::QuatT ( T  angle,
const Vec3T< T > &  axis 
)

Create a Quaternion calculated from a rotation of angle radians around the rotation axis axis.

Definition at line 442 of file QuatTemplate.h.

◆ QuatT() [5/10]

template<typename T >
agx::QuatT< T >::QuatT ( T  angle1,
const Vec3T< T > &  axis1,
T  angle2,
const Vec3T< T > &  axis2,
T  angle3,
const Vec3T< T > &  axis3 
)

Create a Quaternion based on the concatenation between the three specified angle and axis.

Definition at line 448 of file QuatTemplate.h.

◆ QuatT() [6/10]

template<typename T >
agx::QuatT< T >::QuatT ( const Vec3T< T > &  from,
const Vec3T< T > &  to 
)

Create a Quaternion which maps the rotation from vector from to the vector to.

Definition at line 456 of file QuatTemplate.h.

◆ QuatT() [7/10]

template<typename T >
agx::QuatT< T >::QuatT ( const EulerAngles &  euler)
explicit

Create a Quaternion based on the rotation from euler specified as a EulerAngle.

◆ QuatT() [8/10]

template<typename T >
agx::QuatT< T >::QuatT ( const QuatT< T > &  copy)
default

Copy constructor.

◆ QuatT() [9/10]

template<typename T >
template<typename T2 >
agx::QuatT< T >::QuatT ( const QuatT< T2 > &  copy)
explicit

Copy constructor for other types.

Definition at line 464 of file QuatTemplate.h.

◆ QuatT() [10/10]

template<typename T >
agx::QuatT< T >::QuatT ( const AffineMatrix4x4T< T > &  matrix)
explicit

Create a Quaternion based on the rotation part in the specified Affine 4x4 transformation matrix.

Definition at line 473 of file QuatTemplate.h.

Member Function Documentation

◆ asVec3()

template<typename T >
Vec3T< T > agx::QuatT< T >::asVec3
Returns
the vector part (x,y,z) as a Vec3T<T>

Definition at line 508 of file QuatTemplate.h.

◆ asVec4()

template<typename T >
Vec4T< T > agx::QuatT< T >::asVec4
Returns
the elements in the Quaternion as a Vec4

Definition at line 502 of file QuatTemplate.h.

◆ at()

template<typename T >
T agx::QuatT< T >::at ( size_t  i)
Returns
the element at i. Mainly for accessing QuatT<T> in Lua.

Definition at line 811 of file QuatTemplate.h.

◆ conj()

template<typename T >
QuatT< T > agx::QuatT< T >::conj
Returns
the conjugate

Definition at line 737 of file QuatTemplate.h.

◆ get() [1/4]

template<typename T >
void agx::QuatT< T >::get ( AffineMatrix4x4T< T > &  matrix) const

Set the Rotational part of matrix from this quaternion.

Parameters
matrix- reference to the matrix where the result will be written.

◆ get() [2/4]

template<typename T >
void agx::QuatT< T >::get ( EulerAngles &  euler) const

Convert this quaternion to an EulerAngles representation.

param euler - reference to where the result will be written.

◆ get() [3/4]

template<typename T >
void agx::QuatT< T >::get ( OrthoMatrix3x3 &  matrix) const

Set an OrthoMatrix3x3 to represent the same rotation as the quaternion.

Parameters
matrix- reference to the matrix where the result will be written.

◆ get() [4/4]

template<typename T >
void agx::QuatT< T >::get ( T &  angle,
agx::Vec3T< T > &  axis 
) const

Convert a Quaternion to an axis and angle representation.

Parameters
axis- reference to which the axis will be written
angle- reference to the real value where the angle will be written

◆ getAngle()

template<typename T >
agx::Real agx::QuatT< T >::getAngle ( ) const

Get the rotation angle represented by the quaternion.

◆ getAsEulerAngles()

template<typename T >
Vec3T<T> agx::QuatT< T >::getAsEulerAngles ( agx::EulerConvention::Convention  convention = agx::EulerConvention::Convention::DEFAULT_CONVENTION) const

Convert to Euler anglers.

and retrieve as a Vec3 with the angles stored.

Parameters
convention- The specified convention for EulerAngles

◆ getRotate() [1/2]

template<typename T >
void agx::QuatT< T >::getRotate ( T &  angle,
T &  x,
T &  y,
T &  z 
) const

Get the angle and vector components represented by the quaternion.

Referenced by agx::RigidBody::getCmRotation(), agx::RigidBody::getRotation(), and agxCollide::Geometry::getRotation().

◆ getRotate() [2/2]

template<typename T >
void agx::QuatT< T >::getRotate ( T &  angle,
Vec3T< T > &  vec 
) const

Get the angle and vector represented by the quaternion.

◆ getUnitVector()

template<typename T >
agx::Vec3T<T> agx::QuatT< T >::getUnitVector ( ) const

Get the rotation unit vector represented by the quaternion.

◆ inverse()

template<typename T >
QuatT< T > agx::QuatT< T >::inverse

Multiplicative inverse method: q^(-1) = q^*‍/(q.q^*)

Definition at line 743 of file QuatTemplate.h.

Referenced by agx::QuatT< T >::operator/(), and agx::QuatT< T >::operator/=().

◆ leftMult()

template<typename T >
const QuatT< T > agx::QuatT< T >::leftMult ( const QuatT< T > &  rhs) const

Binary left multiplication: q = p * rhs; results in the OTHER WAY AROUND: q = rhs quatmultiply p;.

Definition at line 641 of file QuatTemplate.h.

◆ length()

template<typename T >
T agx::QuatT< T >::length
Returns
the length of the quaternion = sqrt( vec . vec )

Definition at line 725 of file QuatTemplate.h.

◆ length2()

template<typename T >
T agx::QuatT< T >::length2
Returns
the squared length of the quaternion = vec . vec

Definition at line 731 of file QuatTemplate.h.

◆ normalize()

template<typename T >
T agx::QuatT< T >::normalize

Normalize the quat so that it has unit length.

Returns the previous length of the quat.

Definition at line 796 of file QuatTemplate.h.

◆ operator!=()

template<typename T >
bool agx::QuatT< T >::operator!= ( const QuatT< T > &  v) const
Returns
true if v is not identical to this quaternion

Definition at line 496 of file QuatTemplate.h.

References agx::QuatT< T >::m_data.

◆ operator*() [1/3]

template<typename T >
const QuatT< T > agx::QuatT< T >::operator* ( const QuatT< T > &  rhs) const

Binary LEFT multiply: result is q = rhs quatmultiply this, even though the notation is q = this * rhs ;.

Definition at line 617 of file QuatTemplate.h.

References agx::QuatT< T >::m_data.

◆ operator*() [2/3]

template<typename T >
Vec3T< T > agx::QuatT< T >::operator* ( const Vec3T< T > &  v) const
inline

Rotate a vector by this quaternion.

Definition at line 783 of file QuatTemplate.h.

◆ operator*() [3/3]

template<typename T >
const QuatT< T > agx::QuatT< T >::operator* ( T  rhs) const

Multiply by scalar rhs.

Definition at line 601 of file QuatTemplate.h.

◆ operator*=() [1/2]

template<typename T >
QuatT< T > & agx::QuatT< T >::operator*= ( const QuatT< T > &  rhs)

Unary LEFT multiply: result is this = rhs quatmultiply this, which makes sense since the notation suggests this = rhs * this ;.

Definition at line 626 of file QuatTemplate.h.

References agx::QuatT< T >::m_data.

◆ operator*=() [2/2]

template<typename T >
QuatT< T > & agx::QuatT< T >::operator*= ( T  rhs)

Unary multiply by scalar rhs.

Definition at line 607 of file QuatTemplate.h.

◆ operator+()

template<typename T >
const QuatT< T > agx::QuatT< T >::operator+ ( const QuatT< T > &  rhs) const

Binary addition.

Definition at line 685 of file QuatTemplate.h.

References agx::QuatT< T >::m_data.

◆ operator+=()

template<typename T >
QuatT< T > & agx::QuatT< T >::operator+= ( const QuatT< T > &  rhs)

Unary addition.

Definition at line 692 of file QuatTemplate.h.

References agx::QuatT< T >::m_data.

◆ operator-() [1/2]

template<typename T >
const QuatT< T > agx::QuatT< T >::operator-

Negation operator - returns the negative of the quaternion.

Basically just calls operator - () on the Vec4

Definition at line 719 of file QuatTemplate.h.

◆ operator-() [2/2]

template<typename T >
const QuatT< T > agx::QuatT< T >::operator- ( const QuatT< T > &  rhs) const

Binary subtraction.

Definition at line 702 of file QuatTemplate.h.

References agx::QuatT< T >::m_data.

◆ operator-=()

template<typename T >
QuatT< T > & agx::QuatT< T >::operator-= ( const QuatT< T > &  rhs)

Unary subtraction.

Definition at line 709 of file QuatTemplate.h.

References agx::QuatT< T >::m_data.

◆ operator/() [1/2]

template<typename T >
const QuatT< T > agx::QuatT< T >::operator/ ( const QuatT< T > &  denom) const

Binary divide.

Definition at line 672 of file QuatTemplate.h.

References agx::QuatT< T >::inverse().

◆ operator/() [2/2]

template<typename T >
QuatT< T > agx::QuatT< T >::operator/ ( T  rhs) const

Divide by scalar rhs.

Definition at line 654 of file QuatTemplate.h.

◆ operator/=() [1/2]

template<typename T >
QuatT< T > & agx::QuatT< T >::operator/= ( const QuatT< T > &  denom)

Unary divide.

Definition at line 678 of file QuatTemplate.h.

References agx::QuatT< T >::inverse().

◆ operator/=() [2/2]

template<typename T >
QuatT< T > & agx::QuatT< T >::operator/= ( T  rhs)

Unary divide by scalar rhs.

Definition at line 661 of file QuatTemplate.h.

◆ operator=()

template<typename T >
QuatT< T > & agx::QuatT< T >::operator= ( const QuatT< T > &  v)

Assignment operator.

Definition at line 480 of file QuatTemplate.h.

References agx::QuatT< T >::m_data.

◆ operator==()

template<typename T >
bool agx::QuatT< T >::operator== ( const QuatT< T > &  v) const

Test for equality.

Returns
true if this Quaternion is identical (using == operator) to v

Definition at line 490 of file QuatTemplate.h.

References agx::QuatT< T >::m_data.

◆ operator[]() [1/2]

template<typename T >
T & agx::QuatT< T >::operator[] ( size_t  i)
Returns
a reference to the i:th element of the quaternion in the order x,y,z,w

Definition at line 532 of file QuatTemplate.h.

References agxAssert.

◆ operator[]() [2/2]

template<typename T >
T agx::QuatT< T >::operator[] ( size_t  i) const
Returns
the value of the i:th element of the quaternion in the order x,y,z,w

Definition at line 539 of file QuatTemplate.h.

References agxAssert.

◆ ptr() [1/2]

template<typename T >
T * agx::QuatT< T >::ptr
Returns
a pointer to the data

Definition at line 823 of file QuatTemplate.h.

◆ ptr() [2/2]

template<typename T >
const T * agx::QuatT< T >::ptr
Returns
a const pointer to the data

Definition at line 829 of file QuatTemplate.h.

◆ rightMult()

template<typename T >
const QuatT< T > agx::QuatT< T >::rightMult ( const QuatT< T > &  rhs) const

Binary RIGHT multiplication: q = p * rhs ; results in q = p quatmultiply rhs ;.

Definition at line 647 of file QuatTemplate.h.

◆ rotate() [1/4]

template<typename T >
QuatT< T > agx::QuatT< T >::rotate ( const Vec3T< T > &  from,
const Vec3T< T > &  to 
)
static

Static method which constructs and returns a Quaternion from rotating vector from to vector to.

Definition at line 774 of file QuatTemplate.h.

References agx::QuatT< T >::setRotate().

◆ rotate() [2/4]

template<typename T >
QuatT< T > agx::QuatT< T >::rotate ( T  angle,
const Vec3T< T > &  vec 
)
static

Static method which constructs and returns a Quaternion from a rotation given as angle radians around the vector vec.

Definition at line 756 of file QuatTemplate.h.

References agx::QuatT< T >::setRotate().

◆ rotate() [3/4]

template<typename T >
QuatT< T > agx::QuatT< T >::rotate ( T  angle,
T  x,
T  y,
T  z 
)
static

Static method which constructs and returns a Quaternion from a rotation given as angle radians around the vector (x, y, z)

Definition at line 750 of file QuatTemplate.h.

◆ rotate() [4/4]

template<typename T >
QuatT< T > agx::QuatT< T >::rotate ( T  angle1,
const Vec3T< T > &  axis1,
T  angle2,
const Vec3T< T > &  axis2,
T  angle3,
const Vec3T< T > &  axis3 
)
static

Static method which constructs and returns a Quaternion from a rotation given as a concatenation of the three angle/axis rotations:

this = q1*q2*q3

Definition at line 764 of file QuatTemplate.h.

References agx::QuatT< T >::setRotate().

◆ set() [1/6]

template<typename T >
QuatT<T>& agx::QuatT< T >::set ( const AffineMatrix4x4T< T > &  matrix)

Set this quaternion with the rotational part of matrix.

Returns
a reference to this updated quaternion.

◆ set() [2/6]

template<typename T >
QuatT<T>& agx::QuatT< T >::set ( const EulerAngles &  euler)

Set this quaternion with the rotation described by the EulerAngles representation.

Returns
reference to this updated quaternion.

◆ set() [3/6]

template<typename T >
QuatT<T>& agx::QuatT< T >::set ( const OrthoMatrix3x3 &  matrix)

Set this quaternion with the rotation described by a OrthoMatrix3x3.

Returns
a reference to this updated quaternion.

◆ set() [4/6]

template<typename T >
void agx::QuatT< T >::set ( const Vec4T< T > &  v)

Set the four elements of the quaternion as an Vec4.

Definition at line 523 of file QuatTemplate.h.

References agx::Vec4T< T >::w(), agx::Vec4T< T >::x(), agx::Vec4T< T >::y(), and agx::Vec4T< T >::z().

◆ set() [5/6]

template<typename T >
void agx::QuatT< T >::set ( T  val,
size_t  i 
)

Set the value of element i. Mainly for accessing QuatT<T> in Lua.

Definition at line 817 of file QuatTemplate.h.

◆ set() [6/6]

template<typename T >
void agx::QuatT< T >::set ( T  x,
T  y,
T  z,
T  w 
)

Set the 4 elements of the quaternion as 4 scalars.

Definition at line 514 of file QuatTemplate.h.

◆ setRotate() [1/4]

template<typename T >
void agx::QuatT< T >::setRotate ( const Vec3T< T > &  from,
const Vec3T< T > &  to 
)

Make a rotation QuatT<T> which will rotate from to to Generally take a dot product to get the angle between these and then use a cross product to get the rotation axis Watch out for the two special cases when the vectors are co-incident or opposite in direction.

◆ setRotate() [2/4]

template<typename T >
void agx::QuatT< T >::setRotate ( T  angle,
const Vec3T< T > &  vec 
)

Set the rotation of this Quaternion as a rotation angle radians around the vector vec.

◆ setRotate() [3/4]

template<typename T >
void agx::QuatT< T >::setRotate ( T  angle,
T  x,
T  y,
T  z 
)

Set the rotation of the Quaternion as a rotation angle radians around the vector (x, y, z)

Referenced by agx::QuatT< T >::rotate(), agx::AffineMatrix4x4T< T >::setRotate(), and agx::Matrix4x4T< T >::setRotate().

◆ setRotate() [4/4]

template<typename T >
void agx::QuatT< T >::setRotate ( T  angle1,
const Vec3T< T > &  axis1,
T  angle2,
const Vec3T< T > &  axis2,
T  angle3,
const Vec3T< T > &  axis3 
)

Set the rotation of this Quaternion as a concatenation of the three angle/axis rotations:

this = q1*q2*q3

◆ slerp()

template<typename T >
void agx::QuatT< T >::slerp ( T  t,
const QuatT< T > &  from,
const QuatT< T > &  to 
)

Spherical Linear Interpolation.

As t goes from 0 to 1, the QuatT<T> object goes from from to to.

◆ w() [1/2]

template<typename T >
T & agx::QuatT< T >::w
Returns
a reference to the scalar (last) element of the quaternion.

Definition at line 564 of file QuatTemplate.h.

◆ w() [2/2]

template<typename T >
T agx::QuatT< T >::w
Returns
the value of the scalar (last) element of the quaternion.

Definition at line 588 of file QuatTemplate.h.

◆ x() [1/2]

template<typename T >
T & agx::QuatT< T >::x
Returns
a reference to the first element of the vector part of the quaternion.

Definition at line 546 of file QuatTemplate.h.

◆ x() [2/2]

template<typename T >
T agx::QuatT< T >::x
Returns
the value of the first element of the vector part of the quaternion.

Definition at line 570 of file QuatTemplate.h.

◆ y() [1/2]

template<typename T >
T & agx::QuatT< T >::y
Returns
a reference to the second element of the vector part of the quaternion.

Definition at line 552 of file QuatTemplate.h.

◆ y() [2/2]

template<typename T >
T agx::QuatT< T >::y
Returns
the value of the second element of the vector part of the quaternion.

Definition at line 576 of file QuatTemplate.h.

◆ z() [1/2]

template<typename T >
T & agx::QuatT< T >::z
Returns
a reference to the third element of the vector part of the quaternion.

Definition at line 558 of file QuatTemplate.h.

◆ z() [2/2]

template<typename T >
T agx::QuatT< T >::z
Returns
the value of the third element of the vector part of the quaternion.

Definition at line 582 of file QuatTemplate.h.

◆ zeroRotation()

template<typename T >
bool agx::QuatT< T >::zeroRotation
inline
Returns
true if the QuatT<T> represents a zero rotation, and therefore can be ignored in computations.

Definition at line 594 of file QuatTemplate.h.

Member Data Documentation

◆ m_data


The documentation for this class was generated from the following file: