Adding constexpr to cross(vec, qua) and cross(qua, vec)

This commit is contained in:
RohacekD 2020-12-08 23:19:33 +01:00 committed by Dominik Roháček
parent 47ce4ef8a3
commit d0806d4b6d
2 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, qualifier Q> template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> cross( GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> cross(
qua<T, Q> const& q, qua<T, Q> const& q,
vec<3, T, Q> const& v); vec<3, T, Q> const& v);
@ -51,7 +51,7 @@ namespace glm
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template<typename T, qualifier Q> template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> cross( GLM_FUNC_DECL GLM_CONSTEXPR vec<3, T, Q> cross(
vec<3, T, Q> const& v, vec<3, T, Q> const& v,
qua<T, Q> const& q); qua<T, Q> const& q);

View File

@ -12,13 +12,13 @@ namespace glm
} }
template<typename T, qualifier Q> template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& v, qua<T, Q> const& q) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> cross(vec<3, T, Q> const& v, qua<T, Q> const& q)
{ {
return inverse(q) * v; return inverse(q) * v;
} }
template<typename T, qualifier Q> template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> cross(qua<T, Q> const& q, vec<3, T, Q> const& v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, Q> cross(qua<T, Q> const& q, vec<3, T, Q> const& v)
{ {
return q * v; return q * v;
} }