Add IDENTITY and ZERO constants for all matrices
- Tests, too
This commit is contained in:
@@ -61,6 +61,10 @@ namespace glm
|
||||
static GLM_RELAXED_CONSTEXPR precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
static const type ZERO;
|
||||
static const type IDENTITY;
|
||||
# endif
|
||||
private:
|
||||
col_type value[2];
|
||||
|
||||
|
||||
@@ -50,6 +50,13 @@ namespace detail
|
||||
}
|
||||
}//namespace detail
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat2x2<T, P> tmat2x2<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template<typename T, precision P>
|
||||
const tmat2x2<T, P> tmat2x2<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace glm
|
||||
static GLM_RELAXED_CONSTEXPR precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
static const type ZERO;
|
||||
static const type IDENTITY;
|
||||
# endif
|
||||
|
||||
private:
|
||||
col_type value[2];
|
||||
|
||||
|
||||
@@ -32,6 +32,13 @@
|
||||
|
||||
namespace glm
|
||||
{
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat2x3<T, P> tmat2x3<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template<typename T, precision P>
|
||||
const tmat2x3<T, P> tmat2x3<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace glm
|
||||
static GLM_RELAXED_CONSTEXPR precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
static const type ZERO;
|
||||
static const type IDENTITY;
|
||||
# endif
|
||||
|
||||
private:
|
||||
col_type value[2];
|
||||
|
||||
|
||||
@@ -32,6 +32,13 @@
|
||||
|
||||
namespace glm
|
||||
{
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat2x4<T, P> tmat2x4<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template<typename T, precision P>
|
||||
const tmat2x4<T, P> tmat2x4<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace glm
|
||||
static GLM_RELAXED_CONSTEXPR precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
static const type ZERO;
|
||||
static const type IDENTITY;
|
||||
# endif
|
||||
|
||||
private:
|
||||
col_type value[3];
|
||||
|
||||
|
||||
@@ -32,6 +32,13 @@
|
||||
|
||||
namespace glm
|
||||
{
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat3x2<T, P> tmat3x2<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template<typename T, precision P>
|
||||
const tmat3x2<T, P> tmat3x2<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
|
||||
@@ -56,6 +56,11 @@ namespace glm
|
||||
static GLM_RELAXED_CONSTEXPR precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
static const type ZERO;
|
||||
static const type IDENTITY;
|
||||
# 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>
|
||||
|
||||
@@ -56,6 +56,14 @@ namespace detail
|
||||
}
|
||||
}//namespace detail
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat3x3<T, P> tmat3x3<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template<typename T, precision P>
|
||||
const tmat3x3<T, P> tmat3x3<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace glm
|
||||
static GLM_RELAXED_CONSTEXPR precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
static const type ZERO;
|
||||
static const type IDENTITY;
|
||||
# endif
|
||||
|
||||
private:
|
||||
col_type value[3];
|
||||
|
||||
|
||||
@@ -32,6 +32,13 @@
|
||||
|
||||
namespace glm
|
||||
{
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat3x4<T, P> tmat3x4<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template<typename T, precision P>
|
||||
const tmat3x4<T, P> tmat3x4<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace glm
|
||||
static GLM_RELAXED_CONSTEXPR precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
static const type ZERO;
|
||||
static const type IDENTITY;
|
||||
# endif
|
||||
|
||||
private:
|
||||
col_type value[4];
|
||||
|
||||
|
||||
@@ -32,6 +32,13 @@
|
||||
|
||||
namespace glm
|
||||
{
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat4x2<T, P> tmat4x2<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template<typename T, precision P>
|
||||
const tmat4x2<T, P> tmat4x2<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
|
||||
@@ -57,6 +57,11 @@ namespace glm
|
||||
static GLM_RELAXED_CONSTEXPR precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
static const type ZERO;
|
||||
static const type IDENTITY;
|
||||
# endif
|
||||
|
||||
private:
|
||||
col_type value[4];
|
||||
|
||||
|
||||
@@ -32,6 +32,13 @@
|
||||
|
||||
namespace glm
|
||||
{
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat4x3<T, P> tmat4x3<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template<typename T, precision P>
|
||||
const tmat4x3<T, P> tmat4x3<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
|
||||
@@ -56,6 +56,11 @@ namespace glm
|
||||
static GLM_RELAXED_CONSTEXPR precision prec = P;
|
||||
# endif//GLM_META_PROG_HELPERS
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
static const type ZERO;
|
||||
static const type IDENTITY;
|
||||
# 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>
|
||||
|
||||
@@ -92,6 +92,13 @@ namespace detail
|
||||
}
|
||||
}//namespace detail
|
||||
|
||||
# ifdef GLM_STATIC_CONST_MEMBERS
|
||||
template<typename T, precision P>
|
||||
const tmat4x4<T, P> tmat4x4<T, P>::ZERO(static_cast<T>(0));
|
||||
|
||||
template<typename T, precision P>
|
||||
const tmat4x4<T, P> tmat4x4<T, P>::IDENTITY(static_cast<T>(1));
|
||||
# endif
|
||||
// -- Constructors --
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
|
||||
|
||||
Reference in New Issue
Block a user