Added GLM_META_PROG_HELPERS #350

This commit is contained in:
Christophe Riccio 2015-07-19 00:25:33 +02:00
parent 47deb9709c
commit 38c9cd6cba
18 changed files with 199 additions and 155 deletions

View File

@ -54,17 +54,19 @@ namespace glm
template <typename U, precision Q>
friend tvec2<U, Q> operator/(tvec2<U, Q> const & v, tmat2x2<U, Q> const & m);
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 2;
static GLM_CONSTEXPR length_t cols = 2;
static GLM_CONSTEXPR length_t rows = 2;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 2;
static const length_t cols = 2;
static const length_t rows = 2;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 2;
static GLM_CONSTEXPR length_t columns = 2;
static GLM_CONSTEXPR length_t rows = 2;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 2;
static const length_t columns = 2;
static const length_t rows = 2;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
private:
/// @cond DETAIL

View File

@ -50,17 +50,19 @@ namespace glm
typedef tmat3x2<T, P> transpose_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 2;
static GLM_CONSTEXPR length_t cols = 3;
static GLM_CONSTEXPR length_t rows = 2;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 2;
static const length_t cols = 3;
static const length_t rows = 2;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 2;
static GLM_CONSTEXPR length_t cols = 3;
static GLM_CONSTEXPR length_t rows = 2;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 2;
static const length_t cols = 3;
static const length_t rows = 2;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
private:
/// @cond DETAIL

View File

@ -50,17 +50,19 @@ namespace glm
typedef tmat4x2<T, P> transpose_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 2;
static GLM_CONSTEXPR length_t cols = 4;
static GLM_CONSTEXPR length_t rows = 2;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 2;
static const length_t cols = 4;
static const length_t rows = 2;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 2;
static GLM_CONSTEXPR length_t cols = 4;
static GLM_CONSTEXPR length_t rows = 2;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 2;
static const length_t cols = 4;
static const length_t rows = 2;
static const precision prec = P;
# endif
# endif//GLM_META_PROG_HELPERS
private:
/// @cond DETAIL

View File

@ -50,17 +50,19 @@ namespace glm
typedef tmat2x3<T, P> transpose_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 3;
static GLM_CONSTEXPR length_t cols = 2;
static GLM_CONSTEXPR length_t rows = 3;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 3;
static const length_t cols = 2;
static const length_t rows = 3;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 3;
static GLM_CONSTEXPR length_t cols = 2;
static GLM_CONSTEXPR length_t rows = 3;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 3;
static const length_t cols = 2;
static const length_t rows = 3;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
private:
/// @cond DETAIL

View File

@ -50,17 +50,19 @@ namespace glm
typedef tmat4x3<T, P> transpose_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 3;
static GLM_CONSTEXPR length_t cols = 4;
static GLM_CONSTEXPR length_t rows = 3;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 3;
static const length_t cols = 4;
static const length_t rows = 3;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 3;
static GLM_CONSTEXPR length_t cols = 4;
static GLM_CONSTEXPR length_t rows = 3;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 3;
static const length_t cols = 4;
static const length_t rows = 3;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
private:
/// @cond DETAIL

View File

@ -50,17 +50,19 @@ namespace glm
typedef tmat2x4<T, P> transpose_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR length_t cols = 2;
static GLM_CONSTEXPR length_t rows = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const length_t cols = 2;
static const length_t rows = 4;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR length_t cols = 2;
static GLM_CONSTEXPR length_t rows = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const length_t cols = 2;
static const length_t rows = 4;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
private:
/// @cond DETAIL

View File

@ -50,17 +50,19 @@ namespace glm
typedef tmat3x4<T, P> transpose_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR length_t cols = 3;
static GLM_CONSTEXPR length_t rows = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const length_t cols = 3;
static const length_t rows = 4;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR length_t cols = 3;
static GLM_CONSTEXPR length_t rows = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const length_t cols = 3;
static const length_t rows = 4;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
private:
// Data

View File

