Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::Math::QuaternionSimd< QuaternionT > Class Template Reference

#include <VectorMath.h>

Inheritance diagram for Harlinn::Math::QuaternionSimd< QuaternionT >:
[legend]
Collaboration diagram for Harlinn::Math::QuaternionSimd< QuaternionT >:
[legend]

Public Types

using QuaternionType = QuaternionT
 
using ValueType = typename QuaternionType::ValueType
 
using size_type = size_t
 
using value_type = ValueType
 
using Vector = typename Vector<value_type, 3>
 
using VectorSimd = typename Vector::Simd
 
using Normal = Normal3f
 
using NormalSimd = typename Normal::Simd
 
using Simd = QuaternionSimd<QuaternionT>
 
using Matrix = SquareMatrix<ValueType, 4>
 
using MatrixSimd = SquareMatrixSimd<Matrix, 4>
 
using Traits = typename QuaternionType::Traits
 
using SIMDType = typename Traits::SIMDType
 

Public Member Functions

 QuaternionSimd () noexcept
 
 QuaternionSimd (const QuaternionSimd &other) noexcept
 
 QuaternionSimd (SIMDType other) noexcept
 
template<SimdType T>
 QuaternionSimd (const T &pitchYawRoll)
 Creates a quaternion based on the pitch, yaw, and roll (Euler angles).
 
template<TupleType T>
 QuaternionSimd (const T &pitchYawRoll)
 Creates a quaternion based on the pitch, yaw, and roll (Euler angles).
 
template<SimdType T>
 QuaternionSimd (const T &xyz, value_type w)
 
template<TupleType T>
 QuaternionSimd (const T &xyz, value_type w)
 
 QuaternionSimd (ValueType pitch, ValueType yaw, ValueType roll) noexcept
 Creates a quaternion based on the pitch, yaw, and roll (Euler angles).
 
 QuaternionSimd (const QuaternionType &quaternion) noexcept
 
constexpr QuaternionSimd (ValueType xv, ValueType yv, ValueType zv, ValueType wv) noexcept
 
QuaternionSimdoperator= (const QuaternionSimd &other) noexcept
 
QuaternionSimdoperator= (SIMDType other) noexcept
 
QuaternionSimdoperator= (const QuaternionType &quaternion) noexcept
 
bool operator== (const QuaternionSimd &other) const noexcept
 
bool operator!= (const QuaternionSimd &other) const noexcept
 
bool operator== (const QuaternionType &other) const noexcept
 
bool operator!= (const QuaternionType &other) const noexcept
 
QuaternionSimd operator- () const noexcept
 
QuaternionSimdoperator+= (const QuaternionSimd &other) noexcept
 
QuaternionSimdoperator+= (ValueType value) noexcept
 
QuaternionSimdoperator+= (const QuaternionType &quaternion) noexcept
 
QuaternionSimdoperator-= (const QuaternionSimd &other) noexcept
 
QuaternionSimdoperator-= (ValueType value) noexcept
 
QuaternionSimdoperator-= (const QuaternionType &quaternion) noexcept
 
QuaternionSimdoperator*= (const QuaternionSimd &other) noexcept
 
QuaternionSimdoperator*= (ValueType value) noexcept
 
QuaternionSimdoperator*= (const QuaternionType &quaternion) noexcept
 
QuaternionSimdoperator/= (ValueType value) noexcept
 
VectorSimd ToEuler () const noexcept
 Computes rotation about y-axis (y), then x-axis (x), then z-axis (z)
 
template<size_t N>
requires ( N > 2 )
QuaternionSimd< QuaternionT > FromMatrix (const std::array< SIMDType, N > &matrix) noexcept
 

Static Public Member Functions

template<SimdType T>
requires IsCompatible<T, VectorSimd>
static QuaternionSimd FromNormalizedAxisAndAngle (const T &normalizedAxis, float angle) noexcept
 Creates a rotation quaternion around a normalized axis.
 
