JUCE: Quaternion< Type > Class Template Reference

JUCE

Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Quaternion< Type > Class Template Reference
juce_opengl » geometry

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

`#include <juce_Quaternion.h>`

## 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
Quaternion & | operator= (Quaternion other) noexcept
Quaternion & | operator*= (Quaternion other) noexcept
Type | length () const noexcept
Type | normal () const noexcept
Quaternion | normalised () const noexcept
Matrix3D< Type > | getRotationMatrix () const noexcept
| Returns the matrix that will perform the rotation specified by this quaternion. More...

## 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
Vector3D< Type > | vector
| The vector part of the quaternion. More...
Type | scalar
| The scalar 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 | ( |  | ) |
| noexcept

Referenced by Quaternion< Type >::fromAngle(), and Quaternion< Type >::normalised().

## ◆ Quaternion() [2/4]

template<typename Type >

Quaternion< Type >::Quaternion | ( | const Quaternion< Type > & | other | ) |
| noexcept

## ◆ Quaternion() [3/4]

template<typename Type >

Quaternion< Type >::Quaternion | ( | Vector3D< Type > | vectorPart,
|  | Type | scalarPart
| ) |  |
| noexcept

## ◆ Quaternion() [4/4]

template<typename Type >

Quaternion< Type >::Quaternion | ( | Type | x,
|  | Type | y,
|  | Type | z,
|  | Type | w
| ) |  |
| noexcept

## Member Function Documentation

## ◆ fromAngle()

template<typename Type >

static Quaternion Quaternion< Type >::fromAngle | ( | Type | angle,
|  | Vector3D< Type > | axis
| ) |  |
| staticnoexcept

Creates a quaternion from an angle and an axis.

References gl::angle, and Quaternion< Type >::Quaternion().

## ◆ operator=()

template<typename Type >

Quaternion & Quaternion< Type >::operator= | ( | Quaternion< Type > | other | ) |
| noexcept

References Quaternion< Type >::scalar, and Quaternion< Type >::vector.

## ◆ operator*=()

template<typename Type >

Quaternion & Quaternion< Type >::operator*= | ( | Quaternion< Type > | other | ) |
| noexcept

References Quaternion< Type >::scalar, and Quaternion< Type >::vector.

## ◆ length()

template<typename Type >

Type Quaternion< Type >::length | ( |  | ) | const
| noexcept

References Quaternion< Type >::normal().

Referenced by Quaternion< Type >::normalised().

## ◆ normal()

template<typename Type >

Type Quaternion< Type >::normal | ( |  | ) | const
| noexcept

References Quaternion< Type >::scalar, and Quaternion< Type >::vector.

Referenced by Quaternion< Type >::getRotationMatrix(), and Quaternion< Type >::length().

## ◆ normalised()

template<typename Type >

Quaternion Quaternion< Type >::normalised | ( |  | ) | const
| noexcept

References jassert, gl::len, Quaternion< Type >::length(), Quaternion< Type >::Quaternion(), Quaternion< Type >::scalar, and Quaternion< Type >::vector.

## ◆ getRotationMatrix()

template<typename Type >

Matrix3D< Type > Quaternion< Type >::getRotationMatrix | ( |  | ) | const
| noexcept

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

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

Referenced by Draggable3DOrientation::getRotationMatrix().

## Member Data Documentation

## ◆ vector

template<typename Type >

Vector3D<Type> Quaternion< Type >::vector

The vector part of the quaternion.

Referenced by Quaternion< Type >::getRotationMatrix(), Quaternion< Type >::normal(), Quaternion< Type >::normalised(), Quaternion< Type >::operator*=(), and Quaternion< Type >::operator=().

## ◆ scalar

template<typename Type >

Type Quaternion< Type >::scalar

The scalar part of the quaternion.

Referenced by Quaternion< Type >::getRotationMatrix(), Quaternion< Type >::normal(), Quaternion< Type >::normalised(), Quaternion< Type >::operator*=(), and Quaternion< Type >::operator=().

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

- juce_Quaternion.h