@ -49,17 +49,19 @@ namespace glm
typedef tmat4x4<T, P> transpose_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR length_t cols = 4;
static GLM_CONSTEXPR length_t rows = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const length_t cols = 4;
static const length_t rows = 4;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR length_t cols = 4;
static GLM_CONSTEXPR length_t rows = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const length_t cols = 4;
static const length_t rows = 4;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
template <typename U, precision Q>
friend tvec4<U, Q> operator/(tmat4x4<U, Q> const & m, tvec4<U, Q> const & v);

View File

@ -54,13 +54,17 @@ namespace glm
typedef tvec1<T, P> type;
typedef tvec1<bool, P> bool_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 1;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 1;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 1;
static GLM_CONSTEXPR precision precision = P;
# else
static const length_t components = 1;
static const precision precision = P;
# endif
# endif//GLM_META_PROG_HELPERS
//////////////////////////////////////
// Data

View File

@ -54,13 +54,16 @@ namespace glm
typedef tvec2<T, P> type;
typedef tvec2<bool, P> bool_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 2;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 2;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 2;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 2;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
//////////////////////////////////////
// Data

View File

@ -54,13 +54,16 @@ namespace glm
typedef tvec3<T, P> type;
typedef tvec3<bool, P> bool_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 3;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 3;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 3;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 3;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
//////////////////////////////////////
// Data

View File

@ -108,13 +108,16 @@ namespace detail
typedef tvec4<T, P> type;
typedef tvec4<bool, P> bool_type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
//////////////////////////////////////
// Data

View File

@ -64,13 +64,16 @@ namespace glm
{
typedef tquat<T, P> type;
typedef T value_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 4;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
public:
T x, y, z, w;

View File

@ -63,13 +63,16 @@ namespace glm
{
typedef T value_type;
typedef glm::tquat<T, P> part_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 8;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 8;
static const precision prec = P;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 8;
static GLM_CONSTEXPR precision prec = P;
# else
static const length_t components = 8;
static const precision prec = P;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
public:
glm::tquat<T, P> real, dual;

View File

@ -71,17 +71,19 @@ namespace detail
typedef fmat4x4SIMD type;
typedef fmat4x4SIMD transpose_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR length_t cols = 4;
static GLM_CONSTEXPR length_t rows = 4;
static GLM_CONSTEXPR precision prec = defaultp;
# else
static const length_t components = 4;
static const length_t cols = 4;
static const length_t rows = 4;
static const precision prec = defaultp;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR length_t cols = 4;
static GLM_CONSTEXPR length_t rows = 4;
static GLM_CONSTEXPR precision prec = defaultp;
# else
static const length_t components = 4;
static const length_t cols = 4;
static const length_t rows = 4;
static const precision prec = defaultp;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
GLM_FUNC_DECL length_t length() const;

View File

@ -75,13 +75,16 @@ namespace detail
typedef fquatSIMD type;
typedef tquat<bool, defaultp> bool_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR precision prec = defaultp;
# else
static const length_t components = 4;
static const precision prec = defaultp;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR precision prec = defaultp;
# else
static const length_t components = 4;
static const precision prec = defaultp;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
#ifdef GLM_SIMD_ENABLE_XYZW_UNION
union

View File

@ -98,13 +98,16 @@ namespace detail
typedef fvec4SIMD type;
typedef tvec4<bool, highp> bool_type;
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR precision prec = defaultp;
# else
static const length_t components = 4;
static const precision prec = defaultp;
# endif
# if GLM_META_PROG_HELPERS
# if GLM_HAS_CONSTEXPR
static GLM_CONSTEXPR length_t components = 4;
static GLM_CONSTEXPR precision prec = defaultp;
# else
static const length_t components = 4;
static const precision prec = defaultp;
# endif//GLM_HAS_CONSTEXPR
# endif//GLM_META_PROG_HELPERS
#ifdef GLM_SIMD_ENABLE_XYZW_UNION
union

View File

@ -58,6 +58,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
- Added functions eulerAngleXYZ and extractEulerAngleXYZ #311
- Added <glm/gtx/hash.hpp> to perform std::hash on GLM types #320
- Added <glm/gtx/wrap.hpp> for texcoord wrapping
- Added static components and precision members to all vector and quat types #350
##### Improvements:
- Changed usage of __has_include to support Intel compiler #307