template<TupleType T>
requires IsCompatible<T, Vector>
static QuaternionSimd FromNormalizedAxisAndAngle (const T &normalizedAxis, float angle) noexcept
 Creates a rotation quaternion around a normalized axis.
 
static QuaternionSimd FromAxisAndAngle (const Math::Vector< float, 3 >::Simd &axis, float angle) noexcept
 Creates a rotation quaternion around an axis.
 
static QuaternionSimd FromAxisAndAngle (const Math::Vector< float, 3 > &axis, float angle) noexcept
 Creates a rotation quaternion around an axis.
 
template<size_t N>
requires ( N > 2 )
static QuaternionSimd FromMatrix (const std::array< SIMDType, N > &matrix) noexcept
 Creates a rotation quaternion from a rotation matrix.
 
static QuaternionSimd FromMatrix (const MatrixSimd &matrix) noexcept
 Creates a rotation quaternion from a rotation matrix.
 
static QuaternionSimd FromMatrix (const Matrix &matrix) noexcept
 Creates a rotation quaternion from a rotation matrix.
 
template<SimdType T, SimdType U>
requires IsCompatible<T, VectorSimd, U>
static QuaternionSimd ShortestArc (const T &fromDir, const U &toDir) noexcept
 Creates the shortest-arc rotation between two directions.
 
template<SimdType T, TupleType U>
requires IsCompatible<T, VectorSimd, U>
static QuaternionSimd ShortestArc (const T &fromDir, const U &toDir) noexcept
 Creates the shortest-arc rotation between two directions.
 
template<TupleType T, SimdType U>
requires IsCompatible<T, VectorSimd, U>
static QuaternionSimd ShortestArc (const T &fromDir, const U &toDir) noexcept
 Creates the shortest-arc rotation between two directions.
 
template<TupleType T, TupleType U>
requires IsCompatible<T, VectorSimd, U>
static QuaternionSimd ShortestArc (const T &fromDir, const U &toDir) noexcept
 Creates the shortest-arc rotation between two directions.
 
static constexpr QuaternionSimd Identity () noexcept
 Returns the identity quaternion.
 
static constexpr QuaternionSimd Zero () noexcept
 Returns a quaternion with all elements set to zero.
 

Public Attributes

SIMDType simd
 

Static Public Attributes

static constexpr size_type Size = 4
 
static constexpr size_type Capacity = Traits::SIMDTypeCapacity
 

Member Typedef Documentation

◆ Matrix

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::Matrix = SquareMatrix<ValueType, 4>

◆ MatrixSimd

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::MatrixSimd = SquareMatrixSimd<Matrix, 4>

◆ Normal

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::Normal = Normal3f

◆ NormalSimd

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::NormalSimd = typename Normal::Simd

◆ QuaternionType

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionType = QuaternionT

◆ Simd

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::Simd = QuaternionSimd<QuaternionT>

◆ SIMDType

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::SIMDType = typename Traits::SIMDType

◆ size_type

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::size_type = size_t

◆ Traits

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::Traits = typename QuaternionType::Traits

◆ value_type

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::value_type = ValueType

◆ ValueType

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::ValueType = typename QuaternionType::ValueType

◆ Vector

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::Vector = typename Vector<value_type, 3>

◆ VectorSimd

template<typename QuaternionT >
using Harlinn::Math::QuaternionSimd< QuaternionT >::VectorSimd = typename Vector::Simd

Constructor & Destructor Documentation

◆ QuaternionSimd() [1/10]

template<typename QuaternionT >
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( )
inlinenoexcept

◆ QuaternionSimd() [2/10]

template<typename QuaternionT >
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( const QuaternionSimd< QuaternionT > & other)
inlinenoexcept

◆ QuaternionSimd() [3/10]

template<typename QuaternionT >
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( SIMDType other)
inlineexplicitnoexcept

◆ QuaternionSimd() [4/10]

template<typename QuaternionT >
template<SimdType T>
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( const T & pitchYawRoll)
inline

