Commit 8e451e99 authored by Philip Trettner's avatar Philip Trettner

Updated GLM to 0.9.7.2

parent cbfd4f79
Pipeline #729 passed with stage
...@@ -548,14 +548,16 @@ namespace detail ...@@ -548,14 +548,16 @@ namespace detail
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
return std::isnan(x); return std::isnan(x);
# elif GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL) # elif GLM_COMPILER & GLM_COMPILER_VC
return _isnan(x) != 0; return _isnan(x) != 0;
# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # elif GLM_COMPILER & GLM_COMPILER_INTEL
# if GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L # if GLM_PLATFORM & GLM_PLATFORM_WINDOWS
return _isnan(x) != 0; return _isnan(x) != 0;
# else # else
return std::isnan(x); return ::isnan(x) != 0;
# endif # endif
# elif (GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))) && (GLM_PLATFORM & GLM_PLATFORM_ANDROID) && __cplusplus < 201103L
return _isnan(x) != 0;
# elif GLM_COMPILER & GLM_COMPILER_CUDA # elif GLM_COMPILER & GLM_COMPILER_CUDA
return isnan(x) != 0; return isnan(x) != 0;
# else # else
...@@ -583,7 +585,11 @@ namespace detail ...@@ -583,7 +585,11 @@ namespace detail
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
return std::isinf(x); return std::isinf(x);
# elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC) # elif GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC)
# if(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;
# else
return ::isinf(x);
# endif
# elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) # elif GLM_COMPILER & (GLM_COMPILER_GCC | (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM))
# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L) # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID && __cplusplus < 201103L)
return _isinf(x) != 0; return _isinf(x) != 0;
...@@ -662,7 +668,7 @@ namespace detail ...@@ -662,7 +668,7 @@ namespace detail
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'frexp' only accept floating-point inputs");
return std::frexp(x, exp); return std::frexp(x, &exp);
} }
template <typename T, precision P> template <typename T, precision P>
...@@ -670,7 +676,7 @@ namespace detail ...@@ -670,7 +676,7 @@ namespace detail
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
return tvec1<T, P>(std::frexp(x.x, exp.x)); return tvec1<T, P>(std::frexp(x.x, &exp.x));
} }
template <typename T, precision P> template <typename T, precision P>
...@@ -706,7 +712,7 @@ namespace detail ...@@ -706,7 +712,7 @@ namespace detail
frexp(x.w, exp.w)); frexp(x.w, exp.w));
} }
template <typename genType, precision P> template <typename genType>
GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp) GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'ldexp' only accept floating-point inputs");
......
...@@ -86,7 +86,7 @@ namespace detail ...@@ -86,7 +86,7 @@ namespace detail
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType length(genType x) GLM_FUNC_QUALIFIER genType length(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' accepts only floating-point inputs");
return abs(x); return abs(x);
} }
...@@ -94,7 +94,7 @@ namespace detail ...@@ -94,7 +94,7 @@ namespace detail
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T length(vecType<T, P> const & v) GLM_FUNC_QUALIFIER T length(vecType<T, P> const & v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' accepts only floating-point inputs");
return sqrt(dot(v, v)); return sqrt(dot(v, v));
} }
...@@ -103,7 +103,7 @@ namespace detail ...@@ -103,7 +103,7 @@ namespace detail
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType distance(genType const & p0, genType const & p1) GLM_FUNC_QUALIFIER genType distance(genType const & p0, genType const & p1)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' accepts only floating-point inputs");
return length(p1 - p0); return length(p1 - p0);
} }
...@@ -118,14 +118,14 @@ namespace detail ...@@ -118,14 +118,14 @@ namespace detail
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER T dot(T x, T y) GLM_FUNC_QUALIFIER T dot(T x, T y)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
return x * y; return x * y;
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T dot(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER T dot(vecType<T, P> const & x, vecType<T, P> const & y)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
return detail::compute_dot<vecType, T, P>::call(x, y); return detail::compute_dot<vecType, T, P>::call(x, y);
} }
...@@ -133,7 +133,7 @@ namespace detail ...@@ -133,7 +133,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> cross(tvec3<T, P> const & x, tvec3<T, P> const & y) GLM_FUNC_QUALIFIER tvec3<T, P> cross(tvec3<T, P> const & x, tvec3<T, P> const & y)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' accepts only floating-point inputs");
return tvec3<T, P>( return tvec3<T, P>(
x.y * y.z - y.y * x.z, x.y * y.z - y.y * x.z,
...@@ -145,7 +145,7 @@ namespace detail ...@@ -145,7 +145,7 @@ namespace detail
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType normalize(genType const & x) GLM_FUNC_QUALIFIER genType normalize(genType const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' accepts only floating-point inputs");
return x < genType(0) ? genType(-1) : genType(1); return x < genType(0) ? genType(-1) : genType(1);
} }
...@@ -153,7 +153,7 @@ namespace detail ...@@ -153,7 +153,7 @@ namespace detail
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> normalize(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> normalize(vecType<T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
return x * inversesqrt(dot(x, x)); return x * inversesqrt(dot(x, x));
} }
...@@ -182,7 +182,7 @@ namespace detail ...@@ -182,7 +182,7 @@ namespace detail
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType const & eta) GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType const & eta)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' accepts only floating-point inputs");
genType const dotValue(dot(N, I)); genType const dotValue(dot(N, I));
genType const k(static_cast<genType>(1) - eta * eta * (static_cast<genType>(1) - dotValue * dotValue)); genType const k(static_cast<genType>(1) - eta * eta * (static_cast<genType>(1) - dotValue * dotValue));
...@@ -192,7 +192,7 @@ namespace detail ...@@ -192,7 +192,7 @@ namespace detail
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> refract(vecType<T, P> const & I, vecType<T, P> const & N, T eta) GLM_FUNC_QUALIFIER vecType<T, P> refract(vecType<T, P> const & I, vecType<T, P> const & N, T eta)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' accepts only floating-point inputs");
T const dotValue(dot(N, I)); T const dotValue(dot(N, I));
T const k(static_cast<T>(1) - eta * eta * (static_cast<T>(1) - dotValue * dotValue)); T const k(static_cast<T>(1) - eta * eta * (static_cast<T>(1) - dotValue * dotValue));
......
...@@ -123,7 +123,7 @@ namespace glm ...@@ -123,7 +123,7 @@ namespace glm
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & a, vecType<T, P> const & b) GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & a, vecType<T, P> const & b)
{ {
return detail::functor2<T, P, vecType>::call(atan2, a, b); return detail::functor2<T, P, vecType>::call(::std::atan2, a, b);
} }
using std::atan; using std::atan;
......
...@@ -42,4 +42,12 @@ namespace glm ...@@ -42,4 +42,12 @@ namespace glm
simd, simd,
defaultp = highp defaultp = highp
}; };
template <typename T, precision P, template <typename, precision> class genType>
struct type
{
static bool const is_vec = false;
static bool const is_mat = false;
static bool const is_quat = false;
};
}//namespace glm }//namespace glm
...@@ -38,15 +38,15 @@ ...@@ -38,15 +38,15 @@
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// Version // Version
#define GLM_VERSION 97 #define GLM_VERSION 98
#define GLM_VERSION_MAJOR 0 #define GLM_VERSION_MAJOR 0
#define GLM_VERSION_MINOR 9 #define GLM_VERSION_MINOR 9
#define GLM_VERSION_PATCH 7 #define GLM_VERSION_PATCH 8
#define GLM_VERSION_REVISION 1 #define GLM_VERSION_REVISION 0
#if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_VERSION_DISPLAYED)) #if(defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_VERSION_DISPLAYED))
# define GLM_MESSAGE_VERSION_DISPLAYED # define GLM_MESSAGE_VERSION_DISPLAYED
# pragma message ("GLM: version 0.9.7.1") # pragma message ("GLM: version 0.9.8.0")
#endif//GLM_MESSAGE #endif//GLM_MESSAGE
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
...@@ -65,6 +65,8 @@ ...@@ -65,6 +65,8 @@
#ifdef GLM_FORCE_PLATFORM_UNKNOWN #ifdef GLM_FORCE_PLATFORM_UNKNOWN
# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN # define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
#elif defined(__CYGWIN__)
# define GLM_PLATFORM GLM_PLATFORM_CYGWIN
#elif defined(__QNXNTO__) #elif defined(__QNXNTO__)
# define GLM_PLATFORM GLM_PLATFORM_QNXNTO # define GLM_PLATFORM GLM_PLATFORM_QNXNTO
#elif defined(__APPLE__) #elif defined(__APPLE__)
...@@ -393,13 +395,13 @@ ...@@ -393,13 +395,13 @@
#elif defined(GLM_FORCE_SSE2) #elif defined(GLM_FORCE_SSE2)
# define GLM_ARCH (GLM_ARCH_SSE2) # define GLM_ARCH (GLM_ARCH_SSE2)
#elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX)) #elif (GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX))
# if(__AVX2__) # if defined(__AVX2__)
# define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) # define GLM_ARCH (GLM_ARCH_AVX2 | GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
# elif(__AVX__) # elif defined(__AVX__)
# define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2) # define GLM_ARCH (GLM_ARCH_AVX | GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
# elif(__SSE3__) # elif defined(__SSE3__)
# define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2) # define GLM_ARCH (GLM_ARCH_SSE3 | GLM_ARCH_SSE2)
# elif(__SSE2__) # elif defined(__SSE2__)
# define GLM_ARCH (GLM_ARCH_SSE2) # define GLM_ARCH (GLM_ARCH_SSE2)
# else # else
# define GLM_ARCH GLM_ARCH_PURE # define GLM_ARCH GLM_ARCH_PURE
...@@ -455,13 +457,6 @@ ...@@ -455,13 +457,6 @@
#endif//GLM_ARCH #endif//GLM_ARCH
#if GLM_ARCH & GLM_ARCH_SSE2 #if GLM_ARCH & GLM_ARCH_SSE2
# include <emmintrin.h> # include <emmintrin.h>
# if(GLM_COMPILER == GLM_COMPILER_VC2005) // VC2005 is missing some intrinsics, workaround
inline float _mm_cvtss_f32(__m128 A) { return A.m128_f32[0]; }
inline __m128 _mm_castpd_ps(__m128d PD) { union { __m128 ps; __m128d pd; } c; c.pd = PD; return c.ps; }
inline __m128d _mm_castps_pd(__m128 PS) { union { __m128 ps; __m128d pd; } c; c.ps = PS; return c.pd; }
inline __m128i _mm_castps_si128(__m128 PS) { union { __m128 ps; __m128i pi; } c; c.ps = PS; return c.pi; }
inline __m128 _mm_castsi128_ps(__m128i PI) { union { __m128 ps; __m128i pi; } c; c.pi = PI; return c.ps; }
# endif
#endif//GLM_ARCH #endif//GLM_ARCH
#if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED) #if defined(GLM_MESSAGES) && !defined(GLM_MESSAGE_ARCH_DISPLAYED)
...@@ -577,29 +572,20 @@ ...@@ -577,29 +572,20 @@
# endif # endif
# elif GLM_COMPILER & GLM_COMPILER_INTEL # elif GLM_COMPILER & GLM_COMPILER_INTEL
# ifdef _MSC_EXTENSIONS # ifdef _MSC_EXTENSIONS
# if __cplusplus >= 201402L # define GLM_MSC_EXT GLM_LANG_CXXMS_FLAG
# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG)
# elif __cplusplus >= 201103L
# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG)
# elif GLM_COMPILER >= GLM_COMPILER_INTEL13
# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG)
# elif __cplusplus >= 199711L
# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG)
# else # else
# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) # define GLM_MSC_EXT 0
# endif # endif
# else
# if __cplusplus >= 201402L # if __cplusplus >= 201402L
# define GLM_LANG (GLM_LANG_CXX14 | GLM_LANG_CXXMS_FLAG) # define GLM_LANG (GLM_LANG_CXX14 | GLM_MSC_EXT)
# elif __cplusplus >= 201103L # elif __cplusplus >= 201103L
# define GLM_LANG (GLM_LANG_CXX11 | GLM_LANG_CXXMS_FLAG) # define GLM_LANG (GLM_LANG_CXX11 | GLM_MSC_EXT)
# elif GLM_COMPILER >= GLM_COMPILER_INTEL13 # elif __INTEL_CXX11_MODE__
# define GLM_LANG (GLM_LANG_CXX0X | GLM_LANG_CXXMS_FLAG) # define GLM_LANG (GLM_LANG_CXX0X | GLM_MSC_EXT)
# elif __cplusplus >= 199711L # elif __cplusplus >= 199711L
# define GLM_LANG (GLM_LANG_CXX98 | GLM_LANG_CXXMS_FLAG) # define GLM_LANG (GLM_LANG_CXX98 | GLM_MSC_EXT)
# else # else
# define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG) # define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT)
# endif
# endif # endif
# else // Unkown compiler # else // Unkown compiler
# if __cplusplus >= 201402L # if __cplusplus >= 201402L
...@@ -650,7 +636,7 @@ ...@@ -650,7 +636,7 @@
// http://gcc.gnu.org/projects/cxx0x.html // http://gcc.gnu.org/projects/cxx0x.html
// http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx // http://msdn.microsoft.com/en-us/library/vstudio/hh567368(v=vs.120).aspx
#if GLM_PLATFORM == GLM_PLATFORM_ANDROID #if GLM_PLATFORM == GLM_PLATFORM_ANDROID || GLM_PLATFORM == GLM_PLATFORM_CYGWIN
# define GLM_HAS_CXX11_STL 0 # define GLM_HAS_CXX11_STL 0
#elif GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG) #elif GLM_COMPILER & (GLM_COMPILER_LLVM | GLM_COMPILER_APPLE_CLANG)
# if __has_include(<__config>) // libc++ # if __has_include(<__config>) // libc++
...@@ -667,7 +653,7 @@ ...@@ -667,7 +653,7 @@
# define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && \ # define GLM_HAS_CXX11_STL ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && \
((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \ ((GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC48)) || \
((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \ ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2013)) || \
((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15))) ((GLM_PLATFORM != GLM_PLATFORM_WINDOWS) && (GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_COMPILER >= GLM_COMPILER_INTEL15)))
#endif #endif
// N1720 // N1720
...@@ -1011,7 +997,7 @@ namespace detail ...@@ -1011,7 +997,7 @@ namespace detail
} }
}//namespace glm }//namespace glm
# define GLM_COUNTOF(arr) glm::countof(arr) # define GLM_COUNTOF(arr) glm::countof(arr)
#elif _MSC_VER #elif defined(_MSC_VER)
# define GLM_COUNTOF(arr) _countof(arr) # define GLM_COUNTOF(arr) _countof(arr)
#else #else
# define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0]) # define GLM_COUNTOF(arr) sizeof(arr) / sizeof(arr[0])
......
...@@ -52,12 +52,12 @@ namespace detail ...@@ -52,12 +52,12 @@ namespace detail
i(0) i(0)
{} {}
GLM_FUNC_QUALIFIER uif32(float f) : GLM_FUNC_QUALIFIER uif32(float f_) :
f(f) f(f_)
{} {}
GLM_FUNC_QUALIFIER uif32(uint32 i) : GLM_FUNC_QUALIFIER uif32(uint32 i_) :
i(i) i(i_)
{} {}
float f; float f;
......
...@@ -61,6 +61,10 @@ namespace glm ...@@ -61,6 +61,10 @@ namespace glm
static GLM_RELAXED_CONSTEXPR precision prec = P; static GLM_RELAXED_CONSTEXPR precision prec = P;
# endif//GLM_META_PROG_HELPERS # endif//GLM_META_PROG_HELPERS
# ifdef GLM_STATIC_CONST_MEMBERS
static const type ZERO;
static const type IDENTITY;
# endif
private: private:
col_type value[2]; col_type value[2];
...@@ -157,7 +161,10 @@ namespace glm ...@@ -157,7 +161,10 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m); GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m);
// -- Binary operators -- // -- Binary operators --
...@@ -222,6 +229,16 @@ namespace glm ...@@ -222,6 +229,16 @@ namespace glm
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2); GLM_FUNC_DECL bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
// -- Is type --
template <typename T, precision P>
struct type<T, P, tmat2x2>
{
static bool const is_vec = false;
static bool const is_mat = true;
static bool const is_quat = false;
};
} //namespace glm } //namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE #ifndef GLM_EXTERNAL_TEMPLATE
......
...@@ -50,6 +50,13 @@ namespace detail ...@@ -50,6 +50,13 @@ namespace detail
} }
}//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 -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
...@@ -367,7 +374,13 @@ namespace detail ...@@ -367,7 +374,13 @@ namespace detail
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m) GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m)
{ {
return tmat2x2<T, P>( return tmat2x2<T, P>(
-m[0], -m[0],
......
<
...@@ -57,6 +57,11 @@ namespace glm ...@@ -57,6 +57,11 @@ namespace glm
static GLM_RELAXED_CONSTEXPR precision prec = P; static GLM_RELAXED_CONSTEXPR precision prec = P;
# endif//GLM_META_PROG_HELPERS # endif//GLM_META_PROG_HELPERS
# ifdef GLM_STATIC_CONST_MEMBERS
static const type ZERO;
static const type IDENTITY;
# endif
private: private:
col_type value[2]; col_type value[2];
...@@ -149,7 +154,10 @@ namespace glm ...@@ -149,7 +154,10 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> const operator-(tmat2x3<T, P> const & m); GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m);
// -- Binary operators -- // -- Binary operators --
...@@ -199,6 +207,16 @@ namespace glm ...@@ -199,6 +207,16 @@ namespace glm
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2); GLM_FUNC_DECL bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
// -- Is type --
template <typename T, precision P>
struct type<T, P, tmat2x3>
{
static bool const is_vec = false;
static bool const is_mat = true;
static bool const is_quat = false;
};
}//namespace glm }//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE