v0.1.8
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Pages
CGUL::QuaternionT< Type > Struct Template Reference

Quaternion. More...

#include <Quaternion.hpp>

Public Member Functions

 QuaternionT (const Vector3T< Type > &euler)
 
 QuaternionT (Type w, Type x, Type y, Type z)
 
QuaternionT< Type > & operator* (const QuaternionT< Type > &operand) const
 
QuaternionT< Type > & operator*= (const QuaternionT< Type > &operand)
 
QuaternionT< Type > & operator* (Type operand) const
 
QuaternionT< Type > & operator*= (Type operand)
 
QuaternionT< Type > & operator+ (const QuaternionT< Type > &operand) const
 
QuaternionT< Type > & operator+= (const QuaternionT< Type > &operand)
 
QuaternionT< Type > & operator- (const QuaternionT< Type > &operand) const
 
QuaternionT< Type > & operator-= (const QuaternionT< Type > &operand)
 
void Normalize ()
 Normalizes the quaternion. More...
 
void RotateOnAxis (const Vector3T< Type > &axis, Type angle)
 
void Set (Type w, Type x, Type y, Type z)
 
void FromEuler (const Vector3T< Type > &euler)
 
Vector3T< Type > ToEuler ()
 

Static Public Member Functions

static QuaternionT< Type > Lerp (const QuaternionT &from, const QuaternionT &to, Type t)
 Performs linear interpolation on a quaternion and normalizes it.
 

Public Attributes

Type w
 The w component.
 
Type x
 The x component.
 
Type y
 The y component.
 
Type z
 The z component.
 

Detailed Description

template<typename Type>
struct CGUL::QuaternionT< Type >

Quaternion.

Todo:
Finish this class.

Member Function Documentation

template<typename Type >
void CGUL::QuaternionT< Type >::Normalize ( )

Normalizes the quaternion.

In theory, a quaternion should always be normalized. Due to floating point inconsistencies, quaternions are hardly ever normalized. It is imperative that a quaternion be normalized regularly. Ideally, you would normalize a quaternion once per tick.

Note
"A de-normalized quaternion is NOT a happy quaternion and will cause you problems" -Professor Nicholson

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