Creates a quaternion based on the pitch, yaw, and roll (Euler angles).

Parameters
pitchYawRollA vector containing the Euler angles in the order pitch (around x-axis), then yaw (around y-axis), and then roll (around z-axis).

◆ QuaternionSimd() [5/10]

template<typename QuaternionT >
template<TupleType T>
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( const T & pitchYawRoll)
inline

Creates a quaternion based on the pitch, yaw, and roll (Euler angles).

Parameters
pitchYawRollA vector containing the Euler angles in the order pitch (around x-axis), then yaw (around y-axis), and then roll (around z-axis).

◆ QuaternionSimd() [6/10]

template<typename QuaternionT >
template<SimdType T>
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( const T & xyz,
value_type w )
inline

◆ QuaternionSimd() [7/10]

template<typename QuaternionT >
template<TupleType T>
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( const T & xyz,
value_type w )
inline

◆ QuaternionSimd() [8/10]

template<typename QuaternionT >
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( ValueType pitch,
ValueType yaw,
ValueType roll )
inlinenoexcept

Creates a quaternion based on the pitch, yaw, and roll (Euler angles).

Parameters
pitchAngle of rotation around the x-axis, in radians.
yawAngle of rotation around the y-axis, in radians.
rollAngle of rotation around the z-axis, in radians.

◆ QuaternionSimd() [9/10]

template<typename QuaternionT >
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( const QuaternionType & quaternion)
inlineexplicitnoexcept

◆ QuaternionSimd() [10/10]

template<typename QuaternionT >
Harlinn::Math::QuaternionSimd< QuaternionT >::QuaternionSimd ( ValueType xv,
ValueType yv,
ValueType zv,
ValueType wv )
inlineconstexprnoexcept

Member Function Documentation

◆ FromAxisAndAngle() [1/2]

template<typename QuaternionT >
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::FromAxisAndAngle ( const Math::Vector< float, 3 > & axis,
float angle )
inlinestaticnoexcept

Creates a rotation quaternion around an axis.

Parameters
normalizedAxisA vector describing the axis of rotation.
angleThe angle of rotation in radians.
Returns
The rotation quaternion.

◆ FromAxisAndAngle() [2/2]

template<typename QuaternionT >
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::FromAxisAndAngle ( const Math::Vector< float, 3 >::Simd & axis,
float angle )
inlinestaticnoexcept

Creates a rotation quaternion around an axis.

Parameters
normalizedAxisA vector describing the axis of rotation.
angleThe angle of rotation in radians.
Returns
The rotation quaternion.

◆ FromMatrix() [1/4]

template<typename QuaternionT >
QuaternionSimd< QuaternionT > Harlinn::Math::QuaternionSimd< QuaternionT >::FromMatrix ( const Matrix & matrix)
inlinestaticnoexcept

Creates a rotation quaternion from a rotation matrix.

Parameters
matrixThe rotation matrix.
Returns
The rotation quaternion.

◆ FromMatrix() [2/4]

template<typename QuaternionT >
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::FromMatrix ( const MatrixSimd & matrix)
inlinestaticnoexcept

Creates a rotation quaternion from a rotation matrix.

Parameters
matrixThe rotation matrix.
Returns
The rotation quaternion.

◆ FromMatrix() [3/4]

template<typename QuaternionT >
template<size_t N>
requires ( N > 2 )
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::FromMatrix ( const std::array< SIMDType, N > & matrix)
staticnoexcept

Creates a rotation quaternion from a rotation matrix.

Parameters
matrixThe rotation matrix.
Returns
The rotation quaternion.

◆ FromMatrix() [4/4]

template<typename QuaternionT >
template<size_t N>
requires ( N > 2 )
QuaternionSimd< QuaternionT > Harlinn::Math::QuaternionSimd< QuaternionT >::FromMatrix ( const std::array< SIMDType, N > & matrix)
inlinenoexcept

◆ FromNormalizedAxisAndAngle() [1/2]

