summaryrefslogtreecommitdiff
path: root/src/common/quaternion.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2019-02-27 11:19:53 -0500
committerGitHub <noreply@github.com>2019-02-27 11:19:53 -0500
commit66e023fba210741a16a4d629404fdc8578fc5222 (patch)
tree71dd53c8dabf9ed9da9ec7e1a636d375fc863ce2 /src/common/quaternion.h
parentb27e6ad9127471dd89f53719c0d3f6630e839dea (diff)
parentb9238edd0d0bfa7c88ad81ef00347b5194ebed77 (diff)
Merge pull request #2167 from lioncash/namespace
common: Move Quaternion, Rectangle, Vec2, Vec3, and Vec4 into the Common namespace
Diffstat (limited to 'src/common/quaternion.h')
-rw-r--r--src/common/quaternion.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/quaternion.h b/src/common/quaternion.h
index c528c0b68..370198ae0 100644
--- a/src/common/quaternion.h
+++ b/src/common/quaternion.h
@@ -6,12 +6,12 @@
#include "common/vector_math.h"
-namespace Math {
+namespace Common {
template <typename T>
class Quaternion {
public:
- Math::Vec3<T> xyz;
+ Vec3<T> xyz;
T w{};
Quaternion<decltype(-T{})> Inverse() const {
@@ -38,12 +38,12 @@ public:
};
template <typename T>
-auto QuaternionRotate(const Quaternion<T>& q, const Math::Vec3<T>& v) {
+auto QuaternionRotate(const Quaternion<T>& q, const Vec3<T>& v) {
return v + 2 * Cross(q.xyz, Cross(q.xyz, v) + v * q.w);
}
-inline Quaternion<float> MakeQuaternion(const Math::Vec3<float>& axis, float angle) {
+inline Quaternion<float> MakeQuaternion(const Vec3<float>& axis, float angle) {
return {axis * std::sin(angle / 2), std::cos(angle / 2)};
}
-} // namespace Math
+} // namespace Common