Add static rows, cols, prec, and components fields to all matrix types

This commit is contained in:
Jesse Talavera-Greenberg 2015-07-03 15:21:11 -04:00
parent 5d05c8c1f7
commit 38f63d3943
10 changed files with 229 additions and 109 deletions

View File

@ -54,6 +54,18 @@ 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
private:
/// @cond DETAIL
col_type value[2];

View File

@ -50,6 +50,18 @@ 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
private:
/// @cond DETAIL
col_type value[2];

View File

@ -50,6 +50,18 @@ 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
private:
/// @cond DETAIL
col_type value[2];

View File

@ -50,6 +50,18 @@ 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
private:
/// @cond DETAIL
col_type value[3];

View File

@ -49,6 +49,18 @@ namespace glm
typedef tmat3x3<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 = 3;
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 = 3;
static const length_t rows = 3;
static const precision prec = P;
# endif
template <typename U, precision Q>
friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v);
template <typename U, precision Q>

View File

@ -50,6 +50,18 @@ 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
private:
/// @cond DETAIL
col_type value[3];

View File

@ -50,6 +50,18 @@ 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
private:
/// @cond DETAIL
col_type value[4];

View File

@ -50,6 +50,18 @@ 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
private:
// Data
col_type value[4];

View File

@ -49,6 +49,18 @@ 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
template <typename U, precision Q>
friend tvec4<U, Q> operator/(tmat4x4<U, Q> const & m, tvec4<U, Q> const & v);
template <typename U, precision Q>

View File

@ -71,6 +71,18 @@ 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
GLM_FUNC_DECL length_t length() const;
fvec4SIMD Data[4];