template<typename QuaternionT >
template<SimdType T>
requires IsCompatible<T, VectorSimd>
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::FromNormalizedAxisAndAngle ( const T & normalizedAxis,
float angle )
inlinestaticnoexcept

Creates a rotation quaternion around a normalized axis.

Parameters
normalizedAxisA normalized vector describing the axis of rotation.
angleThe angle of rotation in radians.
Returns
The rotation quaternion.

◆ FromNormalizedAxisAndAngle() [2/2]

template<typename QuaternionT >
template<TupleType T>
requires IsCompatible<T, Vector>
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::FromNormalizedAxisAndAngle ( const T & normalizedAxis,
float angle )
inlinestaticnoexcept

Creates a rotation quaternion around a normalized axis.

Parameters
normalizedAxisA normalized vector describing the axis of rotation.
angleThe angle of rotation in radians.
Returns
The rotation quaternion.

◆ Identity()

template<typename QuaternionT >
static constexpr QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::Identity ( )
inlinestaticconstexprnoexcept

Returns the identity quaternion.

Returns
The identity quaternion.

◆ operator!=() [1/2]

template<typename QuaternionT >
bool Harlinn::Math::QuaternionSimd< QuaternionT >::operator!= ( const QuaternionSimd< QuaternionT > & other) const
inlinenoexcept

◆ operator!=() [2/2]

template<typename QuaternionT >
bool Harlinn::Math::QuaternionSimd< QuaternionT >::operator!= ( const QuaternionType & other) const
inlinenoexcept

◆ operator*=() [1/3]

template<typename QuaternionT >
QuaternionSimd & Harlinn::Math::QuaternionSimd< QuaternionT >::operator*= ( const QuaternionSimd< QuaternionT > & other)
inlinenoexcept

◆ operator*=() [2/3]

template<typename QuaternionT >
QuaternionSimd< QuaternionT > & Harlinn::Math::QuaternionSimd< QuaternionT >::operator*= ( const QuaternionType & quaternion)
inlinenoexcept

◆ operator*=() [3/3]

template<typename QuaternionT >
QuaternionSimd & Harlinn::Math::QuaternionSimd< QuaternionT >::operator*= ( ValueType value)
inlinenoexcept

◆ operator+=() [1/3]

template<typename QuaternionT >
QuaternionSimd & Harlinn::Math::QuaternionSimd< QuaternionT >::operator+= ( const QuaternionSimd< QuaternionT > & other)
inlinenoexcept

◆ operator+=() [2/3]

template<typename QuaternionT >
QuaternionSimd< QuaternionT > & Harlinn::Math::QuaternionSimd< QuaternionT >::operator+= ( const QuaternionType & quaternion)
inlinenoexcept

◆ operator+=() [3/3]

template<typename QuaternionT >
QuaternionSimd & Harlinn::Math::QuaternionSimd< QuaternionT >::operator+= ( ValueType value)
inlinenoexcept

◆ operator-()

template<typename QuaternionT >
QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::operator- ( ) const
inlinenoexcept

◆ operator-=() [1/3]

template<typename QuaternionT >
QuaternionSimd< QuaternionT > & Harlinn::Math::QuaternionSimd< QuaternionT >::operator-= ( const QuaternionSimd< QuaternionT > & other)
inlinenoexcept

◆ operator-=() [2/3]

template<typename QuaternionT >
QuaternionSimd & Harlinn::Math::QuaternionSimd< QuaternionT >::operator-= ( const QuaternionType & quaternion)
inlinenoexcept

◆ operator-=() [3/3]

template<typename QuaternionT >
QuaternionSimd & Harlinn::Math::QuaternionSimd< QuaternionT >::operator-= ( ValueType value)
inlinenoexcept

◆ operator/=()

template<typename QuaternionT >
QuaternionSimd & Harlinn::Math::QuaternionSimd< QuaternionT >::operator/= ( ValueType value)
inlinenoexcept

◆ operator=() [1/3]

