Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Quaternion.h
Go to the documentation of this file.
1#ifndef ULT_MATH_QUATERNION_H_INCLUDED
2#define ULT_MATH_QUATERNION_H_INCLUDED
3
4#include <Ult/Math/Vector3D.h>
5
6namespace Ult
7{
8
14{
15public:
19 Quaternion();
23 Quaternion(const Quaternion& q);
27 Quaternion(const float x, const float y, const float z, const float w);
28
32 Quaternion operator*(const Quaternion& q) const;
37
39 float Magnitude() const;
41 void Normalize();
43 Quaternion Conjugate() const;
44
46 void RotationAxisToQuaternion(const float angle, const Vector3D& axis);
48 void EulerToQuaternion(const Vector3D& euler);
49
53 Quaternion CrossProduct(const Quaternion& q) const;
54
59 void CreateMatrix(float* matrix) const;
63 void MatrixToQuaternion(const float* matrix);
64
69 void Slerp(const Quaternion& q1, const Quaternion& q2, float t);
70
72 float x, y, z, w;
73};
74
75} // namespace Ult
76
77#endif // ULT_MATH_QUATERNION_H_INCLUDED
78
Quaternion()
Definition Quaternion.cpp:11
void RotationAxisToQuaternion(const float angle, const Vector3D &axis)
Definition Quaternion.cpp:75
void MatrixToQuaternion(const float *matrix)
Definition Quaternion.cpp:138
float Magnitude() const
Definition Quaternion.cpp:53
float x
Definition Quaternion.h:72
float z
Definition Quaternion.h:72
Quaternion Conjugate() const
Definition Quaternion.cpp:70
Quaternion CrossProduct(const Quaternion &q) const
Definition Quaternion.cpp:103
float w
Definition Quaternion.h:72
float y
Definition Quaternion.h:72
void Slerp(const Quaternion &q1, const Quaternion &q2, float t)
Definition Quaternion.cpp:154
void CreateMatrix(float *matrix) const
Definition Quaternion.cpp:113
void EulerToQuaternion(const Vector3D &euler)
Definition Quaternion.cpp:87
void Normalize()
Definition Quaternion.cpp:58
Quaternion operator*(const Quaternion &q) const
Definition Quaternion.cpp:35
Quaternion & operator=(const Quaternion &q)
Definition Quaternion.cpp:44
Definition Vector3D.h:12
Definition Archive.h:13