Added GLM_FORCE_SIZE_FUNC to replace .length() by .size() #245

This commit is contained in:
Christophe Riccio
2014-10-05 22:12:25 +02:00
parent 03a01880b0
commit 291708ce07
33 changed files with 202 additions and 5 deletions

View File

@@ -66,7 +66,13 @@ namespace glm
public:
T x, y, z, w;
#if GLM_FORCE_SIZE_FUNC
/// Return the count of components of a quaternion
GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
#else
/// Return the count of components of a quaternion
GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
#endif//GLM_FORCE_SIZE_FUNC
// Constructors
GLM_FUNC_DECL tquat();

View File

@@ -45,11 +45,19 @@ namespace detail
};
}//namespace detail
#if GLM_FORCE_SIZE_FUNC
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR size_t tquat<T, P>::size() const
{
return 4;
}
#else
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR length_t tquat<T, P>::length() const
{
return 4;
}
#endif
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat() :