Quaternion.h
Go to the documentation of this file.
23 static_assert(std::is_floating_point<T>::value, "Quaternion only can be instantiated with floating point types");
79 void Set(const Vector3<T>& rotationBasis0, const Vector3<T>& rotationBasis1, const Vector3<T>& rotationBasis2);
T L2Norm() const
Returns L2 norm of this quaternion.
Definition: Quaternion-Impl.h:390
Quaternion RMul(const Quaternion &other) const
Returns other quaternion * this quaternion.
Definition: Quaternion-Impl.h:248
static Quaternion MakeIdentity()
Returns identity matrix.
Definition: Quaternion-Impl.h:434
Quaternion< T > Slerp(const Quaternion< T > &a, const Quaternion< T > &b, T t)
Computes spherical linear interpolation.
Definition: Quaternion-Impl.h:440
Matrix4x4< T > Matrix4() const
Converts to the 4x4 rotation matrix.
Definition: Quaternion-Impl.h:368
Quaternion Normalized() const
Returns normalized quaternion.
Definition: Quaternion-Impl.h:205
Matrix3x3< T > Matrix3() const
Converts to the 3x3 rotation matrix.
Definition: Quaternion-Impl.h:347
T Angle() const
Returns the rotational angle.
Definition: Quaternion-Impl.h:311
void Rotate(T angleInRadians)
Rotate this quaternion with given angle in radians.
Definition: Quaternion-Impl.h:270
Quaternion()
Make an identity quaternion.
Definition: Quaternion-Impl.h:15
bool operator==(const Quaternion &other) const
Returns true if equal.
Definition: Quaternion-Impl.h:422
Quaternion Inverse() const
Returns the inverse quaternion.
Definition: Quaternion-Impl.h:340
Definition: pybind11Utils.h:24
void Normalize()
Normalizes the quaternion.
Definition: Quaternion-Impl.h:283
Quaternion & operator*=(const Quaternion &other)
Returns this quaternion *= other quaternion.
Definition: Quaternion-Impl.h:403
Quaternion< U > CastTo() const
Returns quaternion with other base type.
Definition: Quaternion-Impl.h:199
T & operator[](size_t i)
Returns the reference to the i-th element.
Definition: Quaternion-Impl.h:410
Vector3< T > Mul(const Vector3< T > &v) const
Returns this quaternion * vector.
Definition: Quaternion-Impl.h:213
void IMul(const Quaternion &other)
Returns this quaternion *= other quaternion.
Definition: Quaternion-Impl.h:258
Vector3< T > Axis() const
Returns the rotational axis.
Definition: Quaternion-Impl.h:297
void Set(const Quaternion &other)
Sets the quaternion with other quaternion.
Definition: Quaternion-Impl.h:63
bool operator!=(const Quaternion &other) const
Returns true if not equal.
Definition: Quaternion-Impl.h:428
Vector< T, 3 > operator*(const Quaternion< T > &q, const Vector< T, 3 > &v)
Returns quaternion q * vector v.
Definition: Quaternion-Impl.h:481
T Dot(const Quaternion< T > &other)
Computes the dot product with other quaternion.
Definition: Quaternion-Impl.h:242
void GetAxisAngle(Vector3< T > *axis, T *angle) const
Returns the axis and angle.
Definition: Quaternion-Impl.h:325
Quaternion & operator=(const Quaternion &other)
Assigns other quaternion.
Definition: Quaternion-Impl.h:396
void SetIdentity()
Makes this quaternion identity.
Definition: Quaternion-Impl.h:264