| 1 | #pragma once |
| 2 | |
| 3 | #include <basis/seadTypes.h> |
| 4 | #include <math/seadMathPolicies.h> |
| 5 | |
| 6 | namespace sead |
| 7 | { |
| 8 | template <typename T> |
| 9 | class QuatCalcCommon |
| 10 | { |
| 11 | public: |
| 12 | using Base = typename Policies<T>::QuatBase; |
| 13 | using Vec3 = typename Policies<T>::Vec3Base; |
| 14 | |
| 15 | static T length(const Base& v); |
| 16 | static T normalize(Base& v); |
| 17 | static T dot(const Base& u, const Base& v); |
| 18 | static void setMul(Base& out, const Base& u, const Base& v); |
| 19 | static void slerpTo(Base& out, const Base& q1, const Base& q2, f32 t); |
| 20 | static void makeUnit(Base& q); |
| 21 | static bool makeVectorRotation(Base& q, const Vec3& from, const Vec3& to); |
| 22 | static void set(Base& q, const Base& other); |
| 23 | static void set(Base& q, T w, T x, T y, T z); |
| 24 | static void setRPY(Base& q, T roll, T pitch, T yaw); |
| 25 | static void setAxisAngle(Base& q, const Vec3& axis, T angle); |
| 26 | static void calcRPY(Vec3& rpy, const Base& q); |
| 27 | }; |
| 28 | |
| 29 | } // namespace sead |
| 30 | |
| 31 | #define SEAD_MATH_QUAT_CALC_COMMON_H_ |
| 32 | #include "math/seadQuatCalcCommon.hpp" |
| 33 | #undef SEAD_MATH_QUAT_CALC_COMMON_H_ |
| 34 | |