Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
STK::Quaternion< Type > Class Template Reference

#include <StkQuaternion.h>

Inheritance diagram for STK::Quaternion< Type >:
STK::Vector4< Type >

Public Member Functions

constexpr Quaternion (Type x, Type y, Type z, Type w)
 
constexpr Quaternion (const Vector3< Type > &v, Type s)
 Construct a Quaternion from a vector and a scalar.
 
constexpr Quaternion (const Vector4< Type > &v)
 
constexpr void setIdentity ()
 
constexpr Type getScalar () const
 
void setScalar (Type w)
 
constexpr Vector3< Type > getVector () const
 
constexpr void setVector (const Vector3< Type > &v)
 
constexpr Vector3< Type > operator* (const Vector3< Type > &v) const
 Rotates the given vector with the quaternion.
 
constexpr Quaternion operator* (const Quaternion &q) const
 
constexpr void invert ()
 
constexpr Quaternion getInverse () const
 
constexpr void conjugate ()
 
constexpr Quaternion getConjugate () const
 
constexpr Vector3< Type > rotateVector (const Vector3< Type > &vector) const
 Rotates the given vector with this quaternion and returns the resulting vector.
 
constexpr void setAxisAngle (Vector3< Type > axis, Type angle)
 
constexpr void getAxisAngle (Vector3< Type > &axis, Type &angle) const
 
constexpr void eulerToQuat (Type roll, Type pitch, Type yaw)
 
constexpr Matrix4x4< Type > getRotMatrix () const
 
constexpr void setRotMatrix (const Matrix4x4< Type > &m)
 
constexpr void slerp (const Quaternion &src, const Quaternion &dst, Type t)
 
- Public Member Functions inherited from STK::Vector4< Type >
constexpr Vector4 (const Type x, const Type y, const Type z, const Type w)
 
constexpr Vector4 (const Vector3< Type > &v, Type w)
 
template<typename U , STK::enable_if_safe_cast_t< U, Type > = true>
constexpr Vector4 (const Vector4< U > &v)
 
template<typename U >
constexpr operator Vector4< U > () const
 
constexpr const Type & x () const
 
constexpr const Type & y () const
 
constexpr const Type & z () const
 
constexpr const Type & w () const
 
constexpr ranges::span< const Type, 4 > data () const
 
constexpr Type & x ()
 
constexpr Type & y ()
 
constexpr Type & z ()
 
constexpr Type & w ()
 
constexpr ranges::span< Type, 4 > data ()
 
constexpr void setX (Type x)
 
constexpr void setY (Type y)
 
constexpr void setZ (Type z)
 
constexpr void setW (Type w)
 
constexpr bool fuzzyCompare (const Vector4 &v2, Type eps) const
 
constexpr void setValues (const Type &x, const Type &y, const Type &z, const Type &w)
 
constexpr void setValues (ranges::span< const Type, 4 > v)
 
constexpr void getValues (ranges::span< Type, 4 > v) const
 
constexpr void scale (const Type &s)
 
constexpr void add (const Vector4 &t)
 
constexpr Type lengthSquared () const
 Length squared.
 
constexpr Type length () const
 
constexpr Vector4normalize ()
 Normalization.
 
constexpr Vector4operator+= (const Vector4 &v)
 Addition.
 
constexpr Vector4operator-= (const Vector4 &v)
 Subtraction.
 
constexpr Vector4 operator- () const
 Unary negation.
 
constexpr Vector4 operator/ (Type v) const
 Scalar division.
 
constexpr Vector4operator*= (Type v)
 Scalar multiplication.
 
constexpr Vector4operator/= (Type v)
 Scalar division.
 

Static Public Member Functions

static constexpr Quaternion fromAxisAngle (Vector3< Type > axis, Type angle)
 
- Static Public Member Functions inherited from STK::Vector4< Type >
static constexpr Type dot (const Vector4 &v1, const Vector4 &v2)
 Computing dot product.
 

Friends

constexpr friend Quaternion operator* (const Quaternion &q, Type v)
 
constexpr friend Quaternion operator* (Type v, const Quaternion &q)
 
constexpr friend Quaternion operator/ (const Quaternion &q, Type v)
 
constexpr friend Quaternion operator/ (const Quaternion &q, const Quaternion &other)
 

Additional Inherited Members

- Static Public Attributes inherited from STK::Vector4< Type >
static constexpr std::size_t vector_size = 4
 
- Protected Attributes inherited from STK::Vector4< Type >
std::array< Type, 4 > data_ { 0, 0, 0, 0 }
 

Detailed Description

template<class Type>
class STK::Quaternion< Type >

Quaternion - A Quaternion class

Author
Thomas E. Sevaldrud tse@m.nosp@m.ath..nosp@m.sinte.nosp@m.f.no
Rune Aasgaard rune..nosp@m.aasg.nosp@m.aard@.nosp@m.sint.nosp@m.ef.no
See also
Vector3
Matrix4x4

Member Function Documentation

◆ eulerToQuat()

template<class Type >
constexpr void STK::Quaternion< Type >::eulerToQuat ( Type  roll,
Type  pitch,
Type  yaw 
)
inlineconstexpr

Create a Quaternion corresponding to the given euler angles (in degrees). The positive direction of the rotation is clockwise.

◆ getAxisAngle()

template<class Type >
constexpr void STK::Quaternion< Type >::getAxisAngle ( Vector3< Type > &  axis,
Type &  angle 
) const
inlineconstexpr

Returns the axis and rotation angle (in degrees) corresponding to this quaternion. The positive direction of rotation is clockwise when viewed from the origin of the axis.

◆ setAxisAngle()

template<class Type >
constexpr void STK::Quaternion< Type >::setAxisAngle ( Vector3< Type >  axis,
Type  angle 
)
inlineconstexpr

Creates a quaterion that rotates angle degrees about the given axis. The positive direction of rotation is clockwise when viewed from the origin of the axis.

◆ slerp()

template<class Type >
constexpr void STK::Quaternion< Type >::slerp ( const Quaternion< Type > &  src,
const Quaternion< Type > &  dst,
Type  t 
)
inlineconstexpr

Spherical linear interpolation between two quaternions.


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