Clean up GLM_FORCE_NO_CTOR_INIT and fixed tests

This commit is contained in:
Christophe Riccio
2017-07-25 22:15:55 +02:00
parent f2cb4a3fdf
commit c933f6e591
9 changed files with 37 additions and 32 deletions

View File

@@ -342,23 +342,14 @@ namespace detail
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps())
# endif
{}
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps())
# endif
{}
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps())
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS

View File

@@ -133,6 +133,12 @@ namespace glm
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(tdualquat<T, P> const & q1, tdualquat<T, P> const & q2);
/// Creates an identity dual quaternion.
///
/// @see gtx_dual_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tdualquat<T, P> dual_quat_identity();
/// Returns the normalized quaternion.
///
/// @see gtx_dual_quaternion

View File

@@ -218,6 +218,14 @@ namespace glm
// -- Operations --
template<typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P> dual_quat_identity()
{
return tdualquat<T, P>(
tquat<T, P>(static_cast<T>(1), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0)),
tquat<T, P>(static_cast<T>(0), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0)));
}
template<typename T, precision P>
GLM_FUNC_QUALIFIER tdualquat<T, P> normalize(tdualquat<T, P> const & q)
{

View File

@@ -32,6 +32,12 @@ namespace glm
/// @addtogroup gtx_quaternion
/// @{
/// Create an identity quaternion.
///
/// @see gtx_quaternion
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_identity();
/// Compute a cross product between a quaternion and a vector.
///
/// @see gtx_quaternion

View File

@@ -6,6 +6,12 @@
namespace glm
{
template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> quat_identity()
{
return tquat<T, P>(static_cast<T>(1), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0));
}
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> cross(vec<3, T, P> const& v, tquat<T, P> const& q)
{