Roboid Control for C++
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< T > ToAngleAxis () const
 
bool operator== (const SwingTwistOf< T > d) const
 
SphericalOf< T > operator* (const SphericalOf< T > &vector) const
 Rotate a vector using this rotation.
 
SwingTwistOf< T > operator* (const SwingTwistOf< T > &rotation) const
 Multiply this rotation with another rotation.
 
SwingTwistOf< T > operator*= (const SwingTwistOf< T > &rotation)
 
void Normalize ()
 

Static Public Member Functions

static SwingTwistOf< T > Degrees (float horizontal, float vertical=0, float twist=0)
 
static SwingTwistOf< T > FromQuaternion (Quaternion q)
 
static SwingTwistOf< T > FromAngleAxis (SphericalOf< T > aa)
 
static SwingTwistOf< T > Inverse (SwingTwistOf< T > rotation)
 
static SwingTwistOf< T > AngleAxis (float angle, const DirectionOf< T > &axis)
 Convert an angle/axis representation to a swingt.
 
static AngleOf< T > Angle (const SwingTwistOf< T > &r1, const SwingTwistOf< T > &r2)
 

Public Attributes

DirectionOf< T > swing
 
AngleOf< T > twist
 

Static Public Attributes

static const SwingTwistOf< T > identity = 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: