diff options
| author | 2019-02-26 22:38:34 -0500 | |
|---|---|---|
| committer | 2019-02-26 22:38:36 -0500 | |
| commit | 1b855efd5eb21ef802d15f6a531878754904ad4d (patch) | |
| tree | ae6fe25b9e889790b1770bbc77d67e4819d5f572 /src/common/quaternion.h | |
| parent | common/quaternion: Move Quaternion into the Common namespace (diff) | |
| download | yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.tar.gz yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.tar.xz yuzu-1b855efd5eb21ef802d15f6a531878754904ad4d.zip | |
common/vector_math: Move Vec[x] types into the Common namespace
These types are within the common library, so they should be using the
Common namespace.
Diffstat (limited to '')
| -rw-r--r-- | src/common/quaternion.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/quaternion.h b/src/common/quaternion.h index 1c304b048..370198ae0 100644 --- a/src/common/quaternion.h +++ b/src/common/quaternion.h | |||
| @@ -11,7 +11,7 @@ namespace Common { | |||
| 11 | template <typename T> | 11 | template <typename T> |
| 12 | class Quaternion { | 12 | class Quaternion { |
| 13 | public: | 13 | public: |
| 14 | Math::Vec3<T> xyz; | 14 | Vec3<T> xyz; |
| 15 | T w{}; | 15 | T w{}; |
| 16 | 16 | ||
| 17 | Quaternion<decltype(-T{})> Inverse() const { | 17 | Quaternion<decltype(-T{})> Inverse() const { |
| @@ -38,11 +38,11 @@ public: | |||
| 38 | }; | 38 | }; |
| 39 | 39 | ||
| 40 | template <typename T> | 40 | template <typename T> |
| 41 | auto QuaternionRotate(const Quaternion<T>& q, const Math::Vec3<T>& v) { | 41 | auto QuaternionRotate(const Quaternion<T>& q, const Vec3<T>& v) { |
| 42 | return v + 2 * Cross(q.xyz, Cross(q.xyz, v) + v * q.w); | 42 | return v + 2 * Cross(q.xyz, Cross(q.xyz, v) + v * q.w); |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | inline Quaternion<float> MakeQuaternion(const Math::Vec3<float>& axis, float angle) { | 45 | inline Quaternion<float> MakeQuaternion(const Vec3<float>& axis, float angle) { |
| 46 | return {axis * std::sin(angle / 2), std::cos(angle / 2)}; | 46 | return {axis * std::sin(angle / 2), std::cos(angle / 2)}; |
| 47 | } | 47 | } |
| 48 | 48 | ||