3Gear Systems SDK  v0.9.34
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
HandTrackingClient::Quaternion< T > Class Template Reference

A minimal quaternion class. More...

#include <VecMath.h>

Public Member Functions

 Quaternion ()
 Initializes the quaternion to the identity rotation.
 
 Quaternion (T x_in, T y_in, T z_in, T w_in)
 Initializes the quaternion from the passed-in values.
 
 Quaternion (const Vector3< T > &v_in, T w_in)
 Initializes the quaternion from vector and scalar components. More...
 
template<typename T2 >
Quaternion< T2 > cast ()
 Convert to a vector with a different base type.
 
Quaternion< T > conjugate () const
 Computes and returns the quaternion conjugate. More...
 
Vector3< T > rotate (const Vector3< T > &v) const
 Rotates the passed-in vector by the rotation represented by this quaternion.
 
void normalize ()
 Normalizes this quaternion.
 
Quaternion< T > normalized () const
 Returns a normalized version of this quaternion.
 
bool operator== (const Quaternion< T > &rhs) const
 Tests for equality (no floating point slop).
 
bool operator!= (const Quaternion< T > &rhs) const
 Tests for inequality (no floating point slop).
 

Static Public Member Functions

static Quaternion< T > fromAxisAngle (const Vector3< T > axis, const T angle)
 

Public Attributes

Vector3< T > v
 The vector component.
 
w
 The w scalar component.
 

Detailed Description

template<typename T>
class HandTrackingClient::Quaternion< T >

A minimal quaternion class.

We have provided this simple Quaternion class to avoid a dependence on an external math library (like Eigen).

Constructor & Destructor Documentation

template<typename T>
HandTrackingClient::Quaternion< T >::Quaternion ( const Vector3< T > &  v_in,
w_in 
)
inline

Initializes the quaternion from vector and scalar components.

Note that this is not the same as initializing with an axis-angle pair (see Quaternionf::fromAxisAngle).

Parameters
v_inVector part.
w_inScalar part.

Member Function Documentation

template<typename T >
Quaternion< T > HandTrackingClient::Quaternion< T >::conjugate ( ) const

Computes and returns the quaternion conjugate.

For normalized quaternions (which represent rotations), the conjugate represents the inverse rotation.

template<typename T>
Quaternion< T > HandTrackingClient::Quaternion< T >::fromAxisAngle ( const Vector3< T >  axis,
const T  angle 
)
static

Initializes the quaternion with the passed-in axis/angle pair.

Parameters
axisRotation axis, must be normalized.
angleAngle in radians.

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