JUCE  v5.1.1-3-g1a0b28c73
JUCE API
Quaternion< Type > Class Template Reference

Holds a quaternion (a 3D vector and a scalar value). More...

#include <juce_Quaternion.h>

Collaboration diagram for Quaternion< Type >:

Public Member Functions

 Quaternion () noexcept
 
 Quaternion (const Quaternion &other) noexcept
 
 Quaternion (Vector3D< Type > vectorPart, Type scalarPart) noexcept
 
 Quaternion (Type x, Type y, Type z, Type w) noexcept
 
Matrix3D< Type > getRotationMatrix () const noexcept
 Returns the matrix that will perform the rotation specified by this quaternion. More...
 
Type length () const noexcept
 
Type normal () const noexcept
 
Quaternion normalised () const noexcept
 
Quaternionoperator*= (Quaternion other) noexcept
 
Quaternionoperator= (Quaternion other) noexcept
 

Static Public Member Functions

static Quaternion fromAngle (Type angle, Vector3D< Type > axis) noexcept
 Creates a quaternion from an angle and an axis. More...
 

Public Attributes

Type scalar
 The scalar part of the quaternion. More...
 
Vector3D< Type > vector
 The vector part of the quaternion. More...
 

Detailed Description

template<typename Type>
class Quaternion< Type >

Holds a quaternion (a 3D vector and a scalar value).

Constructor & Destructor Documentation

◆ Quaternion() [1/4]

template<typename Type>
Quaternion< Type >::Quaternion ( )
inlinenoexcept

◆ Quaternion() [2/4]

template<typename Type>
Quaternion< Type >::Quaternion ( const Quaternion< Type > &  other)
inlinenoexcept

◆ Quaternion() [3/4]

template<typename Type>
Quaternion< Type >::Quaternion ( Vector3D< Type >  vectorPart,
Type  scalarPart 
)
inlinenoexcept

◆ Quaternion() [4/4]

template<typename Type>
Quaternion< Type >::Quaternion ( Type  x,
Type  y,
Type  z,
Type  w 
)
inlinenoexcept

Member Function Documentation

◆ fromAngle()

template<typename Type>
static Quaternion Quaternion< Type >::fromAngle ( Type  angle,
Vector3D< Type >  axis 
)
inlinestaticnoexcept

Creates a quaternion from an angle and an axis.

References Quaternion< Type >::Quaternion().

Referenced by Draggable3DOrientation::rotationFromMove().

◆ getRotationMatrix()

template<typename Type>
Matrix3D<Type> Quaternion< Type >::getRotationMatrix ( ) const
inlinenoexcept

Returns the matrix that will perform the rotation specified by this quaternion.

References Quaternion< Type >::normal(), Quaternion< Type >::scalar, and Quaternion< Type >::vector.

Referenced by Draggable3DOrientation::getRotationMatrix().

◆ length()

template<typename Type>
Type Quaternion< Type >::length ( ) const
inlinenoexcept

◆ normal()

template<typename Type>
Type Quaternion< Type >::normal ( ) const
inlinenoexcept

◆ normalised()

template<typename Type>
Quaternion Quaternion< Type >::normalised ( ) const
inlinenoexcept

◆ operator*=()

template<typename Type>
Quaternion& Quaternion< Type >::operator*= ( Quaternion< Type >  other)
inlinenoexcept

◆ operator=()

template<typename Type>
Quaternion& Quaternion< Type >::operator= ( Quaternion< Type >  other)
inlinenoexcept

Member Data Documentation

◆ scalar

◆ vector


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