From a1574aabd510d5fdc3842780b1d833aa2fb8eac6 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Feb 2019 22:31:15 -0500 Subject: common/quaternion: Move Quaternion into the Common namespace Quaternion is within the common library, so it should be using the Common namespace. --- src/common/quaternion.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/common/quaternion.h') diff --git a/src/common/quaternion.h b/src/common/quaternion.h index c528c0b68..1c304b048 100644 --- a/src/common/quaternion.h +++ b/src/common/quaternion.h @@ -6,7 +6,7 @@ #include "common/vector_math.h" -namespace Math { +namespace Common { template class Quaternion { @@ -46,4 +46,4 @@ inline Quaternion MakeQuaternion(const Math::Vec3& axis, float ang return {axis * std::sin(angle / 2), std::cos(angle / 2)}; } -} // namespace Math +} // namespace Common -- cgit v1.2.3 From 1b855efd5eb21ef802d15f6a531878754904ad4d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 26 Feb 2019 22:38:34 -0500 Subject: 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. --- src/common/quaternion.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/common/quaternion.h') 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 { template class Quaternion { public: - Math::Vec3 xyz; + Vec3 xyz; T w{}; Quaternion Inverse() const { @@ -38,11 +38,11 @@ public: }; template -auto QuaternionRotate(const Quaternion& q, const Math::Vec3& v) { +auto QuaternionRotate(const Quaternion& q, const Vec3& v) { return v + 2 * Cross(q.xyz, Cross(q.xyz, v) + v * q.w); } -inline Quaternion MakeQuaternion(const Math::Vec3& axis, float angle) { +inline Quaternion MakeQuaternion(const Vec3& axis, float angle) { return {axis * std::sin(angle / 2), std::cos(angle / 2)}; } -- cgit v1.2.3