- Added constexpr for *vec*, *mat*, *quat* and *dual_quat* types #493

This commit is contained in:
Christophe Riccio 2016-05-05 14:39:50 +02:00
parent d52766297d
commit 7e86e9bc3c
2 changed files with 8 additions and 8 deletions

View File

@ -110,12 +110,12 @@ namespace glm
/// @param v A second normalized axis
/// @see gtc_quaternion
/// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
GLM_FUNC_DECL GLM_CONSTEXPR tquat(tvec3<T, P> const & u, tvec3<T, P> const & v);
GLM_FUNC_DECL tquat(tvec3<T, P> const & u, tvec3<T, P> const & v);
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tquat(tvec3<T, P> const & eulerAngles);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tquat(tmat3x3<T, P> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tquat(tmat4x4<T, P> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tquat(tvec3<T, P> const & eulerAngles);
GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat3x3<T, P> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat4x4<T, P> const & m);
// -- Unary arithmetic operators --

View File

@ -141,7 +141,7 @@ namespace detail
//}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tvec3<T, P> const & u, tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tvec3<T, P> const & u, tvec3<T, P> const & v)
{
tvec3<T, P> const LocalW(cross(u, v));
T Dot = detail::compute_dot<tvec3, T, P>::call(u, v);
@ -151,7 +151,7 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tvec3<T, P> const & eulerAngle)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tvec3<T, P> const & eulerAngle)
{
tvec3<T, P> c = glm::cos(eulerAngle * T(0.5));
tvec3<T, P> s = glm::sin(eulerAngle * T(0.5));
@ -163,13 +163,13 @@ namespace detail
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tmat3x3<T, P> const & m)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tmat3x3<T, P> const & m)
{
*this = quat_cast(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tmat4x4<T, P> const & m)
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tmat4x4<T, P> const & m)
{
*this = quat_cast(m);
}