Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
aiQuaterniont< TReal > Class Template Reference

This class represents a quaternion as a 4D vector. More...

#include <quaternion.h>

Public Member Functions

 aiQuaterniont () AI_NO_EXCEPT
 
 aiQuaterniont (aiVector3t< TReal > axis, TReal angle)
 Construct from an axis-angle pair.
 
 aiQuaterniont (aiVector3t< TReal > normalized)
 Construct from a normalized quaternion stored in a vec3.
 
 aiQuaterniont (const aiMatrix3x3t< TReal > &pRotMatrix)
 Construct from rotation matrix.
 
 aiQuaterniont (TReal pw, TReal px, TReal py, TReal pz)
 
 aiQuaterniont (TReal roty, TReal rotz, TReal rotx)
 Construct from euler angles.
 
aiQuaterniont & Conjugate ()
 Will compute the quaternion conjugate.
 
bool Equal (const aiQuaterniont &o, TReal epsilon=ai_epsilon) const
 
aiMatrix3x3t< TReal > GetMatrix () const
 Returns a matrix representation of the quaternion.
 
aiQuaterniont & Normalize ()
 Will normalize the quaternion representation.
 
bool operator!= (const aiQuaterniont &o) const
 
aiQuaterniont operator* (const aiQuaterniont &two) const
 Multiply two quaternions.
 
aiQuaterniont & operator*= (const aiMatrix4x4t< TReal > &mat)
 
bool operator== (const aiQuaterniont &o) const
 
aiVector3t< TReal > Rotate (const aiVector3t< TReal > &in) const
 Rotate a point by this quaternion.
 

Static Public Member Functions

static void Interpolate (aiQuaterniont &pOut, const aiQuaterniont &pStart, const aiQuaterniont &pEnd, TReal pFactor)
 Performs a spherical interpolation between two quaternions and writes the result into the third.
 

Public Attributes

TReal w
 w,x,y,z components of the quaternion
 
TReal x
 
TReal y
 
TReal z
 

Detailed Description

template<typename TReal>
class aiQuaterniont< TReal >

This class represents a quaternion as a 4D vector.

Constructor & Destructor Documentation

◆ aiQuaterniont() [1/6]

◆ aiQuaterniont() [2/6]

template<typename TReal >
aiQuaterniont< TReal >::aiQuaterniont ( TReal  pw,
TReal  px,
TReal  py,
TReal  pz 
)
inline

◆ aiQuaterniont() [3/6]

template<typename TReal >
aiQuaterniont< TReal >::aiQuaterniont ( const aiMatrix3x3t< TReal > &  pRotMatrix)
inlineexplicit

Construct from rotation matrix.

Result is undefined if the matrix is not orthonormal.

◆ aiQuaterniont() [4/6]

template<typename TReal >
aiQuaterniont< TReal >::aiQuaterniont ( TReal  roty,
TReal  rotz,
TReal  rotx 
)
inline

Construct from euler angles.

◆ aiQuaterniont() [5/6]

template<typename TReal >
aiQuaterniont< TReal >::aiQuaterniont ( aiVector3t< TReal >  axis,
TReal  angle 
)
inline

Construct from an axis-angle pair.

◆ aiQuaterniont() [6/6]

template<typename TReal >
aiQuaterniont< TReal >::aiQuaterniont ( aiVector3t< TReal >  normalized)
inlineexplicit

Construct from a normalized quaternion stored in a vec3.

Member Function Documentation

◆ Conjugate()

template<typename TReal >
aiQuaterniont< TReal > & aiQuaterniont< TReal >::Conjugate ( )
inline

Will compute the quaternion conjugate.

The result will be stored in the instance.

◆ Equal()

template<typename TReal >
bool aiQuaterniont< TReal >::Equal ( const aiQuaterniont< TReal > &  o,
TReal  epsilon = ai_epsilon 
) const
inline

◆ GetMatrix()

template<typename TReal >
aiMatrix3x3t< TReal > aiQuaterniont< TReal >::GetMatrix ( ) const
inline

Returns a matrix representation of the quaternion.

◆ Interpolate()

template<typename TReal >
void aiQuaterniont< TReal >::Interpolate ( aiQuaterniont< TReal > &  pOut,
const aiQuaterniont< TReal > &  pStart,
const aiQuaterniont< TReal > &  pEnd,
TReal  pFactor 
)
inlinestatic

Performs a spherical interpolation between two quaternions and writes the result into the third.

Parameters
pOutTarget object to received the interpolated rotation.
pStartStart rotation of the interpolation at factor == 0.
pEndEnd rotation, factor == 1.
pFactorInterpolation factor between 0 and 1. Values outside of this range yield undefined results.

◆ Normalize()

template<typename TReal >
aiQuaterniont< TReal > & aiQuaterniont< TReal >::Normalize ( )
inline

Will normalize the quaternion representation.

◆ operator!=()

◆ operator*()

template<typename TReal >
aiQuaterniont< TReal > aiQuaterniont< TReal >::operator* ( const aiQuaterniont< TReal > &  two) const
inline

Multiply two quaternions.

Parameters
twoThe other quaternion.
Returns
The result of the multiplication.

◆ operator*=()

◆ operator==()

◆ Rotate()

template<typename TReal >
aiVector3t< TReal > aiQuaterniont< TReal >::Rotate ( const aiVector3t< TReal > &  in) const
inline

Rotate a point by this quaternion.

Member Data Documentation

◆ w

w,x,y,z components of the quaternion

◆ x

◆ y

◆ z


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