36namespace LinearAlgebra {
275 float GetLength()
const;
276 float GetLengthSquared()
const;
277 static float GetLengthSquared(
const Quaternion &
q);
288using namespace Passer::LinearAlgebra;
An angle in various representations.
Definition Angle.h:21
A quaternion.
Definition Quaternion.h:41
static float Angle(Quaternion orientation1, Quaternion orientation2)
Get the angle between two orientations.
Definition Quaternion.cpp:241
static Quaternion Inverse(Quaternion quaternion)
The inverse of quaterion.
Definition Quaternion.cpp:143
static Quaternion GetRotationAround(Vector3 axis, Quaternion rotation)
Returns the rotation limited around the given axis.
Definition Quaternion.cpp:403
static Quaternion AngleAxis(float angle, const Vector3 &axis)
Convert an angle/axis representation to a quaternion.
Definition Quaternion.cpp:224
static Quaternion EulerXYZ(float x, float y, float z)
Create a rotation from euler angles.
Definition Quaternion.cpp:359
static void GetSwingTwist(Vector3 axis, Quaternion rotation, Quaternion *swing, Quaternion *twist)
Swing-twist decomposition of a rotation.
Definition Quaternion.cpp:412
static Vector3 ToAngles(const Quaternion &q)
Convert to euler angles.
Definition Quaternion.cpp:80
bool operator==(const Quaternion &quaternion) const
Check the equality of two quaternions.
Definition Quaternion.cpp:139
static Quaternion FromToRotation(Vector3 fromDirection, Vector3 toDirection)
Calculat the rotation from on vector to another.
Definition Quaternion.cpp:204
void Normalize()
Convert to unit quaternion.
Definition Quaternion.cpp:61
~Quaternion()
Quaternion destructor.
Definition Quaternion.cpp:42
Vector3 operator*(const Vector3 &vector) const
Rotate a vector using this quaterion.
void ToAngleAxis(float *angle, Vector3 *axis)
Convert this quaternion to angle/axis representation.
Definition Quaternion.cpp:246
static float GetAngleAround(Vector3 axis, Quaternion rotation)
Returns the angle of around the give axis for a rotation.
Definition Quaternion.cpp:390
static const Quaternion identity
An identity quaternion.
Definition Quaternion.h:68
static Quaternion SlerpUnclamped(const Quaternion &rotation1, const Quaternion &rotation2, float factor)
Unclamped sherical lerp between two rotations.
Definition Quaternion.cpp:265
static Quaternion Euler(Vector3 eulerAngles)
Create a rotation from a vector containing euler angles.
static Quaternion LookRotation(const Vector3 &forward, const Vector3 &upwards)
A rotation which looks in the given direction.
static Quaternion EulerXYZ(Vector3 eulerAngles)
Create a rotation from a vector containing euler angles.
Quaternion()
Create a new identity quaternion.
Definition Quaternion.cpp:21
static Quaternion Slerp(const Quaternion &rotation1, const Quaternion &rotation2, float factor)
Sherical lerp between two rotations.
Definition Quaternion.cpp:317
Quaternion operator*(const Quaternion &rotation) const
Multiply this quaternion with another quaternion.
static float Dot(Quaternion rotation1, Quaternion rotation2)
Calculate the dot product of two quaternions.
Definition Quaternion.cpp:76
static Quaternion Euler(float x, float y, float z)
Create a rotation from euler angles.
Definition Quaternion.cpp:327
static Quaternion RotateTowards(const Quaternion &from, const Quaternion &to, float maxDegreesDelta)
Rotate form one orientation to anther with a maximum amount of degrees.
Definition Quaternion.cpp:213
A 3-dimensional vector.
Definition Vector3.h:42
A quaternion (C-style)
Definition Quaternion.h:15
float x
The x component.
Definition Quaternion.h:19
float z
The z component.
Definition Quaternion.h:27
float y
The y component.
Definition Quaternion.h:23
float w
The w component.
Definition Quaternion.h:31