template<typename QuaternionT >
QuaternionSimd & Harlinn::Math::QuaternionSimd< QuaternionT >::operator= ( const QuaternionSimd< QuaternionT > & other)
inlinenoexcept

◆ operator=() [2/3]

template<typename QuaternionT >
QuaternionSimd< QuaternionT > & Harlinn::Math::QuaternionSimd< QuaternionT >::operator= ( const QuaternionType & quaternion)
inlinenoexcept

◆ operator=() [3/3]

template<typename QuaternionT >
QuaternionSimd & Harlinn::Math::QuaternionSimd< QuaternionT >::operator= ( SIMDType other)
inlinenoexcept

◆ operator==() [1/2]

template<typename QuaternionT >
bool Harlinn::Math::QuaternionSimd< QuaternionT >::operator== ( const QuaternionSimd< QuaternionT > & other) const
inlinenoexcept

◆ operator==() [2/2]

template<typename QuaternionT >
bool Harlinn::Math::QuaternionSimd< QuaternionT >::operator== ( const QuaternionType & other) const
inlinenoexcept

◆ ShortestArc() [1/4]

template<typename QuaternionT >
template<SimdType T, SimdType U>
requires IsCompatible<T, VectorSimd, U>
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::ShortestArc ( const T & fromDir,
const U & toDir )
inlinestaticnoexcept

Creates the shortest-arc rotation between two directions.

Parameters
fromDirThe from direction.

///

Parameters
toDirThe to direction.
Returns
The rotation quaternion.

◆ ShortestArc() [2/4]

template<typename QuaternionT >
template<SimdType T, TupleType U>
requires IsCompatible<T, VectorSimd, U>
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::ShortestArc ( const T & fromDir,
const U & toDir )
inlinestaticnoexcept

Creates the shortest-arc rotation between two directions.

Parameters
fromDirThe from direction.

///

Parameters
toDirThe to direction.
Returns
The rotation quaternion.

◆ ShortestArc() [3/4]

template<typename QuaternionT >
template<TupleType T, SimdType U>
requires IsCompatible<T, VectorSimd, U>
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::ShortestArc ( const T & fromDir,
const U & toDir )
inlinestaticnoexcept

Creates the shortest-arc rotation between two directions.

Parameters
fromDirThe from direction.

///

Parameters
toDirThe to direction.
Returns
The rotation quaternion.

◆ ShortestArc() [4/4]

template<typename QuaternionT >
template<TupleType T, TupleType U>
requires IsCompatible<T, VectorSimd, U>
static QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::ShortestArc ( const T & fromDir,
const U & toDir )
inlinestaticnoexcept

Creates the shortest-arc rotation between two directions.

Parameters
fromDirThe from direction.

///

Parameters
toDirThe to direction.
Returns
The rotation quaternion.

◆ ToEuler()

template<typename QuaternionT >
QuaternionSimd< QuaternionT >::VectorSimd Harlinn::Math::QuaternionSimd< QuaternionT >::ToEuler ( ) const
inlinenoexcept

Computes rotation about y-axis (y), then x-axis (x), then z-axis (z)

Returns
The rotation about y-axis (y), then x-axis (x), then z-axis (z)

◆ Zero()

template<typename QuaternionT >
static constexpr QuaternionSimd Harlinn::Math::QuaternionSimd< QuaternionT >::Zero ( )
inlinestaticconstexprnoexcept

Returns a quaternion with all elements set to zero.

Returns
A quaternion with all elements set to zero.

Member Data Documentation

◆ Capacity

template<typename QuaternionT >
size_type Harlinn::Math::QuaternionSimd< QuaternionT >::Capacity = Traits::SIMDTypeCapacity
staticconstexpr

◆ simd

template<typename QuaternionT >
SIMDType Harlinn::Math::QuaternionSimd< QuaternionT >::simd

◆ Size

template<typename QuaternionT >
size_type Harlinn::Math::QuaternionSimd< QuaternionT >::Size = 4
staticconstexpr

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