#include <Runtime/Core/Public/Types.h>
template<typename VecType = SimFloat>
TQuat struct
Unit quaternion parameterized on a scalar type.
| Template parameters | |
|---|---|
| VecType | Scalar element type — defaults to SimFloat. |
Stored as (x, y, z, w) with the scalar part in w. Hamilton product convention.
Public static functions
Constructors, destructors, conversion operators
Public functions
- auto Conjugate() const -> TQuat
- auto LengthSqr() const -> VecType
- auto Normalized() const -> TQuat
- auto operator*(const TQuat& o) const -> TQuat
- Hamilton product:
this* o. - auto Rotate(const TVector3<VecType>& v) const -> TVector3<VecType>
- Rotate vector
vby this unit quaternion: v + 2w(q×v) + 2(q×(q×v)). -
template<typename Dst>auto CastTo() const -> TQuat<Dst>
- Explicit per-component type conversion.
- auto ToFloat() const -> TQuat<float>
- Convert to float components.
- auto ToSim() const -> TQuat<SimFloat>
- Convert to SimFloat components.