LinearAlgebra
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
Passer::LinearAlgebra::SwingTwistOf< T > Class Template Reference

Detailed Description

template<typename T>
class Passer::LinearAlgebra::SwingTwistOf< T >

An orientation using swing and twist angles in various representations.

Template Parameters
TThe implmentation type used for the representation of the angles

#include <SwingTwist.h>

Public Member Functions

 SwingTwistOf (DirectionOf< T > swing, AngleOf< T > twist)
 
 SwingTwistOf (AngleOf< T > horizontal, AngleOf< T > vertical, AngleOf< T > twist)
 
Quaternion ToQuaternion () const
 
SphericalOf< TToAngleAxis () const
 
bool operator== (const SwingTwistOf< T > d) const
 
SphericalOf< Toperator* (const SphericalOf< T > &vector) const
 Rotate a vector using this rotation.
 
SwingTwistOf< Toperator* (const SwingTwistOf< T > &rotation) const
 Multiply this rotation with another rotation.
 
SwingTwistOf< Toperator*= (const SwingTwistOf< T > &rotation)
 
void Normalize ()
 

Static Public Member Functions

static SwingTwistOf< TDegrees (float horizontal, float vertical=0, float twist=0)
 
static SwingTwistOf< TFromQuaternion (Quaternion q)
 
static SwingTwistOf< TFromAngleAxis (SphericalOf< T > aa)
 
static SwingTwistOf< TInverse (SwingTwistOf< T > rotation)
 
static SwingTwistOf< TAngleAxis (float angle, const DirectionOf< T > &axis)
 Convert an angle/axis representation to a swingt.
 
static AngleOf< TAngle (const SwingTwistOf< T > &r1, const SwingTwistOf< T > &r2)
 

Public Attributes

DirectionOf< Tswing
 
AngleOf< Ttwist
 

Static Public Attributes

static const SwingTwistOf< Tidentity = SwingTwistOf()
 

Member Function Documentation

◆ operator*() [1/2]

template<typename T >
SphericalOf< T > SwingTwistOf::operator* ( const SphericalOf< T > &  vector) const

Rotate a vector using this rotation.

Parameters
vectorThe vector to rotate
Returns
The rotated vector

◆ operator*() [2/2]

template<typename T >
SwingTwistOf< T > SwingTwistOf::operator* ( const SwingTwistOf< T > &  rotation) const

Multiply this rotation with another rotation.

Parameters
rotationThe swing/twist rotation to multiply with
Returns
The resulting swing/twist rotation

The result will be this rotation rotated according to the give rotation.

◆ AngleAxis()

template<typename T >
SwingTwistOf< T > SwingTwistOf::AngleAxis ( float  angle,
const DirectionOf< T > &  axis 
)
static

Convert an angle/axis representation to a swingt.

Parameters
angleThe angle
axisThe axis
Returns
The resulting quaternion

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