From 16d307e5439619113224aa5ebf53809d5ffa930e Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Thu, 26 Sep 2019 15:27:52 -0700 Subject: [PATCH] enforce that quaternions are made of arithmetic types I believe this might fix some msvc compiler issues too. --- libs/math/include/math/quat.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/libs/math/include/math/quat.h b/libs/math/include/math/quat.h index 5fb8db8934..3008122986 100644 --- a/libs/math/include/math/quat.h +++ b/libs/math/include/math/quat.h @@ -97,24 +97,24 @@ public: constexpr TQuaternion() : x(0), y(0), z(0), w(0) {} // handles implicit conversion to a tvec4. must not be explicit. - template> - constexpr TQuaternion(A w) : x(0), y(0), z(0), w(w) { - } + template> + constexpr TQuaternion(A w) : x(0), y(0), z(0), w(w) {} // initialize from 4 values to w + xi + yj + zk - template + template> constexpr TQuaternion(A w, B x, C y, D z) : x(x), y(y), z(z), w(w) {} // initialize from a vec3 + a value to : v.xi + v.yj + v.zk + w - template + template> constexpr TQuaternion(const TVec3& v, B w) : x(v.x), y(v.y), z(v.z), w(w) {} - // initialize from a double4 - template + // initialize from a vec4 + template> constexpr explicit TQuaternion(const TVec4& v) : x(v.x), y(v.y), z(v.z), w(v.w) {} // initialize from a quaternion of a different type - template + template> constexpr explicit TQuaternion(const TQuaternion& v) : x(v.x), y(v.y), z(v.z), w(v.w) {} // conjugate operator @@ -123,7 +123,7 @@ public: } // constructs a quaternion from an axis and angle - template + template> constexpr static TQuaternion MATH_PURE fromAxisAngle(const TVec3& axis, B angle) { return TQuaternion(std::sin(angle * 0.5) * normalize(axis), std::cos(angle * 0.5)); }