#include <quaternion.h>
Definition at line 14 of file quaternion.h.
◆ Quaternion() [1/3]
impeller::Quaternion::Quaternion |
( |
| ) |
|
|
inline |
◆ Quaternion() [2/3]
◆ Quaternion() [3/3]
impeller::Quaternion::Quaternion |
( |
const Vector3 & |
axis, |
|
|
Scalar |
angle |
|
) |
| |
|
inline |
◆ Dot()
◆ Invert()
◆ Length()
Scalar impeller::Quaternion::Length |
( |
| ) |
const |
|
inline |
◆ Normalize()
Quaternion impeller::Quaternion::Normalize |
( |
| ) |
const |
|
inline |
◆ operator!=()
bool impeller::Quaternion::operator!= |
( |
const Quaternion & |
o | ) |
const |
|
inline |
Definition at line 85 of file quaternion.h.
86 return x != o.x ||
y != o.y ||
z != o.z ||
w != o.w;
References w, x, y, and z.
◆ operator*() [1/3]
Definition at line 53 of file quaternion.h.
55 w * o.x +
x * o.w +
y * o.z -
z * o.y,
56 w * o.y +
y * o.w +
z * o.x -
x * o.z,
57 w * o.z +
z * o.w +
x * o.y -
y * o.x,
58 w * o.w -
x * o.x -
y * o.y -
z * o.z,
References w, x, y, and z.
◆ operator*() [2/3]
Definition at line 62 of file quaternion.h.
63 return {scale *
x, scale *
y, scale *
z, scale *
w};
References w, x, y, and z.
◆ operator*() [3/3]
◆ operator+()
Definition at line 73 of file quaternion.h.
74 return {
x + o.x,
y + o.y,
z + o.z,
w + o.w};
References w, x, y, and z.
◆ operator-()
Definition at line 77 of file quaternion.h.
78 return {
x - o.x,
y - o.y,
z - o.z,
w - o.w};
References w, x, y, and z.
◆ operator==()
bool impeller::Quaternion::operator== |
( |
const Quaternion & |
o | ) |
const |
|
inline |
Definition at line 81 of file quaternion.h.
82 return x == o.x &&
y == o.y &&
z == o.z &&
w == o.w;
References w, x, y, and z.
◆ Slerp()
Definition at line 10 of file quaternion.cc.
11 double cosine =
Dot(to);
12 if (fabs(cosine) < 1.0 - 1
e-3 ) {
16 auto sine = sqrt(1.0 - cosine * cosine);
17 auto angle = atan2(sine, cosine);
18 auto sineInverse = 1.0 / sine;
19 auto c0 = sin((1.0 - time) * angle) * sineInverse;
20 auto c1 = sin(time * angle) * sineInverse;
21 return *
this * c0 + to * c1;
26 return (*
this * (1.0 - time) + to * time).Normalize();
Scalar Dot(const Quaternion &q) const
References Dot(), e, and Normalize().
Scalar impeller::Quaternion::e[4] |
Scalar impeller::Quaternion::w = 1.0 |
Definition at line 20 of file quaternion.h.
Referenced by impeller::Matrix::Decompose(), Dot(), Invert(), Length(), impeller::Matrix::MakeRotation(), impeller::Matrix::Matrix(), Normalize(), operator!=(), operator*(), operator+(), operator-(), std::operator<<(), operator==(), Quaternion(), and QuaternionNear().
Scalar impeller::Quaternion::x = 0.0 |
Definition at line 17 of file quaternion.h.
Referenced by impeller::Matrix::Decompose(), Dot(), Invert(), Length(), impeller::Matrix::MakeRotation(), impeller::Matrix::Matrix(), Normalize(), operator!=(), operator*(), operator+(), operator-(), std::operator<<(), operator==(), Quaternion(), and QuaternionNear().
Scalar impeller::Quaternion::y = 0.0 |
Definition at line 18 of file quaternion.h.
Referenced by impeller::Matrix::Decompose(), Dot(), Invert(), Length(), impeller::Matrix::MakeRotation(), impeller::Matrix::Matrix(), Normalize(), operator!=(), operator*(), operator+(), operator-(), std::operator<<(), operator==(), Quaternion(), and QuaternionNear().
Scalar impeller::Quaternion::z = 0.0 |
Definition at line 19 of file quaternion.h.
Referenced by impeller::Matrix::Decompose(), Dot(), Invert(), Length(), impeller::Matrix::MakeRotation(), impeller::Matrix::Matrix(), Normalize(), operator!=(), operator*(), operator+(), operator-(), std::operator<<(), operator==(), Quaternion(), and QuaternionNear().
The documentation for this struct was generated from the following files: