Use length_t instead of int for vec and mat lengths #584

This commit is contained in:
Christophe Riccio
2016-12-30 20:05:04 +01:00
parent b92fdf5a59
commit c2fe3fccf6
217 changed files with 4724 additions and 4799 deletions

View File

@@ -11,93 +11,93 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER T mod289(T const & x) GLM_FUNC_QUALIFIER T mod289(T const & x)
{ {
return x - floor(x * (static_cast<T>(1.0) / static_cast<T>(289.0))) * static_cast<T>(289.0); return x - floor(x * (static_cast<T>(1.0) / static_cast<T>(289.0))) * static_cast<T>(289.0);
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER T permute(T const & x) GLM_FUNC_QUALIFIER T permute(T const & x)
{ {
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> permute(vec<2, T, P> const & x) GLM_FUNC_QUALIFIER vec<2, T, P> permute(vec<2, T, P> const & x)
{ {
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> permute(vec<3, T, P> const & x) GLM_FUNC_QUALIFIER vec<3, T, P> permute(vec<3, T, P> const & x)
{ {
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> permute(vec<4, T, P> const & x) GLM_FUNC_QUALIFIER vec<4, T, P> permute(vec<4, T, P> const & x)
{ {
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x); return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
} }
/* /*
template <typename T, precision P, template<typename> class vecType> template<typename T, precision P, template<typename> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> permute(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> permute(vecType<L, T, P> const & x)
{ {
return mod289(((x * T(34)) + T(1)) * x); return mod289(((x * T(34)) + T(1)) * x);
} }
*/ */
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r)
{ {
return T(1.79284291400159) - T(0.85373472095314) * r; return T(1.79284291400159) - T(0.85373472095314) * r;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> taylorInvSqrt(vec<2, T, P> const & r) GLM_FUNC_QUALIFIER vec<2, T, P> taylorInvSqrt(vec<2, T, P> const & r)
{ {
return T(1.79284291400159) - T(0.85373472095314) * r; return T(1.79284291400159) - T(0.85373472095314) * r;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> taylorInvSqrt(vec<3, T, P> const & r) GLM_FUNC_QUALIFIER vec<3, T, P> taylorInvSqrt(vec<3, T, P> const & r)
{ {
return T(1.79284291400159) - T(0.85373472095314) * r; return T(1.79284291400159) - T(0.85373472095314) * r;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> taylorInvSqrt(vec<4, T, P> const & r) GLM_FUNC_QUALIFIER vec<4, T, P> taylorInvSqrt(vec<4, T, P> const & r)
{ {
return T(1.79284291400159) - T(0.85373472095314) * r; return T(1.79284291400159) - T(0.85373472095314) * r;
} }
/* /*
template <typename T, precision P, template<typename> class vecType> template<typename T, precision P, template<typename> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> taylorInvSqrt(vecType<D, T, P> const & r) GLM_FUNC_QUALIFIER vecType<L, T, P> taylorInvSqrt(vecType<L, T, P> const & r)
{ {
return T(1.79284291400159) - T(0.85373472095314) * r; return T(1.79284291400159) - T(0.85373472095314) * r;
} }
*/ */
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> fade(vec<2, T, P> const & t) GLM_FUNC_QUALIFIER vec<2, T, P> fade(vec<2, T, P> const & t)
{ {
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> fade(vec<3, T, P> const & t) GLM_FUNC_QUALIFIER vec<3, T, P> fade(vec<3, T, P> const & t)
{ {
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> fade(vec<4, T, P> const & t) GLM_FUNC_QUALIFIER vec<4, T, P> fade(vec<4, T, P> const & t)
{ {
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
} }
/* /*
template <typename T, precision P, template <typename> class vecType> template<typename T, precision P, template<typename> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> fade(vecType<D, T, P> const & t) GLM_FUNC_QUALIFIER vecType<L, T, P> fade(vecType<L, T, P> const & t)
{ {
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
} }

View File

@@ -7,7 +7,7 @@ namespace glm{
namespace detail namespace detail
{ {
// Internal class for implementing swizzle operators // Internal class for implementing swizzle operators
template <typename T, int N> template<typename T, int N>
struct _swizzle_base0 struct _swizzle_base0
{ {
protected: protected:
@@ -20,24 +20,24 @@ namespace detail
char _buffer[1]; char _buffer[1];
}; };
template <int N, typename T, precision P, int E0, int E1, int E2, int E3, bool Aligned> template<int N, typename T, precision P, int E0, int E1, int E2, int E3, bool Aligned>
struct _swizzle_base1 : public _swizzle_base0<T, N> struct _swizzle_base1 : public _swizzle_base0<T, N>
{ {
}; };
template <typename T, precision P, int E0, int E1, bool Aligned> template<typename T, precision P, int E0, int E1, bool Aligned>
struct _swizzle_base1<2, T, P, E0,E1,-1,-2, Aligned> : public _swizzle_base0<T, 2> struct _swizzle_base1<2, T, P, E0,E1,-1,-2, Aligned> : public _swizzle_base0<T, 2>
{ {
GLM_FUNC_QUALIFIER vec<2, T, P> operator ()() const { return vec<2, T, P>(this->elem(E0), this->elem(E1)); } GLM_FUNC_QUALIFIER vec<2, T, P> operator ()() const { return vec<2, T, P>(this->elem(E0), this->elem(E1)); }
}; };
template <typename T, precision P, int E0, int E1, int E2, bool Aligned> template<typename T, precision P, int E0, int E1, int E2, bool Aligned>
struct _swizzle_base1<3, T, P, E0,E1,E2,-1, Aligned> : public _swizzle_base0<T, 3> struct _swizzle_base1<3, T, P, E0,E1,E2,-1, Aligned> : public _swizzle_base0<T, 3>
{ {
GLM_FUNC_QUALIFIER vec<3, T, P> operator ()() const { return vec<3, T, P>(this->elem(E0), this->elem(E1), this->elem(E2)); } GLM_FUNC_QUALIFIER vec<3, T, P> operator ()() const { return vec<3, T, P>(this->elem(E0), this->elem(E1), this->elem(E2)); }
}; };
template <typename T, precision P, int E0, int E1, int E2, int E3, bool Aligned> template<typename T, precision P, int E0, int E1, int E2, int E3, bool Aligned>
struct _swizzle_base1<4, T, P, E0,E1,E2,E3, Aligned> : public _swizzle_base0<T, 4> struct _swizzle_base1<4, T, P, E0,E1,E2,E3, Aligned> : public _swizzle_base0<T, 4>
{ {
GLM_FUNC_QUALIFIER vec<4, T, P> operator ()() const { return vec<4, T, P>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } GLM_FUNC_QUALIFIER vec<4, T, P> operator ()() const { return vec<4, T, P>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
@@ -55,7 +55,7 @@ namespace detail
DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles
containing duplicate elements so that they cannot be used as r-values). containing duplicate elements so that they cannot be used as r-values).
*/ */
template <int N, typename T, precision P, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS> template<int N, typename T, precision P, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS>
struct _swizzle_base2 : public _swizzle_base1<N, T, P, E0,E1,E2,E3, detail::is_aligned<P>::value> struct _swizzle_base2 : public _swizzle_base1<N, T, P, E0,E1,E2,E3, detail::is_aligned<P>::value>
{ {
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t)
@@ -118,7 +118,7 @@ namespace detail
} }
protected: protected:
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER void _apply_op(vec<N, T, P> const& that, U op) GLM_FUNC_QUALIFIER void _apply_op(vec<N, T, P> const& that, U op)
{ {
// Make a copy of the data in this == &that. // Make a copy of the data in this == &that.
@@ -133,7 +133,7 @@ namespace detail
}; };
// Specialization for swizzles containing duplicate elements. These cannot be modified. // Specialization for swizzles containing duplicate elements. These cannot be modified.
template <int N, typename T, precision P, int E0, int E1, int E2, int E3> template<int N, typename T, precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base2<N, T, P, E0,E1,E2,E3, 1> : public _swizzle_base1<N, T, P, E0,E1,E2,E3, detail::is_aligned<P>::value> struct _swizzle_base2<N, T, P, E0,E1,E2,E3, 1> : public _swizzle_base1<N, T, P, E0,E1,E2,E3, detail::is_aligned<P>::value>
{ {
struct Stub {}; struct Stub {};
@@ -147,7 +147,7 @@ namespace detail
} }
}; };
template <int N, typename T, precision P, int E0, int E1, int E2, int E3> template<int N, typename T, precision P, int E0, int E1, int E2, int E3>
struct _swizzle : public _swizzle_base2<N, T, P, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)> struct _swizzle : public _swizzle_base2<N, T, P, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)>
{ {
typedef _swizzle_base2<N, T, P, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)> base_type; typedef _swizzle_base2<N, T, P, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)> base_type;
@@ -160,8 +160,8 @@ namespace detail
// //
// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros // To prevent the C++ syntax from getting entirely overwhelming, define some alias macros
// //
#define _GLM_SWIZZLE_TEMPLATE1 template <int N, typename T, precision P, int E0, int E1, int E2, int E3> #define _GLM_SWIZZLE_TEMPLATE1 template<int N, typename T, precision P, int E0, int E1, int E2, int E3>
#define _GLM_SWIZZLE_TEMPLATE2 template <int N, typename T, precision P, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3> #define _GLM_SWIZZLE_TEMPLATE2 template<int N, typename T, precision P, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3>
#define _GLM_SWIZZLE_TYPE1 _swizzle<N, T, P, E0, E1, E2, E3> #define _GLM_SWIZZLE_TYPE1 _swizzle<N, T, P, E0, E1, E2, E3>
#define _GLM_SWIZZLE_TYPE2 _swizzle<N, T, P, F0, F1, F2, F3> #define _GLM_SWIZZLE_TYPE2 _swizzle<N, T, P, F0, F1, F2, F3>

View File

@@ -22,21 +22,21 @@
} }
#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \ #define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \
template <typename T> \ template<typename T> \
vec<L, T, P> vec<L, T, P>::A ## B() CONST \ vec<L, T, P> vec<L, T, P>::A ## B() CONST \
{ \ { \
return vec<2, T, P>(this->A, this->B); \ return vec<2, T, P>(this->A, this->B); \
} }
#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \ #define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \
template <typename T> \ template<typename T> \
vec<3, T, P> vec<L, T, P>::A ## B ## C() CONST \ vec<3, T, P> vec<L, T, P>::A ## B ## C() CONST \
{ \ { \
return vec<3, T, P>(this->A, this->B, this->C); \ return vec<3, T, P>(this->A, this->B, this->C); \
} }
#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \ #define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \
template <typename T> \ template<typename T> \
vec<4, T, P> vec<L, T, P>::A ## B ## C ## D() CONST \ vec<4, T, P> vec<L, T, P>::A ## B ## C ## D() CONST \
{ \ { \
return vec<4, T, P>(this->A, this->B, this->C, this->D); \ return vec<4, T, P>(this->A, this->B, this->C, this->D); \

View File

@@ -11,10 +11,10 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <int D, typename R, typename T, precision P> template<length_t L, typename R, typename T, precision P>
struct functor1{}; struct functor1{};
template <typename R, typename T, precision P> template<typename R, typename T, precision P>
struct functor1<1, R, T, P> struct functor1<1, R, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<1, R, P> call(R (*Func) (T x), vec<1, T, P> const & v) GLM_FUNC_QUALIFIER static vec<1, R, P> call(R (*Func) (T x), vec<1, T, P> const & v)
@@ -23,7 +23,7 @@ namespace detail
} }
}; };
template <typename R, typename T, precision P> template<typename R, typename T, precision P>
struct functor1<2, R, T, P> struct functor1<2, R, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<2, R, P> call(R (*Func) (T x), vec<2, T, P> const & v) GLM_FUNC_QUALIFIER static vec<2, R, P> call(R (*Func) (T x), vec<2, T, P> const & v)
@@ -32,7 +32,7 @@ namespace detail
} }
}; };
template <typename R, typename T, precision P> template<typename R, typename T, precision P>
struct functor1<3, R, T, P> struct functor1<3, R, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<3, R, P> call(R (*Func) (T x), vec<3, T, P> const & v) GLM_FUNC_QUALIFIER static vec<3, R, P> call(R (*Func) (T x), vec<3, T, P> const & v)
@@ -41,7 +41,7 @@ namespace detail
} }
}; };
template <typename R, typename T, precision P> template<typename R, typename T, precision P>
struct functor1<4, R, T, P> struct functor1<4, R, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<4, R, P> call(R (*Func) (T x), vec<4, T, P> const & v) GLM_FUNC_QUALIFIER static vec<4, R, P> call(R (*Func) (T x), vec<4, T, P> const & v)
@@ -50,10 +50,10 @@ namespace detail
} }
}; };
template <int D, typename T, precision P> template<length_t L, typename T, precision P>
struct functor2{}; struct functor2{};
template <typename T, precision P> template<typename T, precision P>
struct functor2<1, T, P> struct functor2<1, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, vec<1, T, P> const & b) GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, vec<1, T, P> const & b)
@@ -62,7 +62,7 @@ namespace detail
} }
}; };
template <typename T, precision P> template<typename T, precision P>
struct functor2<2, T, P> struct functor2<2, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, vec<2, T, P> const & b) GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, vec<2, T, P> const & b)
@@ -71,7 +71,7 @@ namespace detail
} }
}; };
template <typename T, precision P> template<typename T, precision P>
struct functor2<3, T, P> struct functor2<3, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, vec<3, T, P> const & b) GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, vec<3, T, P> const & b)
@@ -80,7 +80,7 @@ namespace detail
} }
}; };
template <typename T, precision P> template<typename T, precision P>
struct functor2<4, T, P> struct functor2<4, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, vec<4, T, P> const & b) GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, vec<4, T, P> const & b)
@@ -89,10 +89,10 @@ namespace detail
} }
}; };
template <int D, typename T, precision P> template<length_t L, typename T, precision P>
struct functor2_vec_sca{}; struct functor2_vec_sca{};
template <typename T, precision P> template<typename T, precision P>
struct functor2_vec_sca<1, T, P> struct functor2_vec_sca<1, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, T b) GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, T b)
@@ -101,7 +101,7 @@ namespace detail
} }
}; };
template <typename T, precision P> template<typename T, precision P>
struct functor2_vec_sca<2, T, P> struct functor2_vec_sca<2, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, T b) GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, T b)
@@ -110,7 +110,7 @@ namespace detail
} }
}; };
template <typename T, precision P> template<typename T, precision P>
struct functor2_vec_sca<3, T, P> struct functor2_vec_sca<3, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, T b) GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, T b)
@@ -119,7 +119,7 @@ namespace detail
} }
}; };
template <typename T, precision P> template<typename T, precision P>
struct functor2_vec_sca<4, T, P> struct functor2_vec_sca<4, T, P>
{ {
GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, T b) GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, T b)

View File

@@ -166,21 +166,21 @@ glm::vec3 lighting
*/ */
/* /*
template <typename T, glm::precision P, template<typename, glm::precision> class vecType> template<typename T, glm::precision P, template<typename, glm::precision> class vecType>
T normalizeDotA(vecType<D, T, P> const & x, vecType<D, T, P> const & y) T normalizeDotA(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
} }
#define GLM_TEMPLATE_GENTYPE typename T, glm::precision P, template<typename, glm::precision> class #define GLM_TEMPLATE_GENTYPE typename T, glm::precision P, template<typename, glm::precision> class
template <GLM_TEMPLATE_GENTYPE vecType> template<GLM_TEMPLATE_GENTYPE vecType>
T normalizeDotB(vecType<D, T, P> const & x, vecType<D, T, P> const & y) T normalizeDotB(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
} }
template <typename vecType> template<typename vecType>
typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b) typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b)
{ {
return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b)); return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b));

View File

@@ -26,11 +26,11 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType abs(genType x); GLM_FUNC_DECL genType abs(genType x);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> abs(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> abs(vecType<L, T, P> const & x);
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
/// ///
@@ -38,8 +38,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> sign(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> sign(vecType<L, T, P> const & x);
/// Returns a value equal to the nearest integer that is less then or equal to x. /// Returns a value equal to the nearest integer that is less then or equal to x.
/// ///
@@ -47,8 +47,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> floor(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> floor(vecType<L, T, P> const & x);
/// Returns a value equal to the nearest integer to x /// Returns a value equal to the nearest integer to x
/// whose absolute value is not larger than the absolute value of x. /// whose absolute value is not larger than the absolute value of x.
@@ -57,8 +57,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> trunc(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> trunc(vecType<L, T, P> const & x);
/// Returns a value equal to the nearest integer to x. /// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the /// The fraction 0.5 will round in a direction chosen by the
@@ -70,8 +70,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> round(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> round(vecType<L, T, P> const & x);
/// Returns a value equal to the nearest integer to x. /// Returns a value equal to the nearest integer to x.
/// A fractional part of 0.5 will round toward the nearest even /// A fractional part of 0.5 will round toward the nearest even
@@ -82,8 +82,8 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a> /// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> roundEven(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> roundEven(vecType<L, T, P> const & x);
/// Returns a value equal to the nearest integer /// Returns a value equal to the nearest integer
/// that is greater than or equal to x. /// that is greater than or equal to x.
@@ -92,8 +92,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> ceil(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> ceil(vecType<L, T, P> const & x);
/// Return x - floor(x). /// Return x - floor(x).
/// ///
@@ -101,11 +101,11 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType fract(genType x); GLM_FUNC_DECL genType fract(genType x);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> fract(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> fract(vecType<L, T, P> const & x);
/// Modulus. Returns x - y * floor(x / y) /// Modulus. Returns x - y * floor(x / y)
/// for each component in x using the floating point value y. /// for each component in x using the floating point value y.
@@ -114,14 +114,14 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType mod(genType x, genType y); GLM_FUNC_DECL genType mod(genType x, genType y);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> mod(vecType<D, T, P> const & x, T y); GLM_FUNC_DECL vecType<L, T, P> mod(vecType<L, T, P> const & x, T y);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> mod(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, T, P> mod(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns the fractional part of x and sets i to the integer /// Returns the fractional part of x and sets i to the integer
/// part (as a whole number floating point value). Both the /// part (as a whole number floating point value). Both the
@@ -132,7 +132,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType modf(genType x, genType & i); GLM_FUNC_DECL genType modf(genType x, genType & i);
/// Returns y if y < x; otherwise, it returns x. /// Returns y if y < x; otherwise, it returns x.
@@ -141,14 +141,14 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType min(genType x, genType y); GLM_FUNC_DECL genType min(genType x, genType y);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> min(vecType<D, T, P> const & x, T y); GLM_FUNC_DECL vecType<L, T, P> min(vecType<L, T, P> const & x, T y);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> min(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, T, P> min(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns y if x < y; otherwise, it returns x. /// Returns y if x < y; otherwise, it returns x.
/// ///
@@ -156,14 +156,14 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType max(genType x, genType y); GLM_FUNC_DECL genType max(genType x, genType y);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> max(vecType<D, T, P> const & x, T y); GLM_FUNC_DECL vecType<L, T, P> max(vecType<L, T, P> const & x, T y);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> max(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, T, P> max(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns min(max(x, minVal), maxVal) for each component in x /// Returns min(max(x, minVal), maxVal) for each component in x
/// using the floating-point values minVal and maxVal. /// using the floating-point values minVal and maxVal.
@@ -172,14 +172,14 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> clamp(vecType<D, T, P> const & x, T minVal, T maxVal); GLM_FUNC_DECL vecType<L, T, P> clamp(vecType<L, T, P> const & x, T minVal, T maxVal);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> clamp(vecType<D, T, P> const & x, vecType<D, T, P> const & minVal, vecType<D, T, P> const & maxVal); GLM_FUNC_DECL vecType<L, T, P> clamp(vecType<L, T, P> const & x, vecType<L, T, P> const & minVal, vecType<L, T, P> const & maxVal);
/// If genTypeU is a floating scalar or vector: /// If genTypeU is a floating scalar or vector:
/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
@@ -223,35 +223,35 @@ namespace glm
/// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second. /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second.
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
/// @endcode /// @endcode
template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> mix(vecType<D, T, P> const & x, vecType<D, T, P> const & y, vecType<D, U, P> const & a); GLM_FUNC_DECL vecType<L, T, P> mix(vecType<L, T, P> const & x, vecType<L, T, P> const & y, vecType<L, U, P> const & a);
template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> mix(vecType<D, T, P> const & x, vecType<D, T, P> const & y, U a); GLM_FUNC_DECL vecType<L, T, P> mix(vecType<L, T, P> const & x, vecType<L, T, P> const & y, U a);
template <typename genTypeT, typename genTypeU> template<typename genTypeT, typename genTypeU>
GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType step(genType edge, genType x); GLM_FUNC_DECL genType step(genType edge, genType x);
/// Returns 0.0 if x < edge, otherwise it returns 1.0. /// Returns 0.0 if x < edge, otherwise it returns 1.0.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <int, typename, precision> class vecType, int D, typename T, precision P> template<template<length_t, typename, precision> class vecType, length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<D, T, P> step(T edge, vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> step(T edge, vecType<L, T, P> const & x);
/// Returns 0.0 if x < edge, otherwise it returns 1.0. /// Returns 0.0 if x < edge, otherwise it returns 1.0.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <int, typename, precision> class vecType, int D, typename T, precision P> template<template<length_t, typename, precision> class vecType, length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<D, T, P> step(vecType<D, T, P> const & edge, vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> step(vecType<L, T, P> const & edge, vecType<L, T, P> const & x);
/// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
/// performs smooth Hermite interpolation between 0 and 1 /// performs smooth Hermite interpolation between 0 and 1
@@ -267,14 +267,14 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x); GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> smoothstep(T edge0, T edge1, vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> smoothstep(T edge0, T edge1, vecType<L, T, P> const & x);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> smoothstep(vecType<D, T, P> const & edge0, vecType<D, T, P> const & edge1, vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> smoothstep(vecType<L, T, P> const & edge0, vecType<L, T, P> const & edge1, vecType<L, T, P> const & x);
/// Returns true if x holds a NaN (not a number) /// Returns true if x holds a NaN (not a number)
/// representation in the underlying implementation's set of /// representation in the underlying implementation's set of
@@ -288,8 +288,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> isnan(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, bool, P> isnan(vecType<L, T, P> const & x);
/// Returns true if x holds a positive infinity or negative /// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's /// infinity representation in the underlying implementation's
@@ -301,8 +301,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> isinf(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, bool, P> isinf(vecType<L, T, P> const & x);
/// Returns a signed integer value representing /// Returns a signed integer value representing
/// the encoding of a floating-point value. The floating-point /// the encoding of a floating-point value. The floating-point
@@ -318,8 +318,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <int, typename, precision> class vecType, int D, precision P> template<template<length_t, typename, precision> class vecType, length_t L, precision P>
GLM_FUNC_DECL vecType<D, int, P> floatBitsToInt(vecType<D, float, P> const & v); GLM_FUNC_DECL vecType<L, int, P> floatBitsToInt(vecType<L, float, P> const & v);
/// Returns a unsigned integer value representing /// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint /// the encoding of a floating-point value. The floatingpoint
@@ -335,8 +335,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <int, typename, precision> class vecType, int D, precision P> template<template<length_t, typename, precision> class vecType, length_t L, precision P>
GLM_FUNC_DECL vecType<D, uint, P> floatBitsToUint(vecType<D, float, P> const & v); GLM_FUNC_DECL vecType<L, uint, P> floatBitsToUint(vecType<L, float, P> const & v);
/// Returns a floating-point value corresponding to a signed /// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value. /// integer encoding of a floating-point value.
@@ -356,8 +356,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <int, typename, precision> class vecType, int D, precision P> template<template<length_t, typename, precision> class vecType, length_t L, precision P>
GLM_FUNC_DECL vecType<D, float, P> intBitsToFloat(vecType<D, int, P> const & v); GLM_FUNC_DECL vecType<L, float, P> intBitsToFloat(vecType<L, int, P> const & v);
/// Returns a floating-point value corresponding to a /// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value. /// unsigned integer encoding of a floating-point value.
@@ -377,8 +377,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <int, typename, precision> class vecType, int D, precision P> template<template<length_t, typename, precision> class vecType, length_t L, precision P>
GLM_FUNC_DECL vecType<D, float, P> uintBitsToFloat(vecType<D, uint, P> const & v); GLM_FUNC_DECL vecType<L, float, P> uintBitsToFloat(vecType<L, uint, P> const & v);
/// Computes and returns a * b + c. /// Computes and returns a * b + c.
/// ///
@@ -386,7 +386,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c); GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c);
/// Splits x into a floating-point significand in the range /// Splits x into a floating-point significand in the range
@@ -403,7 +403,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genIType> template<typename genType, typename genIType>
GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp); GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp);
/// Builds a floating-point number from x and the /// Builds a floating-point number from x and the
@@ -417,7 +417,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>; /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genIType> template<typename genType, typename genIType>
GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp); GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp);
/// @} /// @}

View File

@@ -11,7 +11,7 @@
namespace glm namespace glm
{ {
// min // min
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType min(genType x, genType y) GLM_FUNC_QUALIFIER genType min(genType x, genType y)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs");
@@ -19,7 +19,7 @@ namespace glm
} }
// max // max
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType max(genType x, genType y) GLM_FUNC_QUALIFIER genType max(genType x, genType y)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs");
@@ -28,7 +28,7 @@ namespace glm
} }
// abs // abs
template <> template<>
GLM_FUNC_QUALIFIER int32 abs(int32 x) GLM_FUNC_QUALIFIER int32 abs(int32 x)
{ {
int32 const y = x >> 31; int32 const y = x >> 31;
@@ -39,7 +39,7 @@ namespace glm
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
using ::std::round; using ::std::round;
# else # else
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType round(genType x) GLM_FUNC_QUALIFIER genType round(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'round' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'round' only accept floating-point inputs");
@@ -52,7 +52,7 @@ namespace glm
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
using ::std::trunc; using ::std::trunc;
# else # else
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType trunc(genType x) GLM_FUNC_QUALIFIER genType trunc(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'trunc' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'trunc' only accept floating-point inputs");
@@ -66,11 +66,11 @@ namespace glm
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <typename genFIType, bool /*signed*/> template<typename genFIType, bool /*signed*/>
struct compute_abs struct compute_abs
{}; {};
template <typename genFIType> template<typename genFIType>
struct compute_abs<genFIType, true> struct compute_abs<genFIType, true>
{ {
GLM_FUNC_QUALIFIER static genFIType call(genFIType x) GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
@@ -85,7 +85,7 @@ namespace detail
}; };
#if GLM_COMPILER & GLM_COMPILER_CUDA #if GLM_COMPILER & GLM_COMPILER_CUDA
template <> template<>
struct compute_abs<float, true> struct compute_abs<float, true>
{ {
GLM_FUNC_QUALIFIER static float call(float x) GLM_FUNC_QUALIFIER static float call(float x)
@@ -95,7 +95,7 @@ namespace detail
}; };
#endif #endif
template <typename genFIType> template<typename genFIType>
struct compute_abs<genFIType, false> struct compute_abs<genFIType, false>
{ {
GLM_FUNC_QUALIFIER static genFIType call(genFIType x) GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
@@ -107,59 +107,59 @@ namespace detail
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_abs_vector struct compute_abs_vector
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
return detail::functor1<D, T, T, P>::call(abs, x); return detail::functor1<L, T, T, P>::call(abs, x);
} }
}; };
template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_mix_vector struct compute_mix_vector
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y, vecType<D, U, P> const & a) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y, vecType<L, U, P> const & a)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
return vecType<D, T, P>(vecType<D, U, P>(x) + a * vecType<D, U, P>(y - x)); return vecType<L, T, P>(vecType<L, U, P>(x) + a * vecType<L, U, P>(y - x));
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_mix_vector<D, T, bool, P, vecType, Aligned> struct compute_mix_vector<L, T, bool, P, vecType, Aligned>
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y, vecType<D, bool, P> const & a) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y, vecType<L, bool, P> const & a)
{ {
vecType<D, T, P> Result(uninitialize); vecType<L, T, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i) for(length_t i = 0; i < x.length(); ++i)
Result[i] = a[i] ? y[i] : x[i]; Result[i] = a[i] ? y[i] : x[i];
return Result; return Result;
} }
}; };
template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_mix_scalar struct compute_mix_scalar
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y, U const & a) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y, U const & a)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a"); GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
return vecType<D, T, P>(vecType<D, U, P>(x) + a * vecType<D, U, P>(y - x)); return vecType<L, T, P>(vecType<L, U, P>(x) + a * vecType<L, U, P>(y - x));
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_mix_scalar<D, T, bool, P, vecType, Aligned> struct compute_mix_scalar<L, T, bool, P, vecType, Aligned>
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y, bool const & a) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y, bool const & a)
{ {
return a ? y : x; return a ? y : x;
} }
}; };
template <typename T, typename U> template<typename T, typename U>
struct compute_mix struct compute_mix
{ {
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a) GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a)
@@ -170,7 +170,7 @@ namespace detail
} }
}; };
template <typename T> template<typename T>
struct compute_mix<T, bool> struct compute_mix<T, bool>
{ {
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a) GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a)
@@ -179,147 +179,147 @@ namespace detail
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool isFloat, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool isFloat, bool Aligned>
struct compute_sign struct compute_sign
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
return vecType<D, T, P>(glm::lessThan(vecType<D, T, P>(0), x)) - vecType<D, T, P>(glm::lessThan(x, vecType<D, T, P>(0))); return vecType<L, T, P>(glm::lessThan(vecType<L, T, P>(0), x)) - vecType<L, T, P>(glm::lessThan(x, vecType<L, T, P>(0)));
} }
}; };
# if GLM_ARCH == GLM_ARCH_X86 # if GLM_ARCH == GLM_ARCH_X86
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_sign<T, P, vecType, false, Aligned> struct compute_sign<T, P, vecType, false, Aligned>
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
T const Shift(static_cast<T>(sizeof(T) * 8 - 1)); T const Shift(static_cast<T>(sizeof(T) * 8 - 1));
vecType<D, T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift)); vecType<L, T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
return (x >> Shift) | y; return (x >> Shift) | y;
} }
}; };
# endif # endif
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_floor struct compute_floor
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
return detail::functor1<D, T, T, P>::call(std::floor, x); return detail::functor1<L, T, T, P>::call(std::floor, x);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_ceil struct compute_ceil
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
return detail::functor1<D, T, T, P>::call(std::ceil, x); return detail::functor1<L, T, T, P>::call(std::ceil, x);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_fract struct compute_fract
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
return x - floor(x); return x - floor(x);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_trunc struct compute_trunc
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
return detail::functor1<D, T, T, P>::call(trunc, x); return detail::functor1<L, T, T, P>::call(trunc, x);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_round struct compute_round
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
return detail::functor1<D, T, T, P>::call(round, x); return detail::functor1<L, T, T, P>::call(round, x);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_mod struct compute_mod
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & a, vecType<D, T, P> const & b) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & a, vecType<L, T, P> const & b)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs."); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
return a - b * floor(a / b); return a - b * floor(a / b);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_min_vector struct compute_min_vector
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
return detail::functor2<D, T, P>::call(min, x, y); return detail::functor2<L, T, P>::call(min, x, y);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_max_vector struct compute_max_vector
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
return detail::functor2<D, T, P>::call(max, x, y); return detail::functor2<L, T, P>::call(max, x, y);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_clamp_vector struct compute_clamp_vector
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & minVal, vecType<D, T, P> const & maxVal) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & minVal, vecType<L, T, P> const & maxVal)
{ {
return min(max(x, minVal), maxVal); return min(max(x, minVal), maxVal);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_step_vector struct compute_step_vector
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & edge, vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & edge, vecType<L, T, P> const & x)
{ {
return mix(vecType<D, T, P>(1), vecType<D, T, P>(0), glm::lessThan(x, edge)); return mix(vecType<L, T, P>(1), vecType<L, T, P>(0), glm::lessThan(x, edge));
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_smoothstep_vector struct compute_smoothstep_vector
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & edge0, vecType<D, T, P> const & edge1, vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & edge0, vecType<L, T, P> const & edge1, vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs");
vecType<D, T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1))); vecType<L, T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)));
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp); return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp);
} }
}; };
}//namespace detail }//namespace detail
template <typename genFIType> template<typename genFIType>
GLM_FUNC_QUALIFIER genFIType abs(genFIType x) GLM_FUNC_QUALIFIER genFIType abs(genFIType x)
{ {
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x); return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> abs(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> abs(vecType<L, T, P> const & x)
{ {
return detail::compute_abs_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(x); return detail::compute_abs_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
} }
// sign // sign
// fast and works for any type // fast and works for any type
template <typename genFIType> template<typename genFIType>
GLM_FUNC_QUALIFIER genFIType sign(genFIType x) GLM_FUNC_QUALIFIER genFIType sign(genFIType x)
{ {
GLM_STATIC_ASSERT( GLM_STATIC_ASSERT(
@@ -329,42 +329,42 @@ namespace detail
return detail::compute_sign<1, genFIType, defaultp, vec, std::numeric_limits<genFIType>::is_iec559, highp>::call(vec<1, genFIType>(x)).x; return detail::compute_sign<1, genFIType, defaultp, vec, std::numeric_limits<genFIType>::is_iec559, highp>::call(vec<1, genFIType>(x)).x;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> sign(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> sign(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT( GLM_STATIC_ASSERT(
std::numeric_limits<T>::is_iec559 || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer), std::numeric_limits<T>::is_iec559 || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer),
"'sign' only accept signed inputs"); "'sign' only accept signed inputs");
return detail::compute_sign<D, T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x); return detail::compute_sign<L, T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
} }
// floor // floor
using ::std::floor; using ::std::floor;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> floor(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> floor(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'floor' only accept floating-point inputs."); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'floor' only accept floating-point inputs.");
return detail::compute_floor<D, T, P, vecType, detail::is_aligned<P>::value>::call(x); return detail::compute_floor<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> trunc(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> trunc(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'trunc' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'trunc' only accept floating-point inputs");
return detail::compute_trunc<D, T, P, vecType, detail::is_aligned<P>::value>::call(x); return detail::compute_trunc<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> round(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> round(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'round' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'round' only accept floating-point inputs");
return detail::compute_round<D, T, P, vecType, detail::is_aligned<P>::value>::call(x); return detail::compute_round<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
} }
/* /*
// roundEven // roundEven
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType roundEven(genType const& x) GLM_FUNC_QUALIFIER genType roundEven(genType const& x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs");
@@ -374,7 +374,7 @@ namespace detail
*/ */
// roundEven // roundEven
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType roundEven(genType x) GLM_FUNC_QUALIFIER genType roundEven(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs");
@@ -405,38 +405,38 @@ namespace detail
//} //}
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> roundEven(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> roundEven(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'roundEven' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'roundEven' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(roundEven, x); return detail::functor1<L, T, T, P>::call(roundEven, x);
} }
// ceil // ceil
using ::std::ceil; using ::std::ceil;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> ceil(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> ceil(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ceil' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ceil' only accept floating-point inputs");
return detail::compute_ceil<D, T, P, vecType, detail::is_aligned<P>::value>::call(x); return detail::compute_ceil<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
} }
// fract // fract
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType fract(genType x) GLM_FUNC_QUALIFIER genType fract(genType x)
{ {
return fract(vec<1, genType>(x)).x; return fract(vec<1, genType>(x)).x;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> fract(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> fract(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fract' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fract' only accept floating-point inputs");
return detail::compute_fract<D, T, P, vecType, detail::is_aligned<P>::value>::call(x); return detail::compute_fract<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
} }
// mod // mod
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType mod(genType x, genType y) GLM_FUNC_QUALIFIER genType mod(genType x, genType y)
{ {
# if GLM_COMPILER & GLM_COMPILER_CUDA # if GLM_COMPILER & GLM_COMPILER_CUDA
@@ -448,34 +448,34 @@ namespace detail
# endif # endif
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> mod(vecType<D, T, P> const & x, T y) GLM_FUNC_QUALIFIER vecType<L, T, P> mod(vecType<L, T, P> const & x, T y)
{ {
return detail::compute_mod<D, T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<D, T, P>(y)); return detail::compute_mod<L, T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<L, T, P>(y));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> mod(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER vecType<L, T, P> mod(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
return detail::compute_mod<D, T, P, vecType, detail::is_aligned<P>::value>::call(x, y); return detail::compute_mod<L, T, P, vecType, detail::is_aligned<P>::value>::call(x, y);
} }
// modf // modf
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) GLM_FUNC_QUALIFIER genType modf(genType x, genType & i)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'modf' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'modf' only accept floating-point inputs");
return std::modf(x, &i); return std::modf(x, &i);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> modf(vec<1, T, P> const & x, vec<1, T, P> & i) GLM_FUNC_QUALIFIER vec<1, T, P> modf(vec<1, T, P> const & x, vec<1, T, P> & i)
{ {
return vec<1, T, P>( return vec<1, T, P>(
modf(x.x, i.x)); modf(x.x, i.x));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> modf(vec<2, T, P> const & x, vec<2, T, P> & i) GLM_FUNC_QUALIFIER vec<2, T, P> modf(vec<2, T, P> const & x, vec<2, T, P> & i)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -483,7 +483,7 @@ namespace detail
modf(x.y, i.y)); modf(x.y, i.y));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> modf(vec<3, T, P> const & x, vec<3, T, P> & i) GLM_FUNC_QUALIFIER vec<3, T, P> modf(vec<3, T, P> const & x, vec<3, T, P> & i)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -492,7 +492,7 @@ namespace detail
modf(x.z, i.z)); modf(x.z, i.z));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> modf(vec<4, T, P> const & x, vec<4, T, P> & i) GLM_FUNC_QUALIFIER vec<4, T, P> modf(vec<4, T, P> const & x, vec<4, T, P> & i)
{ {
return vec<4, T, P>( return vec<4, T, P>(
@@ -511,94 +511,94 @@ namespace detail
//CHAR_BIT - 1))); //CHAR_BIT - 1)));
// min // min
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> min(vecType<D, T, P> const & a, T b) GLM_FUNC_QUALIFIER vecType<L, T, P> min(vecType<L, T, P> const & a, T b)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point inputs for the interpolator a"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point inputs for the interpolator a");
return detail::compute_min_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<D, T, P>(b)); return detail::compute_min_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<L, T, P>(b));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> min(vecType<D, T, P> const & a, vecType<D, T, P> const & b) GLM_FUNC_QUALIFIER vecType<L, T, P> min(vecType<L, T, P> const & a, vecType<L, T, P> const & b)
{ {
return detail::compute_min_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(a, b); return detail::compute_min_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(a, b);
} }
// max // max
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> max(vecType<D, T, P> const & a, T b) GLM_FUNC_QUALIFIER vecType<L, T, P> max(vecType<L, T, P> const & a, T b)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point inputs for the interpolator a"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point inputs for the interpolator a");
return detail::compute_max_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<D, T, P>(b)); return detail::compute_max_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<L, T, P>(b));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> max(vecType<D, T, P> const & a, vecType<D, T, P> const & b) GLM_FUNC_QUALIFIER vecType<L, T, P> max(vecType<L, T, P> const & a, vecType<L, T, P> const & b)
{ {
return detail::compute_max_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(a, b); return detail::compute_max_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(a, b);
} }
// clamp // clamp
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal) GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
return min(max(x, minVal), maxVal); return min(max(x, minVal), maxVal);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> clamp(vecType<D, T, P> const & x, T minVal, T maxVal) GLM_FUNC_QUALIFIER vecType<L, T, P> clamp(vecType<L, T, P> const & x, T minVal, T maxVal)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
return detail::compute_clamp_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<D, T, P>(minVal), vecType<D, T, P>(maxVal)); return detail::compute_clamp_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<L, T, P>(minVal), vecType<L, T, P>(maxVal));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> clamp(vecType<D, T, P> const & x, vecType<D, T, P> const & minVal, vecType<D, T, P> const & maxVal) GLM_FUNC_QUALIFIER vecType<L, T, P> clamp(vecType<L, T, P> const & x, vecType<L, T, P> const & minVal, vecType<L, T, P> const & maxVal)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
return detail::compute_clamp_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(x, minVal, maxVal); return detail::compute_clamp_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(x, minVal, maxVal);
} }
template <typename genTypeT, typename genTypeU> template<typename genTypeT, typename genTypeU>
GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a) GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a)
{ {
return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a); return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a);
} }
template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> mix(vecType<D, T, P> const & x, vecType<D, T, P> const & y, U a) GLM_FUNC_QUALIFIER vecType<L, T, P> mix(vecType<L, T, P> const & x, vecType<L, T, P> const & y, U a)
{ {
return detail::compute_mix_scalar<D, T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a); return detail::compute_mix_scalar<L, T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
} }
template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> mix(vecType<D, T, P> const & x, vecType<D, T, P> const & y, vecType<D, U, P> const & a) GLM_FUNC_QUALIFIER vecType<L, T, P> mix(vecType<L, T, P> const & x, vecType<L, T, P> const & y, vecType<L, U, P> const & a)
{ {
return detail::compute_mix_vector<D, T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a); return detail::compute_mix_vector<L, T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
} }
// step // step
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType step(genType edge, genType x) GLM_FUNC_QUALIFIER genType step(genType edge, genType x)
{ {
return mix(static_cast<genType>(1), static_cast<genType>(0), glm::lessThan(x, edge)); return mix(static_cast<genType>(1), static_cast<genType>(0), glm::lessThan(x, edge));
} }
template <template <int, typename, precision> class vecType, int D, typename T, precision P> template<template<length_t, typename, precision> class vecType, length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<D, T, P> step(T edge, vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> step(T edge, vecType<L, T, P> const & x)
{ {
return detail::compute_step_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(vecType<D, T, P>(edge), x); return detail::compute_step_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(vecType<L, T, P>(edge), x);
} }
template <template <int, typename, precision> class vecType, int D, typename T, precision P> template<template<length_t, typename, precision> class vecType, length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<D, T, P> step(vecType<D, T, P> const & edge, vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> step(vecType<L, T, P> const & edge, vecType<L, T, P> const & x)
{ {
return detail::compute_step_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(edge, x); return detail::compute_step_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(edge, x);
} }
// smoothstep // smoothstep
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
@@ -607,22 +607,22 @@ namespace detail
return tmp * tmp * (genType(3) - genType(2) * tmp); return tmp * tmp * (genType(3) - genType(2) * tmp);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> smoothstep(T edge0, T edge1, vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> smoothstep(T edge0, T edge1, vecType<L, T, P> const & x)
{ {
return detail::compute_smoothstep_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(vecType<D, T, P>(edge0), vecType<D, T, P>(edge1), x); return detail::compute_smoothstep_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(vecType<L, T, P>(edge0), vecType<L, T, P>(edge1), x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> smoothstep(vecType<D, T, P> const & edge0, vecType<D, T, P> const & edge1, vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> smoothstep(vecType<L, T, P> const & edge0, vecType<L, T, P> const & edge1, vecType<L, T, P> const & x)
{ {
return detail::compute_smoothstep_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(edge0, edge1, x); return detail::compute_smoothstep_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(edge0, edge1, x);
} }
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
using std::isnan; using std::isnan;
# else # else
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER bool isnan(genType x) GLM_FUNC_QUALIFIER bool isnan(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isnan' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isnan' only accept floating-point inputs");
@@ -647,18 +647,18 @@ namespace detail
} }
# endif # endif
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> isnan(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, bool, P> isnan(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
return detail::functor1<D, bool, T, P>::call(isnan, x); return detail::functor1<L, bool, T, P>::call(isnan, x);
} }
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
using std::isinf; using std::isinf;
# else # else
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER bool isinf(genType x) GLM_FUNC_QUALIFIER bool isinf(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isinf' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isinf' only accept floating-point inputs");
@@ -686,12 +686,12 @@ namespace detail
} }
# endif # endif
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> isinf(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, bool, P> isinf(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
return detail::functor1<D, bool, T, P>::call(isinf, x); return detail::functor1<L, bool, T, P>::call(isinf, x);
} }
GLM_FUNC_QUALIFIER int floatBitsToInt(float const & v) GLM_FUNC_QUALIFIER int floatBitsToInt(float const & v)
@@ -699,10 +699,10 @@ namespace detail
return reinterpret_cast<int&>(const_cast<float&>(v)); return reinterpret_cast<int&>(const_cast<float&>(v));
} }
template <template <int, typename, precision> class vecType, int D, precision P> template<template<length_t, typename, precision> class vecType, length_t L, precision P>
GLM_FUNC_QUALIFIER vecType<D, int, P> floatBitsToInt(vecType<D, float, P> const & v) GLM_FUNC_QUALIFIER vecType<L, int, P> floatBitsToInt(vecType<L, float, P> const & v)
{ {
return reinterpret_cast<vecType<D, int, P>&>(const_cast<vecType<D, float, P>&>(v)); return reinterpret_cast<vecType<L, int, P>&>(const_cast<vecType<L, float, P>&>(v));
} }
GLM_FUNC_QUALIFIER uint floatBitsToUint(float const & v) GLM_FUNC_QUALIFIER uint floatBitsToUint(float const & v)
@@ -710,10 +710,10 @@ namespace detail
return reinterpret_cast<uint&>(const_cast<float&>(v)); return reinterpret_cast<uint&>(const_cast<float&>(v));
} }
template <template <int, typename, precision> class vecType, int D, precision P> template<template<length_t, typename, precision> class vecType, length_t L, precision P>
GLM_FUNC_QUALIFIER vecType<D, uint, P> floatBitsToUint(vecType<D, float, P> const & v) GLM_FUNC_QUALIFIER vecType<L, uint, P> floatBitsToUint(vecType<L, float, P> const & v)
{ {
return reinterpret_cast<vecType<D, uint, P>&>(const_cast<vecType<D, float, P>&>(v)); return reinterpret_cast<vecType<L, uint, P>&>(const_cast<vecType<L, float, P>&>(v));
} }
GLM_FUNC_QUALIFIER float intBitsToFloat(int const & v) GLM_FUNC_QUALIFIER float intBitsToFloat(int const & v)
@@ -721,10 +721,10 @@ namespace detail
return reinterpret_cast<float&>(const_cast<int&>(v)); return reinterpret_cast<float&>(const_cast<int&>(v));
} }
template <template <int, typename, precision> class vecType, int D, precision P> template<template<length_t, typename, precision> class vecType, length_t L, precision P>
GLM_FUNC_QUALIFIER vecType<D, float, P> intBitsToFloat(vecType<D, int, P> const & v) GLM_FUNC_QUALIFIER vecType<L, float, P> intBitsToFloat(vecType<L, int, P> const & v)
{ {
return reinterpret_cast<vecType<D, float, P>&>(const_cast<vecType<D, int, P>&>(v)); return reinterpret_cast<vecType<L, float, P>&>(const_cast<vecType<L, int, P>&>(v));
} }
GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & v) GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & v)
@@ -732,19 +732,19 @@ namespace detail
return reinterpret_cast<float&>(const_cast<uint&>(v)); return reinterpret_cast<float&>(const_cast<uint&>(v));
} }
template <template <int, typename, precision> class vecType, int D, precision P> template<template<length_t, typename, precision> class vecType, length_t L, precision P>
GLM_FUNC_QUALIFIER vecType<D, float, P> uintBitsToFloat(vecType<D, uint, P> const & v) GLM_FUNC_QUALIFIER vecType<L, float, P> uintBitsToFloat(vecType<L, uint, P> const & v)
{ {
return reinterpret_cast<vecType<D, float, P>&>(const_cast<vecType<D, uint, P>&>(v)); return reinterpret_cast<vecType<L, float, P>&>(const_cast<vecType<L, uint, P>&>(v));
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType fma(genType const & a, genType const & b, genType const & c) GLM_FUNC_QUALIFIER genType fma(genType const & a, genType const & b, genType const & c)
{ {
return a * b + c; return a * b + c;
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType frexp(genType x, int & exp) GLM_FUNC_QUALIFIER genType frexp(genType x, int & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
@@ -752,7 +752,7 @@ namespace detail
return std::frexp(x, &exp); return std::frexp(x, &exp);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> frexp(vec<1, T, P> const & x, vec<1, int, P> & exp) GLM_FUNC_QUALIFIER vec<1, T, P> frexp(vec<1, T, P> const & x, vec<1, int, P> & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
@@ -760,7 +760,7 @@ namespace detail
return vec<1, T, P>(std::frexp(x.x, &exp.x)); return vec<1, T, P>(std::frexp(x.x, &exp.x));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> frexp(vec<2, T, P> const & x, vec<2, int, P> & exp) GLM_FUNC_QUALIFIER vec<2, T, P> frexp(vec<2, T, P> const & x, vec<2, int, P> & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
@@ -770,7 +770,7 @@ namespace detail
frexp(x.y, exp.y)); frexp(x.y, exp.y));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> frexp(vec<3, T, P> const & x, vec<3, int, P> & exp) GLM_FUNC_QUALIFIER vec<3, T, P> frexp(vec<3, T, P> const & x, vec<3, int, P> & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
@@ -781,7 +781,7 @@ namespace detail
frexp(x.z, exp.z)); frexp(x.z, exp.z));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> frexp(vec<4, T, P> const & x, vec<4, int, P> & exp) GLM_FUNC_QUALIFIER vec<4, T, P> frexp(vec<4, T, P> const & x, vec<4, int, P> & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
@@ -793,7 +793,7 @@ namespace detail
frexp(x.w, exp.w)); frexp(x.w, exp.w));
} }
template <typename genType> 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 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
@@ -801,7 +801,7 @@ namespace detail
return std::ldexp(x, exp); return std::ldexp(x, exp);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> ldexp(vec<1, T, P> const & x, vec<1, int, P> const & exp) GLM_FUNC_QUALIFIER vec<1, T, P> ldexp(vec<1, T, P> const & x, vec<1, int, P> const & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
@@ -810,7 +810,7 @@ namespace detail
ldexp(x.x, exp.x)); ldexp(x.x, exp.x));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> ldexp(vec<2, T, P> const & x, vec<2, int, P> const & exp) GLM_FUNC_QUALIFIER vec<2, T, P> ldexp(vec<2, T, P> const & x, vec<2, int, P> const & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
@@ -820,7 +820,7 @@ namespace detail
ldexp(x.y, exp.y)); ldexp(x.y, exp.y));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> ldexp(vec<3, T, P> const & x, vec<3, int, P> const & exp) GLM_FUNC_QUALIFIER vec<3, T, P> ldexp(vec<3, T, P> const & x, vec<3, int, P> const & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
@@ -831,7 +831,7 @@ namespace detail
ldexp(x.z, exp.z)); ldexp(x.z, exp.z));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> ldexp(vec<4, T, P> const & x, vec<4, int, P> const & exp) GLM_FUNC_QUALIFIER vec<4, T, P> ldexp(vec<4, T, P> const & x, vec<4, int, P> const & exp)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");

View File

@@ -10,7 +10,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <precision P> template<precision P>
struct compute_abs_vector<4, float, P, vec, true> struct compute_abs_vector<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
@@ -21,7 +21,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_abs_vector<4, int, P, vec, true> struct compute_abs_vector<4, int, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const & v) GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const & v)
@@ -32,7 +32,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_floor<4, float, P, vec, true> struct compute_floor<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
@@ -43,7 +43,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_ceil<4, float, P, vec, true> struct compute_ceil<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
@@ -54,7 +54,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_fract<4, float, P, vec, true> struct compute_fract<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
@@ -65,7 +65,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_round<4, float, P, vec, true> struct compute_round<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
@@ -76,7 +76,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_mod<4, float, P, vec, true> struct compute_mod<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & y) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & y)
@@ -87,7 +87,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_min_vector<4, float, P, vec, true> struct compute_min_vector<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v1, vec<4, float, P> const & v2) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
@@ -98,7 +98,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_min_vector<4, int32, P, vec, true> struct compute_min_vector<4, int32, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2) GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
@@ -109,7 +109,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_min_vector<4, uint32, P, vec, true> struct compute_min_vector<4, uint32, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, uint32, P> const & v1, vec<4, uint32, P> const & v2) GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, uint32, P> const & v1, vec<4, uint32, P> const & v2)
@@ -120,7 +120,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_max_vector<4, float, P, vec, true> struct compute_max_vector<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v1, vec<4, float, P> const & v2) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
@@ -131,7 +131,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_max_vector<4, int32, P, vec, true> struct compute_max_vector<4, int32, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2) GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
@@ -142,7 +142,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_max_vector<4, uint32, P, vec, true> struct compute_max_vector<4, uint32, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & v1, vec<4, uint32, P> const & v2) GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & v1, vec<4, uint32, P> const & v2)
@@ -153,7 +153,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_clamp_vector<4, float, P, vec, true> struct compute_clamp_vector<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & minVal, vec<4, float, P> const & maxVal) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & minVal, vec<4, float, P> const & maxVal)
@@ -164,7 +164,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_clamp_vector<4, int32, P, vec, true> struct compute_clamp_vector<4, int32, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & x, vec<4, int32, P> const & minVal, vec<4, int32, P> const & maxVal) GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & x, vec<4, int32, P> const & minVal, vec<4, int32, P> const & maxVal)
@@ -175,7 +175,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_clamp_vector<4, uint32, P, vec, true> struct compute_clamp_vector<4, uint32, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & x, vec<4, uint32, P> const & minVal, vec<4, uint32, P> const & maxVal) GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & x, vec<4, uint32, P> const & minVal, vec<4, uint32, P> const & maxVal)
@@ -186,7 +186,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_mix_vector<4, float, bool, P, vec, true> struct compute_mix_vector<4, float, bool, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & y, vec<4, bool, P> const & a) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & y, vec<4, bool, P> const & a)
@@ -204,7 +204,7 @@ namespace detail
} }
}; };
/* FIXME /* FIXME
template <precision P> template<precision P>
struct compute_step_vector<float, P, tvec4> struct compute_step_vector<float, P, tvec4>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& edge, vec<4, float, P> const& x) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& edge, vec<4, float, P> const& x)
@@ -215,7 +215,7 @@ namespace detail
} }
}; };
*/ */
template <precision P> template<precision P>
struct compute_smoothstep_vector<4, float, P, vec, true> struct compute_smoothstep_vector<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& edge0, vec<4, float, P> const& edge1, vec<4, float, P> const& x) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& edge0, vec<4, float, P> const& edge1, vec<4, float, P> const& x)

View File

@@ -29,8 +29,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> pow(vecType<D, T, P> const & base, vecType<D, T, P> const & exponent); GLM_FUNC_DECL vecType<L, T, P> pow(vecType<L, T, P> const & base, vecType<L, T, P> const & exponent);
/// Returns the natural exponentiation of x, i.e., e^x. /// Returns the natural exponentiation of x, i.e., e^x.
/// ///
@@ -39,8 +39,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> exp(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, T, P> exp(vecType<L, T, P> const & v);
/// Returns the natural logarithm of v, i.e., /// Returns the natural logarithm of v, i.e.,
/// returns the value y which satisfies the equation x = e^y. /// returns the value y which satisfies the equation x = e^y.
@@ -51,8 +51,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> log(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, T, P> log(vecType<L, T, P> const & v);
/// Returns 2 raised to the v power. /// Returns 2 raised to the v power.
/// ///
@@ -61,8 +61,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> exp2(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, T, P> exp2(vecType<L, T, P> const & v);
/// Returns the base 2 log of x, i.e., returns the value y, /// Returns the base 2 log of x, i.e., returns the value y,
/// which satisfies the equation x = 2 ^ y. /// which satisfies the equation x = 2 ^ y.
@@ -72,8 +72,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> log2(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, T, P> log2(vecType<L, T, P> const & v);
/// Returns the positive square root of v. /// Returns the positive square root of v.
/// ///
@@ -82,10 +82,10 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
//template <typename genType> //template<typename genType>
//GLM_FUNC_DECL genType sqrt(genType const & x); //GLM_FUNC_DECL genType sqrt(genType const & x);
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> sqrt(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, T, P> sqrt(vecType<L, T, P> const & v);
/// Returns the reciprocal of the positive square root of v. /// Returns the reciprocal of the positive square root of v.
/// ///
@@ -94,8 +94,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> inversesqrt(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, T, P> inversesqrt(vecType<L, T, P> const & v);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@@ -13,50 +13,50 @@ namespace detail
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
using std::log2; using std::log2;
# else # else
template <typename genType> template<typename genType>
genType log2(genType Value) genType log2(genType Value)
{ {
return std::log(Value) * static_cast<genType>(1.4426950408889634073599246810019); return std::log(Value) * static_cast<genType>(1.4426950408889634073599246810019);
} }
# endif # endif
template <int D, typename T, precision P, template <int, class, precision> class vecType, bool isFloat, bool Aligned> template<length_t L, typename T, precision P, template<int, class, precision> class vecType, bool isFloat, bool Aligned>
struct compute_log2 struct compute_log2
{ {
GLM_FUNC_QUALIFIER static vec<D, T, P> call(vec<D, T, P> const & vec) GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v)
{ {
return detail::functor1<D, T, T, P>::call(log2, vec); return detail::functor1<L, T, T, P>::call(log2, v);
} }
}; };
template <int D, typename T, precision P, bool Aligned> template<length_t L, typename T, precision P, bool Aligned>
struct compute_sqrt struct compute_sqrt
{ {
GLM_FUNC_QUALIFIER static vec<D, T, P> call(vec<D, T, P> const & x) GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
{ {
return detail::functor1<D, T, T, P>::call(std::sqrt, x); return detail::functor1<L, T, T, P>::call(std::sqrt, x);
} }
}; };
template <int D, typename T, precision P, bool Aligned> template<length_t L, typename T, precision P, bool Aligned>
struct compute_inversesqrt struct compute_inversesqrt
{ {
GLM_FUNC_QUALIFIER static vec<D, T, P> call(vec<D, T, P> const & x) GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const & x)
{ {
return static_cast<T>(1) / sqrt(x); return static_cast<T>(1) / sqrt(x);
} }
}; };
template <int D, bool Aligned> template<length_t L, bool Aligned>
struct compute_inversesqrt<D, float, lowp, Aligned> struct compute_inversesqrt<L, float, lowp, Aligned>
{ {
GLM_FUNC_QUALIFIER static vec<D, float, lowp> call(vec<D, float, lowp> const & x) GLM_FUNC_QUALIFIER static vec<L, float, lowp> call(vec<L, float, lowp> const & x)
{ {
vec<D, float, lowp> tmp(x); vec<L, float, lowp> tmp(x);
vec<D, float, lowp> xhalf(tmp * 0.5f); vec<L, float, lowp> xhalf(tmp * 0.5f);
vec<D, uint, lowp>* p = reinterpret_cast<vec<D, uint, lowp>*>(const_cast<vec<D, float, lowp>*>(&x)); vec<L, uint, lowp>* p = reinterpret_cast<vec<L, uint, lowp>*>(const_cast<vec<L, float, lowp>*>(&x));
vec<D, uint, lowp> i = vec<D, uint, lowp>(0x5f375a86) - (*p >> vec<D, uint, lowp>(1)); vec<L, uint, lowp> i = vec<L, uint, lowp>(0x5f375a86) - (*p >> vec<L, uint, lowp>(1));
vec<D, float, lowp>* ptmp = reinterpret_cast<vec<D, float, lowp>*>(&i); vec<L, float, lowp>* ptmp = reinterpret_cast<vec<L, float, lowp>*>(&i);
tmp = *ptmp; tmp = *ptmp;
tmp = tmp * (1.5f - xhalf * tmp * tmp); tmp = tmp * (1.5f - xhalf * tmp * tmp);
return tmp; return tmp;
@@ -66,30 +66,30 @@ namespace detail
// pow // pow
using std::pow; using std::pow;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> pow(vecType<D, T, P> const & base, vecType<D, T, P> const & exponent) GLM_FUNC_QUALIFIER vecType<L, T, P> pow(vecType<L, T, P> const & base, vecType<L, T, P> const& exponent)
{ {
return detail::functor2<D, T, P>::call(pow, base, exponent); return detail::functor2<L, T, P>::call(pow, base, exponent);
} }
// exp // exp
using std::exp; using std::exp;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> exp(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> exp(vecType<L, T, P> const& x)
{ {
return detail::functor1<D, T, T, P>::call(exp, x); return detail::functor1<L, T, T, P>::call(exp, x);
} }
// log // log
using std::log; using std::log;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> log(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> log(vecType<L, T, P> const& x)
{ {
return detail::functor1<D, T, T, P>::call(log, x); return detail::functor1<L, T, T, P>::call(log, x);
} }
//exp2, ln2 = 0.69314718055994530941723212145818f //exp2, ln2 = 0.69314718055994530941723212145818f
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType exp2(genType x) GLM_FUNC_QUALIFIER genType exp2(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'exp2' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'exp2' only accept floating-point inputs");
@@ -97,46 +97,46 @@ namespace detail
return std::exp(static_cast<genType>(0.69314718055994530941723212145818) * x); return std::exp(static_cast<genType>(0.69314718055994530941723212145818) * x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> exp2(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> exp2(vecType<L, T, P> const& x)
{ {
return detail::functor1<D, T, T, P>::call(exp2, x); return detail::functor1<L, T, T, P>::call(exp2, x);
} }
// log2, ln2 = 0.69314718055994530941723212145818f // log2, ln2 = 0.69314718055994530941723212145818f
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType log2(genType x) GLM_FUNC_QUALIFIER genType log2(genType x)
{ {
return log2(vec<1, genType>(x)).x; return log2(vec<1, genType>(x)).x;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> log2(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> log2(vecType<L, T, P> const& x)
{ {
return detail::compute_log2<D, T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x); return detail::compute_log2<L, T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
} }
// sqrt // sqrt
using std::sqrt; using std::sqrt;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> sqrt(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> sqrt(vecType<L, T, P> const& x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs");
return detail::compute_sqrt<D, T, P, detail::is_aligned<P>::value>::call(x); return detail::compute_sqrt<L, T, P, detail::is_aligned<P>::value>::call(x);
} }
// inversesqrt // inversesqrt
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType inversesqrt(genType x) GLM_FUNC_QUALIFIER genType inversesqrt(genType x)
{ {
return static_cast<genType>(1) / sqrt(x); return static_cast<genType>(1) / sqrt(x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> inversesqrt(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> inversesqrt(vecType<L, T, P> const& x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs");
return detail::compute_inversesqrt<D, T, P, detail::is_aligned<P>::value>::call(x); return detail::compute_inversesqrt<L, T, P, detail::is_aligned<P>::value>::call(x);
} }
}//namespace glm }//namespace glm

View File

@@ -8,7 +8,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <precision P> template<precision P>
struct compute_sqrt<4, float, P, true> struct compute_sqrt<4, float, P, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
@@ -19,7 +19,7 @@ namespace detail
} }
}; };
template <> template<>
struct compute_sqrt<4, float, aligned_lowp, true> struct compute_sqrt<4, float, aligned_lowp, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const & v) GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const & v)

View File

@@ -23,9 +23,9 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL T length( GLM_FUNC_DECL T length(
vecType<D, T, P> const & x); vecType<L, T, P> const& x);
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
/// ///
@@ -33,10 +33,10 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL T distance( GLM_FUNC_DECL T distance(
vecType<D, T, P> const & p0, vecType<L, T, P> const& p0,
vecType<D, T, P> const & p1); vecType<L, T, P> const& p1);
/// Returns the dot product of x and y, i.e., result = x * y. /// Returns the dot product of x and y, i.e., result = x * y.
/// ///
@@ -44,10 +44,10 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <int D, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL T dot( GLM_FUNC_DECL T dot(
vec<D, T, P> const & x, vec<L, T, P> const & x,
vec<D, T, P> const & y); vec<L, T, P> const & y);
/// Returns the cross product of x and y. /// Returns the cross product of x and y.
/// ///
@@ -55,7 +55,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> cross( GLM_FUNC_DECL vec<3, T, P> cross(
vec<3, T, P> const & x, vec<3, T, P> const & x,
vec<3, T, P> const & y); vec<3, T, P> const & y);
@@ -65,9 +65,9 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/normalize.xml">GLSL normalize man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> normalize( GLM_FUNC_DECL vecType<L, T, P> normalize(
vecType<D, T, P> const & x); vecType<L, T, P> const& x);
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N. /// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
/// ///
@@ -75,11 +75,11 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> faceforward( GLM_FUNC_DECL vecType<L, T, P> faceforward(
vecType<D, T, P> const & N, vecType<L, T, P> const& N,
vecType<D, T, P> const & I, vecType<L, T, P> const& I,
vecType<D, T, P> const & Nref); vecType<L, T, P> const& Nref);
/// For the incident vector I and surface orientation N, /// For the incident vector I and surface orientation N,
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
@@ -88,7 +88,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType reflect( GLM_FUNC_DECL genType reflect(
genType const & I, genType const & I,
genType const & N); genType const & N);
@@ -101,10 +101,10 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> refract( GLM_FUNC_DECL vecType<L, T, P> refract(
vecType<D, T, P> const & I, vecType<L, T, P> const& I,
vecType<D, T, P> const & N, vecType<L, T, P> const& N,
T eta); T eta);
/// @} /// @}

View File

@@ -10,28 +10,28 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <template <int, typename, precision> class vecType, int D, typename T, precision P, bool Aligned> template<template<length_t, typename, precision> class vecType, length_t L, typename T, precision P, bool Aligned>
struct compute_length struct compute_length
{ {
GLM_FUNC_QUALIFIER static T call(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER static T call(vecType<L, T, P> const & v)
{ {
return sqrt(dot(v, v)); return sqrt(dot(v, v));
} }
}; };
template <template <int, typename, precision> class vecType, int D, typename T, precision P, bool Aligned> template<template<length_t, typename, precision> class vecType, length_t L, typename T, precision P, bool Aligned>
struct compute_distance struct compute_distance
{ {
GLM_FUNC_QUALIFIER static T call(vecType<D, T, P> const & p0, vecType<D, T, P> const & p1) GLM_FUNC_QUALIFIER static T call(vecType<L, T, P> const & p0, vecType<L, T, P> const & p1)
{ {
return length(p1 - p0); return length(p1 - p0);
} }
}; };
template <typename V, typename T, bool Aligned> template<typename V, typename T, bool Aligned>
struct compute_dot{}; struct compute_dot{};
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_dot<vec<1, T, P>, T, Aligned> struct compute_dot<vec<1, T, P>, T, Aligned>
{ {
GLM_FUNC_QUALIFIER static T call(vec<1, T, P> const & a, vec<1, T, P> const & b) GLM_FUNC_QUALIFIER static T call(vec<1, T, P> const & a, vec<1, T, P> const & b)
@@ -40,7 +40,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_dot<vec<2, T, P>, T, Aligned> struct compute_dot<vec<2, T, P>, T, Aligned>
{ {
GLM_FUNC_QUALIFIER static T call(vec<2, T, P> const & a, vec<2, T, P> const & b) GLM_FUNC_QUALIFIER static T call(vec<2, T, P> const & a, vec<2, T, P> const & b)
@@ -50,7 +50,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_dot<vec<3, T, P>, T, Aligned> struct compute_dot<vec<3, T, P>, T, Aligned>
{ {
GLM_FUNC_QUALIFIER static T call(vec<3, T, P> const & a, vec<3, T, P> const & b) GLM_FUNC_QUALIFIER static T call(vec<3, T, P> const & a, vec<3, T, P> const & b)
@@ -60,7 +60,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_dot<vec<4, T, P>, T, Aligned> struct compute_dot<vec<4, T, P>, T, Aligned>
{ {
GLM_FUNC_QUALIFIER static T call(vec<4, T, P> const & a, vec<4, T, P> const & b) GLM_FUNC_QUALIFIER static T call(vec<4, T, P> const & a, vec<4, T, P> const & b)
@@ -70,7 +70,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_cross struct compute_cross
{ {
GLM_FUNC_QUALIFIER static vec<3, T, P> call(vec<3, T, P> const & x, vec<3, T, P> const & y) GLM_FUNC_QUALIFIER static vec<3, T, P> call(vec<3, T, P> const & x, vec<3, T, P> const & y)
@@ -84,10 +84,10 @@ namespace detail
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_normalize struct compute_normalize
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
@@ -95,10 +95,10 @@ namespace detail
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_faceforward struct compute_faceforward
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & N, vecType<D, T, P> const & I, vecType<D, T, P> const & Nref) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & N, vecType<L, T, P> const & I, vecType<L, T, P> const & Nref)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
@@ -106,19 +106,19 @@ namespace detail
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_reflect struct compute_reflect
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & I, vecType<D, T, P> const & N) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & I, vecType<L, T, P> const & N)
{ {
return I - N * dot(N, I) * static_cast<T>(2); return I - N * dot(N, I) * static_cast<T>(2);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_refract struct compute_refract
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & I, vecType<D, T, P> const & N, T eta) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & I, vecType<L, T, P> const & N, T eta)
{ {
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));
@@ -128,7 +128,7 @@ namespace detail
}//namespace detail }//namespace detail
// length // length
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' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' accepts only floating-point inputs");
@@ -136,16 +136,16 @@ namespace detail
return abs(x); return abs(x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER T length(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER T length(vecType<L, T, P> const & v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' accepts only floating-point inputs");
return detail::compute_length<vecType, D, T, P, detail::is_aligned<P>::value>::call(v); return detail::compute_length<vecType, L, T, P, detail::is_aligned<P>::value>::call(v);
} }
// distance // distance
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' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' accepts only floating-point inputs");
@@ -153,28 +153,28 @@ namespace detail
return length(p1 - p0); return length(p1 - p0);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER T distance(vecType<D, T, P> const & p0, vecType<D, T, P> const & p1) GLM_FUNC_QUALIFIER T distance(vecType<L, T, P> const & p0, vecType<L, T, P> const & p1)
{ {
return detail::compute_distance<vecType, D, T, P, detail::is_aligned<P>::value>::call(p0, p1); return detail::compute_distance<vecType, L, T, P, detail::is_aligned<P>::value>::call(p0, p1);
} }
// dot // dot
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' accepts only 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 <int D, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER T dot(vec<D, T, P> const & x, vec<D, T, P> const & y) GLM_FUNC_QUALIFIER T dot(vec<L, T, P> const & x, vec<L, T, P> const & y)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
return detail::compute_dot<vec<D, T, P>, T, detail::is_aligned<P>::value>::call(x, y); return detail::compute_dot<vec<L, T, P>, T, detail::is_aligned<P>::value>::call(x, y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T dot(tquat<T, P> const & x, tquat<T, P> const & y) GLM_FUNC_QUALIFIER T dot(tquat<T, P> const & x, tquat<T, P> const & y)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
@@ -182,14 +182,14 @@ namespace detail
} }
// cross // cross
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> cross(vec<3, T, P> const & x, vec<3, T, P> const & y) GLM_FUNC_QUALIFIER vec<3, T, P> cross(vec<3, T, P> const & x, vec<3, T, P> const & y)
{ {
return detail::compute_cross<T, P, detail::is_aligned<P>::value>::call(x, y); return detail::compute_cross<T, P, detail::is_aligned<P>::value>::call(x, y);
} }
// normalize // normalize
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' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' accepts only floating-point inputs");
@@ -197,42 +197,42 @@ namespace detail
return x < genType(0) ? genType(-1) : genType(1); return x < genType(0) ? genType(-1) : genType(1);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> normalize(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> normalize(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
return detail::compute_normalize<D, T, P, vecType, detail::is_aligned<P>::value>::call(x); return detail::compute_normalize<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
} }
// faceforward // faceforward
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType faceforward(genType const & N, genType const & I, genType const & Nref) GLM_FUNC_QUALIFIER genType faceforward(genType const & N, genType const & I, genType const & Nref)
{ {
return dot(Nref, I) < static_cast<genType>(0) ? N : -N; return dot(Nref, I) < static_cast<genType>(0) ? N : -N;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> faceforward(vecType<D, T, P> const & N, vecType<D, T, P> const & I, vecType<D, T, P> const & Nref) GLM_FUNC_QUALIFIER vecType<L, T, P> faceforward(vecType<L, T, P> const & N, vecType<L, T, P> const & I, vecType<L, T, P> const & Nref)
{ {
return detail::compute_faceforward<D, T, P, vecType, detail::is_aligned<P>::value>::call(N, I, Nref); return detail::compute_faceforward<L, T, P, vecType, detail::is_aligned<P>::value>::call(N, I, Nref);
} }
// reflect // reflect
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType reflect(genType const & I, genType const & N) GLM_FUNC_QUALIFIER genType reflect(genType const & I, genType const & N)
{ {
return I - N * dot(N, I) * genType(2); return I - N * dot(N, I) * genType(2);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> reflect(vecType<D, T, P> const & I, vecType<D, T, P> const & N) GLM_FUNC_QUALIFIER vecType<L, T, P> reflect(vecType<L, T, P> const & I, vecType<L, T, P> const & N)
{ {
return detail::compute_reflect<D, T, P, vecType, detail::is_aligned<P>::value>::call(I, N); return detail::compute_reflect<L, T, P, vecType, detail::is_aligned<P>::value>::call(I, N);
} }
// refract // refract
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType eta) GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType eta)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' accepts only floating-point inputs");
@@ -241,11 +241,11 @@ namespace detail
return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast<genType>(k >= static_cast<genType>(0)); return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast<genType>(k >= static_cast<genType>(0));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> refract(vecType<D, T, P> const & I, vecType<D, T, P> const & N, T eta) GLM_FUNC_QUALIFIER vecType<L, T, P> refract(vecType<L, T, P> const & I, vecType<L, T, P> const & N, T eta)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' accepts only floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' accepts only floating-point inputs");
return detail::compute_refract<D, T, P, vecType, detail::is_aligned<P>::value>::call(I, N, eta); return detail::compute_refract<L, T, P, vecType, detail::is_aligned<P>::value>::call(I, N, eta);
} }
}//namespace glm }//namespace glm

View File

@@ -8,7 +8,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <precision P> template<precision P>
struct compute_length<vec, 4, float, P, true> struct compute_length<vec, 4, float, P, true>
{ {
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const & v) GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const & v)
@@ -17,7 +17,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_distance<vec, 4, float, P, true> struct compute_distance<vec, 4, float, P, true>
{ {
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const & p0, vec<4, float, P> const & p1) GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const & p0, vec<4, float, P> const & p1)
@@ -26,7 +26,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_dot<vec<4, float, P>, float, true> struct compute_dot<vec<4, float, P>, float, true>
{ {
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const& x, vec<4, float, P> const& y) GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const& x, vec<4, float, P> const& y)
@@ -35,7 +35,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_cross<float, P, true> struct compute_cross<float, P, true>
{ {
GLM_FUNC_QUALIFIER static vec<3, float, P> call(vec<3, float, P> const & a, vec<3, float, P> const & b) GLM_FUNC_QUALIFIER static vec<3, float, P> call(vec<3, float, P> const & a, vec<3, float, P> const & b)
@@ -50,7 +50,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_normalize<4, float, P, vec, true> struct compute_normalize<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
@@ -61,7 +61,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_faceforward<4, float, P, vec, true> struct compute_faceforward<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& N, vec<4, float, P> const& I, vec<4, float, P> const& Nref) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& N, vec<4, float, P> const& I, vec<4, float, P> const& Nref)
@@ -72,7 +72,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_reflect<4, float, P, vec, true> struct compute_reflect<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& I, vec<4, float, P> const& N) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& I, vec<4, float, P> const& N)
@@ -83,7 +83,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_refract<4, float, P, vec, true> struct compute_refract<4, float, P, vec, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& I, vec<4, float, P> const& N, float eta) GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& I, vec<4, float, P> const& N, float eta)

View File

@@ -30,11 +30,11 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, uint, P> uaddCarry( GLM_FUNC_DECL vecType<L, uint, P> uaddCarry(
vecType<D, uint, P> const & x, vecType<L, uint, P> const & x,
vecType<D, uint, P> const & y, vecType<L, uint, P> const & y,
vecType<D, uint, P> & carry); vecType<L, uint, P> & carry);
/// Subtracts the 32-bit unsigned integer y from x, returning /// Subtracts the 32-bit unsigned integer y from x, returning
/// the difference if non-negative, or pow(2, 32) plus the difference /// the difference if non-negative, or pow(2, 32) plus the difference
@@ -44,11 +44,11 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, uint, P> usubBorrow( GLM_FUNC_DECL vecType<L, uint, P> usubBorrow(
vecType<D, uint, P> const & x, vecType<L, uint, P> const & x,
vecType<D, uint, P> const & y, vecType<L, uint, P> const & y,
vecType<D, uint, P> & borrow); vecType<L, uint, P> & borrow);
/// Multiplies 32-bit integers x and y, producing a 64-bit /// Multiplies 32-bit integers x and y, producing a 64-bit
/// result. The 32 least-significant bits are returned in lsb. /// result. The 32 least-significant bits are returned in lsb.
@@ -58,12 +58,12 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL void umulExtended( GLM_FUNC_DECL void umulExtended(
vecType<D, uint, P> const & x, vecType<L, uint, P> const & x,
vecType<D, uint, P> const & y, vecType<L, uint, P> const & y,
vecType<D, uint, P> & msb, vecType<L, uint, P> & msb,
vecType<D, uint, P> & lsb); vecType<L, uint, P> & lsb);
/// Multiplies 32-bit integers x and y, producing a 64-bit /// Multiplies 32-bit integers x and y, producing a 64-bit
/// result. The 32 least-significant bits are returned in lsb. /// result. The 32 least-significant bits are returned in lsb.
@@ -73,12 +73,12 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL void imulExtended( GLM_FUNC_DECL void imulExtended(
vecType<D, int, P> const & x, vecType<L, int, P> const & x,
vecType<D, int, P> const & y, vecType<L, int, P> const & y,
vecType<D, int, P> & msb, vecType<L, int, P> & msb,
vecType<D, int, P> & lsb); vecType<L, int, P> & lsb);
/// Extracts bits [offset, offset + bits - 1] from value, /// Extracts bits [offset, offset + bits - 1] from value,
/// returning them in the least significant bits of the result. /// returning them in the least significant bits of the result.
@@ -95,9 +95,9 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> bitfieldExtract( GLM_FUNC_DECL vecType<L, T, P> bitfieldExtract(
vecType<D, T, P> const & Value, vecType<L, T, P> const& Value,
int Offset, int Offset,
int Bits); int Bits);
@@ -115,10 +115,10 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> bitfieldInsert( GLM_FUNC_DECL vecType<L, T, P> bitfieldInsert(
vecType<D, T, P> const & Base, vecType<L, T, P> const& Base,
vecType<D, T, P> const & Insert, vecType<L, T, P> const& Insert,
int Offset, int Offset,
int Bits); int Bits);
@@ -130,8 +130,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> bitfieldReverse(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, T, P> bitfieldReverse(vecType<L, T, P> const & v);
/// Returns the number of bits set to 1 in the binary representation of value. /// Returns the number of bits set to 1 in the binary representation of value.
/// ///
@@ -139,7 +139,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genType> template<typename genType>
GLM_FUNC_DECL int bitCount(genType v); GLM_FUNC_DECL int bitCount(genType v);
/// Returns the number of bits set to 1 in the binary representation of value. /// Returns the number of bits set to 1 in the binary representation of value.
@@ -148,8 +148,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, int, P> bitCount(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, int, P> bitCount(vecType<L, T, P> const & v);
/// Returns the bit number of the least significant bit set to /// Returns the bit number of the least significant bit set to
/// 1 in the binary representation of value. /// 1 in the binary representation of value.
@@ -159,7 +159,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL int findLSB(genIUType x); GLM_FUNC_DECL int findLSB(genIUType x);
/// Returns the bit number of the least significant bit set to /// Returns the bit number of the least significant bit set to
@@ -170,8 +170,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, int, P> findLSB(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, int, P> findLSB(vecType<L, T, P> const & v);
/// Returns the bit number of the most significant bit in the binary representation of value. /// Returns the bit number of the most significant bit in the binary representation of value.
/// For positive integers, the result will be the bit number of the most significant bit set to 1. /// For positive integers, the result will be the bit number of the most significant bit set to 1.
@@ -182,7 +182,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL int findMSB(genIUType x); GLM_FUNC_DECL int findMSB(genIUType x);
/// Returns the bit number of the most significant bit in the binary representation of value. /// Returns the bit number of the most significant bit in the binary representation of value.
@@ -194,8 +194,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, int, P> findMSB(vecType<D, T, P> const & v); GLM_FUNC_DECL vecType<L, int, P> findMSB(vecType<L, T, P> const & v);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@@ -24,49 +24,49 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER T mask(T Bits) GLM_FUNC_QUALIFIER T mask(T Bits)
{ {
return Bits >= sizeof(T) * 8 ? ~static_cast<T>(0) : (static_cast<T>(1) << Bits) - static_cast<T>(1); return Bits >= sizeof(T) * 8 ? ~static_cast<T>(0) : (static_cast<T>(1) << Bits) - static_cast<T>(1);
} }
template <int D, typename T, glm::precision P, template <int, typename, precision> class vecType, bool Aligned, bool EXEC> template<length_t L, typename T, glm::precision P, template<length_t, typename, precision> class vecType, bool Aligned, bool EXEC>
struct compute_bitfieldReverseStep struct compute_bitfieldReverseStep
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & v, T, T) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const& v, T, T)
{ {
return v; return v;
} }
}; };
template <int D, typename T, glm::precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, glm::precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_bitfieldReverseStep<D, T, P, vecType, Aligned, true> struct compute_bitfieldReverseStep<L, T, P, vecType, Aligned, true>
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & v, T Mask, T Shift) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const& v, T Mask, T Shift)
{ {
return (v & Mask) << Shift | (v & (~Mask)) >> Shift; return (v & Mask) << Shift | (v & (~Mask)) >> Shift;
} }
}; };
template <int D, typename T, glm::precision P, template <int, typename, precision> class vecType, bool Aligned, bool EXEC> template<length_t L, typename T, glm::precision P, template<length_t, typename, precision> class vecType, bool Aligned, bool EXEC>
struct compute_bitfieldBitCountStep struct compute_bitfieldBitCountStep
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & v, T, T) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const& v, T, T)
{ {
return v; return v;
} }
}; };
template <int D, typename T, glm::precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, glm::precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_bitfieldBitCountStep<D, T, P, vecType, Aligned, true> struct compute_bitfieldBitCountStep<L, T, P, vecType, Aligned, true>
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & v, T Mask, T Shift) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const& v, T Mask, T Shift)
{ {
return (v & Mask) + ((v >> Shift) & Mask); return (v & Mask) + ((v >> Shift) & Mask);
} }
}; };
template <typename genIUType, size_t Bits> template<typename genIUType, size_t Bits>
struct compute_findLSB struct compute_findLSB
{ {
GLM_FUNC_QUALIFIER static int call(genIUType Value) GLM_FUNC_QUALIFIER static int call(genIUType Value)
@@ -79,7 +79,7 @@ namespace detail
}; };
# if GLM_HAS_BITSCAN_WINDOWS # if GLM_HAS_BITSCAN_WINDOWS
template <typename genIUType> template<typename genIUType>
struct compute_findLSB<genIUType, 32> struct compute_findLSB<genIUType, 32>
{ {
GLM_FUNC_QUALIFIER static int call(genIUType Value) GLM_FUNC_QUALIFIER static int call(genIUType Value)
@@ -91,7 +91,7 @@ namespace detail
}; };
# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) # if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32))
template <typename genIUType> template<typename genIUType>
struct compute_findLSB<genIUType, 64> struct compute_findLSB<genIUType, 64>
{ {
GLM_FUNC_QUALIFIER static int call(genIUType Value) GLM_FUNC_QUALIFIER static int call(genIUType Value)
@@ -104,42 +104,42 @@ namespace detail
# endif # endif
# endif//GLM_HAS_BITSCAN_WINDOWS # endif//GLM_HAS_BITSCAN_WINDOWS
template <int D, typename T, glm::precision P, template <int, typename, precision> class vecType, bool EXEC = true> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool EXEC = true>
struct compute_findMSB_step_vec struct compute_findMSB_step_vec
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, T Shift) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, T Shift)
{ {
return x | (x >> Shift); return x | (x >> Shift);
} }
}; };
template <int D, typename T, glm::precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
struct compute_findMSB_step_vec<D, T, P, vecType, false> struct compute_findMSB_step_vec<L, T, P, vecType, false>
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, T) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const& x, T)
{ {
return x; return x;
} }
}; };
template <int D, typename T, glm::precision P, template <int, typename, precision> class vecType, int> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, int>
struct compute_findMSB_vec struct compute_findMSB_vec
{ {
GLM_FUNC_QUALIFIER static vecType<D, int, P> call(vecType<D, T, P> const & vec) GLM_FUNC_QUALIFIER static vecType<L, int, P> call(vecType<L, T, P> const& v)
{ {
vecType<D, T, P> x(vec); vecType<L, T, P> x(v);
x = compute_findMSB_step_vec<D, T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 1)); x = compute_findMSB_step_vec<L, T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 1));
x = compute_findMSB_step_vec<D, T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 2)); x = compute_findMSB_step_vec<L, T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 2));
x = compute_findMSB_step_vec<D, T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 4)); x = compute_findMSB_step_vec<L, T, P, vecType, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 4));
x = compute_findMSB_step_vec<D, T, P, vecType, sizeof(T) * 8 >= 16>::call(x, static_cast<T>( 8)); x = compute_findMSB_step_vec<L, T, P, vecType, sizeof(T) * 8 >= 16>::call(x, static_cast<T>( 8));
x = compute_findMSB_step_vec<D, T, P, vecType, sizeof(T) * 8 >= 32>::call(x, static_cast<T>(16)); x = compute_findMSB_step_vec<L, T, P, vecType, sizeof(T) * 8 >= 32>::call(x, static_cast<T>(16));
x = compute_findMSB_step_vec<D, T, P, vecType, sizeof(T) * 8 >= 64>::call(x, static_cast<T>(32)); x = compute_findMSB_step_vec<L, T, P, vecType, sizeof(T) * 8 >= 64>::call(x, static_cast<T>(32));
return vecType<D, int, P>(sizeof(T) * 8 - 1) - glm::bitCount(~x); return vecType<L, int, P>(sizeof(T) * 8 - 1) - glm::bitCount(~x);
} }
}; };
# if GLM_HAS_BITSCAN_WINDOWS # if GLM_HAS_BITSCAN_WINDOWS
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER int compute_findMSB_32(genIUType Value) GLM_FUNC_QUALIFIER int compute_findMSB_32(genIUType Value)
{ {
unsigned long Result(0); unsigned long Result(0);
@@ -147,17 +147,17 @@ namespace detail
return IsNotNull ? int(Result) : -1; return IsNotNull ? int(Result) : -1;
} }
template <int D, typename T, glm::precision P, template<int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
struct compute_findMSB_vec<D, T, P, vecType, 32> struct compute_findMSB_vec<L, T, P, vecType, 32>
{ {
GLM_FUNC_QUALIFIER static vecType<D, int, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, int, P> call(vecType<L, T, P> const& x)
{ {
return detail::functor1<D, int, T, P>::call(compute_findMSB_32, x); return detail::functor1<L, int, T, P>::call(compute_findMSB_32, x);
} }
}; };
# if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32)) # if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_MODEL == GLM_MODEL_32))
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value) GLM_FUNC_QUALIFIER int compute_findMSB_64(genIUType Value)
{ {
unsigned long Result(0); unsigned long Result(0);
@@ -165,12 +165,12 @@ namespace detail
return IsNotNull ? int(Result) : -1; return IsNotNull ? int(Result) : -1;
} }
template <int D, typename T, glm::precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
struct compute_findMSB_vec<D, T, P, vecType, 64> struct compute_findMSB_vec<L, T, P, vecType, 64>
{ {
GLM_FUNC_QUALIFIER static vecType<D, int, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, int, P> call(vecType<L, T, P> const& x)
{ {
return detail::functor1<D, int, T, P>::call(compute_findMSB_64, x); return detail::functor1<L, int, T, P>::call(compute_findMSB_64, x);
} }
}; };
# endif # endif
@@ -186,13 +186,13 @@ namespace detail
return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1))); return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
} }
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, uint, P> uaddCarry(vecType<D, uint, P> const & x, vecType<D, uint, P> const & y, vecType<D, uint, P> & Carry) GLM_FUNC_QUALIFIER vecType<L, uint, P> uaddCarry(vecType<L, uint, P> const& x, vecType<L, uint, P> const& y, vecType<L, uint, P>& Carry)
{ {
vecType<D, uint64, P> Value64(vecType<D, uint64, P>(x) + vecType<D, uint64, P>(y)); vecType<L, uint64, P> Value64(vecType<L, uint64, P>(x) + vecType<L, uint64, P>(y));
vecType<D, uint64, P> Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1)); vecType<L, uint64, P> Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
Carry = mix(vecType<D, uint32, P>(0), vecType<D, uint32, P>(1), greaterThan(Value64, Max32)); Carry = mix(vecType<L, uint32, P>(0), vecType<L, uint32, P>(1), greaterThan(Value64, Max32));
return vecType<D, uint32,P>(Value64 % (Max32 + static_cast<uint64>(1))); return vecType<L, uint32,P>(Value64 % (Max32 + static_cast<uint64>(1)));
} }
// usubBorrow // usubBorrow
@@ -207,12 +207,12 @@ namespace detail
return static_cast<uint32>((static_cast<int64>(1) << static_cast<int64>(32)) + (static_cast<int64>(y) - static_cast<int64>(x))); return static_cast<uint32>((static_cast<int64>(1) << static_cast<int64>(32)) + (static_cast<int64>(y) - static_cast<int64>(x)));
} }
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, uint, P> usubBorrow(vecType<D, uint, P> const & x, vecType<D, uint, P> const & y, vecType<D, uint, P> & Borrow) GLM_FUNC_QUALIFIER vecType<L, uint, P> usubBorrow(vecType<L, uint, P> const& x, vecType<L, uint, P> const& y, vecType<L, uint, P>& Borrow)
{ {
Borrow = mix(vecType<D, uint, P>(1), vecType<D, uint, P>(0), greaterThanEqual(x, y)); Borrow = mix(vecType<L, uint, P>(1), vecType<L, uint, P>(0), greaterThanEqual(x, y));
vecType<D, uint, P> const YgeX(y - x); vecType<L, uint, P> const YgeX(y - x);
vecType<D, uint, P> const XgeY(vecType<D, uint32, P>((static_cast<int64>(1) << static_cast<int64>(32)) + (vecType<D, int64, P>(y) - vecType<D, int64, P>(x)))); vecType<L, uint, P> const XgeY(vecType<L, uint32, P>((static_cast<int64>(1) << static_cast<int64>(32)) + (vecType<L, int64, P>(y) - vecType<L, int64, P>(x))));
return mix(XgeY, YgeX, greaterThanEqual(y, x)); return mix(XgeY, YgeX, greaterThanEqual(y, x));
} }
@@ -226,18 +226,18 @@ namespace detail
lsb = static_cast<uint>(Value64); lsb = static_cast<uint>(Value64);
} }
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER void umulExtended(vecType<D, uint, P> const & x, vecType<D, uint, P> const & y, vecType<D, uint, P> & msb, vecType<D, uint, P> & lsb) GLM_FUNC_QUALIFIER void umulExtended(vecType<L, uint, P> const& x, vecType<L, uint, P> const& y, vecType<L, uint, P>& msb, vecType<L, uint, P>& lsb)
{ {
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch"); GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
vecType<D, uint64, P> Value64(vecType<D, uint64, P>(x) * vecType<D, uint64, P>(y)); vecType<L, uint64, P> Value64(vecType<L, uint64, P>(x) * vecType<L, uint64, P>(y));
msb = vecType<D, uint32, P>(Value64 >> static_cast<uint64>(32)); msb = vecType<L, uint32, P>(Value64 >> static_cast<uint64>(32));
lsb = vecType<D, uint32, P>(Value64); lsb = vecType<L, uint32, P>(Value64);
} }
// imulExtended // imulExtended
GLM_FUNC_QUALIFIER void imulExtended(int x, int y, int & msb, int & lsb) GLM_FUNC_QUALIFIER void imulExtended(int x, int y, int& msb, int& lsb)
{ {
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
@@ -246,25 +246,25 @@ namespace detail
lsb = static_cast<int>(Value64); lsb = static_cast<int>(Value64);
} }
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER void imulExtended(vecType<D, int, P> const & x, vecType<D, int, P> const & y, vecType<D, int, P> & msb, vecType<D, int, P> & lsb) GLM_FUNC_QUALIFIER void imulExtended(vecType<L, int, P> const& x, vecType<L, int, P> const& y, vecType<L, int, P>& msb, vecType<L, int, P>& lsb)
{ {
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch"); GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
vecType<D, int64, P> Value64(vecType<D, int64, P>(x) * vecType<D, int64, P>(y)); vecType<L, int64, P> Value64(vecType<L, int64, P>(x) * vecType<L, int64, P>(y));
lsb = vecType<D, int32, P>(Value64 & static_cast<int64>(0xFFFFFFFF)); lsb = vecType<L, int32, P>(Value64 & static_cast<int64>(0xFFFFFFFF));
msb = vecType<D, int32, P>((Value64 >> static_cast<int64>(32)) & static_cast<int64>(0xFFFFFFFF)); msb = vecType<L, int32, P>((Value64 >> static_cast<int64>(32)) & static_cast<int64>(0xFFFFFFFF));
} }
// bitfieldExtract // bitfieldExtract
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldExtract(genIUType Value, int Offset, int Bits) GLM_FUNC_QUALIFIER genIUType bitfieldExtract(genIUType Value, int Offset, int Bits)
{ {
return bitfieldExtract(vec<1, genIUType>(Value), Offset, Bits).x; return bitfieldExtract(vec<1, genIUType>(Value), Offset, Bits).x;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> bitfieldExtract(vecType<D, T, P> const & Value, int Offset, int Bits) GLM_FUNC_QUALIFIER vecType<L, T, P> bitfieldExtract(vecType<L, T, P> const& Value, int Offset, int Bits)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldExtract' only accept integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldExtract' only accept integer inputs");
@@ -272,14 +272,14 @@ namespace detail
} }
// bitfieldInsert // bitfieldInsert
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const & Base, genIUType const & Insert, int Offset, int Bits) GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const & Base, genIUType const & Insert, int Offset, int Bits)
{ {
return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x; return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> bitfieldInsert(vecType<D, T, P> const & Base, vecType<D, T, P> const & Insert, int Offset, int Bits) GLM_FUNC_QUALIFIER vecType<L, T, P> bitfieldInsert(vecType<L, T, P> const& Base, vecType<L, T, P> const& Insert, int Offset, int Bits)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldInsert' only accept integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldInsert' only accept integer values");
@@ -288,54 +288,54 @@ namespace detail
} }
// bitfieldReverse // bitfieldReverse
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType bitfieldReverse(genType x) GLM_FUNC_QUALIFIER genType bitfieldReverse(genType x)
{ {
return bitfieldReverse(glm::vec<1, genType, glm::defaultp>(x)).x; return bitfieldReverse(glm::vec<1, genType, glm::defaultp>(x)).x;
} }
template <int D, typename T, glm::precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, glm::precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> bitfieldReverse(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> bitfieldReverse(vecType<L, T, P> const& v)
{ {
vecType<D, T, P> x(v); vecType<L, T, P> x(v);
x = detail::compute_bitfieldReverseStep<D, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 2>::call(x, T(0x5555555555555555ull), static_cast<T>( 1)); x = detail::compute_bitfieldReverseStep<L, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 2>::call(x, T(0x5555555555555555ull), static_cast<T>( 1));
x = detail::compute_bitfieldReverseStep<D, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 4>::call(x, T(0x3333333333333333ull), static_cast<T>( 2)); x = detail::compute_bitfieldReverseStep<L, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 4>::call(x, T(0x3333333333333333ull), static_cast<T>( 2));
x = detail::compute_bitfieldReverseStep<D, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4)); x = detail::compute_bitfieldReverseStep<L, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4));
x = detail::compute_bitfieldReverseStep<D, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 16>::call(x, T(0x00FF00FF00FF00FFull), static_cast<T>( 8)); x = detail::compute_bitfieldReverseStep<L, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 16>::call(x, T(0x00FF00FF00FF00FFull), static_cast<T>( 8));
x = detail::compute_bitfieldReverseStep<D, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 32>::call(x, T(0x0000FFFF0000FFFFull), static_cast<T>(16)); x = detail::compute_bitfieldReverseStep<L, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 32>::call(x, T(0x0000FFFF0000FFFFull), static_cast<T>(16));
x = detail::compute_bitfieldReverseStep<D, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 64>::call(x, T(0x00000000FFFFFFFFull), static_cast<T>(32)); x = detail::compute_bitfieldReverseStep<L, T, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 64>::call(x, T(0x00000000FFFFFFFFull), static_cast<T>(32));
return x; return x;
} }
// bitCount // bitCount
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER int bitCount(genType x) GLM_FUNC_QUALIFIER int bitCount(genType x)
{ {
return bitCount(glm::vec<1, genType, glm::defaultp>(x)).x; return bitCount(glm::vec<1, genType, glm::defaultp>(x)).x;
} }
template <int D, typename T, glm::precision P, template <int, typename, glm::precision> class vecType> template<length_t L, typename T, glm::precision P, template<length_t, typename, glm::precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, int, P> bitCount(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, int, P> bitCount(vecType<L, T, P> const& v)
{ {
#if GLM_COMPILER & GLM_COMPILER_VC #if GLM_COMPILER & GLM_COMPILER_VC
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4310) //cast truncates constant value #pragma warning(disable : 4310) //cast truncates constant value
#endif #endif
vecType<D, typename detail::make_unsigned<T>::type, P> x(*reinterpret_cast<vecType<D, typename detail::make_unsigned<T>::type, P> const *>(&v)); vecType<L, typename detail::make_unsigned<T>::type, P> x(*reinterpret_cast<vecType<L, typename detail::make_unsigned<T>::type, P> const *>(&v));
x = detail::compute_bitfieldBitCountStep<D, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned<T>::type(0x5555555555555555ull), typename detail::make_unsigned<T>::type( 1)); x = detail::compute_bitfieldBitCountStep<L, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 2>::call(x, typename detail::make_unsigned<T>::type(0x5555555555555555ull), typename detail::make_unsigned<T>::type( 1));
x = detail::compute_bitfieldBitCountStep<D, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned<T>::type(0x3333333333333333ull), typename detail::make_unsigned<T>::type( 2)); x = detail::compute_bitfieldBitCountStep<L, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 4>::call(x, typename detail::make_unsigned<T>::type(0x3333333333333333ull), typename detail::make_unsigned<T>::type( 2));
x = detail::compute_bitfieldBitCountStep<D, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned<T>::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned<T>::type( 4)); x = detail::compute_bitfieldBitCountStep<L, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 8>::call(x, typename detail::make_unsigned<T>::type(0x0F0F0F0F0F0F0F0Full), typename detail::make_unsigned<T>::type( 4));
x = detail::compute_bitfieldBitCountStep<D, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 16>::call(x, typename detail::make_unsigned<T>::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned<T>::type( 8)); x = detail::compute_bitfieldBitCountStep<L, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 16>::call(x, typename detail::make_unsigned<T>::type(0x00FF00FF00FF00FFull), typename detail::make_unsigned<T>::type( 8));
x = detail::compute_bitfieldBitCountStep<D, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 32>::call(x, typename detail::make_unsigned<T>::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned<T>::type(16)); x = detail::compute_bitfieldBitCountStep<L, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 32>::call(x, typename detail::make_unsigned<T>::type(0x0000FFFF0000FFFFull), typename detail::make_unsigned<T>::type(16));
x = detail::compute_bitfieldBitCountStep<D, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 64>::call(x, typename detail::make_unsigned<T>::type(0x00000000FFFFFFFFull), typename detail::make_unsigned<T>::type(32)); x = detail::compute_bitfieldBitCountStep<L, typename detail::make_unsigned<T>::type, P, vecType, detail::is_aligned<P>::value, sizeof(T) * 8>= 64>::call(x, typename detail::make_unsigned<T>::type(0x00000000FFFFFFFFull), typename detail::make_unsigned<T>::type(32));
return vecType<D, int, P>(x); return vecType<L, int, P>(x);
#if GLM_COMPILER & GLM_COMPILER_VC #if GLM_COMPILER & GLM_COMPILER_VC
#pragma warning(pop) #pragma warning(pop)
#endif #endif
} }
// findLSB // findLSB
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER int findLSB(genIUType Value) GLM_FUNC_QUALIFIER int findLSB(genIUType Value)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values"); GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
@@ -343,29 +343,29 @@ namespace detail
return detail::compute_findLSB<genIUType, sizeof(genIUType) * 8>::call(Value); return detail::compute_findLSB<genIUType, sizeof(genIUType) * 8>::call(Value);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, int, P> findLSB(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, int, P> findLSB(vecType<L, T, P> const& x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findLSB' only accept integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findLSB' only accept integer values");
return detail::functor1<D, int, T, P>::call(findLSB, x); return detail::functor1<L, int, T, P>::call(findLSB, x);
} }
// findMSB // findMSB
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER int findMSB(genIUType x) GLM_FUNC_QUALIFIER int findMSB(genIUType v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values"); GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
return findMSB(vec<1, genIUType>(x)).x; return findMSB(vec<1, genIUType>(v)).x;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, int, P> findMSB(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, int, P> findMSB(vecType<L, T, P> const& v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findMSB' only accept integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findMSB' only accept integer values");
return detail::compute_findMSB_vec<D, T, P, vecType, sizeof(T) * 8>::call(x); return detail::compute_findMSB_vec<L, T, P, vecType, sizeof(T) * 8>::call(v);
} }
}//namespace glm }//namespace glm

View File

@@ -8,7 +8,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <glm::precision P> template<glm::precision P>
struct compute_bitfieldReverseStep<4, uint32, P, vec, true, true> struct compute_bitfieldReverseStep<4, uint32, P, vec, true, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & v, uint32 Mask, uint32 Shift) GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & v, uint32 Mask, uint32 Shift)
@@ -29,7 +29,7 @@ namespace detail
} }
}; };
template <glm::precision P> template<glm::precision P>
struct compute_bitfieldBitCountStep<4, uint32, P, vec, true, true> struct compute_bitfieldBitCountStep<4, uint32, P, vec, true, true>
{ {
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & v, uint32 Mask, uint32 Shift) GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & v, uint32 Mask, uint32 Shift)
@@ -48,14 +48,14 @@ namespace detail
}//namespace detail }//namespace detail
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <> template<>
GLM_FUNC_QUALIFIER int bitCount(uint32 x) GLM_FUNC_QUALIFIER int bitCount(uint32 x)
{ {
return _mm_popcnt_u32(x); return _mm_popcnt_u32(x);
} }
# if(GLM_MODEL == GLM_MODEL_64) # if(GLM_MODEL == GLM_MODEL_64)
template <> template<>
GLM_FUNC_QUALIFIER int bitCount(uint64 x) GLM_FUNC_QUALIFIER int bitCount(uint64 x)
{ {
return static_cast<int>(_mm_popcnt_u64(x)); return static_cast<int>(_mm_popcnt_u64(x));

View File

@@ -34,55 +34,55 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <typename T, precision P> template<typename T, precision P>
struct outerProduct_trait<2, 2, T, P, vec, vec> struct outerProduct_trait<2, 2, T, P, vec, vec>
{ {
typedef mat<2, 2, T, P> type; typedef mat<2, 2, T, P> type;
}; };
template <typename T, precision P> template<typename T, precision P>
struct outerProduct_trait<2, 3, T, P, vec, vec> struct outerProduct_trait<2, 3, T, P, vec, vec>
{ {
typedef mat<3, 2, T, P> type; typedef mat<3, 2, T, P> type;
}; };
template <typename T, precision P> template<typename T, precision P>
struct outerProduct_trait<2, 4, T, P, vec, vec> struct outerProduct_trait<2, 4, T, P, vec, vec>
{ {
typedef mat<4, 2, T, P> type; typedef mat<4, 2, T, P> type;
}; };
template <typename T, precision P> template<typename T, precision P>
struct outerProduct_trait<3, 2, T, P, vec, vec> struct outerProduct_trait<3, 2, T, P, vec, vec>
{ {
typedef mat<2, 3, T, P> type; typedef mat<2, 3, T, P> type;
}; };
template <typename T, precision P> template<typename T, precision P>
struct outerProduct_trait<3, 3, T, P, vec, vec> struct outerProduct_trait<3, 3, T, P, vec, vec>
{ {
typedef mat<3, 3, T, P> type; typedef mat<3, 3, T, P> type;
}; };
template <typename T, precision P> template<typename T, precision P>
struct outerProduct_trait<3, 4, T, P, vec, vec> struct outerProduct_trait<3, 4, T, P, vec, vec>
{ {
typedef mat<4, 3, T, P> type; typedef mat<4, 3, T, P> type;
}; };
template <typename T, precision P> template<typename T, precision P>
struct outerProduct_trait<4, 2, T, P, vec, vec> struct outerProduct_trait<4, 2, T, P, vec, vec>
{ {
typedef mat<2, 4, T, P> type; typedef mat<2, 4, T, P> type;
}; };
template <typename T, precision P> template<typename T, precision P>
struct outerProduct_trait<4, 3, T, P, vec, vec> struct outerProduct_trait<4, 3, T, P, vec, vec>
{ {
typedef mat<3, 4, T, P> type; typedef mat<3, 4, T, P> type;
}; };
template <typename T, precision P> template<typename T, precision P>
struct outerProduct_trait<4, 4, T, P, vec, vec> struct outerProduct_trait<4, 4, T, P, vec, vec>
{ {
typedef mat<4, 4, T, P> type; typedef mat<4, 4, T, P> type;
@@ -100,7 +100,7 @@ namespace detail
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename T, precision P, template <typename, precision> class matType> template<typename T, precision P, template<typename, precision> class matType>
GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y); GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y);
/// Treats the first parameter c as a column vector /// Treats the first parameter c as a column vector
@@ -111,7 +111,7 @@ namespace detail
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <int DA, int DB, typename T, precision P, template <int, typename, precision> class vecTypeA, template <int, typename, precision> class vecTypeB> template<int DA, int DB, typename T, precision P, template<length_t, typename, precision> class vecTypeA, template<length_t, typename, precision> class vecTypeB>
GLM_FUNC_DECL typename detail::outerProduct_trait<DA, DB, T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<DA, T, P> const & c, vecTypeB<DB, T, P> const & r); GLM_FUNC_DECL typename detail::outerProduct_trait<DA, DB, T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<DA, T, P> const & c, vecTypeB<DB, T, P> const & r);
/// Returns the transposed matrix of x /// Returns the transposed matrix of x
@@ -121,7 +121,7 @@ namespace detail
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11)) # if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC11))
template <typename T, precision P, template <typename, precision> class matType> template<typename T, precision P, template<typename, precision> class matType>
GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x); GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x);
# endif # endif
@@ -131,7 +131,7 @@ namespace detail
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename T, precision P, template <typename, precision> class matType> template<typename T, precision P, template<typename, precision> class matType>
GLM_FUNC_DECL T determinant(matType<T, P> const & m); GLM_FUNC_DECL T determinant(matType<T, P> const & m);
/// Return the inverse of a squared matrix. /// Return the inverse of a squared matrix.
@@ -140,7 +140,7 @@ namespace detail
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename T, precision P, template <typename, precision> class matType> template<typename T, precision P, template<typename, precision> class matType>
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m); GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m);
/// @} /// @}

View File

@@ -7,7 +7,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <template <length_t, length_t, typename, precision> class matType, length_t C, length_t R, typename T, precision P, bool Aligned> template<template<length_t, length_t, typename, precision> class matType, length_t C, length_t R, typename T, precision P, bool Aligned>
struct compute_matrixCompMult struct compute_matrixCompMult
{ {
GLM_FUNC_QUALIFIER static matType<C, R, T, P> call(matType<C, R, T, P> const& x, matType<C, R, T, P> const& y) GLM_FUNC_QUALIFIER static matType<C, R, T, P> call(matType<C, R, T, P> const& x, matType<C, R, T, P> const& y)
@@ -19,10 +19,10 @@ namespace detail
} }
}; };
template <template <length_t, length_t, typename, precision> class matType, length_t C, length_t R, typename T, precision P, bool Aligned> template<template<length_t, length_t, typename, precision> class matType, length_t C, length_t R, typename T, precision P, bool Aligned>
struct compute_transpose{}; struct compute_transpose{};
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_transpose<mat, 2, 2, T, P, Aligned> struct compute_transpose<mat, 2, 2, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<2, 2, T, P> call(mat<2, 2, T, P> const& m) GLM_FUNC_QUALIFIER static mat<2, 2, T, P> call(mat<2, 2, T, P> const& m)
@@ -36,7 +36,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_transpose<mat, 2, 3, T, P, Aligned> struct compute_transpose<mat, 2, 3, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<3, 2, T, P> call(mat<2, 3, T, P> const& m) GLM_FUNC_QUALIFIER static mat<3, 2, T, P> call(mat<2, 3, T, P> const& m)
@@ -52,7 +52,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_transpose<mat, 2, 4, T, P, Aligned> struct compute_transpose<mat, 2, 4, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<4, 2, T, P> call(mat<2, 4, T, P> const& m) GLM_FUNC_QUALIFIER static mat<4, 2, T, P> call(mat<2, 4, T, P> const& m)
@@ -70,7 +70,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_transpose<mat, 3, 2, T, P, Aligned> struct compute_transpose<mat, 3, 2, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<2, 3, T, P> call(mat<3, 2, T, P> const& m) GLM_FUNC_QUALIFIER static mat<2, 3, T, P> call(mat<3, 2, T, P> const& m)
@@ -86,7 +86,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_transpose<mat, 3, 3, T, P, Aligned> struct compute_transpose<mat, 3, 3, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<3, 3, T, P> call(mat<3, 3, T, P> const& m) GLM_FUNC_QUALIFIER static mat<3, 3, T, P> call(mat<3, 3, T, P> const& m)
@@ -107,7 +107,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_transpose<mat, 3, 4, T, P, Aligned> struct compute_transpose<mat, 3, 4, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<4, 3, T, P> call(mat<3, 4, T, P> const& m) GLM_FUNC_QUALIFIER static mat<4, 3, T, P> call(mat<3, 4, T, P> const& m)
@@ -129,7 +129,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_transpose<mat, 4, 2, T, P, Aligned> struct compute_transpose<mat, 4, 2, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<2, 4, T, P> call(mat<4, 2, T, P> const& m) GLM_FUNC_QUALIFIER static mat<2, 4, T, P> call(mat<4, 2, T, P> const& m)
@@ -147,7 +147,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_transpose<mat, 4, 3, T, P, Aligned> struct compute_transpose<mat, 4, 3, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<3, 4, T, P> call(mat<4, 3, T, P> const& m) GLM_FUNC_QUALIFIER static mat<3, 4, T, P> call(mat<4, 3, T, P> const& m)
@@ -169,7 +169,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_transpose<mat, 4, 4, T, P, Aligned> struct compute_transpose<mat, 4, 4, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<4, 4, T, P> call(mat<4, 4, T, P> const& m) GLM_FUNC_QUALIFIER static mat<4, 4, T, P> call(mat<4, 4, T, P> const& m)
@@ -198,10 +198,10 @@ namespace detail
} }
}; };
template <template <length_t, length_t, typename, precision> class matType, length_t C, length_t R, typename T, precision P, bool Aligned> template<template<length_t, length_t, typename, precision> class matType, length_t C, length_t R, typename T, precision P, bool Aligned>
struct compute_determinant{}; struct compute_determinant{};
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_determinant<mat, 2, 2, T, P, Aligned> struct compute_determinant<mat, 2, 2, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static T call(mat<2, 2, T, P> const& m) GLM_FUNC_QUALIFIER static T call(mat<2, 2, T, P> const& m)
@@ -210,7 +210,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_determinant<mat, 3, 3, T, P, Aligned> struct compute_determinant<mat, 3, 3, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static T call(mat<3, 3, T, P> const& m) GLM_FUNC_QUALIFIER static T call(mat<3, 3, T, P> const& m)
@@ -222,7 +222,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_determinant<mat, 4, 4, T, P, Aligned> struct compute_determinant<mat, 4, 4, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static T call(mat<4, 4, T, P> const& m) GLM_FUNC_QUALIFIER static T call(mat<4, 4, T, P> const& m)
@@ -246,10 +246,10 @@ namespace detail
} }
}; };
template <template <length_t, length_t, typename, precision> class matType, length_t C, length_t R, typename T, precision P, bool Aligned> template<template<length_t, length_t, typename, precision> class matType, length_t C, length_t R, typename T, precision P, bool Aligned>
struct compute_inverse{}; struct compute_inverse{};
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_inverse<mat, 2, 2, T, P, Aligned> struct compute_inverse<mat, 2, 2, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<2, 2, T, P> call(mat<2, 2, T, P> const& m) GLM_FUNC_QUALIFIER static mat<2, 2, T, P> call(mat<2, 2, T, P> const& m)
@@ -268,7 +268,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_inverse<mat, 3, 3, T, P, Aligned> struct compute_inverse<mat, 3, 3, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<3, 3, T, P> call(mat<3, 3, T, P> const& m) GLM_FUNC_QUALIFIER static mat<3, 3, T, P> call(mat<3, 3, T, P> const& m)
@@ -293,7 +293,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_inverse<mat, 4, 4, T, P, Aligned> struct compute_inverse<mat, 4, 4, T, P, Aligned>
{ {
GLM_FUNC_QUALIFIER static mat<4, 4, T, P> call(mat<4, 4, T, P> const& m) GLM_FUNC_QUALIFIER static mat<4, 4, T, P> call(mat<4, 4, T, P> const& m)
@@ -355,14 +355,14 @@ namespace detail
}; };
}//namespace detail }//namespace detail
template <length_t C, length_t R, typename T, precision P, template <length_t, length_t, typename, precision> class matType> template<length_t C, length_t R, typename T, precision P, template<length_t, length_t, typename, precision> class matType>
GLM_FUNC_QUALIFIER matType<C, R, T, P> matrixCompMult(matType<C, R, T, P> const & x, matType<C, R, T, P> const & y) GLM_FUNC_QUALIFIER matType<C, R, T, P> matrixCompMult(matType<C, R, T, P> const & x, matType<C, R, T, P> const & y)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'matrixCompMult' only accept floating-point inputs");
return detail::compute_matrixCompMult<matType, C, R, T, P, detail::is_aligned<P>::value>::call(x, y); return detail::compute_matrixCompMult<matType, C, R, T, P, detail::is_aligned<P>::value>::call(x, y);
} }
template<int DA, int DB, typename T, precision P, template <int, typename, precision> class vecTypeA, template <int, typename, precision> class vecTypeB> template<int DA, int DB, typename T, precision P, template<length_t, typename, precision> class vecTypeA, template<length_t, typename, precision> class vecTypeB>
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<DA, DB, T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<DA, T, P> const & c, vecTypeB<DB, T, P> const & r) GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<DA, DB, T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<DA, T, P> const & c, vecTypeB<DB, T, P> const & r)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs");
@@ -373,21 +373,21 @@ namespace detail
return m; return m;
} }
template <length_t C, length_t R, typename T, precision P, template <length_t C, length_t R, typename, precision> class matType> template<length_t C, length_t R, typename T, precision P, template<length_t C, length_t R, typename, precision> class matType>
GLM_FUNC_QUALIFIER typename matType<C, R, T, P>::transpose_type transpose(matType<C, R, T, P> const & m) GLM_FUNC_QUALIFIER typename matType<C, R, T, P>::transpose_type transpose(matType<C, R, T, P> const & m)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'transpose' only accept floating-point inputs");
return detail::compute_transpose<matType, C, R, T, P, detail::is_aligned<P>::value>::call(m); return detail::compute_transpose<matType, C, R, T, P, detail::is_aligned<P>::value>::call(m);
} }
template <length_t C, length_t R, typename T, precision P, template <length_t C, length_t R, typename, precision> class matType> template<length_t C, length_t R, typename T, precision P, template<length_t C, length_t R, typename, precision> class matType>
GLM_FUNC_QUALIFIER T determinant(matType<C, R, T, P> const & m) GLM_FUNC_QUALIFIER T determinant(matType<C, R, T, P> const & m)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'determinant' only accept floating-point inputs");
return detail::compute_determinant<matType, C, R, T, P, detail::is_aligned<P>::value>::call(m); return detail::compute_determinant<matType, C, R, T, P, detail::is_aligned<P>::value>::call(m);
} }
template <length_t C, length_t R, typename T, precision P, template <length_t C, length_t R, typename, precision> class matType> template<length_t C, length_t R, typename T, precision P, template<length_t C, length_t R, typename, precision> class matType>
GLM_FUNC_QUALIFIER matType<C, R, T, P> inverse(matType<C, R, T, P> const & m) GLM_FUNC_QUALIFIER matType<C, R, T, P> inverse(matType<C, R, T, P> const & m)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs");

View File

@@ -10,7 +10,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <precision P> template<precision P>
struct compute_matrixCompMult<mat<4, 4, float, P, true> struct compute_matrixCompMult<mat<4, 4, float, P, true>
{ {
GLM_STATIC_ASSERT(detail::is_aligned<P>::value, "Specialization requires aligned"); GLM_STATIC_ASSERT(detail::is_aligned<P>::value, "Specialization requires aligned");
@@ -26,7 +26,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_transpose<mat<4, 4, float, P, true> struct compute_transpose<mat<4, 4, float, P, true>
{ {
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const & m) GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const & m)
@@ -39,7 +39,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_determinant<mat<4, 4, float, P, true> struct compute_determinant<mat<4, 4, float, P, true>
{ {
GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, P> const& m) GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, P> const& m)
@@ -48,7 +48,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_inverse<mat<4, 4, float, P, true> struct compute_inverse<mat<4, 4, float, P, true>
{ {
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const& m) GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const& m)

View File

@@ -28,8 +28,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL GLM_CONSTEXPR vecType<D, T, P> radians(vecType<D, T, P> const & degrees); GLM_FUNC_DECL GLM_CONSTEXPR vecType<L, T, P> radians(vecType<L, T, P> const & degrees);
/// Converts radians to degrees and returns the result. /// Converts radians to degrees and returns the result.
/// ///
@@ -37,8 +37,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL GLM_CONSTEXPR vecType<D, T, P> degrees(vecType<D, T, P> const & radians); GLM_FUNC_DECL GLM_CONSTEXPR vecType<L, T, P> degrees(vecType<L, T, P> const & radians);
/// The standard trigonometric sine function. /// The standard trigonometric sine function.
/// The values returned by this function will range from [-1, 1]. /// The values returned by this function will range from [-1, 1].
@@ -47,8 +47,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> sin(vecType<D, T, P> const & angle); GLM_FUNC_DECL vecType<L, T, P> sin(vecType<L, T, P> const & angle);
/// The standard trigonometric cosine function. /// The standard trigonometric cosine function.
/// The values returned by this function will range from [-1, 1]. /// The values returned by this function will range from [-1, 1].
@@ -57,8 +57,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> cos(vecType<D, T, P> const & angle); GLM_FUNC_DECL vecType<L, T, P> cos(vecType<L, T, P> const & angle);
/// The standard trigonometric tangent function. /// The standard trigonometric tangent function.
/// ///
@@ -66,8 +66,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> tan(vecType<D, T, P> const & angle); GLM_FUNC_DECL vecType<L, T, P> tan(vecType<L, T, P> const & angle);
/// Arc sine. Returns an angle whose sine is x. /// Arc sine. Returns an angle whose sine is x.
/// The range of values returned by this function is [-PI/2, PI/2]. /// The range of values returned by this function is [-PI/2, PI/2].
@@ -77,8 +77,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> asin(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> asin(vecType<L, T, P> const & x);
/// Arc cosine. Returns an angle whose sine is x. /// Arc cosine. Returns an angle whose sine is x.
/// The range of values returned by this function is [0, PI]. /// The range of values returned by this function is [0, PI].
@@ -88,8 +88,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> acos(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> acos(vecType<L, T, P> const & x);
/// Arc tangent. Returns an angle whose tangent is y/x. /// Arc tangent. Returns an angle whose tangent is y/x.
/// The signs of x and y are used to determine what /// The signs of x and y are used to determine what
@@ -101,8 +101,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> atan(vecType<D, T, P> const & y, vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> atan(vecType<L, T, P> const & y, vecType<L, T, P> const & x);
/// Arc tangent. Returns an angle whose tangent is y_over_x. /// Arc tangent. Returns an angle whose tangent is y_over_x.
/// The range of values returned by this function is [-PI/2, PI/2]. /// The range of values returned by this function is [-PI/2, PI/2].
@@ -111,8 +111,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> atan(vecType<D, T, P> const & y_over_x); GLM_FUNC_DECL vecType<L, T, P> atan(vecType<L, T, P> const & y_over_x);
/// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2
/// ///
@@ -120,8 +120,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> sinh(vecType<D, T, P> const & angle); GLM_FUNC_DECL vecType<L, T, P> sinh(vecType<L, T, P> const & angle);
/// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2
/// ///
@@ -129,8 +129,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> cosh(vecType<D, T, P> const & angle); GLM_FUNC_DECL vecType<L, T, P> cosh(vecType<L, T, P> const & angle);
/// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)
/// ///
@@ -138,8 +138,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> tanh(vecType<D, T, P> const & angle); GLM_FUNC_DECL vecType<L, T, P> tanh(vecType<L, T, P> const & angle);
/// Arc hyperbolic sine; returns the inverse of sinh. /// Arc hyperbolic sine; returns the inverse of sinh.
/// ///
@@ -147,8 +147,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> asinh(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> asinh(vecType<L, T, P> const & x);
/// Arc hyperbolic cosine; returns the non-negative inverse /// Arc hyperbolic cosine; returns the non-negative inverse
/// of cosh. Results are undefined if x < 1. /// of cosh. Results are undefined if x < 1.
@@ -157,8 +157,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> acosh(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> acosh(vecType<L, T, P> const & x);
/// Arc hyperbolic tangent; returns the inverse of tanh. /// Arc hyperbolic tangent; returns the inverse of tanh.
/// Results are undefined if abs(x) >= 1. /// Results are undefined if abs(x) >= 1.
@@ -167,8 +167,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> atanh(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, T, P> atanh(vecType<L, T, P> const & x);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@@ -8,7 +8,7 @@
namespace glm namespace glm
{ {
// radians // radians
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees) GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'radians' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'radians' only accept floating-point input");
@@ -16,14 +16,14 @@ namespace glm
return degrees * static_cast<genType>(0.01745329251994329576923690768489); return degrees * static_cast<genType>(0.01745329251994329576923690768489);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<D, T, P> radians(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<L, T, P> radians(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(radians, v); return detail::functor1<L, T, T, P>::call(radians, v);
} }
// degrees // degrees
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians) GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'degrees' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'degrees' only accept floating-point input");
@@ -31,59 +31,59 @@ namespace glm
return radians * static_cast<genType>(57.295779513082320876798154814105); return radians * static_cast<genType>(57.295779513082320876798154814105);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<D, T, P> degrees(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<L, T, P> degrees(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(degrees, v); return detail::functor1<L, T, T, P>::call(degrees, v);
} }
// sin // sin
using ::std::sin; using ::std::sin;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> sin(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> sin(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(sin, v); return detail::functor1<L, T, T, P>::call(sin, v);
} }
// cos // cos
using std::cos; using std::cos;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> cos(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> cos(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(cos, v); return detail::functor1<L, T, T, P>::call(cos, v);
} }
// tan // tan
using std::tan; using std::tan;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> tan(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> tan(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(tan, v); return detail::functor1<L, T, T, P>::call(tan, v);
} }
// asin // asin
using std::asin; using std::asin;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> asin(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> asin(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(asin, v); return detail::functor1<L, T, T, P>::call(asin, v);
} }
// acos // acos
using std::acos; using std::acos;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> acos(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> acos(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(acos, v); return detail::functor1<L, T, T, P>::call(acos, v);
} }
// atan // atan
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType atan(genType y, genType x) GLM_FUNC_QUALIFIER genType atan(genType y, genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input");
@@ -91,52 +91,52 @@ namespace glm
return ::std::atan2(y, x); return ::std::atan2(y, x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> atan(vecType<D, T, P> const & a, vecType<D, T, P> const & b) GLM_FUNC_QUALIFIER vecType<L, T, P> atan(vecType<L, T, P> const & a, vecType<L, T, P> const & b)
{ {
return detail::functor2<D, T, P>::call(::std::atan2, a, b); return detail::functor2<L, T, P>::call(::std::atan2, a, b);
} }
using std::atan; using std::atan;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> atan(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> atan(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(atan, v); return detail::functor1<L, T, T, P>::call(atan, v);
} }
// sinh // sinh
using std::sinh; using std::sinh;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> sinh(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> sinh(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(sinh, v); return detail::functor1<L, T, T, P>::call(sinh, v);
} }
// cosh // cosh
using std::cosh; using std::cosh;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> cosh(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> cosh(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(cosh, v); return detail::functor1<L, T, T, P>::call(cosh, v);
} }
// tanh // tanh
using std::tanh; using std::tanh;
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> tanh(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> tanh(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(tanh, v); return detail::functor1<L, T, T, P>::call(tanh, v);
} }
// asinh // asinh
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
using std::asinh; using std::asinh;
# else # else
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType asinh(genType x) GLM_FUNC_QUALIFIER genType asinh(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asinh' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asinh' only accept floating-point input");
@@ -145,17 +145,17 @@ namespace glm
} }
# endif # endif
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> asinh(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> asinh(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(asinh, v); return detail::functor1<L, T, T, P>::call(asinh, v);
} }
// acosh // acosh
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
using std::acosh; using std::acosh;
# else # else
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType acosh(genType x) GLM_FUNC_QUALIFIER genType acosh(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acosh' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acosh' only accept floating-point input");
@@ -166,17 +166,17 @@ namespace glm
} }
# endif # endif
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> acosh(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> acosh(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(acosh, v); return detail::functor1<L, T, T, P>::call(acosh, v);
} }
// atanh // atanh
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
using std::atanh; using std::atanh;
# else # else
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType atanh(genType x) GLM_FUNC_QUALIFIER genType atanh(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atanh' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atanh' only accept floating-point input");
@@ -187,10 +187,10 @@ namespace glm
} }
# endif # endif
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> atanh(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> atanh(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(atanh, v); return detail::functor1<L, T, T, P>::call(atanh, v);
} }
}//namespace glm }//namespace glm

View File

@@ -29,8 +29,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> lessThan(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, bool, P> lessThan(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns the component-wise comparison of result x <= y. /// Returns the component-wise comparison of result x <= y.
/// ///
@@ -38,8 +38,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> lessThanEqual(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, bool, P> lessThanEqual(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns the component-wise comparison of result x > y. /// Returns the component-wise comparison of result x > y.
/// ///
@@ -47,8 +47,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> greaterThan(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, bool, P> greaterThan(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns the component-wise comparison of result x >= y. /// Returns the component-wise comparison of result x >= y.
/// ///
@@ -56,8 +56,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> greaterThanEqual(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, bool, P> greaterThanEqual(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns the component-wise comparison of result x == y. /// Returns the component-wise comparison of result x == y.
/// ///
@@ -65,8 +65,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> equal(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, bool, P> equal(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns the component-wise comparison of result x != y. /// Returns the component-wise comparison of result x != y.
/// ///
@@ -74,8 +74,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> notEqual(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, bool, P> notEqual(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns true if any component of x is true. /// Returns true if any component of x is true.
/// ///
@@ -83,8 +83,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL bool any(vecType<D, bool, P> const & v); GLM_FUNC_DECL bool any(vecType<L, bool, P> const & v);
/// Returns true if all components of x are true. /// Returns true if all components of x are true.
/// ///
@@ -92,8 +92,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL bool all(vecType<D, bool, P> const & v); GLM_FUNC_DECL bool all(vecType<L, bool, P> const & v);
/// Returns the component-wise logical complement of x. /// Returns the component-wise logical complement of x.
/// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
@@ -102,8 +102,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> not_(vecType<D, bool, P> const & v); GLM_FUNC_DECL vecType<L, bool, P> not_(vecType<L, bool, P> const & v);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@@ -5,75 +5,75 @@
namespace glm namespace glm
{ {
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> lessThan(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER vecType<L, bool, P> lessThan(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
assert(x.length() == y.length()); assert(x.length() == y.length());
vecType<D, bool, P> Result(uninitialize); vecType<L, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i) for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] < y[i]; Result[i] = x[i] < y[i];
return Result; return Result;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> lessThanEqual(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER vecType<L, bool, P> lessThanEqual(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
assert(x.length() == y.length()); assert(x.length() == y.length());
vecType<D, bool, P> Result(uninitialize); vecType<L, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i) for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] <= y[i]; Result[i] = x[i] <= y[i];
return Result; return Result;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> greaterThan(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER vecType<L, bool, P> greaterThan(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
assert(x.length() == y.length()); assert(x.length() == y.length());
vecType<D, bool, P> Result(uninitialize); vecType<L, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i) for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] > y[i]; Result[i] = x[i] > y[i];
return Result; return Result;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> greaterThanEqual(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER vecType<L, bool, P> greaterThanEqual(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
assert(x.length() == y.length()); assert(x.length() == y.length());
vecType<D, bool, P> Result(uninitialize); vecType<L, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i) for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] >= y[i]; Result[i] = x[i] >= y[i];
return Result; return Result;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> equal(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER vecType<L, bool, P> equal(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
assert(x.length() == y.length()); assert(x.length() == y.length());
vecType<D, bool, P> Result(uninitialize); vecType<L, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i) for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] == y[i]; Result[i] = x[i] == y[i];
return Result; return Result;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> notEqual(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER vecType<L, bool, P> notEqual(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
assert(x.length() == y.length()); assert(x.length() == y.length());
vecType<D, bool, P> Result(uninitialize); vecType<L, bool, P> Result(uninitialize);
for(length_t i = 0; i < x.length(); ++i) for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] != y[i]; Result[i] = x[i] != y[i];
return Result; return Result;
} }
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER bool any(vecType<D, bool, P> const & v) GLM_FUNC_QUALIFIER bool any(vecType<L, bool, P> const & v)
{ {
bool Result = false; bool Result = false;
for(length_t i = 0; i < v.length(); ++i) for(length_t i = 0; i < v.length(); ++i)
@@ -81,8 +81,8 @@ namespace glm
return Result; return Result;
} }
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER bool all(vecType<D, bool, P> const & v) GLM_FUNC_QUALIFIER bool all(vecType<L, bool, P> const & v)
{ {
bool Result = true; bool Result = true;
for(length_t i = 0; i < v.length(); ++i) for(length_t i = 0; i < v.length(); ++i)
@@ -90,10 +90,10 @@ namespace glm
return Result; return Result;
} }
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> not_(vecType<D, bool, P> const & v) GLM_FUNC_QUALIFIER vecType<L, bool, P> not_(vecType<L, bool, P> const & v)
{ {
vecType<D, bool, P> Result(uninitialize); vecType<L, bool, P> Result(uninitialize);
for(length_t i = 0; i < v.length(); ++i) for(length_t i = 0; i < v.length(); ++i)
Result[i] = !v[i]; Result[i] = !v[i];
return Result; return Result;

View File

@@ -32,12 +32,12 @@ namespace glm
# endif # endif
}; };
template <length_t L, typename T, precision P = defaultp> struct vec; template<length_t L, typename T, precision P = defaultp> struct vec;
template <length_t C, length_t R, typename T, precision P = defaultp> struct mat; template<length_t C, length_t R, typename T, precision P = defaultp> struct mat;
namespace detail namespace detail
{ {
template <glm::precision P> template<glm::precision P>
struct is_aligned struct is_aligned
{ {
static const bool value = false; static const bool value = false;

View File

@@ -777,7 +777,7 @@ namespace glm
#if GLM_HAS_CONSTEXPR_PARTIAL #if GLM_HAS_CONSTEXPR_PARTIAL
namespace glm namespace glm
{ {
template <typename T, std::size_t N> template<typename T, std::size_t N>
constexpr std::size_t countof(T const (&)[N]) constexpr std::size_t countof(T const (&)[N])
{ {
return N; return N;

View File

@@ -19,7 +19,7 @@ namespace detail
template template
< <
typename VALTYPE, typename VALTYPE,
template <typename> class TYPE template<typename> class TYPE
> >
struct genType struct genType
{ {
@@ -65,14 +65,14 @@ namespace detail
template template
< <
typename VALTYPE, typename VALTYPE,
template <typename> class TYPE template<typename> class TYPE
> >
bool genType<VALTYPE, TYPE>::is_vector() bool genType<VALTYPE, TYPE>::is_vector()
{ {
return true; return true;
} }
/* /*
template <typename valTypeT, unsigned int colT, unsigned int rowT, profile proT = nice> template<typename valTypeT, unsigned int colT, unsigned int rowT, profile proT = nice>
class base class base
{ {
public: public:
@@ -112,7 +112,7 @@ namespace detail
////////////////////////////////////// //////////////////////////////////////
// Conversions // Conversions
template <typename vU, uint cU, uint rU, profile pU> template<typename vU, uint cU, uint rU, profile pU>
explicit base(base<vU, cU, rU, pU> const & m); explicit base(base<vU, cU, rU, pU> const & m);
////////////////////////////////////// //////////////////////////////////////
@@ -136,7 +136,7 @@ namespace detail
}; };
*/ */
//template <typename T> //template<typename T>
//struct traits //struct traits
//{ //{
// static const bool is_signed = false; // static const bool is_signed = false;
@@ -148,28 +148,28 @@ namespace detail
// static const bool is_genUType = false; // static const bool is_genUType = false;
//}; //};
//template <> //template<>
//struct traits<half> //struct traits<half>
//{ //{
// static const bool is_float = true; // static const bool is_float = true;
// static const bool is_genType = true; // static const bool is_genType = true;
//}; //};
//template <> //template<>
//struct traits<float> //struct traits<float>
//{ //{
// static const bool is_float = true; // static const bool is_float = true;
// static const bool is_genType = true; // static const bool is_genType = true;
//}; //};
//template <> //template<>
//struct traits<double> //struct traits<double>
//{ //{
// static const bool is_float = true; // static const bool is_float = true;
// static const bool is_genType = true; // static const bool is_genType = true;
//}; //};
//template <typename genType> //template<typename genType>
//struct desc //struct desc
//{ //{
// typedef genType type; // typedef genType type;
@@ -186,7 +186,7 @@ namespace detail
// static const typename size_type value_size; // static const typename size_type value_size;
//}; //};
//template <typename genType> //template<typename genType>
//const typename desc<genType>::size_type desc<genType>::value_size = genType::value_size(); //const typename desc<genType>::size_type desc<genType>::value_size = genType::value_size();
}//namespace detail }//namespace detail

View File

@@ -7,37 +7,37 @@ namespace detail{
///////////////////////////////// /////////////////////////////////
// Static functions // Static functions
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::size_type base<vT, cT, rT, pT>::col_size() typename base<vT, cT, rT, pT>::size_type base<vT, cT, rT, pT>::col_size()
{ {
return cT; return cT;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::size_type base<vT, cT, rT, pT>::row_size() typename base<vT, cT, rT, pT>::size_type base<vT, cT, rT, pT>::row_size()
{ {
return rT; return rT;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::size_type base<vT, cT, rT, pT>::value_size() typename base<vT, cT, rT, pT>::size_type base<vT, cT, rT, pT>::value_size()
{ {
return rT * cT; return rT * cT;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
bool base<vT, cT, rT, pT>::is_scalar() bool base<vT, cT, rT, pT>::is_scalar()
{ {
return rT == 1 && cT == 1; return rT == 1 && cT == 1;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
bool base<vT, cT, rT, pT>::is_vector() bool base<vT, cT, rT, pT>::is_vector()
{ {
return rT == 1; return rT == 1;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
bool base<vT, cT, rT, pT>::is_matrix() bool base<vT, cT, rT, pT>::is_matrix()
{ {
return rT != 1; return rT != 1;
@@ -46,13 +46,13 @@ bool base<vT, cT, rT, pT>::is_matrix()
///////////////////////////////// /////////////////////////////////
// Constructor // Constructor
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
base<vT, cT, rT, pT>::base() base<vT, cT, rT, pT>::base()
{ {
memset(&this->value, 0, cT * rT * sizeof(vT)); memset(&this->value, 0, cT * rT * sizeof(vT));
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
base<vT, cT, rT, pT>::base base<vT, cT, rT, pT>::base
( (
typename base<vT, cT, rT, pT>::class_type const & m typename base<vT, cT, rT, pT>::class_type const & m
@@ -69,7 +69,7 @@ base<vT, cT, rT, pT>::base
} }
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
base<vT, cT, rT, pT>::base base<vT, cT, rT, pT>::base
( (
typename base<vT, cT, rT, pT>::T const & x typename base<vT, cT, rT, pT>::T const & x
@@ -105,7 +105,7 @@ base<vT, cT, rT, pT>::base
} }
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
base<vT, cT, rT, pT>::base base<vT, cT, rT, pT>::base
( (
typename base<vT, cT, rT, pT>::value_type const * const x typename base<vT, cT, rT, pT>::value_type const * const x
@@ -114,7 +114,7 @@ base<vT, cT, rT, pT>::base
memcpy(&this->value, &x.value, cT * rT * sizeof(vT)); memcpy(&this->value, &x.value, cT * rT * sizeof(vT));
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
base<vT, cT, rT, pT>::base base<vT, cT, rT, pT>::base
( (
typename base<vT, cT, rT, pT>::col_type const * const x typename base<vT, cT, rT, pT>::col_type const * const x
@@ -131,8 +131,8 @@ base<vT, cT, rT, pT>::base
} }
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
template <typename vU, uint cU, uint rU, profile pU> template<typename vU, uint cU, uint rU, profile pU>
base<vT, cT, rT, pT>::base base<vT, cT, rT, pT>::base
( (
base<vU, cU, rU, pU> const & m base<vU, cU, rU, pU> const & m
@@ -152,7 +152,7 @@ base<vT, cT, rT, pT>::base
////////////////////////////////////// //////////////////////////////////////
// Accesses // Accesses
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::col_type& base<vT, cT, rT, pT>::operator[] typename base<vT, cT, rT, pT>::col_type& base<vT, cT, rT, pT>::operator[]
( (
typename base<vT, cT, rT, pT>::size_type i typename base<vT, cT, rT, pT>::size_type i
@@ -161,7 +161,7 @@ typename base<vT, cT, rT, pT>::col_type& base<vT, cT, rT, pT>::operator[]
return this->value[i]; return this->value[i];
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::col_type const & base<vT, cT, rT, pT>::operator[] typename base<vT, cT, rT, pT>::col_type const & base<vT, cT, rT, pT>::operator[]
( (
typename base<vT, cT, rT, pT>::size_type i typename base<vT, cT, rT, pT>::size_type i
@@ -173,7 +173,7 @@ typename base<vT, cT, rT, pT>::col_type const & base<vT, cT, rT, pT>::operator[]
////////////////////////////////////// //////////////////////////////////////
// Unary updatable operators // Unary updatable operators
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator= typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator=
( (
typename base<vT, cT, rT, pT>::class_type const & x typename base<vT, cT, rT, pT>::class_type const & x
@@ -183,7 +183,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator=
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+= typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+=
( (
typename base<vT, cT, rT, pT>::T const & x typename base<vT, cT, rT, pT>::T const & x
@@ -199,7 +199,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+=
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+= typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+=
( (
typename base<vT, cT, rT, pT>::class_type const & x typename base<vT, cT, rT, pT>::class_type const & x
@@ -215,7 +215,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator+=
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-= typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-=
( (
typename base<vT, cT, rT, pT>::T const & x typename base<vT, cT, rT, pT>::T const & x
@@ -231,7 +231,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-=
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-= typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-=
( (
typename base<vT, cT, rT, pT>::class_type const & x typename base<vT, cT, rT, pT>::class_type const & x
@@ -247,7 +247,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-=
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*= typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*=
( (
typename base<vT, cT, rT, pT>::T const & x typename base<vT, cT, rT, pT>::T const & x
@@ -263,7 +263,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*=
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*= typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*=
( (
typename base<vT, cT, rT, pT>::class_type const & x typename base<vT, cT, rT, pT>::class_type const & x
@@ -279,7 +279,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator*=
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/= typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/=
( (
typename base<vT, cT, rT, pT>::T const & x typename base<vT, cT, rT, pT>::T const & x
@@ -295,7 +295,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/=
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/= typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/=
( (
typename base<vT, cT, rT, pT>::class_type const & x typename base<vT, cT, rT, pT>::class_type const & x
@@ -311,7 +311,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator/=
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator++ () typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator++ ()
{ {
typename base<vT, cT, rT, pT>::size_type stop_col = col_size(); typename base<vT, cT, rT, pT>::size_type stop_col = col_size();
@@ -324,7 +324,7 @@ typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator++ ()
return *this; return *this;
} }
template <typename vT, uint cT, uint rT, profile pT> template<typename vT, uint cT, uint rT, profile pT>
typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-- () typename base<vT, cT, rT, pT>::class_type& base<vT, cT, rT, pT>::operator-- ()
{ {
typename base<vT, cT, rT, pT>::size_type stop_col = col_size(); typename base<vT, cT, rT, pT>::size_type stop_col = col_size();

View File

@@ -73,129 +73,129 @@ namespace detail
using std::make_unsigned; using std::make_unsigned;
# else//GLM_HAS_MAKE_SIGNED # else//GLM_HAS_MAKE_SIGNED
template <typename genType> template<typename genType>
struct make_signed struct make_signed
{}; {};
template <> template<>
struct make_signed<char> struct make_signed<char>
{ {
typedef char type; typedef char type;
}; };
template <> template<>
struct make_signed<short> struct make_signed<short>
{ {
typedef short type; typedef short type;
}; };
template <> template<>
struct make_signed<int> struct make_signed<int>
{ {
typedef int type; typedef int type;
}; };
template <> template<>
struct make_signed<long> struct make_signed<long>
{ {
typedef long type; typedef long type;
}; };
template <> template<>
struct make_signed<unsigned char> struct make_signed<unsigned char>
{ {
typedef char type; typedef char type;
}; };
template <> template<>
struct make_signed<unsigned short> struct make_signed<unsigned short>
{ {
typedef short type; typedef short type;
}; };
template <> template<>
struct make_signed<unsigned int> struct make_signed<unsigned int>
{ {
typedef int type; typedef int type;
}; };
template <> template<>
struct make_signed<unsigned long> struct make_signed<unsigned long>
{ {
typedef long type; typedef long type;
}; };
template <typename genType> template<typename genType>
struct make_unsigned struct make_unsigned
{}; {};
template <> template<>
struct make_unsigned<char> struct make_unsigned<char>
{ {
typedef unsigned char type; typedef unsigned char type;
}; };
template <> template<>
struct make_unsigned<short> struct make_unsigned<short>
{ {
typedef unsigned short type; typedef unsigned short type;
}; };
template <> template<>
struct make_unsigned<int> struct make_unsigned<int>
{ {
typedef unsigned int type; typedef unsigned int type;
}; };
template <> template<>
struct make_unsigned<long> struct make_unsigned<long>
{ {
typedef unsigned long type; typedef unsigned long type;
}; };
template <> template<>
struct make_unsigned<unsigned char> struct make_unsigned<unsigned char>
{ {
typedef unsigned char type; typedef unsigned char type;
}; };
template <> template<>
struct make_unsigned<unsigned short> struct make_unsigned<unsigned short>
{ {
typedef unsigned short type; typedef unsigned short type;
}; };
template <> template<>
struct make_unsigned<unsigned int> struct make_unsigned<unsigned int>
{ {
typedef unsigned int type; typedef unsigned int type;
}; };
template <> template<>
struct make_unsigned<unsigned long> struct make_unsigned<unsigned long>
{ {
typedef unsigned long type; typedef unsigned long type;
}; };
template <> template<>
struct make_signed<long long> struct make_signed<long long>
{ {
typedef long long type; typedef long long type;
}; };
template <> template<>
struct make_signed<unsigned long long> struct make_signed<unsigned long long>
{ {
typedef long long type; typedef long long type;
}; };
template <> template<>
struct make_unsigned<long long> struct make_unsigned<long long>
{ {
typedef unsigned long long type; typedef unsigned long long type;
}; };
template <> template<>
struct make_unsigned<unsigned long long> struct make_unsigned<unsigned long long>
{ {
typedef unsigned long long type; typedef unsigned long long type;

View File

@@ -8,11 +8,11 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <int Columns, int Rows, typename T, precision P, template <int, class, precision> class colType, template <int, class, precision> class rowType> template<int Columns, int Rows, typename T, precision P, template<int, class, precision> class colType, template<int, class, precision> class rowType>
struct outerProduct_trait{}; struct outerProduct_trait{};
}//namespace detail }//namespace detail
template <typename T, precision P, template <typename, precision> class matType> template<typename T, precision P, template<typename, precision> class matType>
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m); GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m);
/// @addtogroup core_precision /// @addtogroup core_precision

View File

@@ -11,7 +11,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct mat<2, 2, T, P> struct mat<2, 2, T, P>
{ {
typedef vec<2, T, P> col_type; typedef vec<2, T, P> col_type;
@@ -28,7 +28,7 @@ namespace glm
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<2, 2, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat(mat<2, 2, T, P> const & m) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL mat(mat<2, 2, T, Q> const & m); GLM_FUNC_DECL mat(mat<2, 2, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor); GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
@@ -42,19 +42,19 @@ namespace glm
// -- Conversions -- // -- Conversions --
template <typename U, typename V, typename M, typename N> template<typename U, typename V, typename M, typename N>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
U const & x1, V const & y1, U const & x1, V const & y1,
M const & x2, N const & y2); M const & x2, N const & y2);
template <typename U, typename V> template<typename U, typename V>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
vec<2, U, P> const & v1, vec<2, U, P> const & v1,
vec<2, V, P> const & v2); vec<2, V, P> const & v2);
// -- Matrix conversions -- // -- Matrix conversions --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, U, Q> const & m); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
@@ -78,23 +78,23 @@ namespace glm
GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, T, P> const & v) GLM_DEFAULT; GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, T, P> const & v) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, U, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(U s); GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(mat<2, 2, U, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(mat<2, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(U s); GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(mat<2, 2, U, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(mat<2, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(U s); GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(mat<2, 2, U, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(mat<2, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(U s); GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(mat<2, 2, U, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(mat<2, 2, U, P> const & m);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -107,74 +107,74 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2); GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2); GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator*(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator*(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator*(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m); GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator*(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2); GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<3, 2, T, P> const & m2); GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<4, 2, T, P> const & m2); GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const & m); GLM_FUNC_DECL mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m); GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2); GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2); GLM_FUNC_DECL bool operator==(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2); GLM_FUNC_DECL bool operator!=(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
} //namespace glm } //namespace glm

View File

@@ -8,7 +8,7 @@ namespace glm
// -- Constructors -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat() GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat()
{ {
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@@ -19,7 +19,7 @@ namespace glm
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, P> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, P> const& m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -27,26 +27,26 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, Q> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, Q> const& m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<2, 2, T, P>::mat(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<2, 2, T, P>::mat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(T scalar) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(T scalar)
{ {
this->value[0] = col_type(scalar, 0); this->value[0] = col_type(scalar, 0);
this->value[1] = col_type(0, scalar); this->value[1] = col_type(0, scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat
( (
T const & x0, T const & y0, T const & x0, T const & y0,
@@ -57,7 +57,7 @@ namespace glm
this->value[1] = col_type(x1, y1); this->value[1] = col_type(x1, y1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(col_type const& v0, col_type const& v1) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(col_type const& v0, col_type const& v1)
{ {
this->value[0] = v0; this->value[0] = v0;
@@ -66,8 +66,8 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
template <typename T, precision P> template<typename T, precision P>
template <typename X1, typename Y1, typename X2, typename Y2> template<typename X1, typename Y1, typename X2, typename Y2>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat
( (
X1 const & x1, Y1 const & y1, X1 const & x1, Y1 const & y1,
@@ -78,8 +78,8 @@ namespace glm
this->value[1] = col_type(static_cast<T>(x2), value_type(y2)); this->value[1] = col_type(static_cast<T>(x2), value_type(y2));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename V1, typename V2> template<typename V1, typename V2>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(vec<2, V1, P> const& v1, vec<2, V2, P> const& v2) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(vec<2, V1, P> const& v1, vec<2, V2, P> const& v2)
{ {
this->value[0] = col_type(v1); this->value[0] = col_type(v1);
@@ -88,64 +88,64 @@ namespace glm
// -- mat2x2 matrix conversions -- // -- mat2x2 matrix conversions --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, U, Q> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, U, Q> const& m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 3, T, P> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 3, T, P> const& m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 4, T, P> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 4, T, P> const& m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 3, T, P> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 3, T, P> const& m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 2, T, P> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 2, T, P> const& m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
this->value[1] = m[1]; this->value[1] = m[1];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 4, T, P> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 4, T, P> const& m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 2, T, P> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 2, T, P> const& m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
this->value[1] = m[1]; this->value[1] = m[1];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 4, T, P> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 4, T, P> const& m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 3, T, P> const& m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 3, T, P> const& m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -154,14 +154,14 @@ namespace glm
// -- Accesses -- // -- Accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type& mat<2, 2, T, P>::operator[](typename mat<2, 2, T, P>::length_type i) GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type& mat<2, 2, T, P>::operator[](typename mat<2, 2, T, P>::length_type i)
{ {
assert(i < this->length()); assert(i < this->length());
return this->value[i]; return this->value[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type const& mat<2, 2, T, P>::operator[](typename mat<2, 2, T, P>::length_type i) const GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type const& mat<2, 2, T, P>::operator[](typename mat<2, 2, T, P>::length_type i) const
{ {
assert(i < this->length()); assert(i < this->length());
@@ -171,7 +171,7 @@ namespace glm
// -- Unary updatable operators -- // -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -180,8 +180,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, U, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -189,8 +189,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(U scalar) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(U scalar)
{ {
this->value[0] += scalar; this->value[0] += scalar;
@@ -198,8 +198,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(mat<2, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(mat<2, 2, U, P> const & m)
{ {
this->value[0] += m[0]; this->value[0] += m[0];
@@ -207,8 +207,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(U scalar) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(U scalar)
{ {
this->value[0] -= scalar; this->value[0] -= scalar;
@@ -216,8 +216,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(mat<2, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(mat<2, 2, U, P> const & m)
{ {
this->value[0] -= m[0]; this->value[0] -= m[0];
@@ -225,8 +225,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(U scalar) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(U scalar)
{ {
this->value[0] *= scalar; this->value[0] *= scalar;
@@ -234,15 +234,15 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(mat<2, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(mat<2, 2, U, P> const & m)
{ {
return (*this = *this * m); return (*this = *this * m);
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(U scalar) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(U scalar)
{ {
this->value[0] /= scalar; this->value[0] /= scalar;
@@ -250,8 +250,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(mat<2, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(mat<2, 2, U, P> const & m)
{ {
return *this *= inverse(m); return *this *= inverse(m);
@@ -259,7 +259,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator++() GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator++()
{ {
++this->value[0]; ++this->value[0];
@@ -267,7 +267,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator--() GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator--()
{ {
--this->value[0]; --this->value[0];
@@ -275,7 +275,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator++(int) GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator++(int)
{ {
mat<2, 2, T, P> Result(*this); mat<2, 2, T, P> Result(*this);
@@ -283,7 +283,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator--(int) GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator--(int)
{ {
mat<2, 2, T, P> Result(*this); mat<2, 2, T, P> Result(*this);
@@ -293,13 +293,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m)
{ {
return m; return m;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -309,7 +309,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m, T scalar)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -317,7 +317,7 @@ namespace glm
m[1] + scalar); m[1] + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const & m)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -325,7 +325,7 @@ namespace glm
m[1] + scalar); m[1] + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -333,7 +333,7 @@ namespace glm
m1[1] + m2[1]); m1[1] + m2[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m, T scalar)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -341,7 +341,7 @@ namespace glm
m[1] - scalar); m[1] - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const & m)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -349,7 +349,7 @@ namespace glm
scalar - m[1]); scalar - m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -357,7 +357,7 @@ namespace glm
m1[1] - m2[1]); m1[1] - m2[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m, T scalar)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -365,7 +365,7 @@ namespace glm
m[1] * scalar); m[1] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const & m)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -373,7 +373,7 @@ namespace glm
m[1] * scalar); m[1] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator* GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator*
( (
mat<2, 2, T, P> const& m, mat<2, 2, T, P> const& m,
@@ -385,7 +385,7 @@ namespace glm
m[0][1] * v.x + m[1][1] * v.y); m[0][1] * v.x + m[1][1] * v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator* GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator*
( (
typename mat<2, 2, T, P>::col_type const & v, typename mat<2, 2, T, P>::col_type const & v,
@@ -397,7 +397,7 @@ namespace glm
v.x * m[1][0] + v.y * m[1][1]); v.x * m[1][0] + v.y * m[1][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -407,7 +407,7 @@ namespace glm
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]); m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<3, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -419,7 +419,7 @@ namespace glm
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]); m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<4, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -433,7 +433,7 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]); m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m, T scalar)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -441,7 +441,7 @@ namespace glm
m[1] / scalar); m[1] / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const & m)
{ {
return mat<2, 2, T, P>( return mat<2, 2, T, P>(
@@ -449,19 +449,19 @@ namespace glm
scalar / m[1]); scalar / m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v) GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v)
{ {
return inverse(m) * v; return inverse(m) * v;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m)
{ {
return v * inverse(m); return v * inverse(m);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{ {
mat<2, 2, T, P> m1_copy(m1); mat<2, 2, T, P> m1_copy(m1);
@@ -470,13 +470,13 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{ {
return (m1[0] == m2[0]) && (m1[1] == m2[1]); return (m1[0] == m2[0]) && (m1[1] == m2[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{ {
return (m1[0] != m2[0]) || (m1[1] != m2[1]); return (m1[0] != m2[0]) || (m1[1] != m2[1]);

View File

@@ -12,7 +12,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct mat<2, 3, T, P> struct mat<2, 3, T, P>
{ {
typedef vec<3, T, P> col_type; typedef vec<3, T, P> col_type;
@@ -29,7 +29,7 @@ namespace glm
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<2, 3, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat(mat<2, 3, T, P> const & m) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL mat(mat<2, 3, T, Q> const & m); GLM_FUNC_DECL mat(mat<2, 3, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor); GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
@@ -43,19 +43,19 @@ namespace glm
// -- Conversions -- // -- Conversions --
template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2> template<typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
X1 x1, Y1 y1, Z1 z1, X1 x1, Y1 y1, Z1 z1,
X2 x2, Y2 y2, Z2 z2); X2 x2, Y2 y2, Z2 z2);
template <typename U, typename V> template<typename U, typename V>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
vec<3, U, P> const & v1, vec<3, U, P> const & v1,
vec<3, V, P> const & v2); vec<3, V, P> const & v2);
// -- Matrix conversions -- // -- Matrix conversions --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, U, Q> const & m); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
@@ -79,19 +79,19 @@ namespace glm
GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, T, P> const & m) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, U, P> const & m); GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(U s); GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(mat<2, 3, U, P> const & m); GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(mat<2, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(U s); GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(mat<2, 3, U, P> const & m); GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(mat<2, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator*=(U s); GLM_FUNC_DECL mat<2, 3, T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator/=(U s); GLM_FUNC_DECL mat<2, 3, T, P> & operator/=(U s);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -104,59 +104,59 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m); GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m); GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2); GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2); GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const & m); GLM_FUNC_DECL mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 3, T, P>::col_type operator*(mat<2, 3, T, P> const & m, typename mat<2, 3, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<2, 3, T, P>::col_type operator*(mat<2, 3, T, P> const & m, typename mat<2, 3, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 3, T, P>::row_type operator*(typename mat<2, 3, T, P>::col_type const & v, mat<2, 3, T, P> const & m); GLM_FUNC_DECL typename mat<2, 3, T, P>::row_type operator*(typename mat<2, 3, T, P>::col_type const & v, mat<2, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<2, 2, T, P> const & m2); GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<3, 2, T, P> const & m2); GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<4, 2, T, P> const & m2); GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator/(mat<2, 3, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 3, T, P> operator/(mat<2, 3, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const & m); GLM_FUNC_DECL mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const & m);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2); GLM_FUNC_DECL bool operator==(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2); GLM_FUNC_DECL bool operator!=(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
}//namespace glm }//namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
// -- Constructors -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat() GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat()
{ {
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@@ -17,7 +17,7 @@ namespace glm
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -25,26 +25,26 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, Q> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, Q> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<2, 3, T, P>::mat(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<2, 3, T, P>::mat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(T scalar) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(T scalar)
{ {
this->value[0] = col_type(scalar, 0, 0); this->value[0] = col_type(scalar, 0, 0);
this->value[1] = col_type(0, scalar, 0); this->value[1] = col_type(0, scalar, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat
( (
T x0, T y0, T z0, T x0, T y0, T z0,
@@ -55,7 +55,7 @@ namespace glm
this->value[1] = col_type(x1, y1, z1); this->value[1] = col_type(x1, y1, z1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(col_type const & v0, col_type const & v1) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(col_type const & v0, col_type const & v1)
{ {
this->value[0] = v0; this->value[0] = v0;
@@ -64,8 +64,8 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
template <typename T, precision P> template<typename T, precision P>
template < template<
typename X1, typename Y1, typename Z1, typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2> typename X2, typename Y2, typename Z2>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat
@@ -78,8 +78,8 @@ namespace glm
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2)); this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename V1, typename V2> template<typename V1, typename V2>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(vec<3, V1, P> const & v1, vec<3, V2, P> const & v2) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(vec<3, V1, P> const & v1, vec<3, V2, P> const & v2)
{ {
this->value[0] = col_type(v1); this->value[0] = col_type(v1);
@@ -88,64 +88,64 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, U, Q> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, U, Q> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0); this->value[1] = col_type(m[1], 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0); this->value[1] = col_type(m[1], 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0); this->value[1] = col_type(m[1], 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 3, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -154,14 +154,14 @@ namespace glm
// -- Accesses -- // -- Accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type & mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i) GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type & mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i)
{ {
assert(i < this->length()); assert(i < this->length());
return this->value[i]; return this->value[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type const & mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i) const GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type const & mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i) const
{ {
assert(i < this->length()); assert(i < this->length());
@@ -171,7 +171,7 @@ namespace glm
// -- Unary updatable operators -- // -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -180,8 +180,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, U, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -189,8 +189,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator+=(U s) GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator+=(U s)
{ {
this->value[0] += s; this->value[0] += s;
@@ -198,8 +198,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator+=(mat<2, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator+=(mat<2, 3, U, P> const & m)
{ {
this->value[0] += m[0]; this->value[0] += m[0];
@@ -207,8 +207,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(U s) GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(U s)
{ {
this->value[0] -= s; this->value[0] -= s;
@@ -216,8 +216,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(mat<2, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(mat<2, 3, U, P> const & m)
{ {
this->value[0] -= m[0]; this->value[0] -= m[0];
@@ -225,8 +225,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator*=(U s) GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator*=(U s)
{ {
this->value[0] *= s; this->value[0] *= s;
@@ -234,8 +234,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator/=(U s) GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator/=(U s)
{ {
this->value[0] /= s; this->value[0] /= s;
@@ -245,7 +245,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator++() GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator++()
{ {
++this->value[0]; ++this->value[0];
@@ -253,7 +253,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator--() GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator--()
{ {
--this->value[0]; --this->value[0];
@@ -261,7 +261,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator++(int) GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator++(int)
{ {
mat<2, 3, T, P> Result(*this); mat<2, 3, T, P> Result(*this);
@@ -269,7 +269,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator--(int) GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator--(int)
{ {
mat<2, 3, T, P> Result(*this); mat<2, 3, T, P> Result(*this);
@@ -279,13 +279,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m)
{ {
return m; return m;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -295,7 +295,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m, T scalar)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -303,7 +303,7 @@ namespace glm
m[1] + scalar); m[1] + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -311,7 +311,7 @@ namespace glm
m1[1] + m2[1]); m1[1] + m2[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m, T scalar)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -319,7 +319,7 @@ namespace glm
m[1] - scalar); m[1] - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -327,7 +327,7 @@ namespace glm
m1[1] - m2[1]); m1[1] - m2[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m, T scalar)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -335,7 +335,7 @@ namespace glm
m[1] * scalar); m[1] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const & m)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -343,7 +343,7 @@ namespace glm
m[1] * scalar); m[1] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type operator* GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type operator*
( (
mat<2, 3, T, P> const& m, mat<2, 3, T, P> const& m,
@@ -355,7 +355,7 @@ namespace glm
m[0][2] * v.x + m[1][2] * v.y); m[0][2] * v.x + m[1][2] * v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::row_type operator* GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::row_type operator*
( (
typename mat<2, 3, T, P>::col_type const & v, typename mat<2, 3, T, P>::col_type const & v,
@@ -366,7 +366,7 @@ namespace glm
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]); v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<2, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<2, 2, T, P> const & m2)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -378,7 +378,7 @@ namespace glm
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]); m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<3, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<3, 2, T, P> const & m2)
{ {
T SrcA00 = m1[0][0]; T SrcA00 = m1[0][0];
@@ -408,7 +408,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<4, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<4, 2, T, P> const & m2)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -426,7 +426,7 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]); m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(mat<2, 3, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(mat<2, 3, T, P> const & m, T scalar)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -434,7 +434,7 @@ namespace glm
m[1] / scalar); m[1] / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const & m)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -444,13 +444,13 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{ {
return (m1[0] == m2[0]) && (m1[1] == m2[1]); return (m1[0] == m2[0]) && (m1[1] == m2[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{ {
return (m1[0] != m2[0]) || (m1[1] != m2[1]); return (m1[0] != m2[0]) || (m1[1] != m2[1]);

View File

@@ -12,7 +12,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct mat<2, 4, T, P> struct mat<2, 4, T, P>
{ {
typedef vec<4, T, P> col_type; typedef vec<4, T, P> col_type;
@@ -29,7 +29,7 @@ namespace glm
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<2, 4, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat(mat<2, 4, T, P> const & m) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL mat(mat<2, 4, T, Q> const & m); GLM_FUNC_DECL mat(mat<2, 4, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor); GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
@@ -43,21 +43,21 @@ namespace glm
// -- Conversions -- // -- Conversions --
template < template<
typename X1, typename Y1, typename Z1, typename W1, typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2> typename X2, typename Y2, typename Z2, typename W2>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
X1 x1, Y1 y1, Z1 z1, W1 w1, X1 x1, Y1 y1, Z1 z1, W1 w1,
X2 x2, Y2 y2, Z2 z2, W2 w2); X2 x2, Y2 y2, Z2 z2, W2 w2);
template <typename U, typename V> template<typename U, typename V>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
vec<4, U, P> const & v1, vec<4, U, P> const & v1,
vec<4, V, P> const & v2); vec<4, V, P> const & v2);
// -- Matrix conversions -- // -- Matrix conversions --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, U, Q> const & m); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
@@ -81,19 +81,19 @@ namespace glm
GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, T, P> const & m) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, U, P> const & m); GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(U s); GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(mat<2, 4, U, P> const & m); GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(mat<2, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(U s); GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(mat<2, 4, U, P> const & m); GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(mat<2, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator*=(U s); GLM_FUNC_DECL mat<2, 4, T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator/=(U s); GLM_FUNC_DECL mat<2, 4, T, P> & operator/=(U s);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -106,59 +106,59 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m); GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m); GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2); GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2); GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const & m); GLM_FUNC_DECL mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const & m, typename mat<2, 4, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const & m, typename mat<2, 4, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const & v, mat<2, 4, T, P> const & m); GLM_FUNC_DECL typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const & v, mat<2, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<4, 2, T, P> const & m2); GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<2, 2, T, P> const & m2); GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<3, 2, T, P> const & m2); GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator/(mat<2, 4, T, P> const & m, T scalar); GLM_FUNC_DECL mat<2, 4, T, P> operator/(mat<2, 4, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const & m); GLM_FUNC_DECL mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const & m);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2); GLM_FUNC_DECL bool operator==(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2); GLM_FUNC_DECL bool operator!=(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
}//namespace glm }//namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
// -- Constructors -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat() GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat()
{ {
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@@ -17,7 +17,7 @@ namespace glm
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -25,19 +25,19 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, Q> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, Q> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
this->value[1] = m.value[1]; this->value[1] = m.value[1];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<2, 4, T, P>::mat(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<2, 4, T, P>::mat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(T scalar) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(T scalar)
{ {
value_type const Zero(0); value_type const Zero(0);
@@ -45,7 +45,7 @@ namespace glm
this->value[1] = col_type(Zero, scalar, Zero, Zero); this->value[1] = col_type(Zero, scalar, Zero, Zero);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat
( (
T x0, T y0, T z0, T w0, T x0, T y0, T z0, T w0,
@@ -56,7 +56,7 @@ namespace glm
this->value[1] = col_type(x1, y1, z1, w1); this->value[1] = col_type(x1, y1, z1, w1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(col_type const & v0, col_type const & v1) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(col_type const & v0, col_type const & v1)
{ {
this->value[0] = v0; this->value[0] = v0;
@@ -65,8 +65,8 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
template <typename T, precision P> template<typename T, precision P>
template < template<
typename X1, typename Y1, typename Z1, typename W1, typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2> typename X2, typename Y2, typename Z2, typename W2>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat
@@ -79,8 +79,8 @@ namespace glm
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2)); this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename V1, typename V2> template<typename V1, typename V2>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(vec<4, V1, P> const & v1, vec<4, V2, P> const & v2) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(vec<4, V1, P> const & v1, vec<4, V2, P> const & v2)
{ {
this->value[0] = col_type(v1); this->value[0] = col_type(v1);
@@ -89,64 +89,64 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, U, Q> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, U, Q> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0, 0); this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0); this->value[1] = col_type(m[1], 0, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0); this->value[1] = col_type(m[1], 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]); this->value[1] = col_type(m[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0); this->value[1] = col_type(m[1], 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0, 0); this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0); this->value[1] = col_type(m[1], 0, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 4, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
this->value[1] = m[1]; this->value[1] = m[1];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0, 0); this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0); this->value[1] = col_type(m[1], 0, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -155,14 +155,14 @@ namespace glm
// -- Accesses -- // -- Accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type & mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i) GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type & mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i)
{ {
assert(i < this->length()); assert(i < this->length());
return this->value[i]; return this->value[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type const & mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i) const GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type const & mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i) const
{ {
assert(i < this->length()); assert(i < this->length());
@@ -172,7 +172,7 @@ namespace glm
// -- Unary updatable operators -- // -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -181,8 +181,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, U, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -190,8 +190,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(U s) GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(U s)
{ {
this->value[0] += s; this->value[0] += s;
@@ -199,8 +199,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(mat<2, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(mat<2, 4, U, P> const & m)
{ {
this->value[0] += m[0]; this->value[0] += m[0];
@@ -208,8 +208,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(U s) GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(U s)
{ {
this->value[0] -= s; this->value[0] -= s;
@@ -217,8 +217,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(mat<2, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(mat<2, 4, U, P> const & m)
{ {
this->value[0] -= m[0]; this->value[0] -= m[0];
@@ -226,8 +226,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator*=(U s) GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator*=(U s)
{ {
this->value[0] *= s; this->value[0] *= s;
@@ -235,8 +235,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> & mat<2, 4, T, P>::operator/=(U s) GLM_FUNC_QUALIFIER mat<2, 4, T, P> & mat<2, 4, T, P>::operator/=(U s)
{ {
this->value[0] /= s; this->value[0] /= s;
@@ -246,7 +246,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator++() GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator++()
{ {
++this->value[0]; ++this->value[0];
@@ -254,7 +254,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator--() GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator--()
{ {
--this->value[0]; --this->value[0];
@@ -262,7 +262,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator++(int) GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator++(int)
{ {
mat<2, 4, T, P> Result(*this); mat<2, 4, T, P> Result(*this);
@@ -270,7 +270,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator--(int) GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator--(int)
{ {
mat<2, 4, T, P> Result(*this); mat<2, 4, T, P> Result(*this);
@@ -280,13 +280,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m)
{ {
return m; return m;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -296,7 +296,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m, T scalar)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -304,7 +304,7 @@ namespace glm
m[1] + scalar); m[1] + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -312,7 +312,7 @@ namespace glm
m1[1] + m2[1]); m1[1] + m2[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m, T scalar)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -320,7 +320,7 @@ namespace glm
m[1] - scalar); m[1] - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -328,7 +328,7 @@ namespace glm
m1[1] - m2[1]); m1[1] - m2[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m, T scalar)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -336,7 +336,7 @@ namespace glm
m[1] * scalar); m[1] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const & m)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -344,7 +344,7 @@ namespace glm
m[1] * scalar); m[1] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const & m, typename mat<2, 4, T, P>::row_type const & v) GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const & m, typename mat<2, 4, T, P>::row_type const & v)
{ {
return typename mat<2, 4, T, P>::col_type( return typename mat<2, 4, T, P>::col_type(
@@ -354,7 +354,7 @@ namespace glm
m[0][3] * v.x + m[1][3] * v.y); m[0][3] * v.x + m[1][3] * v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const & v, mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const & v, mat<2, 4, T, P> const & m)
{ {
return typename mat<2, 4, T, P>::row_type( return typename mat<2, 4, T, P>::row_type(
@@ -362,7 +362,7 @@ namespace glm
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]); v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<4, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<4, 2, T, P> const & m2)
{ {
T SrcA00 = m1[0][0]; T SrcA00 = m1[0][0];
@@ -403,7 +403,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<2, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<2, 2, T, P> const & m2)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -417,7 +417,7 @@ namespace glm
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]); m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<3, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<3, 2, T, P> const & m2)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -435,7 +435,7 @@ namespace glm
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]); m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(mat<2, 4, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(mat<2, 4, T, P> const & m, T scalar)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -443,7 +443,7 @@ namespace glm
m[1] / scalar); m[1] / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const & m)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -453,13 +453,13 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{ {
return (m1[0] == m2[0]) && (m1[1] == m2[1]); return (m1[0] == m2[0]) && (m1[1] == m2[1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{ {
return (m1[0] != m2[0]) || (m1[1] != m2[1]); return (m1[0] != m2[0]) || (m1[1] != m2[1]);

View File

@@ -12,7 +12,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct mat<3, 2, T, P> struct mat<3, 2, T, P>
{ {
typedef vec<2, T, P> col_type; typedef vec<2, T, P> col_type;
@@ -29,7 +29,7 @@ namespace glm
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<3, 2, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat(mat<3, 2, T, P> const & m) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL mat(mat<3, 2, T, Q> const & m); GLM_FUNC_DECL mat(mat<3, 2, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor); GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
@@ -54,7 +54,7 @@ namespace glm
X2 x2, Y2 y2, X2 x2, Y2 y2,
X3 x3, Y3 y3); X3 x3, Y3 y3);
template <typename V1, typename V2, typename V3> template<typename V1, typename V2, typename V3>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
vec<2, V1, P> const & v1, vec<2, V1, P> const & v1,
vec<2, V2, P> const & v2, vec<2, V2, P> const & v2,
@@ -62,7 +62,7 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, U, Q> const & m); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
@@ -86,19 +86,19 @@ namespace glm
GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, T, P> const & m) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, U, P> const & m); GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(U s); GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(mat<3, 2, U, P> const & m); GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(mat<3, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(U s); GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(mat<3, 2, U, P> const & m); GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(mat<3, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator*=(U s); GLM_FUNC_DECL mat<3, 2, T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator/=(U s); GLM_FUNC_DECL mat<3, 2, T, P> & operator/=(U s);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -111,59 +111,59 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m); GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m); GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2); GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2); GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const & m); GLM_FUNC_DECL mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const & m, typename mat<3, 2, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const & m, typename mat<3, 2, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const & v, mat<3, 2, T, P> const & m); GLM_FUNC_DECL typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const & v, mat<3, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<2, 3, T, P> const & m2); GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<3, 3, T, P> const & m2); GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<4, 3, T, P> const & m2); GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator/(mat<3, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 2, T, P> operator/(mat<3, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const & m); GLM_FUNC_DECL mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const & m);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2); GLM_FUNC_DECL bool operator==(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2); GLM_FUNC_DECL bool operator!=(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
}//namespace glm }//namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
// -- Constructors -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat() GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat()
{ {
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@@ -18,7 +18,7 @@ namespace glm
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -27,8 +27,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, Q> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, Q> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -36,11 +36,11 @@ namespace glm
this->value[2] = m.value[2]; this->value[2] = m.value[2];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<3, 2, T, P>::mat(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<3, 2, T, P>::mat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(T scalar) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(T scalar)
{ {
this->value[0] = col_type(scalar, 0); this->value[0] = col_type(scalar, 0);
@@ -48,7 +48,7 @@ namespace glm
this->value[2] = col_type(0, 0); this->value[2] = col_type(0, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
( (
T x0, T y0, T x0, T y0,
@@ -61,7 +61,7 @@ namespace glm
this->value[2] = col_type(x2, y2); this->value[2] = col_type(x2, y2);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
( (
col_type const & v0, col_type const & v0,
@@ -76,8 +76,8 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
template <typename T, precision P> template<typename T, precision P>
template < template<
typename X1, typename Y1, typename X1, typename Y1,
typename X2, typename Y2, typename X2, typename Y2,
typename X3, typename Y3> typename X3, typename Y3>
@@ -93,8 +93,8 @@ namespace glm
this->value[2] = col_type(static_cast<T>(x3), value_type(y3)); this->value[2] = col_type(static_cast<T>(x3), value_type(y3));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename V1, typename V2, typename V3> template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
( (
vec<2, V1, P> const & v1, vec<2, V1, P> const & v1,
@@ -109,8 +109,8 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, U, Q> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, U, Q> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -118,7 +118,7 @@ namespace glm
this->value[2] = col_type(m[2]); this->value[2] = col_type(m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 2, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -126,7 +126,7 @@ namespace glm
this->value[2] = col_type(0); this->value[2] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -134,7 +134,7 @@ namespace glm
this->value[2] = col_type(m[2]); this->value[2] = col_type(m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -142,7 +142,7 @@ namespace glm
this->value[2] = col_type(m[2]); this->value[2] = col_type(m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -150,7 +150,7 @@ namespace glm
this->value[2] = col_type(T(0)); this->value[2] = col_type(T(0));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -158,7 +158,7 @@ namespace glm
this->value[2] = col_type(T(0)); this->value[2] = col_type(T(0));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -166,7 +166,7 @@ namespace glm
this->value[2] = col_type(m[2]); this->value[2] = col_type(m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 2, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -174,7 +174,7 @@ namespace glm
this->value[2] = m[2]; this->value[2] = m[2];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -184,14 +184,14 @@ namespace glm
// -- Accesses -- // -- Accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type & mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i) GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type & mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i)
{ {
assert(i < this->length()); assert(i < this->length());
return this->value[i]; return this->value[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type const & mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i) const GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type const & mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i) const
{ {
assert(i < this->length()); assert(i < this->length());
@@ -201,7 +201,7 @@ namespace glm
// -- Unary updatable operators -- // -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -211,8 +211,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, U, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -221,8 +221,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(U s) GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(U s)
{ {
this->value[0] += s; this->value[0] += s;
@@ -231,8 +231,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(mat<3, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(mat<3, 2, U, P> const & m)
{ {
this->value[0] += m[0]; this->value[0] += m[0];
@@ -241,8 +241,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(U s) GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(U s)
{ {
this->value[0] -= s; this->value[0] -= s;
@@ -251,8 +251,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(mat<3, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(mat<3, 2, U, P> const & m)
{ {
this->value[0] -= m[0]; this->value[0] -= m[0];
@@ -261,8 +261,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator*=(U s) GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator*=(U s)
{ {
this->value[0] *= s; this->value[0] *= s;
@@ -271,8 +271,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> & mat<3, 2, T, P>::operator/=(U s) GLM_FUNC_QUALIFIER mat<3, 2, T, P> & mat<3, 2, T, P>::operator/=(U s)
{ {
this->value[0] /= s; this->value[0] /= s;
@@ -283,7 +283,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator++() GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator++()
{ {
++this->value[0]; ++this->value[0];
@@ -292,7 +292,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator--() GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator--()
{ {
--this->value[0]; --this->value[0];
@@ -301,7 +301,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator++(int) GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator++(int)
{ {
mat<3, 2, T, P> Result(*this); mat<3, 2, T, P> Result(*this);
@@ -309,7 +309,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator--(int) GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator--(int)
{ {
mat<3, 2, T, P> Result(*this); mat<3, 2, T, P> Result(*this);
@@ -319,13 +319,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m)
{ {
return m; return m;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -336,7 +336,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m, T scalar)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -345,7 +345,7 @@ namespace glm
m[2] + scalar); m[2] + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -354,7 +354,7 @@ namespace glm
m1[2] + m2[2]); m1[2] + m2[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m, T scalar)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -363,7 +363,7 @@ namespace glm
m[2] - scalar); m[2] - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -372,7 +372,7 @@ namespace glm
m1[2] - m2[2]); m1[2] - m2[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m, T scalar)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -381,7 +381,7 @@ namespace glm
m[2] * scalar); m[2] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const & m)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -390,7 +390,7 @@ namespace glm
m[2] * scalar); m[2] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const & m, typename mat<3, 2, T, P>::row_type const & v) GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const & m, typename mat<3, 2, T, P>::row_type const & v)
{ {
return typename mat<3, 2, T, P>::col_type( return typename mat<3, 2, T, P>::col_type(
@@ -398,7 +398,7 @@ namespace glm
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z); m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const & v, mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const & v, mat<3, 2, T, P> const & m)
{ {
return typename mat<3, 2, T, P>::row_type( return typename mat<3, 2, T, P>::row_type(
@@ -407,7 +407,7 @@ namespace glm
v.x * m[2][0] + v.y * m[2][1]); v.x * m[2][0] + v.y * m[2][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<2, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<2, 3, T, P> const & m2)
{ {
const T SrcA00 = m1[0][0]; const T SrcA00 = m1[0][0];
@@ -432,7 +432,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<3, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<3, 3, T, P> const & m2)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -444,7 +444,7 @@ namespace glm
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]); m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<4, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<4, 3, T, P> const & m2)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -458,7 +458,7 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]); m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(mat<3, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(mat<3, 2, T, P> const & m, T scalar)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -467,7 +467,7 @@ namespace glm
m[2] / scalar); m[2] / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const & m)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -478,13 +478,13 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{ {
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{ {
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);

View File

@@ -11,7 +11,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct mat<3, 3, T, P> struct mat<3, 3, T, P>
{ {
typedef vec<3, T, P> col_type; typedef vec<3, T, P> col_type;
@@ -28,7 +28,7 @@ namespace glm
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<3, 3, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat(mat<3, 3, T, P> const & m) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL mat(mat<3, 3, T, Q> const & m); GLM_FUNC_DECL mat(mat<3, 3, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor); GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
@@ -53,7 +53,7 @@ namespace glm
X2 x2, Y2 y2, Z2 z2, X2 x2, Y2 y2, Z2 z2,
X3 x3, Y3 y3, Z3 z3); X3 x3, Y3 y3, Z3 z3);
template <typename V1, typename V2, typename V3> template<typename V1, typename V2, typename V3>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
vec<3, V1, P> const & v1, vec<3, V1, P> const & v1,
vec<3, V2, P> const & v2, vec<3, V2, P> const & v2,
@@ -61,7 +61,7 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, U, Q> const & m); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
@@ -85,23 +85,23 @@ namespace glm
GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, T, P> const & m) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, U, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(U s); GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(mat<3, 3, U, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(mat<3, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(U s); GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(mat<3, 3, U, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(mat<3, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(U s); GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(mat<3, 3, U, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(mat<3, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(U s); GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(mat<3, 3, U, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(mat<3, 3, U, P> const & m);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -114,74 +114,74 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2); GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2); GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m); GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2); GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<2, 3, T, P> const & m2); GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<4, 3, T, P> const & m2); GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const & m); GLM_FUNC_DECL mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m); GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2); GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2); GLM_FUNC_DECL bool operator==(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2); GLM_FUNC_DECL bool operator!=(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
}//namespace glm }//namespace glm

View File

@@ -8,7 +8,7 @@ namespace glm
// -- Constructors -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat() GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat()
{ {
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@@ -20,7 +20,7 @@ namespace glm
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -29,8 +29,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, Q> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, Q> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -38,11 +38,11 @@ namespace glm
this->value[2] = m.value[2]; this->value[2] = m.value[2];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<3, 3, T, P>::mat(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<3, 3, T, P>::mat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(T scalar) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(T scalar)
{ {
this->value[0] = col_type(scalar, 0, 0); this->value[0] = col_type(scalar, 0, 0);
@@ -50,7 +50,7 @@ namespace glm
this->value[2] = col_type(0, 0, scalar); this->value[2] = col_type(0, 0, scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
( (
T x0, T y0, T z0, T x0, T y0, T z0,
@@ -63,7 +63,7 @@ namespace glm
this->value[2] = col_type(x2, y2, z2); this->value[2] = col_type(x2, y2, z2);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
( (
col_type const & v0, col_type const & v0,
@@ -78,8 +78,8 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
template <typename T, precision P> template<typename T, precision P>
template < template<
typename X1, typename Y1, typename Z1, typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2, typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3> typename X3, typename Y3, typename Z3>
@@ -95,8 +95,8 @@ namespace glm
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3)); this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename V1, typename V2, typename V3> template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
( (
vec<3, V1, P> const& v1, vec<3, V1, P> const& v1,
@@ -111,8 +111,8 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, U, Q> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, U, Q> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -120,7 +120,7 @@ namespace glm
this->value[2] = col_type(m[2]); this->value[2] = col_type(m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -128,7 +128,7 @@ namespace glm
this->value[2] = col_type(0, 0, 1); this->value[2] = col_type(0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -136,7 +136,7 @@ namespace glm
this->value[2] = col_type(m[2]); this->value[2] = col_type(m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 3, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -144,7 +144,7 @@ namespace glm
this->value[2] = col_type(0, 0, 1); this->value[2] = col_type(0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -152,7 +152,7 @@ namespace glm
this->value[2] = col_type(m[2], 1); this->value[2] = col_type(m[2], 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -160,7 +160,7 @@ namespace glm
this->value[2] = col_type(0, 0, 1); this->value[2] = col_type(0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -168,7 +168,7 @@ namespace glm
this->value[2] = col_type(m[2], 1); this->value[2] = col_type(m[2], 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -176,7 +176,7 @@ namespace glm
this->value[2] = col_type(m[2]); this->value[2] = col_type(m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 3, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -186,14 +186,14 @@ namespace glm
// -- Accesses -- // -- Accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type & mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i) GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type & mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i)
{ {
assert(i < this->length()); assert(i < this->length());
return this->value[i]; return this->value[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type const & mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i) const GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type const & mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i) const
{ {
assert(i < this->length()); assert(i < this->length());
@@ -203,7 +203,7 @@ namespace glm
// -- Unary updatable operators -- // -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -213,8 +213,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, U, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -223,8 +223,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(U s) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(U s)
{ {
this->value[0] += s; this->value[0] += s;
@@ -233,8 +233,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(mat<3, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(mat<3, 3, U, P> const & m)
{ {
this->value[0] += m[0]; this->value[0] += m[0];
@@ -243,8 +243,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(U s) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(U s)
{ {
this->value[0] -= s; this->value[0] -= s;
@@ -253,8 +253,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(mat<3, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(mat<3, 3, U, P> const & m)
{ {
this->value[0] -= m[0]; this->value[0] -= m[0];
@@ -263,8 +263,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(U s) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(U s)
{ {
this->value[0] *= s; this->value[0] *= s;
@@ -273,15 +273,15 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(mat<3, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(mat<3, 3, U, P> const & m)
{ {
return (*this = *this * m); return (*this = *this * m);
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(U s) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(U s)
{ {
this->value[0] /= s; this->value[0] /= s;
@@ -290,8 +290,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(mat<3, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(mat<3, 3, U, P> const & m)
{ {
return *this *= inverse(m); return *this *= inverse(m);
@@ -299,7 +299,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator++() GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator++()
{ {
++this->value[0]; ++this->value[0];
@@ -308,7 +308,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator--() GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator--()
{ {
--this->value[0]; --this->value[0];
@@ -317,7 +317,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator++(int) GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator++(int)
{ {
mat<3, 3, T, P> Result(*this); mat<3, 3, T, P> Result(*this);
@@ -325,7 +325,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator--(int) GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator--(int)
{ {
mat<3, 3, T, P> Result(*this); mat<3, 3, T, P> Result(*this);
@@ -335,13 +335,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m)
{ {
return m; return m;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -352,7 +352,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m, T scalar)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -361,7 +361,7 @@ namespace glm
m[2] + scalar); m[2] + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const & m)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -370,7 +370,7 @@ namespace glm
m[2] + scalar); m[2] + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -379,7 +379,7 @@ namespace glm
m1[2] + m2[2]); m1[2] + m2[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m, T scalar)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -388,7 +388,7 @@ namespace glm
m[2] - scalar); m[2] - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const & m)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -397,7 +397,7 @@ namespace glm
scalar - m[2]); scalar - m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -406,7 +406,7 @@ namespace glm
m1[2] - m2[2]); m1[2] - m2[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m, T scalar)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -415,7 +415,7 @@ namespace glm
m[2] * scalar); m[2] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const & m)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -424,7 +424,7 @@ namespace glm
m[2] * scalar); m[2] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v) GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v)
{ {
return typename mat<3, 3, T, P>::col_type( return typename mat<3, 3, T, P>::col_type(
@@ -433,7 +433,7 @@ namespace glm
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z); m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m)
{ {
return typename mat<3, 3, T, P>::row_type( return typename mat<3, 3, T, P>::row_type(
@@ -442,7 +442,7 @@ namespace glm
m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z); m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{ {
T const SrcA00 = m1[0][0]; T const SrcA00 = m1[0][0];
@@ -478,7 +478,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<2, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -490,7 +490,7 @@ namespace glm
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]); m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<4, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -508,7 +508,7 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]); m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m, T scalar)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -517,7 +517,7 @@ namespace glm
m[2] / scalar); m[2] / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const & m)
{ {
return mat<3, 3, T, P>( return mat<3, 3, T, P>(
@@ -526,19 +526,19 @@ namespace glm
scalar / m[2]); scalar / m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v) GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v)
{ {
return inverse(m) * v; return inverse(m) * v;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m)
{ {
return v * inverse(m); return v * inverse(m);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{ {
mat<3, 3, T, P> m1_copy(m1); mat<3, 3, T, P> m1_copy(m1);
@@ -547,13 +547,13 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{ {
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{ {
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);

View File

@@ -12,7 +12,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct mat<3, 4, T, P> struct mat<3, 4, T, P>
{ {
typedef vec<4, T, P> col_type; typedef vec<4, T, P> col_type;
@@ -29,7 +29,7 @@ namespace glm
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<3, 4, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat(mat<3, 4, T, P> const & m) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL mat(mat<3, 4, T, Q> const & m); GLM_FUNC_DECL mat(mat<3, 4, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor); GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
@@ -54,7 +54,7 @@ namespace glm
X2 x2, Y2 y2, Z2 z2, W2 w2, X2 x2, Y2 y2, Z2 z2, W2 w2,
X3 x3, Y3 y3, Z3 z3, W3 w3); X3 x3, Y3 y3, Z3 z3, W3 w3);
template <typename V1, typename V2, typename V3> template<typename V1, typename V2, typename V3>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
vec<4, V1, P> const & v1, vec<4, V1, P> const & v1,
vec<4, V2, P> const & v2, vec<4, V2, P> const & v2,
@@ -62,7 +62,7 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, U, Q> const & m); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
@@ -86,19 +86,19 @@ namespace glm
GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, T, P> const & m) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, U, P> const & m); GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(U s); GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(mat<3, 4, U, P> const & m); GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(mat<3, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(U s); GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(mat<3, 4, U, P> const & m); GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(mat<3, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator*=(U s); GLM_FUNC_DECL mat<3, 4, T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator/=(U s); GLM_FUNC_DECL mat<3, 4, T, P> & operator/=(U s);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -111,59 +111,59 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m); GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m); GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2); GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2); GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const & m); GLM_FUNC_DECL mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 4, T, P>::col_type operator*(mat<3, 4, T, P> const & m, typename mat<3, 4, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<3, 4, T, P>::col_type operator*(mat<3, 4, T, P> const & m, typename mat<3, 4, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 4, T, P>::row_type operator*(typename mat<3, 4, T, P>::col_type const & v, mat<3, 4, T, P> const & m); GLM_FUNC_DECL typename mat<3, 4, T, P>::row_type operator*(typename mat<3, 4, T, P>::col_type const & v, mat<3, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<4, 3, T, P> const& m2); GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<4, 3, T, P> const& m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<2, 3, T, P> const & m2); GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<3, 3, T, P> const& m2); GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<3, 3, T, P> const& m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator/(mat<3, 4, T, P> const & m, T scalar); GLM_FUNC_DECL mat<3, 4, T, P> operator/(mat<3, 4, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const & m); GLM_FUNC_DECL mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const & m);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2); GLM_FUNC_DECL bool operator==(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2); GLM_FUNC_DECL bool operator!=(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
}//namespace glm }//namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
// -- Constructors -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat() GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat()
{ {
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@@ -18,7 +18,7 @@ namespace glm
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -27,8 +27,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, Q> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, Q> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -36,11 +36,11 @@ namespace glm
this->value[2] = m.value[2]; this->value[2] = m.value[2];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<3, 4, T, P>::mat(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<3, 4, T, P>::mat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(T scalar) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(T scalar)
{ {
this->value[0] = col_type(scalar, 0, 0, 0); this->value[0] = col_type(scalar, 0, 0, 0);
@@ -48,7 +48,7 @@ namespace glm
this->value[2] = col_type(0, 0, scalar, 0); this->value[2] = col_type(0, 0, scalar, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
( (
T x0, T y0, T z0, T w0, T x0, T y0, T z0, T w0,
@@ -61,7 +61,7 @@ namespace glm
this->value[2] = col_type(x2, y2, z2, w2); this->value[2] = col_type(x2, y2, z2, w2);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
( (
col_type const & v0, col_type const & v0,
@@ -76,8 +76,8 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
template <typename T, precision P> template<typename T, precision P>
template < template<
typename X1, typename Y1, typename Z1, typename W1, typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2, typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3> typename X3, typename Y3, typename Z3, typename W3>
@@ -93,8 +93,8 @@ namespace glm
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3), value_type(w3)); this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3), value_type(w3));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename V1, typename V2, typename V3> template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
( (
vec<4, V1, P> const & v1, vec<4, V1, P> const & v1,
@@ -109,8 +109,8 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, U, Q> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, U, Q> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -118,7 +118,7 @@ namespace glm
this->value[2] = col_type(m[2]); this->value[2] = col_type(m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0, 0); this->value[0] = col_type(m[0], 0, 0);
@@ -126,7 +126,7 @@ namespace glm
this->value[2] = col_type(0, 0, 1, 0); this->value[2] = col_type(0, 0, 1, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -134,7 +134,7 @@ namespace glm
this->value[2] = col_type(m[2], 0); this->value[2] = col_type(m[2], 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -142,7 +142,7 @@ namespace glm
this->value[2] = col_type(m[2]); this->value[2] = col_type(m[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -150,7 +150,7 @@ namespace glm
this->value[2] = col_type(0, 0, 1, 0); this->value[2] = col_type(0, 0, 1, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0, 0); this->value[0] = col_type(m[0], 0, 0);
@@ -158,7 +158,7 @@ namespace glm
this->value[2] = col_type(m[2], 1, 0); this->value[2] = col_type(m[2], 1, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -166,7 +166,7 @@ namespace glm
this->value[2] = col_type(0, 0, 1, 0); this->value[2] = col_type(0, 0, 1, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0, 0); this->value[0] = col_type(m[0], 0, 0);
@@ -174,7 +174,7 @@ namespace glm
this->value[2] = col_type(m[2], 1, 0); this->value[2] = col_type(m[2], 1, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -184,14 +184,14 @@ namespace glm
// -- Accesses -- // -- Accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type & mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i) GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type & mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i)
{ {
assert(i < this->length()); assert(i < this->length());
return this->value[i]; return this->value[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type const & mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i) const GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type const & mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i) const
{ {
assert(i < this->length()); assert(i < this->length());
@@ -201,7 +201,7 @@ namespace glm
// -- Unary updatable operators -- // -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -211,8 +211,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, U, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -221,8 +221,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(U s) GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(U s)
{ {
this->value[0] += s; this->value[0] += s;
@@ -231,8 +231,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(mat<3, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(mat<3, 4, U, P> const & m)
{ {
this->value[0] += m[0]; this->value[0] += m[0];
@@ -241,8 +241,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(U s) GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(U s)
{ {
this->value[0] -= s; this->value[0] -= s;
@@ -251,8 +251,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(mat<3, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(mat<3, 4, U, P> const & m)
{ {
this->value[0] -= m[0]; this->value[0] -= m[0];
@@ -261,8 +261,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator*=(U s) GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator*=(U s)
{ {
this->value[0] *= s; this->value[0] *= s;
@@ -271,8 +271,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> & mat<3, 4, T, P>::operator/=(U s) GLM_FUNC_QUALIFIER mat<3, 4, T, P> & mat<3, 4, T, P>::operator/=(U s)
{ {
this->value[0] /= s; this->value[0] /= s;
@@ -283,7 +283,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator++() GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator++()
{ {
++this->value[0]; ++this->value[0];
@@ -292,7 +292,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator--() GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator--()
{ {
--this->value[0]; --this->value[0];
@@ -301,7 +301,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator++(int) GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator++(int)
{ {
mat<3, 4, T, P> Result(*this); mat<3, 4, T, P> Result(*this);
@@ -309,7 +309,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator--(int) GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator--(int)
{ {
mat<3, 4, T, P> Result(*this); mat<3, 4, T, P> Result(*this);
@@ -319,13 +319,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m)
{ {
return m; return m;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -336,7 +336,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m, T scalar)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -345,7 +345,7 @@ namespace glm
m[2] + scalar); m[2] + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -354,7 +354,7 @@ namespace glm
m1[2] + m2[2]); m1[2] + m2[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m, T scalar)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -363,7 +363,7 @@ namespace glm
m[2] - scalar); m[2] - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -372,7 +372,7 @@ namespace glm
m1[2] - m2[2]); m1[2] - m2[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m, T scalar)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -381,7 +381,7 @@ namespace glm
m[2] * scalar); m[2] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const & m)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -390,7 +390,7 @@ namespace glm
m[2] * scalar); m[2] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type operator* GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type operator*
( (
mat<3, 4, T, P> const& m, mat<3, 4, T, P> const& m,
@@ -404,7 +404,7 @@ namespace glm
m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z); m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::row_type operator* GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::row_type operator*
( (
typename mat<3, 4, T, P>::col_type const & v, typename mat<3, 4, T, P>::col_type const & v,
@@ -417,7 +417,7 @@ namespace glm
v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]); v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<4, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<4, 3, T, P> const & m2)
{ {
const T SrcA00 = m1[0][0]; const T SrcA00 = m1[0][0];
@@ -466,7 +466,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<2, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<2, 3, T, P> const & m2)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -480,7 +480,7 @@ namespace glm
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]); m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<3, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<3, 3, T, P> const & m2)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -498,7 +498,7 @@ namespace glm
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]); m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(mat<3, 4, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(mat<3, 4, T, P> const & m, T scalar)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -507,7 +507,7 @@ namespace glm
m[2] / scalar); m[2] / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const & m)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -518,13 +518,13 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{ {
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]); return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{ {
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]); return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);

View File

@@ -12,7 +12,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct mat<4, 2, T, P> struct mat<4, 2, T, P>
{ {
typedef vec<2, T, P> col_type; typedef vec<2, T, P> col_type;
@@ -29,7 +29,7 @@ namespace glm
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<4, 2, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat(mat<4, 2, T, P> const & m) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL mat(mat<4, 2, T, Q> const & m); GLM_FUNC_DECL mat(mat<4, 2, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor); GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
@@ -47,7 +47,7 @@ namespace glm
// -- Conversions -- // -- Conversions --
template < template<
typename X1, typename Y1, typename X1, typename Y1,
typename X2, typename Y2, typename X2, typename Y2,
typename X3, typename Y3, typename X3, typename Y3,
@@ -58,7 +58,7 @@ namespace glm
X3 x3, Y3 y3, X3 x3, Y3 y3,
X4 x4, Y4 y4); X4 x4, Y4 y4);
template <typename V1, typename V2, typename V3, typename V4> template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
vec<2, V1, P> const & v1, vec<2, V1, P> const & v1,
vec<2, V2, P> const & v2, vec<2, V2, P> const & v2,
@@ -67,7 +67,7 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, U, Q> const & m); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
@@ -91,19 +91,19 @@ namespace glm
GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, T, P> const & m) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, U, P> const & m); GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(U s); GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(mat<4, 2, U, P> const & m); GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(mat<4, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(U s); GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(mat<4, 2, U, P> const & m); GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(mat<4, 2, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator*=(U s); GLM_FUNC_DECL mat<4, 2, T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator/=(U s); GLM_FUNC_DECL mat<4, 2, T, P> & operator/=(U s);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -116,59 +116,59 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m); GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m); GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2); GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const& m2); GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const& m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const & m); GLM_FUNC_DECL mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const & m, typename mat<4, 2, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const & m, typename mat<4, 2, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const & v, mat<4, 2, T, P> const & m); GLM_FUNC_DECL typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const & v, mat<4, 2, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<2, 4, T, P> const & m2); GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<3, 4, T, P> const & m2); GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<4, 4, T, P> const & m2); GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator/(mat<4, 2, T, P> const & m, T scalar); GLM_FUNC_DECL mat<4, 2, T, P> operator/(mat<4, 2, T, P> const & m, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const & m); GLM_FUNC_DECL mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const & m);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2); GLM_FUNC_DECL bool operator==(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2); GLM_FUNC_DECL bool operator!=(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
}//namespace glm }//namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
// -- Constructors -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat() GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat()
{ {
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@@ -19,7 +19,7 @@ namespace glm
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -29,8 +29,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, Q> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, Q> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -39,11 +39,11 @@ namespace glm
this->value[3] = m.value[3]; this->value[3] = m.value[3];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<4, 2, T, P>::mat(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<4, 2, T, P>::mat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(T scalar) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(T scalar)
{ {
this->value[0] = col_type(scalar, 0); this->value[0] = col_type(scalar, 0);
@@ -52,7 +52,7 @@ namespace glm
this->value[3] = col_type(0, 0); this->value[3] = col_type(0, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
( (
T x0, T y0, T x0, T y0,
@@ -67,7 +67,7 @@ namespace glm
this->value[3] = col_type(x3, y3); this->value[3] = col_type(x3, y3);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
( (
col_type const & v0, col_type const & v0,
@@ -84,8 +84,8 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
template <typename T, precision P> template<typename T, precision P>
template < template<
typename X1, typename Y1, typename X1, typename Y1,
typename X2, typename Y2, typename X2, typename Y2,
typename X3, typename Y3, typename X3, typename Y3,
@@ -104,8 +104,8 @@ namespace glm
this->value[3] = col_type(static_cast<T>(x4), value_type(y4)); this->value[3] = col_type(static_cast<T>(x4), value_type(y4));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename V1, typename V2, typename V3, typename V4> template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
( (
vec<2, V1, P> const & v1, vec<2, V1, P> const & v1,
@@ -122,8 +122,8 @@ namespace glm
// -- Conversion -- // -- Conversion --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, U, Q> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, U, Q> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -132,7 +132,7 @@ namespace glm
this->value[3] = col_type(m[3]); this->value[3] = col_type(m[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -141,7 +141,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -150,7 +150,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -159,7 +159,7 @@ namespace glm
this->value[3] = col_type(m[3]); this->value[3] = col_type(m[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -168,7 +168,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -177,7 +177,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -186,7 +186,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -195,7 +195,7 @@ namespace glm
this->value[3] = col_type(m[3]); this->value[3] = col_type(m[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -206,14 +206,14 @@ namespace glm
// -- Accesses -- // -- Accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type & mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i) GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type & mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i)
{ {
assert(i < this->length()); assert(i < this->length());
return this->value[i]; return this->value[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type const & mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i) const GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type const & mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i) const
{ {
assert(i < this->length()); assert(i < this->length());
@@ -223,7 +223,7 @@ namespace glm
// -- Unary updatable operators -- // -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -234,8 +234,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, U, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -245,8 +245,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(U s) GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(U s)
{ {
this->value[0] += s; this->value[0] += s;
@@ -256,8 +256,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(mat<4, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(mat<4, 2, U, P> const & m)
{ {
this->value[0] += m[0]; this->value[0] += m[0];
@@ -267,8 +267,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(U s) GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(U s)
{ {
this->value[0] -= s; this->value[0] -= s;
@@ -278,8 +278,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(mat<4, 2, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(mat<4, 2, U, P> const & m)
{ {
this->value[0] -= m[0]; this->value[0] -= m[0];
@@ -289,8 +289,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator*=(U s) GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator*=(U s)
{ {
this->value[0] *= s; this->value[0] *= s;
@@ -300,8 +300,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator/=(U s) GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator/=(U s)
{ {
this->value[0] /= s; this->value[0] /= s;
@@ -313,7 +313,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator++() GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator++()
{ {
++this->value[0]; ++this->value[0];
@@ -323,7 +323,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator--() GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator--()
{ {
--this->value[0]; --this->value[0];
@@ -333,7 +333,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator++(int) GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator++(int)
{ {
mat<4, 2, T, P> Result(*this); mat<4, 2, T, P> Result(*this);
@@ -341,7 +341,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator--(int) GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator--(int)
{ {
mat<4, 2, T, P> Result(*this); mat<4, 2, T, P> Result(*this);
@@ -351,13 +351,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m)
{ {
return m; return m;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -369,7 +369,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m, T scalar)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -379,7 +379,7 @@ namespace glm
m[3] + scalar); m[3] + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -389,7 +389,7 @@ namespace glm
m1[3] + m2[3]); m1[3] + m2[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m, T scalar)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -399,7 +399,7 @@ namespace glm
m[3] - scalar); m[3] - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -409,7 +409,7 @@ namespace glm
m1[3] - m2[3]); m1[3] - m2[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m, T scalar)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -419,7 +419,7 @@ namespace glm
m[3] * scalar); m[3] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const & m)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -429,7 +429,7 @@ namespace glm
m[3] * scalar); m[3] * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const & m, typename mat<4, 2, T, P>::row_type const & v) GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const & m, typename mat<4, 2, T, P>::row_type const & v)
{ {
return typename mat<4, 2, T, P>::col_type( return typename mat<4, 2, T, P>::col_type(
@@ -437,7 +437,7 @@ namespace glm
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w); m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const & v, mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const & v, mat<4, 2, T, P> const & m)
{ {
return typename mat<4, 2, T, P>::row_type( return typename mat<4, 2, T, P>::row_type(
@@ -447,7 +447,7 @@ namespace glm
v.x * m[3][0] + v.y * m[3][1]); v.x * m[3][0] + v.y * m[3][1]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<2, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<2, 4, T, P> const & m2)
{ {
T const SrcA00 = m1[0][0]; T const SrcA00 = m1[0][0];
@@ -476,7 +476,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<3, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<3, 4, T, P> const & m2)
{ {
return mat<3, 2, T, P>( return mat<3, 2, T, P>(
@@ -488,7 +488,7 @@ namespace glm
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]); m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<4, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<4, 4, T, P> const & m2)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -502,7 +502,7 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]); m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(mat<4, 2, T, P> const & m, T scalar) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(mat<4, 2, T, P> const & m, T scalar)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -512,7 +512,7 @@ namespace glm
m[3] / scalar); m[3] / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const & m)
{ {
return mat<4, 2, T, P>( return mat<4, 2, T, P>(
@@ -524,13 +524,13 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{ {
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{ {
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);

View File

@@ -12,7 +12,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct mat<4, 3, T, P> struct mat<4, 3, T, P>
{ {
typedef vec<3, T, P> col_type; typedef vec<3, T, P> col_type;
@@ -29,7 +29,7 @@ namespace glm
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<4, 3, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat(mat<4, 3, T, P> const & m) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL mat(mat<4, 3, T, Q> const & m); GLM_FUNC_DECL mat(mat<4, 3, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor); GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
@@ -47,7 +47,7 @@ namespace glm
// -- Conversions -- // -- Conversions --
template < template<
typename X1, typename Y1, typename Z1, typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2, typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3, typename X3, typename Y3, typename Z3,
@@ -58,7 +58,7 @@ namespace glm
X3 const & x3, Y3 const & y3, Z3 const & z3, X3 const & x3, Y3 const & y3, Z3 const & z3,
X4 const & x4, Y4 const & y4, Z4 const & z4); X4 const & x4, Y4 const & y4, Z4 const & z4);
template <typename V1, typename V2, typename V3, typename V4> template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
vec<3, V1, P> const & v1, vec<3, V1, P> const & v1,
vec<3, V2, P> const & v2, vec<3, V2, P> const & v2,
@@ -67,7 +67,7 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, U, Q> const & m); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
@@ -91,19 +91,19 @@ namespace glm
GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, T, P> const & m) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, U, P> const & m); GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(U s); GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(mat<4, 3, U, P> const & m); GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(mat<4, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(U s); GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(mat<4, 3, U, P> const & m); GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(mat<4, 3, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator*=(U s); GLM_FUNC_DECL mat<4, 3, T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator/=(U s); GLM_FUNC_DECL mat<4, 3, T, P> & operator/=(U s);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -116,59 +116,59 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m); GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m); GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m, T const & s); GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m, T const & s);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2); GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m, T const & s); GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m, T const & s);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2); GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m, T const & s); GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m, T const & s);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(T const & s, mat<4, 3, T, P> const & m); GLM_FUNC_DECL mat<4, 3, T, P> operator*(T const & s, mat<4, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 3, T, P>::col_type operator*(mat<4, 3, T, P> const & m, typename mat<4, 3, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<4, 3, T, P>::col_type operator*(mat<4, 3, T, P> const & m, typename mat<4, 3, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 3, T, P>::row_type operator*(typename mat<4, 3, T, P>::col_type const & v, mat<4, 3, T, P> const & m); GLM_FUNC_DECL typename mat<4, 3, T, P>::row_type operator*(typename mat<4, 3, T, P>::col_type const & v, mat<4, 3, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<2, 4, T, P> const & m2); GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<3, 4, T, P> const& m2); GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<3, 4, T, P> const& m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<4, 4, T, P> const & m2); GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator/(mat<4, 3, T, P> const & m, T const & s); GLM_FUNC_DECL mat<4, 3, T, P> operator/(mat<4, 3, T, P> const & m, T const & s);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator/(T const & s, mat<4, 3, T, P> const & m); GLM_FUNC_DECL mat<4, 3, T, P> operator/(T const & s, mat<4, 3, T, P> const & m);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2); GLM_FUNC_DECL bool operator==(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2); GLM_FUNC_DECL bool operator!=(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
}//namespace glm }//namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
// -- Constructors -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat() GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat()
{ {
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@@ -19,7 +19,7 @@ namespace glm
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, P> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -29,8 +29,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, Q> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, Q> const & m)
{ {
this->value[0] = m.value[0]; this->value[0] = m.value[0];
@@ -39,11 +39,11 @@ namespace glm
this->value[3] = m.value[3]; this->value[3] = m.value[3];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<4, 3, T, P>::mat(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<4, 3, T, P>::mat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(T const & s) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(T const & s)
{ {
this->value[0] = col_type(s, 0, 0); this->value[0] = col_type(s, 0, 0);
@@ -52,7 +52,7 @@ namespace glm
this->value[3] = col_type(0, 0, 0); this->value[3] = col_type(0, 0, 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
( (
T const & x0, T const & y0, T const & z0, T const & x0, T const & y0, T const & z0,
@@ -67,7 +67,7 @@ namespace glm
this->value[3] = col_type(x3, y3, z3); this->value[3] = col_type(x3, y3, z3);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
( (
col_type const & v0, col_type const & v0,
@@ -84,8 +84,8 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
template <typename T, precision P> template<typename T, precision P>
template < template<
typename X1, typename Y1, typename Z1, typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2, typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3, typename X3, typename Y3, typename Z3,
@@ -104,8 +104,8 @@ namespace glm
this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4)); this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename V1, typename V2, typename V3, typename V4> template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
( (
vec<3, V1, P> const & v1, vec<3, V1, P> const & v1,
@@ -122,8 +122,8 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, U, Q> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, U, Q> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -132,7 +132,7 @@ namespace glm
this->value[3] = col_type(m[3]); this->value[3] = col_type(m[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -141,7 +141,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -150,7 +150,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -159,7 +159,7 @@ namespace glm
this->value[3] = col_type(m[3]); this->value[3] = col_type(m[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -168,7 +168,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -177,7 +177,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -186,7 +186,7 @@ namespace glm
this->value[3] = col_type(0); this->value[3] = col_type(0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -195,7 +195,7 @@ namespace glm
this->value[3] = col_type(m[3], 0); this->value[3] = col_type(m[3], 0);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 4, T, P> const & m)
{ {
this->value[0] = col_type(m[0]); this->value[0] = col_type(m[0]);
@@ -206,14 +206,14 @@ namespace glm
// -- Accesses -- // -- Accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type & mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i) GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type & mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i)
{ {
assert(i < this->length()); assert(i < this->length());
return this->value[i]; return this->value[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type const & mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i) const GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type const & mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i) const
{ {
assert(i < this->length()); assert(i < this->length());
@@ -223,7 +223,7 @@ namespace glm
// -- Unary updatable operators -- // -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -234,8 +234,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, U, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -245,8 +245,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(U s) GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(U s)
{ {
this->value[0] += s; this->value[0] += s;
@@ -256,8 +256,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(mat<4, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(mat<4, 3, U, P> const & m)
{ {
this->value[0] += m[0]; this->value[0] += m[0];
@@ -267,8 +267,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(U s) GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(U s)
{ {
this->value[0] -= s; this->value[0] -= s;
@@ -278,8 +278,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(mat<4, 3, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(mat<4, 3, U, P> const & m)
{ {
this->value[0] -= m[0]; this->value[0] -= m[0];
@@ -289,8 +289,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator*=(U s) GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator*=(U s)
{ {
this->value[0] *= s; this->value[0] *= s;
@@ -300,8 +300,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator/=(U s) GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator/=(U s)
{ {
this->value[0] /= s; this->value[0] /= s;
@@ -313,7 +313,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator++() GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator++()
{ {
++this->value[0]; ++this->value[0];
@@ -323,7 +323,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator--() GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator--()
{ {
--this->value[0]; --this->value[0];
@@ -333,7 +333,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator++(int) GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator++(int)
{ {
mat<4, 3, T, P> Result(*this); mat<4, 3, T, P> Result(*this);
@@ -341,7 +341,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator--(int) GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator--(int)
{ {
mat<4, 3, T, P> Result(*this); mat<4, 3, T, P> Result(*this);
@@ -351,13 +351,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m)
{ {
return m; return m;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -369,7 +369,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m, T const & s) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m, T const & s)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -379,7 +379,7 @@ namespace glm
m[3] + s); m[3] + s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -389,7 +389,7 @@ namespace glm
m1[3] + m2[3]); m1[3] + m2[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m, T const & s) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m, T const & s)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -399,7 +399,7 @@ namespace glm
m[3] - s); m[3] - s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -409,7 +409,7 @@ namespace glm
m1[3] - m2[3]); m1[3] - m2[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m, T const & s) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m, T const & s)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -419,7 +419,7 @@ namespace glm
m[3] * s); m[3] * s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(T const & s, mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(T const & s, mat<4, 3, T, P> const & m)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -429,7 +429,7 @@ namespace glm
m[3] * s); m[3] * s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type operator* GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type operator*
( (
mat<4, 3, T, P> const& m, mat<4, 3, T, P> const& m,
@@ -441,7 +441,7 @@ namespace glm
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w); m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::row_type operator* GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::row_type operator*
( (
typename mat<4, 3, T, P>::col_type const & v, typename mat<4, 3, T, P>::col_type const & v,
@@ -454,7 +454,7 @@ namespace glm
v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]); v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<2, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<2, 4, T, P> const & m2)
{ {
return mat<2, 3, T, P>( return mat<2, 3, T, P>(
@@ -466,7 +466,7 @@ namespace glm
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]); m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<3, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<3, 4, T, P> const & m2)
{ {
T const SrcA00 = m1[0][0]; T const SrcA00 = m1[0][0];
@@ -508,7 +508,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<4, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<4, 4, T, P> const & m2)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -526,7 +526,7 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]); m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(mat<4, 3, T, P> const & m, T const & s) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(mat<4, 3, T, P> const & m, T const & s)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -536,7 +536,7 @@ namespace glm
m[3] / s); m[3] / s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(T const & s, mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(T const & s, mat<4, 3, T, P> const & m)
{ {
return mat<4, 3, T, P>( return mat<4, 3, T, P>(
@@ -548,13 +548,13 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{ {
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{ {
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);

View File

@@ -11,7 +11,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct mat<4, 4, T, P> struct mat<4, 4, T, P>
{ {
typedef vec<4, T, P> col_type; typedef vec<4, T, P> col_type;
@@ -36,7 +36,7 @@ namespace glm
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<4, 4, T, P> const& m) GLM_DEFAULT; GLM_FUNC_DECL mat(mat<4, 4, T, P> const& m) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m); GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m);
GLM_FUNC_DECL explicit mat(ctor); GLM_FUNC_DECL explicit mat(ctor);
@@ -54,7 +54,7 @@ namespace glm
// -- Conversions -- // -- Conversions --
template < template<
typename X1, typename Y1, typename Z1, typename W1, typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2, typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3, typename X3, typename Y3, typename Z3, typename W3,
@@ -65,7 +65,7 @@ namespace glm
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3, X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3,
X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4); X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4);
template <typename V1, typename V2, typename V3, typename V4> template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL mat( GLM_FUNC_DECL mat(
vec<4, V1, P> const & v1, vec<4, V1, P> const & v1,
vec<4, V2, P> const & v2, vec<4, V2, P> const & v2,
@@ -74,7 +74,7 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, U, Q> const & m); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x); GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
@@ -90,23 +90,23 @@ namespace glm
GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, T, P> const & m) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, U, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(U s); GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(mat<4, 4, U, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(mat<4, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(U s); GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(mat<4, 4, U, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(mat<4, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(U s); GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(mat<4, 4, U, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(mat<4, 4, U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(U s); GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(mat<4, 4, U, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(mat<4, 4, U, P> const & m);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -119,74 +119,74 @@ namespace glm
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m, T const & s); GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m, T const & s);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(T const & s, mat<4, 4, T, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> operator+(T const & s, mat<4, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2); GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m, T const & s); GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m, T const & s);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(T const & s, mat<4, 4, T, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> operator-(T const & s, mat<4, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const& m2); GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const& m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m, T const & s); GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m, T const & s);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(T const & s, mat<4, 4, T, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> operator*(T const & s, mat<4, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator*(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator*(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator*(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m); GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator*(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<2, 4, T, P> const & m2); GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<3, 4, T, P> const & m2); GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2); GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m, T const & s); GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m, T const & s);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator/(T const & s, mat<4, 4, T, P> const & m); GLM_FUNC_DECL mat<4, 4, T, P> operator/(T const & s, mat<4, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v); GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m); GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const& m2); GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const& m2);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2); GLM_FUNC_DECL bool operator==(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2); GLM_FUNC_DECL bool operator!=(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
}//namespace glm }//namespace glm

View File

@@ -8,7 +8,7 @@ namespace glm
// -- Constructors -- // -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat() GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat()
{ {
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
@@ -21,7 +21,7 @@ namespace glm
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -31,8 +31,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, Q> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, Q> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -41,11 +41,11 @@ namespace glm
this->value[3] = m[3]; this->value[3] = m[3];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(ctor) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(T const & s) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(T const & s)
{ {
this->value[0] = col_type(s, 0, 0, 0); this->value[0] = col_type(s, 0, 0, 0);
@@ -54,7 +54,7 @@ namespace glm
this->value[3] = col_type(0, 0, 0, s); this->value[3] = col_type(0, 0, 0, s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
( (
T const & x0, T const & y0, T const & z0, T const & w0, T const & x0, T const & y0, T const & z0, T const & w0,
@@ -69,7 +69,7 @@ namespace glm
this->value[3] = col_type(x3, y3, z3, w3); this->value[3] = col_type(x3, y3, z3, w3);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
( (
col_type const & v0, col_type const & v0,
@@ -84,8 +84,8 @@ namespace glm
this->value[3] = v3; this->value[3] = v3;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
( (
mat<4, 4, U, Q> const & m mat<4, 4, U, Q> const & m
@@ -99,8 +99,8 @@ namespace glm
// -- Conversions -- // -- Conversions --
template <typename T, precision P> template<typename T, precision P>
template < template<
typename X1, typename Y1, typename Z1, typename W1, typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2, typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3, typename X3, typename Y3, typename Z3, typename W3,
@@ -139,8 +139,8 @@ namespace glm
this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4), value_type(w4)); this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4), value_type(w4));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename V1, typename V2, typename V3, typename V4> template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
( (
vec<4, V1, P> const & v1, vec<4, V1, P> const & v1,
@@ -162,7 +162,7 @@ namespace glm
// -- Matrix conversions -- // -- Matrix conversions --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0, 0); this->value[0] = col_type(m[0], 0, 0);
@@ -171,7 +171,7 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1); this->value[3] = col_type(0, 0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -180,7 +180,7 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1); this->value[3] = col_type(0, 0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -189,7 +189,7 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1); this->value[3] = col_type(0, 0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0, 0); this->value[0] = col_type(m[0], 0, 0);
@@ -198,7 +198,7 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1); this->value[3] = col_type(0, 0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 4, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -207,7 +207,7 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1); this->value[3] = col_type(0, 0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 2, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0, 0); this->value[0] = col_type(m[0], 0, 0);
@@ -216,7 +216,7 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1); this->value[3] = col_type(0, 0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 4, T, P> const & m)
{ {
this->value[0] = m[0]; this->value[0] = m[0];
@@ -225,7 +225,7 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1); this->value[3] = col_type(0, 0, 0, 1);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 3, T, P> const & m)
{ {
this->value[0] = col_type(m[0], 0); this->value[0] = col_type(m[0], 0);
@@ -236,14 +236,14 @@ namespace glm
// -- Accesses -- // -- Accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type & mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i) GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type & mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i)
{ {
assert(i < this->length()); assert(i < this->length());
return this->value[i]; return this->value[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type const & mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i) const GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type const & mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i) const
{ {
assert(i < this->length()); assert(i < this->length());
@@ -253,7 +253,7 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, T, P> const & m)
{ {
//memcpy could be faster //memcpy could be faster
@@ -266,8 +266,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, U, P> const & m)
{ {
//memcpy could be faster //memcpy could be faster
@@ -279,8 +279,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(U s) GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(U s)
{ {
this->value[0] += s; this->value[0] += s;
@@ -290,8 +290,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(mat<4, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(mat<4, 4, U, P> const & m)
{ {
this->value[0] += m[0]; this->value[0] += m[0];
@@ -301,8 +301,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(U s) GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(U s)
{ {
this->value[0] -= s; this->value[0] -= s;
@@ -312,8 +312,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(mat<4, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(mat<4, 4, U, P> const & m)
{ {
this->value[0] -= m[0]; this->value[0] -= m[0];
@@ -323,8 +323,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(U s) GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(U s)
{ {
this->value[0] *= s; this->value[0] *= s;
@@ -334,15 +334,15 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(mat<4, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(mat<4, 4, U, P> const & m)
{ {
return (*this = *this * m); return (*this = *this * m);
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(U s) GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(U s)
{ {
this->value[0] /= s; this->value[0] /= s;
@@ -352,8 +352,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(mat<4, 4, U, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(mat<4, 4, U, P> const & m)
{ {
return *this *= inverse(m); return *this *= inverse(m);
@@ -361,7 +361,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator++() GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator++()
{ {
++this->value[0]; ++this->value[0];
@@ -371,7 +371,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator--() GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator--()
{ {
--this->value[0]; --this->value[0];
@@ -381,7 +381,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator++(int) GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator++(int)
{ {
mat<4, 4, T, P> Result(*this); mat<4, 4, T, P> Result(*this);
@@ -389,7 +389,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator--(int) GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator--(int)
{ {
mat<4, 4, T, P> Result(*this); mat<4, 4, T, P> Result(*this);
@@ -399,13 +399,13 @@ namespace glm
// -- Unary constant operators -- // -- Unary constant operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m)
{ {
return m; return m;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -417,7 +417,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m, T const & s) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m, T const & s)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -427,7 +427,7 @@ namespace glm
m[3] + s); m[3] + s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(T const & s, mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(T const & s, mat<4, 4, T, P> const & m)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -437,7 +437,7 @@ namespace glm
m[3] + s); m[3] + s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -447,7 +447,7 @@ namespace glm
m1[3] + m2[3]); m1[3] + m2[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m, T const & s) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m, T const & s)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -457,7 +457,7 @@ namespace glm
m[3] - s); m[3] - s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(T const & s, mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(T const & s, mat<4, 4, T, P> const & m)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -467,7 +467,7 @@ namespace glm
s - m[3]); s - m[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -477,7 +477,7 @@ namespace glm
m1[3] - m2[3]); m1[3] - m2[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m, T const & s) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m, T const & s)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -487,7 +487,7 @@ namespace glm
m[3] * s); m[3] * s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(T const & s, mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(T const & s, mat<4, 4, T, P> const & m)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -497,7 +497,7 @@ namespace glm
m[3] * s); m[3] * s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator* GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator*
( (
mat<4, 4, T, P> const& m, mat<4, 4, T, P> const& m,
@@ -545,7 +545,7 @@ namespace glm
*/ */
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator* GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator*
( (
typename mat<4, 4, T, P>::col_type const & v, typename mat<4, 4, T, P>::col_type const & v,
@@ -559,7 +559,7 @@ namespace glm
m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]); m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<2, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{ {
return mat<2, 4, T, P>( return mat<2, 4, T, P>(
@@ -573,7 +573,7 @@ namespace glm
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3]); m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<3, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{ {
return mat<3, 4, T, P>( return mat<3, 4, T, P>(
@@ -591,7 +591,7 @@ namespace glm
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]); m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{ {
typename mat<4, 4, T, P>::col_type const SrcA0 = m1[0]; typename mat<4, 4, T, P>::col_type const SrcA0 = m1[0];
@@ -612,7 +612,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m, T const & s) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m, T const & s)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -622,7 +622,7 @@ namespace glm
m[3] / s); m[3] / s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(T const & s, mat<4, 4, T, P> const& m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(T const & s, mat<4, 4, T, P> const& m)
{ {
return mat<4, 4, T, P>( return mat<4, 4, T, P>(
@@ -632,19 +632,19 @@ namespace glm
s / m[3]); s / m[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v) GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v)
{ {
return inverse(m) * v; return inverse(m) * v;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m)
{ {
return v * inverse(m); return v * inverse(m);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2) GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{ {
mat<4, 4, T, P> m1_copy(m1); mat<4, 4, T, P> m1_copy(m1);
@@ -653,13 +653,13 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{ {
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]); return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2) GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{ {
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]); return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);

View File

@@ -9,7 +9,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <typename T, std::size_t size, bool aligned> template<typename T, std::size_t size, bool aligned>
struct storage struct storage
{ {
typedef struct type { typedef struct type {
@@ -18,7 +18,7 @@ namespace detail
}; };
#define GLM_ALIGNED_STORAGE_TYPE_STRUCT(x) \ #define GLM_ALIGNED_STORAGE_TYPE_STRUCT(x) \
template <typename T> \ template<typename T> \
struct storage<T, x, true> { \ struct storage<T, x, true> { \
GLM_ALIGNED_STRUCT(x) type { \ GLM_ALIGNED_STRUCT(x) type { \
uint8 data[x]; \ uint8 data[x]; \
@@ -34,19 +34,19 @@ namespace detail
GLM_ALIGNED_STORAGE_TYPE_STRUCT(64) GLM_ALIGNED_STORAGE_TYPE_STRUCT(64)
# if GLM_ARCH & GLM_ARCH_SSE2_BIT # if GLM_ARCH & GLM_ARCH_SSE2_BIT
template <> template<>
struct storage<float, 16, true> struct storage<float, 16, true>
{ {
typedef glm_vec4 type; typedef glm_vec4 type;
}; };
template <> template<>
struct storage<int, 16, true> struct storage<int, 16, true>
{ {
typedef glm_ivec4 type; typedef glm_ivec4 type;
}; };
template <> template<>
struct storage<unsigned int, 16, true> struct storage<unsigned int, 16, true>
{ {
typedef glm_uvec4 type; typedef glm_uvec4 type;
@@ -58,19 +58,19 @@ namespace detail
unsigned __int8 data[16]; unsigned __int8 data[16];
} glm_128; } glm_128;
template <> template<>
struct storage<float, 16, true> struct storage<float, 16, true>
{ {
typedef glm_128 type; typedef glm_128 type;
}; };
template <> template<>
struct storage<int, 16, true> struct storage<int, 16, true>
{ {
typedef glm_128 type; typedef glm_128 type;
}; };
template <> template<>
struct storage<unsigned int, 16, true> struct storage<unsigned int, 16, true>
{ {
typedef glm_128 type; typedef glm_128 type;
@@ -79,7 +79,7 @@ namespace detail
# endif # endif
# if (GLM_ARCH & GLM_ARCH_AVX_BIT) # if (GLM_ARCH & GLM_ARCH_AVX_BIT)
template <> template<>
struct storage<double, 32, true> struct storage<double, 32, true>
{ {
typedef glm_dvec4 type; typedef glm_dvec4 type;
@@ -87,13 +87,13 @@ namespace detail
# endif # endif
# if (GLM_ARCH & GLM_ARCH_AVX2_BIT) # if (GLM_ARCH & GLM_ARCH_AVX2_BIT)
template <> template<>
struct storage<int64, 32, true> struct storage<int64, 32, true>
{ {
typedef glm_i64vec4 type; typedef glm_i64vec4 type;
}; };
template <> template<>
struct storage<uint64, 32, true> struct storage<uint64, 32, true>
{ {
typedef glm_u64vec4 type; typedef glm_u64vec4 type;

View File

@@ -16,7 +16,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct vec<1, T, P> struct vec<1, T, P>
{ {
// -- Implementation detail -- // -- Implementation detail --
@@ -84,7 +84,7 @@ namespace glm
GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const & v) GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const & v) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, Q> const & v);
// -- Explicit basic constructors -- // -- Explicit basic constructors --
@@ -95,23 +95,23 @@ namespace glm
// -- Conversion vector constructors -- // -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, Q> const & v);
// -- Swizzle constructors -- // -- Swizzle constructors --
/* /*
# if(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)) # if(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED))
template <int E0> template<int E0>
GLM_FUNC_DECL tvec(detail::_swizzle<1, T, P, tvec1, E0, -1,-2,-3> const & that) GLM_FUNC_DECL tvec(detail::_swizzle<1, T, P, tvec1, E0, -1,-2,-3> const & that)
{ {
*this = that(); *this = that();
@@ -122,23 +122,23 @@ namespace glm
GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT; GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator+=(U scalar); GLM_FUNC_DECL vec & operator+=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator-=(U scalar); GLM_FUNC_DECL vec & operator-=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator*=(U scalar); GLM_FUNC_DECL vec & operator*=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator/=(U scalar); GLM_FUNC_DECL vec & operator/=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const & v);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -150,147 +150,147 @@ namespace glm
// -- Unary bit operators -- // -- Unary bit operators --
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator%=(U scalar); GLM_FUNC_DECL vec & operator%=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator&=(U scalar); GLM_FUNC_DECL vec & operator&=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator|=(U scalar); GLM_FUNC_DECL vec & operator|=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator^=(U scalar); GLM_FUNC_DECL vec & operator^=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator<<=(U scalar); GLM_FUNC_DECL vec & operator<<=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator>>=(U scalar); GLM_FUNC_DECL vec & operator>>=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
}; };
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator- (vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator- (vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar); GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator~(vec<1, T, P> const & v); GLM_FUNC_DECL vec<1, T, P> operator~(vec<1, T, P> const & v);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL bool operator==(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <precision P> template<precision P>
GLM_FUNC_DECL vec<1, bool, P> operator&&(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2); GLM_FUNC_DECL vec<1, bool, P> operator&&(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2);
template <precision P> template<precision P>
GLM_FUNC_DECL vec<1, bool, P> operator||(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2); GLM_FUNC_DECL vec<1, bool, P> operator||(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2);
}//namespace glm }//namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
// -- Implicit basic constructors -- // -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec() GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
: x(0) : x(0)
@@ -15,65 +15,65 @@ namespace glm
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, T, P> const & v)
: x(v.x) : x(v.x)
{} {}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, T, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, T, Q> const & v)
: x(v.x) : x(v.x)
{} {}
// -- Explicit basic constructors -- // -- Explicit basic constructors --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(T scalar) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(T scalar)
: x(scalar) : x(scalar)
{} {}
// -- Conversion vector constructors -- // -- Conversion vector constructors --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, U, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, U, Q> const & v)
: x(static_cast<T>(v.x)) : x(static_cast<T>(v.x))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<2, U, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<2, U, Q> const & v)
: x(static_cast<T>(v.x)) : x(static_cast<T>(v.x))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<3, U, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<3, U, Q> const & v)
: x(static_cast<T>(v.x)) : x(static_cast<T>(v.x))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<4, U, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<4, U, Q> const & v)
: x(static_cast<T>(v.x)) : x(static_cast<T>(v.x))
{} {}
// -- Component accesses -- // -- Component accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T & vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i) GLM_FUNC_QUALIFIER T & vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i)
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
return (&x)[i]; return (&x)[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const & vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i) const GLM_FUNC_QUALIFIER T const & vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i) const
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
@@ -83,7 +83,7 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, T, P> const & v)
{ {
this->x = v.x; this->x = v.x;
@@ -91,72 +91,72 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, U, P> const & v)
{ {
this->x = static_cast<T>(v.x); this->x = static_cast<T>(v.x);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(U scalar)
{ {
this->x += static_cast<T>(scalar); this->x += static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(vec<1, U, P> const & v)
{ {
this->x += static_cast<T>(v.x); this->x += static_cast<T>(v.x);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(U scalar)
{ {
this->x -= static_cast<T>(scalar); this->x -= static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(vec<1, U, P> const & v)
{ {
this->x -= static_cast<T>(v.x); this->x -= static_cast<T>(v.x);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(U scalar)
{ {
this->x *= static_cast<T>(scalar); this->x *= static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(vec<1, U, P> const & v)
{ {
this->x *= static_cast<T>(v.x); this->x *= static_cast<T>(v.x);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(U scalar)
{ {
this->x /= static_cast<T>(scalar); this->x /= static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(vec<1, U, P> const & v)
{ {
this->x /= static_cast<T>(v.x); this->x /= static_cast<T>(v.x);
@@ -165,21 +165,21 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator++() GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator++()
{ {
++this->x; ++this->x;
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator--() GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator--()
{ {
--this->x; --this->x;
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator++(int) GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator++(int)
{ {
vec<1, T, P> Result(*this); vec<1, T, P> Result(*this);
@@ -187,7 +187,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator--(int) GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator--(int)
{ {
vec<1, T, P> Result(*this); vec<1, T, P> Result(*this);
@@ -197,96 +197,96 @@ namespace glm
// -- Unary bit operators -- // -- Unary bit operators --
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(U scalar)
{ {
this->x %= static_cast<T>(scalar); this->x %= static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(vec<1, U, P> const & v)
{ {
this->x %= static_cast<T>(v.x); this->x %= static_cast<T>(v.x);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(U scalar)
{ {
this->x &= static_cast<T>(scalar); this->x &= static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(vec<1, U, P> const & v)
{ {
this->x &= static_cast<T>(v.x); this->x &= static_cast<T>(v.x);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(U scalar)
{ {
this->x |= static_cast<T>(scalar); this->x |= static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(vec<1, U, P> const & v)
{ {
this->x |= U(v.x); this->x |= U(v.x);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(U scalar)
{ {
this->x ^= static_cast<T>(scalar); this->x ^= static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(vec<1, U, P> const & v)
{ {
this->x ^= static_cast<T>(v.x); this->x ^= static_cast<T>(v.x);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(U scalar)
{ {
this->x <<= static_cast<T>(scalar); this->x <<= static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(vec<1, U, P> const & v)
{ {
this->x <<= static_cast<T>(v.x); this->x <<= static_cast<T>(v.x);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(U scalar) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(U scalar)
{ {
this->x >>= static_cast<T>(scalar); this->x >>= static_cast<T>(scalar);
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(vec<1, U, P> const & v)
{ {
this->x >>= static_cast<T>(v.x); this->x >>= static_cast<T>(v.x);
@@ -295,13 +295,13 @@ namespace glm
// -- Unary constant operators -- // -- Unary constant operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v)
{ {
return v; return v;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
@@ -310,21 +310,21 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x + scalar); v.x + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar + v.x); scalar + v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
@@ -332,63 +332,63 @@ namespace glm
} }
//operator- //operator-
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x - scalar); v.x - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar - v.x); scalar - v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v1.x - v2.x); v1.x - v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x * scalar); v.x * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar * v.x); scalar * v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v1.x * v2.x); v1.x * v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x / scalar); v.x / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar / v.x); scalar / v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
@@ -397,133 +397,133 @@ namespace glm
// -- Binary bit operators -- // -- Binary bit operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x % scalar); v.x % scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar % v.x); scalar % v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v1.x % v2.x); v1.x % v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x & scalar); v.x & scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar & v.x); scalar & v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v1.x & v2.x); v1.x & v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x | scalar); v.x | scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar | v.x); scalar | v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v1.x | v2.x); v1.x | v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x ^ scalar); v.x ^ scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar ^ v.x); scalar ^ v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v1.x ^ v2.x); v1.x ^ v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x << scalar); v.x << scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar << v.x); scalar << v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v1.x << v2.x); v1.x << v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v.x >> scalar); v.x >> scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
scalar >> v.x); scalar >> v.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<1, T, P>( return vec<1, T, P>(
v1.x >> v2.x); v1.x >> v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator~(vec<1, T, P> const & v) GLM_FUNC_QUALIFIER vec<1, T, P> operator~(vec<1, T, P> const & v)
{ {
return vec<1, T, P>( return vec<1, T, P>(
@@ -532,25 +532,25 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER bool operator==(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return (v1.x == v2.x); return (v1.x == v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return (v1.x != v2.x); return (v1.x != v2.x);
} }
template <precision P> template<precision P>
GLM_FUNC_QUALIFIER vec<1, bool, P> operator&&(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2) GLM_FUNC_QUALIFIER vec<1, bool, P> operator&&(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2)
{ {
return vec<1, bool, P>(v1.x && v2.x); return vec<1, bool, P>(v1.x && v2.x);
} }
template <precision P> template<precision P>
GLM_FUNC_QUALIFIER vec<1, bool, P> operator||(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2) GLM_FUNC_QUALIFIER vec<1, bool, P> operator||(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2)
{ {
return vec<1, bool, P>(v1.x || v2.x); return vec<1, bool, P>(v1.x || v2.x);

View File

@@ -15,7 +15,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct vec<2, T, P> struct vec<2, T, P>
{ {
// -- Implementation detail -- // -- Implementation detail --
@@ -85,7 +85,7 @@ namespace glm
GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, T, Q> const& v); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, T, Q> const& v);
// -- Explicit basic constructors -- // -- Explicit basic constructors --
@@ -97,27 +97,27 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B> template<typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, B y); GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, B y);
template <typename A, typename B> template<typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const & v1, vec<1, B, P> const & v2); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const & v1, vec<1, B, P> const & v2);
// -- Conversion vector constructors -- // -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const & v);
// -- Swizzle constructors -- // -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
template <int E0, int E1> template<int E0, int E1>
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1,-1,-2> const& that) GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1,-1,-2> const& that)
{ {
*this = that(); *this = that();
@@ -128,31 +128,31 @@ namespace glm
GLM_FUNC_DECL vec& operator=(vec const & v) GLM_DEFAULT; GLM_FUNC_DECL vec& operator=(vec const & v) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator=(vec<2, U, P> const & v); GLM_FUNC_DECL vec& operator=(vec<2, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator+=(U scalar); GLM_FUNC_DECL vec& operator+=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator+=(vec<1, U, P> const & v); GLM_FUNC_DECL vec& operator+=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator+=(vec<2, U, P> const & v); GLM_FUNC_DECL vec& operator+=(vec<2, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator-=(U scalar); GLM_FUNC_DECL vec& operator-=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator-=(vec<1, U, P> const & v); GLM_FUNC_DECL vec& operator-=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator-=(vec<2, U, P> const & v); GLM_FUNC_DECL vec& operator-=(vec<2, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator*=(U scalar); GLM_FUNC_DECL vec& operator*=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator*=(vec<1, U, P> const & v); GLM_FUNC_DECL vec& operator*=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator*=(vec<2, U, P> const & v); GLM_FUNC_DECL vec& operator*=(vec<2, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator/=(U scalar); GLM_FUNC_DECL vec& operator/=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator/=(vec<1, U, P> const & v); GLM_FUNC_DECL vec& operator/=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec& operator/=(vec<2, U, P> const & v); GLM_FUNC_DECL vec& operator/=(vec<2, U, P> const & v);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -164,219 +164,219 @@ namespace glm
// -- Unary bit operators -- // -- Unary bit operators --
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator%=(U scalar); GLM_FUNC_DECL vec & operator%=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<2, U, P> const & v); GLM_FUNC_DECL vec & operator%=(vec<2, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator&=(U scalar); GLM_FUNC_DECL vec & operator&=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<2, U, P> const & v); GLM_FUNC_DECL vec & operator&=(vec<2, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator|=(U scalar); GLM_FUNC_DECL vec & operator|=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<2, U, P> const & v); GLM_FUNC_DECL vec & operator|=(vec<2, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator^=(U scalar); GLM_FUNC_DECL vec & operator^=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<2, U, P> const & v); GLM_FUNC_DECL vec & operator^=(vec<2, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator<<=(U scalar); GLM_FUNC_DECL vec & operator<<=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<2, U, P> const & v); GLM_FUNC_DECL vec & operator<<=(vec<2, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator>>=(U scalar); GLM_FUNC_DECL vec & operator>>=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<2, U, P> const & v); GLM_FUNC_DECL vec & operator>>=(vec<2, U, P> const & v);
}; };
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator+(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator+(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator-(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator-(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator*(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator*(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator/(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator/(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator%(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator%(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator&(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator&(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator|(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator|(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator^(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator^(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator<<(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator<<(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v, T scalar); GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(T scalar, vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator>>(T scalar, vec<2, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<1, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator>>(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator~(vec<2, T, P> const & v); GLM_FUNC_DECL vec<2, T, P> operator~(vec<2, T, P> const & v);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL bool operator==(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(vec<2, T, P> const & v1, vec<2, T, P> const & v2); GLM_FUNC_DECL bool operator!=(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <precision P> template<precision P>
GLM_FUNC_DECL vec<2, bool, P> operator&&(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2); GLM_FUNC_DECL vec<2, bool, P> operator&&(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2);
template <precision P> template<precision P>
GLM_FUNC_DECL vec<2, bool, P> operator||(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2); GLM_FUNC_DECL vec<2, bool, P> operator||(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2);
}//namespace glm }//namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
// -- Implicit basic constructors -- // -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec() GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0) : x(0), y(0)
@@ -15,45 +15,45 @@ namespace glm
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, P> const & v)
: x(v.x), y(v.y) : x(v.x), y(v.y)
{} {}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, Q> const & v)
: x(v.x), y(v.y) : x(v.x), y(v.y)
{} {}
// -- Explicit basic constructors -- // -- Explicit basic constructors --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T scalar) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T scalar)
: x(scalar), y(scalar) : x(scalar), y(scalar)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T s1, T s2) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T s1, T s2)
: x(s1), y(s2) : x(s1), y(s2)
{} {}
// -- Conversion scalar constructors -- // -- Conversion scalar constructors --
template <typename T, precision P> template<typename T, precision P>
template <typename A, typename B> template<typename A, typename B>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(A a, B b) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(A a, B b)
: x(static_cast<T>(a)) : x(static_cast<T>(a))
, y(static_cast<T>(b)) , y(static_cast<T>(b))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename A, typename B> template<typename A, typename B>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<1, A, P> const & a, vec<1, B, P> const & b) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<1, A, P> const & a, vec<1, B, P> const & b)
: x(static_cast<T>(a.x)) : x(static_cast<T>(a.x))
, y(static_cast<T>(b.x)) , y(static_cast<T>(b.x))
@@ -61,22 +61,22 @@ namespace glm
// -- Conversion vector constructors -- // -- Conversion vector constructors --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, U, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, U, Q> const & v)
: x(static_cast<T>(v.x)) : x(static_cast<T>(v.x))
, y(static_cast<T>(v.y)) , y(static_cast<T>(v.y))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<3, U, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<3, U, Q> const & v)
: x(static_cast<T>(v.x)) : x(static_cast<T>(v.x))
, y(static_cast<T>(v.y)) , y(static_cast<T>(v.y))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<4, U, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<4, U, Q> const & v)
: x(static_cast<T>(v.x)) : x(static_cast<T>(v.x))
, y(static_cast<T>(v.y)) , y(static_cast<T>(v.y))
@@ -84,14 +84,14 @@ namespace glm
// -- Component accesses -- // -- Component accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T & vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i) GLM_FUNC_QUALIFIER T & vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i)
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
return (&x)[i]; return (&x)[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const & vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i) const GLM_FUNC_QUALIFIER T const & vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i) const
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
@@ -101,7 +101,7 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, T, P> const & v)
{ {
this->x = v.x; this->x = v.x;
@@ -110,8 +110,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, U, P> const & v)
{ {
this->x = static_cast<T>(v.x); this->x = static_cast<T>(v.x);
@@ -119,8 +119,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(U scalar)
{ {
this->x += static_cast<T>(scalar); this->x += static_cast<T>(scalar);
@@ -128,8 +128,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(vec<1, U, P> const & v)
{ {
this->x += static_cast<T>(v.x); this->x += static_cast<T>(v.x);
@@ -137,8 +137,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(vec<2, U, P> const & v)
{ {
this->x += static_cast<T>(v.x); this->x += static_cast<T>(v.x);
@@ -146,8 +146,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(U scalar)
{ {
this->x -= static_cast<T>(scalar); this->x -= static_cast<T>(scalar);
@@ -155,8 +155,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(vec<1, U, P> const & v)
{ {
this->x -= static_cast<T>(v.x); this->x -= static_cast<T>(v.x);
@@ -164,8 +164,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(vec<2, U, P> const & v)
{ {
this->x -= static_cast<T>(v.x); this->x -= static_cast<T>(v.x);
@@ -173,8 +173,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(U scalar)
{ {
this->x *= static_cast<T>(scalar); this->x *= static_cast<T>(scalar);
@@ -182,8 +182,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(vec<1, U, P> const & v)
{ {
this->x *= static_cast<T>(v.x); this->x *= static_cast<T>(v.x);
@@ -191,8 +191,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(vec<2, U, P> const & v)
{ {
this->x *= static_cast<T>(v.x); this->x *= static_cast<T>(v.x);
@@ -200,8 +200,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(U scalar)
{ {
this->x /= static_cast<T>(scalar); this->x /= static_cast<T>(scalar);
@@ -209,8 +209,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(vec<1, U, P> const & v)
{ {
this->x /= static_cast<T>(v.x); this->x /= static_cast<T>(v.x);
@@ -218,8 +218,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(vec<2, U, P> const & v)
{ {
this->x /= static_cast<T>(v.x); this->x /= static_cast<T>(v.x);
@@ -229,7 +229,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator++() GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator++()
{ {
++this->x; ++this->x;
@@ -237,7 +237,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator--() GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator--()
{ {
--this->x; --this->x;
@@ -245,7 +245,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> vec<2, T, P>::operator++(int) GLM_FUNC_QUALIFIER vec<2, T, P> vec<2, T, P>::operator++(int)
{ {
vec<2, T, P> Result(*this); vec<2, T, P> Result(*this);
@@ -253,7 +253,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> vec<2, T, P>::operator--(int) GLM_FUNC_QUALIFIER vec<2, T, P> vec<2, T, P>::operator--(int)
{ {
vec<2, T, P> Result(*this); vec<2, T, P> Result(*this);
@@ -263,8 +263,8 @@ namespace glm
// -- Unary bit operators -- // -- Unary bit operators --
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(U scalar)
{ {
this->x %= static_cast<T>(scalar); this->x %= static_cast<T>(scalar);
@@ -272,8 +272,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(vec<1, U, P> const & v)
{ {
this->x %= static_cast<T>(v.x); this->x %= static_cast<T>(v.x);
@@ -281,8 +281,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(vec<2, U, P> const & v)
{ {
this->x %= static_cast<T>(v.x); this->x %= static_cast<T>(v.x);
@@ -290,8 +290,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(U scalar)
{ {
this->x &= static_cast<T>(scalar); this->x &= static_cast<T>(scalar);
@@ -299,8 +299,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(vec<1, U, P> const & v)
{ {
this->x &= static_cast<T>(v.x); this->x &= static_cast<T>(v.x);
@@ -308,8 +308,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(vec<2, U, P> const & v)
{ {
this->x &= static_cast<T>(v.x); this->x &= static_cast<T>(v.x);
@@ -317,8 +317,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(U scalar)
{ {
this->x |= static_cast<T>(scalar); this->x |= static_cast<T>(scalar);
@@ -326,8 +326,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(vec<1, U, P> const & v)
{ {
this->x |= static_cast<T>(v.x); this->x |= static_cast<T>(v.x);
@@ -335,8 +335,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(vec<2, U, P> const & v)
{ {
this->x |= static_cast<T>(v.x); this->x |= static_cast<T>(v.x);
@@ -344,8 +344,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(U scalar)
{ {
this->x ^= static_cast<T>(scalar); this->x ^= static_cast<T>(scalar);
@@ -353,8 +353,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(vec<1, U, P> const & v)
{ {
this->x ^= static_cast<T>(v.x); this->x ^= static_cast<T>(v.x);
@@ -362,8 +362,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(vec<2, U, P> const & v)
{ {
this->x ^= static_cast<T>(v.x); this->x ^= static_cast<T>(v.x);
@@ -371,8 +371,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(U scalar)
{ {
this->x <<= static_cast<T>(scalar); this->x <<= static_cast<T>(scalar);
@@ -380,8 +380,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(vec<1, U, P> const & v)
{ {
this->x <<= static_cast<T>(v.x); this->x <<= static_cast<T>(v.x);
@@ -389,8 +389,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(vec<2, U, P> const & v)
{ {
this->x <<= static_cast<T>(v.x); this->x <<= static_cast<T>(v.x);
@@ -398,8 +398,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(U scalar) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(U scalar)
{ {
this->x >>= static_cast<T>(scalar); this->x >>= static_cast<T>(scalar);
@@ -407,8 +407,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(vec<1, U, P> const & v)
{ {
this->x >>= static_cast<T>(v.x); this->x >>= static_cast<T>(v.x);
@@ -416,8 +416,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(vec<2, U, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(vec<2, U, P> const & v)
{ {
this->x >>= static_cast<T>(v.x); this->x >>= static_cast<T>(v.x);
@@ -427,13 +427,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v)
{ {
return v; return v;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -443,7 +443,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -451,7 +451,7 @@ namespace glm
v.y + scalar); v.y + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -459,7 +459,7 @@ namespace glm
v1.y + v2.x); v1.y + v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator+(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -467,7 +467,7 @@ namespace glm
scalar + v.y); scalar + v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -475,7 +475,7 @@ namespace glm
v1.x + v2.y); v1.x + v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -483,7 +483,7 @@ namespace glm
v1.y + v2.y); v1.y + v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -491,7 +491,7 @@ namespace glm
v.y - scalar); v.y - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -499,7 +499,7 @@ namespace glm
v1.y - v2.x); v1.y - v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator-(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -507,7 +507,7 @@ namespace glm
scalar - v.y); scalar - v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -515,7 +515,7 @@ namespace glm
v1.x - v2.y); v1.x - v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -523,7 +523,7 @@ namespace glm
v1.y - v2.y); v1.y - v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -531,7 +531,7 @@ namespace glm
v.y * scalar); v.y * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -539,7 +539,7 @@ namespace glm
v1.y * v2.x); v1.y * v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator*(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -547,7 +547,7 @@ namespace glm
scalar * v.y); scalar * v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -555,7 +555,7 @@ namespace glm
v1.x * v2.y); v1.x * v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -563,7 +563,7 @@ namespace glm
v1.y * v2.y); v1.y * v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -571,7 +571,7 @@ namespace glm
v.y / scalar); v.y / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -579,7 +579,7 @@ namespace glm
v1.y / v2.x); v1.y / v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator/(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -587,7 +587,7 @@ namespace glm
scalar / v.y); scalar / v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -595,7 +595,7 @@ namespace glm
v1.x / v2.y); v1.x / v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -605,7 +605,7 @@ namespace glm
// -- Binary bit operators -- // -- Binary bit operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -613,7 +613,7 @@ namespace glm
v.y % scalar); v.y % scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -621,7 +621,7 @@ namespace glm
v1.y % v2.x); v1.y % v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator%(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -629,7 +629,7 @@ namespace glm
scalar % v.y); scalar % v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -637,7 +637,7 @@ namespace glm
v1.x % v2.y); v1.x % v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -645,7 +645,7 @@ namespace glm
v1.y % v2.y); v1.y % v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -653,7 +653,7 @@ namespace glm
v.y & scalar); v.y & scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -661,7 +661,7 @@ namespace glm
v1.y & v2.x); v1.y & v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator&(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -669,7 +669,7 @@ namespace glm
scalar & v.y); scalar & v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -677,7 +677,7 @@ namespace glm
v1.x & v2.y); v1.x & v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -685,7 +685,7 @@ namespace glm
v1.y & v2.y); v1.y & v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -693,7 +693,7 @@ namespace glm
v.y | scalar); v.y | scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -701,7 +701,7 @@ namespace glm
v1.y | v2.x); v1.y | v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator|(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -709,7 +709,7 @@ namespace glm
scalar | v.y); scalar | v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -717,7 +717,7 @@ namespace glm
v1.x | v2.y); v1.x | v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -725,7 +725,7 @@ namespace glm
v1.y | v2.y); v1.y | v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -733,7 +733,7 @@ namespace glm
v.y ^ scalar); v.y ^ scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -741,7 +741,7 @@ namespace glm
v1.y ^ v2.x); v1.y ^ v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator^(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -749,7 +749,7 @@ namespace glm
scalar ^ v.y); scalar ^ v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -757,7 +757,7 @@ namespace glm
v1.x ^ v2.y); v1.x ^ v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -765,7 +765,7 @@ namespace glm
v1.y ^ v2.y); v1.y ^ v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -773,7 +773,7 @@ namespace glm
v.y << scalar); v.y << scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -781,7 +781,7 @@ namespace glm
v1.y << v2.x); v1.y << v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -789,7 +789,7 @@ namespace glm
scalar << v.y); scalar << v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -797,7 +797,7 @@ namespace glm
v1.x << v2.y); v1.x << v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -805,7 +805,7 @@ namespace glm
v1.y << v2.y); v1.y << v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v, T scalar)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -813,7 +813,7 @@ namespace glm
v.y >> scalar); v.y >> scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<1, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -821,7 +821,7 @@ namespace glm
v1.y >> v2.x); v1.y >> v2.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(T scalar, vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(T scalar, vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -829,7 +829,7 @@ namespace glm
scalar >> v.y); scalar >> v.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<1, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -837,7 +837,7 @@ namespace glm
v1.x >> v2.y); v1.x >> v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -845,7 +845,7 @@ namespace glm
v1.y >> v2.y); v1.y >> v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> operator~(vec<2, T, P> const & v) GLM_FUNC_QUALIFIER vec<2, T, P> operator~(vec<2, T, P> const & v)
{ {
return vec<2, T, P>( return vec<2, T, P>(
@@ -855,25 +855,25 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER bool operator==(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return (v1.x == v2.x) && (v1.y == v2.y); return (v1.x == v2.x) && (v1.y == v2.y);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(vec<2, T, P> const & v1, vec<2, T, P> const & v2) GLM_FUNC_QUALIFIER bool operator!=(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{ {
return (v1.x != v2.x) || (v1.y != v2.y); return (v1.x != v2.x) || (v1.y != v2.y);
} }
template <precision P> template<precision P>
GLM_FUNC_QUALIFIER vec<2, bool, P> operator&&(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2) GLM_FUNC_QUALIFIER vec<2, bool, P> operator&&(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2)
{ {
return vec<2, bool, P>(v1.x && v2.x, v1.y && v2.y); return vec<2, bool, P>(v1.x && v2.x, v1.y && v2.y);
} }
template <precision P> template<precision P>
GLM_FUNC_QUALIFIER vec<2, bool, P> operator||(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2) GLM_FUNC_QUALIFIER vec<2, bool, P> operator||(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2)
{ {
return vec<2, bool, P>(v1.x || v2.x, v1.y || v2.y); return vec<2, bool, P>(v1.x || v2.x, v1.y || v2.y);

View File

@@ -15,7 +15,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct vec<3, T, P> struct vec<3, T, P>
{ {
// -- Implementation detail -- // -- Implementation detail --
@@ -85,7 +85,7 @@ namespace glm
GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const & v) GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const & v) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, T, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, T, Q> const & v);
// -- Explicit basic constructors -- // -- Explicit basic constructors --
@@ -97,48 +97,48 @@ namespace glm
// -- Conversion scalar constructors -- // -- Conversion scalar constructors --
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C> template<typename A, typename B, typename C>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, B b, C c); GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, B b, C c);
template <typename A, typename B, typename C> template<typename A, typename B, typename C>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const & a, vec<1, B, P> const & b, vec<1, C, P> const & c); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const & a, vec<1, B, P> const & b, vec<1, C, P> const & c);
// -- Conversion vector constructors -- // -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, B b); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, B b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<2, B, Q> const & b); GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<2, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v);
// -- Swizzle constructors -- // -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
template <int E0, int E1, int E2> template<int E0, int E1, int E2>
GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & that) GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & that)
{ {
*this = that(); *this = that();
} }
template <int E0, int E1> template<int E0, int E1>
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & scalar) GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & scalar)
{ {
*this = vec(v(), scalar); *this = vec(v(), scalar);
} }
template <int E0, int E1> template<int E0, int E1>
GLM_FUNC_DECL vec(T const & scalar, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v) GLM_FUNC_DECL vec(T const & scalar, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
{ {
*this = vec(scalar, v()); *this = vec(scalar, v());
@@ -149,31 +149,31 @@ namespace glm
GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT; GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator=(vec<3, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator+=(U scalar); GLM_FUNC_DECL vec & operator+=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator+=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator+=(vec<3, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator-=(U scalar); GLM_FUNC_DECL vec & operator-=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator-=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator-=(vec<3, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator*=(U scalar); GLM_FUNC_DECL vec & operator*=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator*=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator*=(vec<3, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator/=(U scalar); GLM_FUNC_DECL vec & operator/=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator/=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator/=(vec<3, U, P> const & v);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -185,219 +185,219 @@ namespace glm
// -- Unary bit operators -- // -- Unary bit operators --
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator%=(U scalar); GLM_FUNC_DECL vec & operator%=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator%=(vec<3, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator&=(U scalar); GLM_FUNC_DECL vec & operator&=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator&=(vec<3, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator|=(U scalar); GLM_FUNC_DECL vec & operator|=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator|=(vec<3, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator^=(U scalar); GLM_FUNC_DECL vec & operator^=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator^=(vec<3, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator<<=(U scalar); GLM_FUNC_DECL vec & operator<<=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator<<=(vec<3, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator>>=(U scalar); GLM_FUNC_DECL vec & operator>>=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v); GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<3, U, P> const & v); GLM_FUNC_DECL vec & operator>>=(vec<3, U, P> const & v);
}; };
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, T scalar); GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, vec<1, T, P> const & scalar); GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(T scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator+(T scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator+(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v, T scalar); GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(T scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator-(T scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator-(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, T scalar); GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(T scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator*(T scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator*(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v, T scalar); GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(T scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator/(T scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator/(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v, T scalar); GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator%(T const & scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator%(T const & scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator%(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, T scalar); GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(T scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator&(T scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator&(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v, T scalar); GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(T scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator|(T scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator|(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v, T scalar); GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(T scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator^(T scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator^(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v, T scalar); GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(T scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator<<(T scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator<<(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v, T scalar); GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(T scalar, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator>>(T scalar, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<1, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator>>(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator~(vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator~(vec<3, T, P> const & v);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL bool operator==(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(vec<3, T, P> const & v1, vec<3, T, P> const & v2); GLM_FUNC_DECL bool operator!=(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <precision P> template<precision P>
GLM_FUNC_DECL vec<3, bool, P> operator&&(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2); GLM_FUNC_DECL vec<3, bool, P> operator&&(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2);
template <precision P> template<precision P>
GLM_FUNC_DECL vec<3, bool, P> operator||(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2); GLM_FUNC_DECL vec<3, bool, P> operator||(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2);
}//namespace glm }//namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
// -- Implicit basic constructors -- // -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec() GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0) : x(0), y(0), z(0)
@@ -15,46 +15,46 @@ namespace glm
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, T, P> const & v)
: x(v.x), y(v.y), z(v.z) : x(v.x), y(v.y), z(v.z)
{} {}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, T, Q> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, T, Q> const & v)
: x(v.x), y(v.y), z(v.z) : x(v.x), y(v.y), z(v.z)
{} {}
// -- Explicit basic constructors -- // -- Explicit basic constructors --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<3, T, P>::vec(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(T scalar) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(T scalar)
: x(scalar), y(scalar), z(scalar) : x(scalar), y(scalar), z(scalar)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(T a, T b, T c) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(T a, T b, T c)
: x(a), y(b), z(c) : x(a), y(b), z(c)
{} {}
// -- Conversion scalar constructors -- // -- Conversion scalar constructors --
template <typename T, precision P> template<typename T, precision P>
template <typename A, typename B, typename C> template<typename A, typename B, typename C>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(A a, B b, C c) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(A a, B b, C c) :
x(static_cast<T>(a)), x(static_cast<T>(a)),
y(static_cast<T>(b)), y(static_cast<T>(b)),
z(static_cast<T>(c)) z(static_cast<T>(c))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename A, typename B, typename C> template<typename A, typename B, typename C>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, A, P> const & a, vec<1, B, P> const & b, vec<1, C, P> const & c) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, A, P> const & a, vec<1, B, P> const & b, vec<1, C, P> const & c) :
x(static_cast<T>(a)), x(static_cast<T>(a)),
y(static_cast<T>(b)), y(static_cast<T>(b)),
@@ -63,48 +63,48 @@ namespace glm
// -- Conversion vector constructors -- // -- Conversion vector constructors --
template <typename T, precision P> template<typename T, precision P>
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<2, A, Q> const & a, B b) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<2, A, Q> const & a, B b) :
x(static_cast<T>(a.x)), x(static_cast<T>(a.x)),
y(static_cast<T>(a.y)), y(static_cast<T>(a.y)),
z(static_cast<T>(b)) z(static_cast<T>(b))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b) :
x(static_cast<T>(a.x)), x(static_cast<T>(a.x)),
y(static_cast<T>(a.y)), y(static_cast<T>(a.y)),
z(static_cast<T>(b.x)) z(static_cast<T>(b.x))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(A a, vec<2, B, Q> const & b) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(A a, vec<2, B, Q> const & b) :
x(static_cast<T>(a)), x(static_cast<T>(a)),
y(static_cast<T>(b.x)), y(static_cast<T>(b.x)),
z(static_cast<T>(b.y)) z(static_cast<T>(b.y))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b) :
x(static_cast<T>(a.x)), x(static_cast<T>(a.x)),
y(static_cast<T>(b.x)), y(static_cast<T>(b.x)),
z(static_cast<T>(b.y)) z(static_cast<T>(b.y))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, U, Q> const & v) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<3, U, Q> const & v) :
x(static_cast<T>(v.x)), x(static_cast<T>(v.x)),
y(static_cast<T>(v.y)), y(static_cast<T>(v.y)),
z(static_cast<T>(v.z)) z(static_cast<T>(v.z))
{} {}
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<4, U, Q> const & v) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, T, P>::vec(vec<4, U, Q> const & v) :
x(static_cast<T>(v.x)), x(static_cast<T>(v.x)),
y(static_cast<T>(v.y)), y(static_cast<T>(v.y)),
@@ -113,14 +113,14 @@ namespace glm
// -- Component accesses -- // -- Component accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T & vec<3, T, P>::operator[](typename vec<3, T, P>::length_type i) GLM_FUNC_QUALIFIER T & vec<3, T, P>::operator[](typename vec<3, T, P>::length_type i)
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
return (&x)[i]; return (&x)[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const & vec<3, T, P>::operator[](typename vec<3, T, P>::length_type i) const GLM_FUNC_QUALIFIER T const & vec<3, T, P>::operator[](typename vec<3, T, P>::length_type i) const
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
@@ -130,7 +130,7 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, T, P> const & v)
{ {
this->x = v.x; this->x = v.x;
@@ -140,8 +140,8 @@ namespace glm
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P>& vec<3, T, P>::operator=(vec<3, U, P> const & v)
{ {
this->x = static_cast<T>(v.x); this->x = static_cast<T>(v.x);
@@ -150,8 +150,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(U scalar) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(U scalar)
{ {
this->x += static_cast<T>(scalar); this->x += static_cast<T>(scalar);
@@ -160,8 +160,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<1, U, P> const & v)
{ {
this->x += static_cast<T>(v.x); this->x += static_cast<T>(v.x);
@@ -170,8 +170,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator+=(vec<3, U, P> const & v)
{ {
this->x += static_cast<T>(v.x); this->x += static_cast<T>(v.x);
@@ -180,8 +180,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(U scalar) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(U scalar)
{ {
this->x -= static_cast<T>(scalar); this->x -= static_cast<T>(scalar);
@@ -190,8 +190,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<1, U, P> const & v)
{ {
this->x -= static_cast<T>(v.x); this->x -= static_cast<T>(v.x);
@@ -200,8 +200,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator-=(vec<3, U, P> const & v)
{ {
this->x -= static_cast<T>(v.x); this->x -= static_cast<T>(v.x);
@@ -210,8 +210,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(U scalar) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(U scalar)
{ {
this->x *= static_cast<T>(scalar); this->x *= static_cast<T>(scalar);
@@ -220,8 +220,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<1, U, P> const & v)
{ {
this->x *= static_cast<T>(v.x); this->x *= static_cast<T>(v.x);
@@ -230,8 +230,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator*=(vec<3, U, P> const & v)
{ {
this->x *= static_cast<T>(v.x); this->x *= static_cast<T>(v.x);
@@ -240,8 +240,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(U v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(U v)
{ {
this->x /= static_cast<T>(v); this->x /= static_cast<T>(v);
@@ -250,8 +250,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<1, U, P> const & v)
{ {
this->x /= static_cast<T>(v.x); this->x /= static_cast<T>(v.x);
@@ -260,8 +260,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator/=(vec<3, U, P> const & v)
{ {
this->x /= static_cast<T>(v.x); this->x /= static_cast<T>(v.x);
@@ -272,7 +272,7 @@ namespace glm
// -- Increment and decrement operators -- // -- Increment and decrement operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator++() GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator++()
{ {
++this->x; ++this->x;
@@ -281,7 +281,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator--() GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator--()
{ {
--this->x; --this->x;
@@ -290,7 +290,7 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> vec<3, T, P>::operator++(int) GLM_FUNC_QUALIFIER vec<3, T, P> vec<3, T, P>::operator++(int)
{ {
vec<3, T, P> Result(*this); vec<3, T, P> Result(*this);
@@ -298,7 +298,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> vec<3, T, P>::operator--(int) GLM_FUNC_QUALIFIER vec<3, T, P> vec<3, T, P>::operator--(int)
{ {
vec<3, T, P> Result(*this); vec<3, T, P> Result(*this);
@@ -308,8 +308,8 @@ namespace glm
// -- Unary bit operators -- // -- Unary bit operators --
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(U scalar) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(U scalar)
{ {
this->x %= scalar; this->x %= scalar;
@@ -318,8 +318,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<1, U, P> const & v)
{ {
this->x %= v.x; this->x %= v.x;
@@ -328,8 +328,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator%=(vec<3, U, P> const & v)
{ {
this->x %= v.x; this->x %= v.x;
@@ -338,8 +338,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(U scalar) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(U scalar)
{ {
this->x &= scalar; this->x &= scalar;
@@ -348,8 +348,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<1, U, P> const & v)
{ {
this->x &= v.x; this->x &= v.x;
@@ -358,8 +358,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator&=(vec<3, U, P> const & v)
{ {
this->x &= v.x; this->x &= v.x;
@@ -368,8 +368,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(U scalar) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(U scalar)
{ {
this->x |= scalar; this->x |= scalar;
@@ -378,8 +378,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<1, U, P> const & v)
{ {
this->x |= v.x; this->x |= v.x;
@@ -388,8 +388,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator|=(vec<3, U, P> const & v)
{ {
this->x |= v.x; this->x |= v.x;
@@ -398,8 +398,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(U scalar) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(U scalar)
{ {
this->x ^= scalar; this->x ^= scalar;
@@ -408,8 +408,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<1, U, P> const & v)
{ {
this->x ^= v.x; this->x ^= v.x;
@@ -418,8 +418,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator^=(vec<3, U, P> const & v)
{ {
this->x ^= v.x; this->x ^= v.x;
@@ -428,8 +428,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(U scalar) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(U scalar)
{ {
this->x <<= scalar; this->x <<= scalar;
@@ -438,8 +438,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<1, U, P> const & v)
{ {
this->x <<= static_cast<T>(v.x); this->x <<= static_cast<T>(v.x);
@@ -448,8 +448,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator<<=(vec<3, U, P> const & v)
{ {
this->x <<= static_cast<T>(v.x); this->x <<= static_cast<T>(v.x);
@@ -458,8 +458,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(U scalar) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(U scalar)
{ {
this->x >>= static_cast<T>(scalar); this->x >>= static_cast<T>(scalar);
@@ -468,8 +468,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<1, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<1, U, P> const & v)
{ {
this->x >>= static_cast<T>(v.x); this->x >>= static_cast<T>(v.x);
@@ -478,8 +478,8 @@ namespace glm
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<3, U, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> & vec<3, T, P>::operator>>=(vec<3, U, P> const & v)
{ {
this->x >>= static_cast<T>(v.x); this->x >>= static_cast<T>(v.x);
@@ -490,13 +490,13 @@ namespace glm
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v)
{ {
return v; return v;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -507,7 +507,7 @@ namespace glm
// -- Binary arithmetic operators -- // -- Binary arithmetic operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -516,7 +516,7 @@ namespace glm
v.z + scalar); v.z + scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -525,7 +525,7 @@ namespace glm
v.z + scalar.x); v.z + scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator+(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -534,7 +534,7 @@ namespace glm
scalar + v.z); scalar + v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -543,7 +543,7 @@ namespace glm
scalar.x + v.z); scalar.x + v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator+(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -552,7 +552,7 @@ namespace glm
v1.z + v2.z); v1.z + v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -561,7 +561,7 @@ namespace glm
v.z - scalar); v.z - scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -570,7 +570,7 @@ namespace glm
v.z - scalar.x); v.z - scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator-(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -579,7 +579,7 @@ namespace glm
scalar - v.z); scalar - v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -588,7 +588,7 @@ namespace glm
scalar.x - v.z); scalar.x - v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -597,7 +597,7 @@ namespace glm
v1.z - v2.z); v1.z - v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -606,7 +606,7 @@ namespace glm
v.z * scalar); v.z * scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -615,7 +615,7 @@ namespace glm
v.z * scalar.x); v.z * scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator*(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -624,7 +624,7 @@ namespace glm
scalar * v.z); scalar * v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -633,7 +633,7 @@ namespace glm
scalar.x * v.z); scalar.x * v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -642,7 +642,7 @@ namespace glm
v1.z * v2.z); v1.z * v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -651,7 +651,7 @@ namespace glm
v.z / scalar); v.z / scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -660,7 +660,7 @@ namespace glm
v.z / scalar.x); v.z / scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator/(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -669,7 +669,7 @@ namespace glm
scalar / v.z); scalar / v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -678,7 +678,7 @@ namespace glm
scalar.x / v.z); scalar.x / v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -689,7 +689,7 @@ namespace glm
// -- Binary bit operators -- // -- Binary bit operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -698,7 +698,7 @@ namespace glm
v.z % scalar); v.z % scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -707,7 +707,7 @@ namespace glm
v.z % scalar.x); v.z % scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator%(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -716,7 +716,7 @@ namespace glm
scalar % v.z); scalar % v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -725,7 +725,7 @@ namespace glm
scalar.x % v.z); scalar.x % v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -734,7 +734,7 @@ namespace glm
v1.z % v2.z); v1.z % v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -743,7 +743,7 @@ namespace glm
v.z & scalar); v.z & scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -752,7 +752,7 @@ namespace glm
v.z & scalar.x); v.z & scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator&(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -761,7 +761,7 @@ namespace glm
scalar & v.z); scalar & v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -770,7 +770,7 @@ namespace glm
scalar.x & v.z); scalar.x & v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -779,7 +779,7 @@ namespace glm
v1.z & v2.z); v1.z & v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -788,7 +788,7 @@ namespace glm
v.z | scalar); v.z | scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -797,7 +797,7 @@ namespace glm
v.z | scalar.x); v.z | scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator|(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -806,7 +806,7 @@ namespace glm
scalar | v.z); scalar | v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -815,7 +815,7 @@ namespace glm
scalar.x | v.z); scalar.x | v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -824,7 +824,7 @@ namespace glm
v1.z | v2.z); v1.z | v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -833,7 +833,7 @@ namespace glm
v.z ^ scalar); v.z ^ scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -842,7 +842,7 @@ namespace glm
v.z ^ scalar.x); v.z ^ scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator^(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -851,7 +851,7 @@ namespace glm
scalar ^ v.z); scalar ^ v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -860,7 +860,7 @@ namespace glm
scalar.x ^ v.z); scalar.x ^ v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -869,7 +869,7 @@ namespace glm
v1.z ^ v2.z); v1.z ^ v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -878,7 +878,7 @@ namespace glm
v.z << scalar); v.z << scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -887,7 +887,7 @@ namespace glm
v.z << scalar.x); v.z << scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -896,7 +896,7 @@ namespace glm
scalar << v.z); scalar << v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -905,7 +905,7 @@ namespace glm
scalar.x << v.z); scalar.x << v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -914,7 +914,7 @@ namespace glm
v1.z << v2.z); v1.z << v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const & v, T scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const & v, T scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -923,7 +923,7 @@ namespace glm
v.z >> scalar); v.z >> scalar);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const & v, vec<1, T, P> const & scalar) GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const & v, vec<1, T, P> const & scalar)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -932,7 +932,7 @@ namespace glm
v.z >> scalar.x); v.z >> scalar.x);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(T scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(T scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -941,7 +941,7 @@ namespace glm
scalar >> v.z); scalar >> v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<1, T, P> const & scalar, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<1, T, P> const & scalar, vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -950,7 +950,7 @@ namespace glm
scalar.x >> v.z); scalar.x >> v.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -959,7 +959,7 @@ namespace glm
v1.z >> v2.z); v1.z >> v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator~(vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator~(vec<3, T, P> const & v)
{ {
return vec<3, T, P>( return vec<3, T, P>(
@@ -970,25 +970,25 @@ namespace glm
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER bool operator==(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z); return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(vec<3, T, P> const & v1, vec<3, T, P> const & v2) GLM_FUNC_QUALIFIER bool operator!=(vec<3, T, P> const & v1, vec<3, T, P> const & v2)
{ {
return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z); return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z);
} }
template <precision P> template<precision P>
GLM_FUNC_QUALIFIER vec<3, bool, P> operator&&(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2) GLM_FUNC_QUALIFIER vec<3, bool, P> operator&&(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2)
{ {
return vec<3, bool, P>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z); return vec<3, bool, P>(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z);
} }
template <precision P> template<precision P>
GLM_FUNC_QUALIFIER vec<3, bool, P> operator||(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2) GLM_FUNC_QUALIFIER vec<3, bool, P> operator||(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2)
{ {
return vec<3, bool, P>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z); return vec<3, bool, P>(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z);

View File

@@ -15,7 +15,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
struct vec<4, T, P> struct vec<4, T, P>
{ {
// -- Implementation detail -- // -- Implementation detail --
@@ -88,7 +88,7 @@ namespace glm
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, P> const& v) GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, P> const& v) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v); GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v);
// -- Explicit basic constructors -- // -- Explicit basic constructors --
@@ -100,90 +100,90 @@ namespace glm
// -- Conversion scalar constructors -- // -- Conversion scalar constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, typename D> template<typename A, typename B, typename C, typename D>
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(A a, B b, C c, D d); GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(A a, B b, C c, D d);
template <typename A, typename B, typename C, typename D> template<typename A, typename B, typename C, typename D>
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& a, vec<1, B, P> const& b, vec<1, C, P> const& c, vec<1, D, P> const& d); GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& a, vec<1, B, P> const& b, vec<1, C, P> const& c, vec<1, D, P> const& d);
// -- Conversion vector constructors -- // -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q> template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, B b, C c); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, B b, C c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q> template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b, vec<1, C, Q> const & c); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b, vec<1, C, Q> const & c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q> template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<2, B, Q> const & b, C c); GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<2, B, Q> const & b, C c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q> template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b, vec<1, C, Q> const & c); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b, vec<1, C, Q> const & c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q> template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, B b, vec<2, C, Q> const & c); GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, B b, vec<2, C, Q> const & c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q> template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<1, B, Q> const & b, vec<2, C, Q> const & c); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<1, B, Q> const & b, vec<2, C, Q> const & c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const & a, B b); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const & a, B b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const & a, vec<1, B, Q> const & b); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const & a, vec<1, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<3, B, Q> const & b); GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<3, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<3, B, Q> const & b); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<3, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q> template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<2, B, Q> const & b); GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<2, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification) /// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
// -- Swizzle constructors -- // -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED) # if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
template <int E0, int E1, int E2, int E3> template<int E0, int E1, int E2, int E3>
GLM_FUNC_DECL vec(detail::_swizzle<4, T, P, E0, E1, E2, E3> const & that) GLM_FUNC_DECL vec(detail::_swizzle<4, T, P, E0, E1, E2, E3> const & that)
{ {
*this = that(); *this = that();
} }
template <int E0, int E1, int F0, int F1> template<int E0, int E1, int F0, int F1>
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, F0, F1, -1, -2> const & u) GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, F0, F1, -1, -2> const & u)
{ {
*this = vec<4, T, P>(v(), u()); *this = vec<4, T, P>(v(), u());
} }
template <int E0, int E1> template<int E0, int E1>
GLM_FUNC_DECL vec(T const & x, T const & y, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v) GLM_FUNC_DECL vec(T const & x, T const & y, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
{ {
*this = vec<4, T, P>(x, y, v()); *this = vec<4, T, P>(x, y, v());
} }
template <int E0, int E1> template<int E0, int E1>
GLM_FUNC_DECL vec(T const & x, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & w) GLM_FUNC_DECL vec(T const & x, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & w)
{ {
*this = vec<4, T, P>(x, v(), w); *this = vec<4, T, P>(x, v(), w);
} }
template <int E0, int E1> template<int E0, int E1>
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & z, T const & w) GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & z, T const & w)
{ {
*this = vec<4, T, P>(v(), z, w); *this = vec<4, T, P>(v(), z, w);
} }
template <int E0, int E1, int E2> template<int E0, int E1, int E2>
GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v, T const & w) GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v, T const & w)
{ {
*this = vec<4, T, P>(v(), w); *this = vec<4, T, P>(v(), w);
} }
template <int E0, int E1, int E2> template<int E0, int E1, int E2>
GLM_FUNC_DECL vec(T const & x, detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v) GLM_FUNC_DECL vec(T const & x, detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v)
{ {
*this = vec<4, T, P>(x, v()); *this = vec<4, T, P>(x, v());
@@ -194,31 +194,31 @@ namespace glm
GLM_FUNC_DECL vec<4, T, P> & operator=(vec<4, T, P> const & v) GLM_DEFAULT; GLM_FUNC_DECL vec<4, T, P> & operator=(vec<4, T, P> const & v) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator=(vec<4, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator+=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator+=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<1, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<4, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator-=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator-=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<1, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<4, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator*=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator*=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<1, U, P> const& v); GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<1, U, P> const& v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<4, U, P> const& v); GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<4, U, P> const& v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator/=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator/=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<1, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<4, U, P> const & v);
// -- Increment and decrement operators -- // -- Increment and decrement operators --
@@ -230,219 +230,219 @@ namespace glm
// -- Unary bit operators -- // -- Unary bit operators --
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator%=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator%=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<1, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<4, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator&=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator&=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<1, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<4, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator|=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator|=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<1, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<4, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator^=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator^=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<1, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<4, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator<<=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator<<=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<1, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<4, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator>>=(U scalar); GLM_FUNC_DECL vec<4, T, P> & operator>>=(U scalar);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<1, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<1, U, P> const & v);
template <typename U> template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<4, U, P> const & v); GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<4, U, P> const & v);
}; };
// -- Unary operators -- // -- Unary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator+(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<1, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator+(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator-(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<1, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator-(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator*(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<1, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator*(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<1, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator/(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<1, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator/(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, vec<1, T, P> const & scalar); GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator%(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<1, T, P> const & scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator%(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, vec<1, T, P> const & scalar); GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator&(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<1, T, P> const & scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator&(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, vec<1, T, P> const & scalar); GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator|(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<1, T, P> const & scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator|(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, vec<1, T, P> const & scalar); GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator^(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<1, T, P> const & scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator^(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, vec<1, T, P> const & scalar); GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator<<(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<1, T, P> const & scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator<<(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, T scalar); GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, T scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, vec<1, T, P> const & scalar); GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(T scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator>>(T scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<1, T, P> const & scalar, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator>>(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator~(vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator~(vec<4, T, P> const & v);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL bool operator==(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(vec<4, T, P> const & v1, vec<4, T, P> const & v2); GLM_FUNC_DECL bool operator!=(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <precision P> template<precision P>
GLM_FUNC_DECL vec<4, bool, P> operator&&(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2); GLM_FUNC_DECL vec<4, bool, P> operator&&(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2);
template <precision P> template<precision P>
GLM_FUNC_DECL vec<4, bool, P> operator||(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2); GLM_FUNC_DECL vec<4, bool, P> operator||(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2);
}//namespace glm }//namespace glm

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@ namespace glm{
namespace detail namespace detail
{ {
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED # if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
template <precision P, int E0, int E1, int E2, int E3> template<precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, float, P, E0,E1,E2,E3, true> : public _swizzle_base0<float, 4> struct _swizzle_base1<4, float, P, E0,E1,E2,E3, true> : public _swizzle_base0<float, 4>
{ {
GLM_FUNC_QUALIFIER vec<4, float, P> operator ()() const GLM_FUNC_QUALIFIER vec<4, float, P> operator ()() const
@@ -24,7 +24,7 @@ namespace detail
} }
}; };
template <precision P, int E0, int E1, int E2, int E3> template<precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, int32, P, E0,E1,E2,E3, true> : public _swizzle_base0<int32, 4> struct _swizzle_base1<4, int32, P, E0,E1,E2,E3, true> : public _swizzle_base0<int32, 4>
{ {
GLM_FUNC_QUALIFIER vec<4, int32, P> operator ()() const GLM_FUNC_QUALIFIER vec<4, int32, P> operator ()() const
@@ -37,7 +37,7 @@ namespace detail
} }
}; };
template <precision P, int E0, int E1, int E2, int E3> template<precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, uint32, P, E0,E1,E2,E3, true> : public _swizzle_base0<uint32, 4> struct _swizzle_base1<4, uint32, P, E0,E1,E2,E3, true> : public _swizzle_base0<uint32, 4>
{ {
GLM_FUNC_QUALIFIER vec<4, uint32, P> operator ()() const GLM_FUNC_QUALIFIER vec<4, uint32, P> operator ()() const
@@ -51,7 +51,7 @@ namespace detail
}; };
# endif// GLM_SWIZZLE == GLM_SWIZZLE_ENABLED # endif// GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
template <precision P> template<precision P>
struct compute_vec4_add<float, P, true> struct compute_vec4_add<float, P, true>
{ {
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b) static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
@@ -63,7 +63,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P> template<precision P>
struct compute_vec4_add<double, P, true> struct compute_vec4_add<double, P, true>
{ {
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b) static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
@@ -75,7 +75,7 @@ namespace detail
}; };
# endif # endif
template <precision P> template<precision P>
struct compute_vec4_sub<float, P, true> struct compute_vec4_sub<float, P, true>
{ {
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b) static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
@@ -87,7 +87,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P> template<precision P>
struct compute_vec4_sub<double, P, true> struct compute_vec4_sub<double, P, true>
{ {
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b) static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
@@ -99,7 +99,7 @@ namespace detail
}; };
# endif # endif
template <precision P> template<precision P>
struct compute_vec4_mul<float, P, true> struct compute_vec4_mul<float, P, true>
{ {
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b) static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
@@ -111,7 +111,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P> template<precision P>
struct compute_vec4_mul<double, P, true> struct compute_vec4_mul<double, P, true>
{ {
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b) static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
@@ -123,7 +123,7 @@ namespace detail
}; };
# endif # endif
template <precision P> template<precision P>
struct compute_vec4_div<float, P, true> struct compute_vec4_div<float, P, true>
{ {
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b) static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
@@ -135,7 +135,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P> template<precision P>
struct compute_vec4_div<double, P, true> struct compute_vec4_div<double, P, true>
{ {
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b) static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
@@ -147,7 +147,7 @@ namespace detail
}; };
# endif # endif
template <> template<>
struct compute_vec4_div<float, aligned_lowp, true> struct compute_vec4_div<float, aligned_lowp, true>
{ {
static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const & a, vec<4, float, aligned_lowp> const & b) static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const & a, vec<4, float, aligned_lowp> const & b)
@@ -158,7 +158,7 @@ namespace detail
} }
}; };
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_and<T, P, true, 32, true> struct compute_vec4_and<T, P, true, 32, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -170,7 +170,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX2_BIT # if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_and<T, P, true, 64, true> struct compute_vec4_and<T, P, true, 64, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -182,7 +182,7 @@ namespace detail
}; };
# endif # endif
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_or<T, P, true, 32, true> struct compute_vec4_or<T, P, true, 32, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -194,7 +194,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX2_BIT # if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_or<T, P, true, 64, true> struct compute_vec4_or<T, P, true, 64, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -206,7 +206,7 @@ namespace detail
}; };
# endif # endif
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_xor<T, P, true, 32, true> struct compute_vec4_xor<T, P, true, 32, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -218,7 +218,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX2_BIT # if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_xor<T, P, true, 64, true> struct compute_vec4_xor<T, P, true, 64, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -230,7 +230,7 @@ namespace detail
}; };
# endif # endif
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_shift_left<T, P, true, 32, true> struct compute_vec4_shift_left<T, P, true, 32, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -242,7 +242,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX2_BIT # if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_shift_left<T, P, true, 64, true> struct compute_vec4_shift_left<T, P, true, 64, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -254,7 +254,7 @@ namespace detail
}; };
# endif # endif
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_shift_right<T, P, true, 32, true> struct compute_vec4_shift_right<T, P, true, 32, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -266,7 +266,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX2_BIT # if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_shift_right<T, P, true, 64, true> struct compute_vec4_shift_right<T, P, true, 64, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b) static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
@@ -278,7 +278,7 @@ namespace detail
}; };
# endif # endif
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_bitwise_not<T, P, true, 32, true> struct compute_vec4_bitwise_not<T, P, true, 32, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const & v) static vec<4, T, P> call(vec<4, T, P> const & v)
@@ -290,7 +290,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX2_BIT # if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P> template<typename T, precision P>
struct compute_vec4_bitwise_not<T, P, true, 64, true> struct compute_vec4_bitwise_not<T, P, true, 64, true>
{ {
static vec<4, T, P> call(vec<4, T, P> const & v) static vec<4, T, P> call(vec<4, T, P> const & v)
@@ -302,7 +302,7 @@ namespace detail
}; };
# endif # endif
template <precision P> template<precision P>
struct compute_vec4_equal<float, P, false, 32, true> struct compute_vec4_equal<float, P, false, 32, true>
{ {
static bool call(vec<4, float, P> const & v1, vec<4, float, P> const & v2) static bool call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
@@ -311,7 +311,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_vec4_equal<int32, P, true, 32, true> struct compute_vec4_equal<int32, P, true, 32, true>
{ {
static bool call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2) static bool call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
@@ -320,7 +320,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_vec4_nequal<float, P, false, 32, true> struct compute_vec4_nequal<float, P, false, 32, true>
{ {
static bool call(vec<4, float, P> const & v1, vec<4, float, P> const & v2) static bool call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
@@ -329,7 +329,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_vec4_nequal<int32, P, true, 32, true> struct compute_vec4_nequal<int32, P, true, 32, true>
{ {
static bool call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2) static bool call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
@@ -340,21 +340,21 @@ namespace detail
}//namespace detail }//namespace detail
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec() GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps()) : data(_mm_setzero_ps())
# endif # endif
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec() GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps()) : data(_mm_setzero_ps())
# endif # endif
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec() GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps()) : data(_mm_setzero_ps())
@@ -362,117 +362,117 @@ namespace detail
{} {}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(float s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(float s) :
data(_mm_set1_ps(s)) data(_mm_set1_ps(s))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(float s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(float s) :
data(_mm_set1_ps(s)) data(_mm_set1_ps(s))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(float s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(float s) :
data(_mm_set1_ps(s)) data(_mm_set1_ps(s))
{} {}
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_lowp>::vec(double s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_lowp>::vec(double s) :
data(_mm256_set1_pd(s)) data(_mm256_set1_pd(s))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_mediump>::vec(double s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_mediump>::vec(double s) :
data(_mm256_set1_pd(s)) data(_mm256_set1_pd(s))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_highp>::vec(double s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_highp>::vec(double s) :
data(_mm256_set1_pd(s)) data(_mm256_set1_pd(s))
{} {}
# endif # endif
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_lowp>::vec(int32 s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_lowp>::vec(int32 s) :
data(_mm_set1_epi32(s)) data(_mm_set1_epi32(s))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_mediump>::vec(int32 s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_mediump>::vec(int32 s) :
data(_mm_set1_epi32(s)) data(_mm_set1_epi32(s))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_highp>::vec(int32 s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_highp>::vec(int32 s) :
data(_mm_set1_epi32(s)) data(_mm_set1_epi32(s))
{} {}
# if GLM_ARCH & GLM_ARCH_AVX2_BIT # if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_lowp>::vec(int64 s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_lowp>::vec(int64 s) :
data(_mm256_set1_epi64x(s)) data(_mm256_set1_epi64x(s))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_mediump>::vec(int64 s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_mediump>::vec(int64 s) :
data(_mm256_set1_epi64x(s)) data(_mm256_set1_epi64x(s))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_highp>::vec(int64 s) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_highp>::vec(int64 s) :
data(_mm256_set1_epi64x(s)) data(_mm256_set1_epi64x(s))
{} {}
# endif # endif
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(float a, float b, float c, float d) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a)) data(_mm_set_ps(d, c, b, a))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(float a, float b, float c, float d) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a)) data(_mm_set_ps(d, c, b, a))
{} {}
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(float a, float b, float c, float d) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a)) data(_mm_set_ps(d, c, b, a))
{} {}
template <> template<>
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_lowp>::vec(int32 a, int32 b, int32 c, int32 d) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_lowp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_set_epi32(d, c, b, a)) data(_mm_set_epi32(d, c, b, a))
{} {}
template <> template<>
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_mediump>::vec(int32 a, int32 b, int32 c, int32 d) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_mediump>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_set_epi32(d, c, b, a)) data(_mm_set_epi32(d, c, b, a))
{} {}
template <> template<>
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_highp>::vec(int32 a, int32 b, int32 c, int32 d) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_highp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_set_epi32(d, c, b, a)) data(_mm_set_epi32(d, c, b, a))
{} {}
template <> template<>
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(int32 a, int32 b, int32 c, int32 d) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a))) data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
{} {}
template <> template<>
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(int32 a, int32 b, int32 c, int32 d) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a))) data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
{} {}
template <> template<>
template <> template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(int32 a, int32 b, int32 c, int32 d) : GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a))) data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
{} {}

View File

@@ -12,7 +12,7 @@
// GLM_GTC_quaternion // GLM_GTC_quaternion
namespace glm namespace glm
{ {
template <typename T, precision P> struct tquat; template<typename T, precision P> struct tquat;
/// Quaternion of low single-precision floating-point numbers. /// Quaternion of low single-precision floating-point numbers.
/// ///

View File

@@ -32,62 +32,62 @@ namespace glm
/// Build a mask of 'count' bits /// Build a mask of 'count' bits
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType mask(genIUType Bits); GLM_FUNC_DECL genIUType mask(genIUType Bits);
/// Build a mask of 'count' bits /// Build a mask of 'count' bits
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename T, precision P, template <typename, precision> class vecIUType> template<typename T, precision P, template<typename, precision> class vecIUType>
GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v); GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const & v);
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift); GLM_FUNC_DECL genIUType bitfieldRotateRight(genIUType In, int Shift);
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side. /// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> bitfieldRotateRight(vecType<D, T, P> const & In, int Shift); GLM_FUNC_DECL vecType<L, T, P> bitfieldRotateRight(vecType<L, T, P> const & In, int Shift);
/// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift); GLM_FUNC_DECL genIUType bitfieldRotateLeft(genIUType In, int Shift);
/// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side. /// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> bitfieldRotateLeft(vecType<D, T, P> const & In, int Shift); GLM_FUNC_DECL vecType<L, T, P> bitfieldRotateLeft(vecType<L, T, P> const & In, int Shift);
/// Set to 1 a range of bits. /// Set to 1 a range of bits.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount); GLM_FUNC_DECL genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount);
/// Set to 1 a range of bits. /// Set to 1 a range of bits.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> bitfieldFillOne(vecType<D, T, P> const & Value, int FirstBit, int BitCount); GLM_FUNC_DECL vecType<L, T, P> bitfieldFillOne(vecType<L, T, P> const & Value, int FirstBit, int BitCount);
/// Set to 0 a range of bits. /// Set to 0 a range of bits.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount); GLM_FUNC_DECL genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount);
/// Set to 0 a range of bits. /// Set to 0 a range of bits.
/// ///
/// @see gtc_bitfield /// @see gtc_bitfield
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> bitfieldFillZero(vecType<D, T, P> const & Value, int FirstBit, int BitCount); GLM_FUNC_DECL vecType<L, T, P> bitfieldFillZero(vecType<L, T, P> const & Value, int FirstBit, int BitCount);
/// Interleaves the bits of x and y. /// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y. /// The first bit is the first bit of x followed by the first bit of y.

View File

@@ -6,16 +6,16 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <typename PARAM, typename RET> template<typename PARAM, typename RET>
GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y); GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y);
template <typename PARAM, typename RET> template<typename PARAM, typename RET>
GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z); GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z);
template <typename PARAM, typename RET> template<typename PARAM, typename RET>
GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w); GLM_FUNC_DECL RET bitfieldInterleave(PARAM x, PARAM y, PARAM z, PARAM w);
template <> template<>
GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y) GLM_FUNC_QUALIFIER glm::uint16 bitfieldInterleave(glm::uint8 x, glm::uint8 y)
{ {
glm::uint16 REG1(x); glm::uint16 REG1(x);
@@ -33,7 +33,7 @@ namespace detail
return REG1 | (REG2 << 1); return REG1 | (REG2 << 1);
} }
template <> template<>
GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y) GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint16 x, glm::uint16 y)
{ {
glm::uint32 REG1(x); glm::uint32 REG1(x);
@@ -54,7 +54,7 @@ namespace detail
return REG1 | (REG2 << 1); return REG1 | (REG2 << 1);
} }
template <> template<>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y) GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y)
{ {
glm::uint64 REG1(x); glm::uint64 REG1(x);
@@ -78,7 +78,7 @@ namespace detail
return REG1 | (REG2 << 1); return REG1 | (REG2 << 1);
} }
template <> template<>
GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z) GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z)
{ {
glm::uint32 REG1(x); glm::uint32 REG1(x);
@@ -104,7 +104,7 @@ namespace detail
return REG1 | (REG2 << 1) | (REG3 << 2); return REG1 | (REG2 << 1) | (REG3 << 2);
} }
template <> template<>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z) GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z)
{ {
glm::uint64 REG1(x); glm::uint64 REG1(x);
@@ -134,7 +134,7 @@ namespace detail
return REG1 | (REG2 << 1) | (REG3 << 2); return REG1 | (REG2 << 1) | (REG3 << 2);
} }
template <> template<>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z) GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint32 x, glm::uint32 y, glm::uint32 z)
{ {
glm::uint64 REG1(x); glm::uint64 REG1(x);
@@ -164,7 +164,7 @@ namespace detail
return REG1 | (REG2 << 1) | (REG3 << 2); return REG1 | (REG2 << 1) | (REG3 << 2);
} }
template <> template<>
GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w) GLM_FUNC_QUALIFIER glm::uint32 bitfieldInterleave(glm::uint8 x, glm::uint8 y, glm::uint8 z, glm::uint8 w)
{ {
glm::uint32 REG1(x); glm::uint32 REG1(x);
@@ -190,7 +190,7 @@ namespace detail
return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3); return REG1 | (REG2 << 1) | (REG3 << 2) | (REG4 << 3);
} }
template <> template<>
GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w) GLM_FUNC_QUALIFIER glm::uint64 bitfieldInterleave(glm::uint16 x, glm::uint16 y, glm::uint16 z, glm::uint16 w)
{ {
glm::uint64 REG1(x); glm::uint64 REG1(x);
@@ -222,7 +222,7 @@ namespace detail
} }
}//namespace detail }//namespace detail
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits) GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'mask' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'mask' accepts only integer values");
@@ -230,15 +230,15 @@ namespace detail
return Bits >= sizeof(genIUType) * 8 ? ~static_cast<genIUType>(0) : (static_cast<genIUType>(1) << Bits) - static_cast<genIUType>(1); return Bits >= sizeof(genIUType) * 8 ? ~static_cast<genIUType>(0) : (static_cast<genIUType>(1) << Bits) - static_cast<genIUType>(1);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecIUType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecIUType>
GLM_FUNC_QUALIFIER vecIUType<D, T, P> mask(vecIUType<D, T, P> const& v) GLM_FUNC_QUALIFIER vecIUType<L, T, P> mask(vecIUType<L, T, P> const& v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'mask' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'mask' accepts only integer values");
return detail::functor1<D, T, T, P>::call(mask, v); return detail::functor1<L, T, T, P>::call(mask, v);
} }
template <typename genIType> template<typename genIType>
GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift) GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateRight' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateRight' accepts only integer values");
@@ -247,8 +247,8 @@ namespace detail
return (In << static_cast<genIType>(Shift)) | (In >> static_cast<genIType>(BitSize - Shift)); return (In << static_cast<genIType>(Shift)) | (In >> static_cast<genIType>(BitSize - Shift));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> bitfieldRotateRight(vecType<D, T, P> const & In, int Shift) GLM_FUNC_QUALIFIER vecType<L, T, P> bitfieldRotateRight(vecType<L, T, P> const & In, int Shift)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values");
@@ -256,7 +256,7 @@ namespace detail
return (In << static_cast<T>(Shift)) | (In >> static_cast<T>(BitSize - Shift)); return (In << static_cast<T>(Shift)) | (In >> static_cast<T>(BitSize - Shift));
} }
template <typename genIType> template<typename genIType>
GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift) GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateLeft' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
@@ -265,8 +265,8 @@ namespace detail
return (In >> static_cast<genIType>(Shift)) | (In << static_cast<genIType>(BitSize - Shift)); return (In >> static_cast<genIType>(Shift)) | (In << static_cast<genIType>(BitSize - Shift));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> bitfieldRotateLeft(vecType<D, T, P> const& In, int Shift) GLM_FUNC_QUALIFIER vecType<L, T, P> bitfieldRotateLeft(vecType<L, T, P> const& In, int Shift)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateLeft' accepts only integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
@@ -274,26 +274,26 @@ namespace detail
return (In >> static_cast<T>(Shift)) | (In << static_cast<T>(BitSize - Shift)); return (In >> static_cast<T>(Shift)) | (In << static_cast<T>(BitSize - Shift));
} }
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount) GLM_FUNC_QUALIFIER genIUType bitfieldFillOne(genIUType Value, int FirstBit, int BitCount)
{ {
return Value | static_cast<genIUType>(mask(BitCount) << FirstBit); return Value | static_cast<genIUType>(mask(BitCount) << FirstBit);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> bitfieldFillOne(vecType<D, T, P> const& Value, int FirstBit, int BitCount) GLM_FUNC_QUALIFIER vecType<L, T, P> bitfieldFillOne(vecType<L, T, P> const& Value, int FirstBit, int BitCount)
{ {
return Value | static_cast<T>(mask(BitCount) << FirstBit); return Value | static_cast<T>(mask(BitCount) << FirstBit);
} }
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount) GLM_FUNC_QUALIFIER genIUType bitfieldFillZero(genIUType Value, int FirstBit, int BitCount)
{ {
return Value & static_cast<genIUType>(~(mask(BitCount) << FirstBit)); return Value & static_cast<genIUType>(~(mask(BitCount) << FirstBit));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> bitfieldFillZero(vecType<D, T, P> const& Value, int FirstBit, int BitCount) GLM_FUNC_QUALIFIER vecType<L, T, P> bitfieldFillZero(vecType<L, T, P> const& Value, int FirstBit, int BitCount)
{ {
return Value & static_cast<T>(~(mask(BitCount) << FirstBit)); return Value & static_cast<T>(~(mask(BitCount) << FirstBit));
} }

View File

@@ -32,23 +32,23 @@ namespace glm
/// Convert a linear color to sRGB color using a standard gamma correction. /// Convert a linear color to sRGB color using a standard gamma correction.
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> convertLinearToSRGB(vecType<D, T, P> const & ColorLinear); GLM_FUNC_DECL vecType<L, T, P> convertLinearToSRGB(vecType<L, T, P> const & ColorLinear);
/// Convert a linear color to sRGB color using a custom gamma correction. /// Convert a linear color to sRGB color using a custom gamma correction.
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> convertLinearToSRGB(vecType<D, T, P> const & ColorLinear, T Gamma); GLM_FUNC_DECL vecType<L, T, P> convertLinearToSRGB(vecType<L, T, P> const & ColorLinear, T Gamma);
/// Convert a sRGB color to linear color using a standard gamma correction. /// Convert a sRGB color to linear color using a standard gamma correction.
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb /// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> convertSRGBToLinear(vecType<D, T, P> const & ColorSRGB); GLM_FUNC_DECL vecType<L, T, P> convertSRGBToLinear(vecType<L, T, P> const & ColorSRGB);
/// Convert a sRGB color to linear color using a custom gamma correction. /// Convert a sRGB color to linear color using a custom gamma correction.
// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb // IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> convertSRGBToLinear(vecType<D, T, P> const & ColorSRGB, T Gamma); GLM_FUNC_DECL vecType<L, T, P> convertSRGBToLinear(vecType<L, T, P> const & ColorSRGB, T Gamma);
/// @} /// @}
} //namespace glm } //namespace glm

View File

@@ -4,21 +4,21 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
struct compute_rgbToSrgb struct compute_rgbToSrgb
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const& ColorRGB, T GammaCorrection) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const& ColorRGB, T GammaCorrection)
{ {
vecType<D, T, P> const ClampedColor(clamp(ColorRGB, static_cast<T>(0), static_cast<T>(1))); vecType<L, T, P> const ClampedColor(clamp(ColorRGB, static_cast<T>(0), static_cast<T>(1)));
return mix( return mix(
pow(ClampedColor, vecType<D, T, P>(GammaCorrection)) * static_cast<T>(1.055) - static_cast<T>(0.055), pow(ClampedColor, vecType<L, T, P>(GammaCorrection)) * static_cast<T>(1.055) - static_cast<T>(0.055),
ClampedColor * static_cast<T>(12.92), ClampedColor * static_cast<T>(12.92),
lessThan(ClampedColor, vecType<D, T, P>(static_cast<T>(0.0031308)))); lessThan(ClampedColor, vecType<L, T, P>(static_cast<T>(0.0031308))));
} }
}; };
template <typename T, precision P> template<typename T, precision P>
struct compute_rgbToSrgb<4, T, P, vec> struct compute_rgbToSrgb<4, T, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorRGB, T GammaCorrection) GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorRGB, T GammaCorrection)
@@ -27,19 +27,19 @@ namespace detail
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
struct compute_srgbToRgb struct compute_srgbToRgb
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const& ColorSRGB, T Gamma) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const& ColorSRGB, T Gamma)
{ {
return mix( return mix(
pow((ColorSRGB + static_cast<T>(0.055)) * static_cast<T>(0.94786729857819905213270142180095), vecType<D, T, P>(Gamma)), pow((ColorSRGB + static_cast<T>(0.055)) * static_cast<T>(0.94786729857819905213270142180095), vecType<L, T, P>(Gamma)),
ColorSRGB * static_cast<T>(0.07739938080495356037151702786378), ColorSRGB * static_cast<T>(0.07739938080495356037151702786378),
lessThanEqual(ColorSRGB, vecType<D, T, P>(static_cast<T>(0.04045)))); lessThanEqual(ColorSRGB, vecType<L, T, P>(static_cast<T>(0.04045))));
} }
}; };
template <typename T, precision P> template<typename T, precision P>
struct compute_srgbToRgb<4, T, P, vec> struct compute_srgbToRgb<4, T, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorSRGB, T Gamma) GLM_FUNC_QUALIFIER static vec<4, T, P> call(vec<4, T, P> const& ColorSRGB, T Gamma)
@@ -49,14 +49,14 @@ namespace detail
}; };
}//namespace detail }//namespace detail
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> convertLinearToSRGB(vecType<D, T, P> const& ColorLinear) GLM_FUNC_QUALIFIER vecType<L, T, P> convertLinearToSRGB(vecType<L, T, P> const& ColorLinear)
{ {
return detail::compute_rgbToSrgb<D, T, P, vecType>::call(ColorLinear, static_cast<T>(0.41666)); return detail::compute_rgbToSrgb<L, T, P, vecType>::call(ColorLinear, static_cast<T>(0.41666));
} }
// Based on Ian Taylor http://chilliant.blogspot.fr/2012/08/srgb-approximations-for-hlsl.html // Based on Ian Taylor http://chilliant.blogspot.fr/2012/08/srgb-approximations-for-hlsl.html
template <> template<>
GLM_FUNC_QUALIFIER vec<3, float, lowp> convertLinearToSRGB(vec<3, float, lowp> const& ColorLinear) GLM_FUNC_QUALIFIER vec<3, float, lowp> convertLinearToSRGB(vec<3, float, lowp> const& ColorLinear)
{ {
vec<3, float, lowp> S1 = sqrt(ColorLinear); vec<3, float, lowp> S1 = sqrt(ColorLinear);
@@ -65,21 +65,21 @@ namespace detail
return 0.662002687f * S1 + 0.684122060f * S2 - 0.323583601f * S3 - 0.0225411470f * ColorLinear; return 0.662002687f * S1 + 0.684122060f * S2 - 0.323583601f * S3 - 0.0225411470f * ColorLinear;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> convertLinearToSRGB(vecType<D, T, P> const& ColorLinear, T Gamma) GLM_FUNC_QUALIFIER vecType<L, T, P> convertLinearToSRGB(vecType<L, T, P> const& ColorLinear, T Gamma)
{ {
return detail::compute_rgbToSrgb<D, T, P, vecType>::call(ColorLinear, static_cast<T>(1) / Gamma); return detail::compute_rgbToSrgb<L, T, P, vecType>::call(ColorLinear, static_cast<T>(1) / Gamma);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> convertSRGBToLinear(vecType<D, T, P> const& ColorSRGB) GLM_FUNC_QUALIFIER vecType<L, T, P> convertSRGBToLinear(vecType<L, T, P> const& ColorSRGB)
{ {
return detail::compute_srgbToRgb<D, T, P, vecType>::call(ColorSRGB, static_cast<T>(2.4)); return detail::compute_srgbToRgb<L, T, P, vecType>::call(ColorSRGB, static_cast<T>(2.4));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> convertSRGBToLinear(vecType<D, T, P> const& ColorSRGB, T Gamma) GLM_FUNC_QUALIFIER vecType<L, T, P> convertSRGBToLinear(vecType<L, T, P> const& ColorSRGB, T Gamma)
{ {
return detail::compute_srgbToRgb<D, T, P, vecType>::call(ColorSRGB, Gamma); return detail::compute_srgbToRgb<L, T, P, vecType>::call(ColorSRGB, Gamma);
} }
}//namespace glm }//namespace glm

View File

@@ -26,147 +26,147 @@ namespace glm
/// Return the epsilon constant for floating point types. /// Return the epsilon constant for floating point types.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon(); GLM_FUNC_DECL GLM_CONSTEXPR genType epsilon();
/// Return 0. /// Return 0.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType zero(); GLM_FUNC_DECL GLM_CONSTEXPR genType zero();
/// Return 1. /// Return 1.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType one(); GLM_FUNC_DECL GLM_CONSTEXPR genType one();
/// Return the pi constant. /// Return the pi constant.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType pi();
/// Return pi * 2. /// Return pi * 2.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType two_pi();
/// Return square root of pi. /// Return square root of pi.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_pi();
/// Return pi / 2. /// Return pi / 2.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType half_pi();
/// Return pi / 2 * 3. /// Return pi / 2 * 3.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType three_over_two_pi();
/// Return pi / 4. /// Return pi / 4.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType quarter_pi();
/// Return 1 / pi. /// Return 1 / pi.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_pi();
/// Return 1 / (pi * 2). /// Return 1 / (pi * 2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_two_pi();
/// Return 2 / pi. /// Return 2 / pi.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_pi();
/// Return 4 / pi. /// Return 4 / pi.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType four_over_pi();
/// Return 2 / sqrt(pi). /// Return 2 / sqrt(pi).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType two_over_root_pi();
/// Return 1 / sqrt(2). /// Return 1 / sqrt(2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two(); GLM_FUNC_DECL GLM_CONSTEXPR genType one_over_root_two();
/// Return sqrt(pi / 2). /// Return sqrt(pi / 2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_half_pi();
/// Return sqrt(2 * pi). /// Return sqrt(2 * pi).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_two_pi();
/// Return sqrt(ln(4)). /// Return sqrt(ln(4)).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_ln_four();
/// Return e constant. /// Return e constant.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType e(); GLM_FUNC_DECL GLM_CONSTEXPR genType e();
/// Return Euler's constant. /// Return Euler's constant.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType euler(); GLM_FUNC_DECL GLM_CONSTEXPR genType euler();
/// Return sqrt(2). /// Return sqrt(2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_two(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_two();
/// Return sqrt(3). /// Return sqrt(3).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_three(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_three();
/// Return sqrt(5). /// Return sqrt(5).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType root_five(); GLM_FUNC_DECL GLM_CONSTEXPR genType root_five();
/// Return ln(2). /// Return ln(2).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two(); GLM_FUNC_DECL GLM_CONSTEXPR genType ln_two();
/// Return ln(10). /// Return ln(10).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten(); GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ten();
/// Return ln(ln(2)). /// Return ln(ln(2)).
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two(); GLM_FUNC_DECL GLM_CONSTEXPR genType ln_ln_two();
/// Return 1 / 3. /// Return 1 / 3.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType third(); GLM_FUNC_DECL GLM_CONSTEXPR genType third();
/// Return 2 / 3. /// Return 2 / 3.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds(); GLM_FUNC_DECL GLM_CONSTEXPR genType two_thirds();
/// Return the golden ratio constant. /// Return the golden ratio constant.
/// @see gtc_constants /// @see gtc_constants
template <typename genType> template<typename genType>
GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio(); GLM_FUNC_DECL GLM_CONSTEXPR genType golden_ratio();
/// @} /// @}

View File

@@ -5,175 +5,175 @@
namespace glm namespace glm
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon()
{ {
return std::numeric_limits<genType>::epsilon(); return std::numeric_limits<genType>::epsilon();
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType zero() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType zero()
{ {
return genType(0); return genType(0);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one()
{ {
return genType(1); return genType(1);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi()
{ {
return genType(3.14159265358979323846264338327950288); return genType(3.14159265358979323846264338327950288);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_pi()
{ {
return genType(6.28318530717958647692528676655900576); return genType(6.28318530717958647692528676655900576);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_pi()
{ {
return genType(1.772453850905516027); return genType(1.772453850905516027);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType half_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType half_pi()
{ {
return genType(1.57079632679489661923132169163975144); return genType(1.57079632679489661923132169163975144);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType three_over_two_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType three_over_two_pi()
{ {
return genType(4.71238898038468985769396507491925432); return genType(4.71238898038468985769396507491925432);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType quarter_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType quarter_pi()
{ {
return genType(0.785398163397448309615660845819875721); return genType(0.785398163397448309615660845819875721);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_pi()
{ {
return genType(0.318309886183790671537767526745028724); return genType(0.318309886183790671537767526745028724);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_two_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_two_pi()
{ {
return genType(0.159154943091895335768883763372514362); return genType(0.159154943091895335768883763372514362);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_pi()
{ {
return genType(0.636619772367581343075535053490057448); return genType(0.636619772367581343075535053490057448);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType four_over_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType four_over_pi()
{ {
return genType(1.273239544735162686151070106980114898); return genType(1.273239544735162686151070106980114898);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_root_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_over_root_pi()
{ {
return genType(1.12837916709551257389615890312154517); return genType(1.12837916709551257389615890312154517);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_root_two() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType one_over_root_two()
{ {
return genType(0.707106781186547524400844362104849039); return genType(0.707106781186547524400844362104849039);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_half_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_half_pi()
{ {
return genType(1.253314137315500251); return genType(1.253314137315500251);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two_pi() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two_pi()
{ {
return genType(2.506628274631000502); return genType(2.506628274631000502);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_ln_four() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_ln_four()
{ {
return genType(1.17741002251547469); return genType(1.17741002251547469);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType e() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType e()
{ {
return genType(2.71828182845904523536); return genType(2.71828182845904523536);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType euler() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType euler()
{ {
return genType(0.577215664901532860606); return genType(0.577215664901532860606);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_two()
{ {
return genType(1.41421356237309504880168872420969808); return genType(1.41421356237309504880168872420969808);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_three() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_three()
{ {
return genType(1.73205080756887729352744634150587236); return genType(1.73205080756887729352744634150587236);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_five() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType root_five()
{ {
return genType(2.23606797749978969640917366873127623); return genType(2.23606797749978969640917366873127623);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_two() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_two()
{ {
return genType(0.693147180559945309417232121458176568); return genType(0.693147180559945309417232121458176568);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ten() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ten()
{ {
return genType(2.30258509299404568401799145468436421); return genType(2.30258509299404568401799145468436421);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ln_two() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType ln_ln_two()
{ {
return genType(-0.3665129205816643); return genType(-0.3665129205816643);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType third() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType third()
{ {
return genType(0.3333333333333333333333333333333333333333); return genType(0.3333333333333333333333333333333333333333);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_thirds() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType two_thirds()
{ {
return genType(0.666666666666666666666666666666666666667); return genType(0.666666666666666666666666666666666666667);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType golden_ratio() GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType golden_ratio()
{ {
return genType(1.61803398874989484820458683436563811); return genType(1.61803398874989484820458683436563811);

View File

@@ -30,17 +30,17 @@ namespace glm
/// True if this expression is satisfied. /// True if this expression is satisfied.
/// ///
/// @see gtc_epsilon /// @see gtc_epsilon
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> epsilonEqual( GLM_FUNC_DECL vecType<L, bool, P> epsilonEqual(
vecType<D, T, P> const & x, vecType<L, T, P> const& x,
vecType<D, T, P> const & y, vecType<L, T, P> const& y,
T const & epsilon); T const & epsilon);
/// Returns the component-wise comparison of |x - y| < epsilon. /// Returns the component-wise comparison of |x - y| < epsilon.
/// True if this expression is satisfied. /// True if this expression is satisfied.
/// ///
/// @see gtc_epsilon /// @see gtc_epsilon
template <typename genType> template<typename genType>
GLM_FUNC_DECL bool epsilonEqual( GLM_FUNC_DECL bool epsilonEqual(
genType const & x, genType const & x,
genType const & y, genType const & y,
@@ -50,7 +50,7 @@ namespace glm
/// True if this expression is not satisfied. /// True if this expression is not satisfied.
/// ///
/// @see gtc_epsilon /// @see gtc_epsilon
template <typename genType> template<typename genType>
GLM_FUNC_DECL typename genType::boolType epsilonNotEqual( GLM_FUNC_DECL typename genType::boolType epsilonNotEqual(
genType const & x, genType const & x,
genType const & y, genType const & y,
@@ -60,7 +60,7 @@ namespace glm
/// True if this expression is not satisfied. /// True if this expression is not satisfied.
/// ///
/// @see gtc_epsilon /// @see gtc_epsilon
template <typename genType> template<typename genType>
GLM_FUNC_DECL bool epsilonNotEqual( GLM_FUNC_DECL bool epsilonNotEqual(
genType const & x, genType const & x,
genType const & y, genType const & y,

View File

@@ -11,7 +11,7 @@
namespace glm namespace glm
{ {
template <> template<>
GLM_FUNC_QUALIFIER bool epsilonEqual GLM_FUNC_QUALIFIER bool epsilonEqual
( (
float const & x, float const & x,
@@ -22,7 +22,7 @@ namespace glm
return abs(x - y) < epsilon; return abs(x - y) < epsilon;
} }
template <> template<>
GLM_FUNC_QUALIFIER bool epsilonEqual GLM_FUNC_QUALIFIER bool epsilonEqual
( (
double const & x, double const & x,
@@ -33,7 +33,7 @@ namespace glm
return abs(x - y) < epsilon; return abs(x - y) < epsilon;
} }
template <> template<>
GLM_FUNC_QUALIFIER bool epsilonNotEqual GLM_FUNC_QUALIFIER bool epsilonNotEqual
( (
float const & x, float const & x,
@@ -44,7 +44,7 @@ namespace glm
return abs(x - y) >= epsilon; return abs(x - y) >= epsilon;
} }
template <> template<>
GLM_FUNC_QUALIFIER bool epsilonNotEqual GLM_FUNC_QUALIFIER bool epsilonNotEqual
( (
double const & x, double const & x,
@@ -55,51 +55,51 @@ namespace glm
return abs(x - y) >= epsilon; return abs(x - y) >= epsilon;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> epsilonEqual GLM_FUNC_QUALIFIER vecType<L, bool, P> epsilonEqual
( (
vecType<D, T, P> const & x, vecType<L, T, P> const& x,
vecType<D, T, P> const & y, vecType<L, T, P> const& y,
T const & epsilon T const & epsilon
) )
{ {
return lessThan(abs(x - y), vecType<D, T, P>(epsilon)); return lessThan(abs(x - y), vecType<L, T, P>(epsilon));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> epsilonEqual GLM_FUNC_QUALIFIER vecType<L, bool, P> epsilonEqual
( (
vecType<D, T, P> const & x, vecType<L, T, P> const& x,
vecType<D, T, P> const & y, vecType<L, T, P> const& y,
vecType<D, T, P> const & epsilon vecType<L, T, P> const& epsilon
) )
{ {
return lessThan(abs(x - y), vecType<D, T, P>(epsilon)); return lessThan(abs(x - y), vecType<L, T, P>(epsilon));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> epsilonNotEqual GLM_FUNC_QUALIFIER vecType<L, bool, P> epsilonNotEqual
( (
vecType<D, T, P> const & x, vecType<L, T, P> const& x,
vecType<D, T, P> const & y, vecType<L, T, P> const& y,
T const & epsilon T const & epsilon
) )
{ {
return greaterThanEqual(abs(x - y), vecType<D, T, P>(epsilon)); return greaterThanEqual(abs(x - y), vecType<L, T, P>(epsilon));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> epsilonNotEqual GLM_FUNC_QUALIFIER vecType<L, bool, P> epsilonNotEqual
( (
vecType<D, T, P> const & x, vecType<L, T, P> const& x,
vecType<D, T, P> const & y, vecType<L, T, P> const& y,
vecType<D, T, P> const & epsilon vecType<L, T, P> const& epsilon
) )
{ {
return greaterThanEqual(abs(x - y), vecType<D, T, P>(epsilon)); return greaterThanEqual(abs(x - y), vecType<L, T, P>(epsilon));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonEqual GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonEqual
( (
tquat<T, P> const & x, tquat<T, P> const & x,
@@ -111,7 +111,7 @@ namespace glm
return lessThan(abs(v), vec<4, T, P>(epsilon)); return lessThan(abs(v), vec<4, T, P>(epsilon));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonNotEqual GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonNotEqual
( (
tquat<T, P> const & x, tquat<T, P> const & x,

View File

@@ -30,7 +30,7 @@ namespace glm
/// 1D gauss function /// 1D gauss function
/// ///
/// @see gtc_epsilon /// @see gtc_epsilon
template <typename T> template<typename T>
GLM_FUNC_DECL T gauss( GLM_FUNC_DECL T gauss(
T x, T x,
T ExpectedValue, T ExpectedValue,
@@ -39,7 +39,7 @@ namespace glm
/// 2D gauss function /// 2D gauss function
/// ///
/// @see gtc_epsilon /// @see gtc_epsilon
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL T gauss( GLM_FUNC_DECL T gauss(
vec<2, T, P> const& Coord, vec<2, T, P> const& Coord,
vec<2, T, P> const& ExpectedValue, vec<2, T, P> const& ExpectedValue,

View File

@@ -5,7 +5,7 @@
namespace glm namespace glm
{ {
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER T gauss GLM_FUNC_QUALIFIER T gauss
( (
T x, T x,
@@ -16,7 +16,7 @@ namespace glm
return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast<T>(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast<T>(6.28318530717958647692528676655900576))); return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast<T>(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast<T>(6.28318530717958647692528676655900576)));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T gauss GLM_FUNC_QUALIFIER T gauss
( (
vec<2, T, P> const& Coord, vec<2, T, P> const& Coord,

View File

@@ -32,7 +32,7 @@ namespace glm
/// Returns the log2 of x for integer values. Can be reliably using to compute mipmap count from the texture size. /// Returns the log2 of x for integer values. Can be reliably using to compute mipmap count from the texture size.
/// @see gtc_integer /// @see gtc_integer
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType log2(genIUType x); GLM_FUNC_DECL genIUType log2(genIUType x);
/// Modulus. Returns x % y /// Modulus. Returns x % y
@@ -43,7 +43,7 @@ namespace glm
/// @see gtc_integer /// @see gtc_integer
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType mod(genIUType x, genIUType y); GLM_FUNC_DECL genIUType mod(genIUType x, genIUType y);
/// Modulus. Returns x % y /// Modulus. Returns x % y
@@ -55,8 +55,8 @@ namespace glm
/// @see gtc_integer /// @see gtc_integer
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> mod(vecType<D, T, P> const & x, T y); GLM_FUNC_DECL vecType<L, T, P> mod(vecType<L, T, P> const & x, T y);
/// Modulus. Returns x % y /// Modulus. Returns x % y
/// for each component in x using the floating point value y. /// for each component in x using the floating point value y.
@@ -67,8 +67,8 @@ namespace glm
/// @see gtc_integer /// @see gtc_integer
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> mod(vecType<D, T, P> const & x, vecType<D, T, P> const & y); GLM_FUNC_DECL vecType<L, T, P> mod(vecType<L, T, P> const & x, vecType<L, T, P> const & y);
/// Returns a value equal to the nearest integer to x. /// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the /// The fraction 0.5 will round in a direction chosen by the
@@ -80,8 +80,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see gtc_integer /// @see gtc_integer
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, int, P> iround(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, int, P> iround(vecType<L, T, P> const & x);
/// Returns a value equal to the nearest integer to x. /// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the /// The fraction 0.5 will round in a direction chosen by the
@@ -93,8 +93,8 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see gtc_integer /// @see gtc_integer
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, uint, P> uround(vecType<D, T, P> const & x); GLM_FUNC_DECL vecType<L, uint, P> uround(vecType<L, T, P> const & x);
/// @} /// @}
} //namespace glm } //namespace glm

View File

@@ -4,19 +4,19 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
struct compute_log2<D, T, P, vecType, false, Aligned> struct compute_log2<L, T, P, vecType, false, Aligned>
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & vec) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const& v)
{ {
//Equivalent to return findMSB(vec); but save one function call in ASM with VC //Equivalent to return findMSB(vec); but save one function call in ASM with VC
//return findMSB(vec); //return findMSB(vec);
return vecType<D, T, P>(detail::compute_findMSB_vec<D, T, P, vecType, sizeof(T) * 8>::call(vec)); return vecType<L, T, P>(detail::compute_findMSB_vec<L, T, P, vecType, sizeof(T) * 8>::call(v));
} }
}; };
# if GLM_HAS_BITSCAN_WINDOWS # if GLM_HAS_BITSCAN_WINDOWS
template <precision P, bool Aligned> template<precision P, bool Aligned>
struct compute_log2<4, int, P, vec, false, Aligned> struct compute_log2<4, int, P, vec, false, Aligned>
{ {
GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const& v) GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const& v)
@@ -33,7 +33,7 @@ namespace detail
}; };
# endif//GLM_HAS_BITSCAN_WINDOWS # endif//GLM_HAS_BITSCAN_WINDOWS
}//namespace detail }//namespace detail
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER int iround(genType x) GLM_FUNC_QUALIFIER int iround(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'iround' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'iround' only accept floating-point inputs");
@@ -42,16 +42,16 @@ namespace detail
return static_cast<int>(x + static_cast<genType>(0.5)); return static_cast<int>(x + static_cast<genType>(0.5));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<glm::length_t L, typename T, precision P, template<glm::length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, int, P> iround(vecType<D, T, P> const& x) GLM_FUNC_QUALIFIER vecType<L, int, P> iround(vecType<L, T, P> const& x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'iround' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'iround' only accept floating-point inputs");
assert(all(lessThanEqual(vecType<D, T, P>(0), x))); assert(all(lessThanEqual(vecType<L, T, P>(0), x)));
return vecType<D, int, P>(x + static_cast<T>(0.5)); return vecType<L, int, P>(x + static_cast<T>(0.5));
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER uint uround(genType x) GLM_FUNC_QUALIFIER uint uround(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'uround' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'uround' only accept floating-point inputs");
@@ -60,12 +60,12 @@ namespace detail
return static_cast<uint>(x + static_cast<genType>(0.5)); return static_cast<uint>(x + static_cast<genType>(0.5));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<glm::length_t L, typename T, precision P, template<glm::length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, uint, P> uround(vecType<D, T, P> const& x) GLM_FUNC_QUALIFIER vecType<L, uint, P> uround(vecType<L, T, P> const& x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'uround' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'uround' only accept floating-point inputs");
assert(all(lessThanEqual(vecType<D, T, P>(0), x))); assert(all(lessThanEqual(vecType<L, T, P>(0), x)));
return vecType<D, uint, P>(x + static_cast<T>(0.5)); return vecType<L, uint, P>(x + static_cast<T>(0.5));
} }
}//namespace glm }//namespace glm

View File

@@ -25,14 +25,14 @@ namespace glm
/// Get a specific row of a matrix. /// Get a specific row of a matrix.
/// @see gtc_matrix_access /// @see gtc_matrix_access
template <typename genType> template<typename genType>
GLM_FUNC_DECL typename genType::row_type row( GLM_FUNC_DECL typename genType::row_type row(
genType const & m, genType const & m,
length_t index); length_t index);
/// Set a specific row to a matrix. /// Set a specific row to a matrix.
/// @see gtc_matrix_access /// @see gtc_matrix_access
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType row( GLM_FUNC_DECL genType row(
genType const & m, genType const & m,
length_t index, length_t index,
@@ -40,14 +40,14 @@ namespace glm
/// Get a specific column of a matrix. /// Get a specific column of a matrix.
/// @see gtc_matrix_access /// @see gtc_matrix_access
template <typename genType> template<typename genType>
GLM_FUNC_DECL typename genType::col_type column( GLM_FUNC_DECL typename genType::col_type column(
genType const & m, genType const & m,
length_t index); length_t index);
/// Set a specific column to a matrix. /// Set a specific column to a matrix.
/// @see gtc_matrix_access /// @see gtc_matrix_access
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType column( GLM_FUNC_DECL genType column(
genType const & m, genType const & m,
length_t index, length_t index,

View File

@@ -3,7 +3,7 @@
namespace glm namespace glm
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType row GLM_FUNC_QUALIFIER genType row
( (
genType const & m, genType const & m,
@@ -19,7 +19,7 @@ namespace glm
return Result; return Result;
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER typename genType::row_type row GLM_FUNC_QUALIFIER typename genType::row_type row
( (
genType const & m, genType const & m,
@@ -34,7 +34,7 @@ namespace glm
return Result; return Result;
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType column GLM_FUNC_QUALIFIER genType column
( (
genType const & m, genType const & m,
@@ -49,7 +49,7 @@ namespace glm
return Result; return Result;
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER typename genType::col_type column GLM_FUNC_QUALIFIER typename genType::col_type column
( (
genType const & m, genType const & m,

View File

@@ -32,7 +32,7 @@ namespace glm
/// @param m Input matrix to invert. /// @param m Input matrix to invert.
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate.
/// @see gtc_matrix_inverse /// @see gtc_matrix_inverse
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType affineInverse(genType const & m); GLM_FUNC_DECL genType affineInverse(genType const & m);
/// Compute the inverse transpose of a matrix. /// Compute the inverse transpose of a matrix.
@@ -40,7 +40,7 @@ namespace glm
/// @param m Input matrix to invert transpose. /// @param m Input matrix to invert transpose.
/// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate. /// @tparam genType Squared floating-point matrix: half, float or double. Inverse of matrix based of half-precision floating point value is highly innacurate.
/// @see gtc_matrix_inverse /// @see gtc_matrix_inverse
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType inverseTranspose(genType const & m); GLM_FUNC_DECL genType inverseTranspose(genType const & m);
/// @} /// @}

View File

@@ -3,7 +3,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> affineInverse(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> affineInverse(mat<3, 3, T, P> const & m)
{ {
mat<2, 2, T, P> const Inv(inverse(mat<2, 2, T, P>(m))); mat<2, 2, T, P> const Inv(inverse(mat<2, 2, T, P>(m)));
@@ -14,7 +14,7 @@ namespace glm
vec<3, T, P>(-Inv * vec<2, T, P>(m[2]), static_cast<T>(1))); vec<3, T, P>(-Inv * vec<2, T, P>(m[2]), static_cast<T>(1)));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> affineInverse(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> affineInverse(mat<4, 4, T, P> const & m)
{ {
mat<3, 3, T, P> const Inv(inverse(mat<3, 3, T, P>(m))); mat<3, 3, T, P> const Inv(inverse(mat<3, 3, T, P>(m)));
@@ -26,7 +26,7 @@ namespace glm
vec<4, T, P>(-Inv * vec<3, T, P>(m[3]), static_cast<T>(1))); vec<4, T, P>(-Inv * vec<3, T, P>(m[3]), static_cast<T>(1)));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> inverseTranspose(mat<2, 2, T, P> const & m) GLM_FUNC_QUALIFIER mat<2, 2, T, P> inverseTranspose(mat<2, 2, T, P> const & m)
{ {
T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
@@ -40,7 +40,7 @@ namespace glm
return Inverse; return Inverse;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> inverseTranspose(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER mat<3, 3, T, P> inverseTranspose(mat<3, 3, T, P> const & m)
{ {
T Determinant = T Determinant =
@@ -63,7 +63,7 @@ namespace glm
return Inverse; return Inverse;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> inverseTranspose(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER mat<4, 4, T, P> inverseTranspose(mat<4, 4, T, P> const & m)
{ {
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];

View File

@@ -54,7 +54,7 @@ namespace glm
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - translate(mat<4, 4, T, P> const & m, T x, T y, T z) /// @see - translate(mat<4, 4, T, P> const & m, T x, T y, T z)
/// @see - translate(vec<3, T, P> const & v) /// @see - translate(vec<3, T, P> const & v)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> translate( GLM_FUNC_DECL mat<4, 4, T, P> translate(
mat<4, 4, T, P> const& m, mat<4, 4, T, P> const& m,
vec<3, T, P> const & v); vec<3, T, P> const & v);
@@ -68,7 +68,7 @@ namespace glm
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - rotate(mat<4, 4, T, P> const & m, T angle, T x, T y, T z) /// @see - rotate(mat<4, 4, T, P> const & m, T angle, T x, T y, T z)
/// @see - rotate(T angle, vec<3, T, P> const & v) /// @see - rotate(T angle, vec<3, T, P> const & v)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> rotate( GLM_FUNC_DECL mat<4, 4, T, P> rotate(
mat<4, 4, T, P> const& m, mat<4, 4, T, P> const& m,
T angle, T angle,
@@ -82,7 +82,7 @@ namespace glm
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - scale(mat<4, 4, T, P> const & m, T x, T y, T z) /// @see - scale(mat<4, 4, T, P> const & m, T x, T y, T z)
/// @see - scale(vec<3, T, P> const & v) /// @see - scale(vec<3, T, P> const & v)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> scale( GLM_FUNC_DECL mat<4, 4, T, P> scale(
mat<4, 4, T, P> const& m, mat<4, 4, T, P> const& m,
vec<3, T, P> const & v); vec<3, T, P> const & v);
@@ -98,7 +98,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top) /// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
T left, T left,
T right, T right,
@@ -118,7 +118,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top) /// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH( GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH(
T left, T left,
T right, T right,
@@ -138,7 +138,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top) /// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH( GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH(
T left, T left,
T right, T right,
@@ -156,7 +156,7 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar) /// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar)
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho( GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
T left, T left,
T right, T right,
@@ -173,7 +173,7 @@ namespace glm
/// @param far /// @param far
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum( GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum(
T left, T left,
T right, T right,
@@ -192,7 +192,7 @@ namespace glm
/// @param far /// @param far
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH( GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH(
T left, T left,
T right, T right,
@@ -211,7 +211,7 @@ namespace glm
/// @param far /// @param far
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH( GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH(
T left, T left,
T right, T right,
@@ -228,7 +228,7 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive). /// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective( GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective(
T fovy, T fovy,
T aspect, T aspect,
@@ -243,7 +243,7 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive). /// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH( GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH(
T fovy, T fovy,
T aspect, T aspect,
@@ -258,7 +258,7 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive). /// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH( GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH(
T fovy, T fovy,
T aspect, T aspect,
@@ -274,7 +274,7 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive). /// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFov( GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFov(
T fov, T fov,
T width, T width,
@@ -291,7 +291,7 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive). /// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH( GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH(
T fov, T fov,
T width, T width,
@@ -308,7 +308,7 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive). /// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH( GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH(
T fov, T fov,
T width, T width,
@@ -323,7 +323,7 @@ namespace glm
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive). /// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspective( GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspective(
T fovy, T aspect, T near); T fovy, T aspect, T near);
@@ -334,7 +334,7 @@ namespace glm
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive). /// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH( GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH(
T fovy, T aspect, T near); T fovy, T aspect, T near);
@@ -345,7 +345,7 @@ namespace glm
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive). /// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH( GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH(
T fovy, T aspect, T near); T fovy, T aspect, T near);
@@ -356,7 +356,7 @@ namespace glm
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive). /// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective(
T fovy, T aspect, T near); T fovy, T aspect, T near);
@@ -368,7 +368,7 @@ namespace glm
/// @param ep /// @param ep
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double. /// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T> template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective( GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective(
T fovy, T aspect, T near, T ep); T fovy, T aspect, T near, T ep);
@@ -382,7 +382,7 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types. /// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T, typename U, precision P> template<typename T, typename U, precision P>
GLM_FUNC_DECL vec<3, T, P> project( GLM_FUNC_DECL vec<3, T, P> project(
vec<3, T, P> const & obj, vec<3, T, P> const & obj,
mat<4, 4, T, P> const& model, mat<4, 4, T, P> const& model,
@@ -399,7 +399,7 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types. /// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T, typename U, precision P> template<typename T, typename U, precision P>
GLM_FUNC_DECL vec<3, T, P> unProject( GLM_FUNC_DECL vec<3, T, P> unProject(
vec<3, T, P> const & win, vec<3, T, P> const & win,
mat<4, 4, T, P> const& model, mat<4, 4, T, P> const& model,
@@ -414,7 +414,7 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double. /// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types. /// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
template <typename T, precision P, typename U> template<typename T, precision P, typename U>
GLM_FUNC_DECL mat<4, 4, T, P> pickMatrix( GLM_FUNC_DECL mat<4, 4, T, P> pickMatrix(
vec<2, T, P> const & center, vec<2, T, P> const & center,
vec<2, T, P> const & delta, vec<2, T, P> const & delta,
@@ -427,7 +427,7 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) /// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> lookAt( GLM_FUNC_DECL mat<4, 4, T, P> lookAt(
vec<3, T, P> const & eye, vec<3, T, P> const & eye,
vec<3, T, P> const & center, vec<3, T, P> const & center,
@@ -440,7 +440,7 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) /// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> lookAtRH( GLM_FUNC_DECL mat<4, 4, T, P> lookAtRH(
vec<3, T, P> const & eye, vec<3, T, P> const & eye,
vec<3, T, P> const & center, vec<3, T, P> const & center,
@@ -453,7 +453,7 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1) /// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @see gtc_matrix_transform /// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) /// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> lookAtLH( GLM_FUNC_DECL mat<4, 4, T, P> lookAtLH(
vec<3, T, P> const & eye, vec<3, T, P> const & eye,
vec<3, T, P> const & center, vec<3, T, P> const & center,

View File

@@ -7,7 +7,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(mat<4, 4, T, P> const & m, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
{ {
mat<4, 4, T, P> Result(m); mat<4, 4, T, P> Result(m);
@@ -15,7 +15,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v)
{ {
T const a = angle; T const a = angle;
@@ -46,7 +46,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate_slow(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate_slow(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v)
{ {
T const a = angle; T const a = angle;
@@ -75,7 +75,7 @@ namespace glm
return m * Result; return m * Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(mat<4, 4, T, P> const & m, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
{ {
mat<4, 4, T, P> Result(uninitialize); mat<4, 4, T, P> Result(uninitialize);
@@ -86,7 +86,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale_slow(mat<4, 4, T, P> const & m, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale_slow(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
{ {
mat<4, 4, T, P> Result(T(1)); mat<4, 4, T, P> Result(T(1));
@@ -96,7 +96,7 @@ namespace glm
return m * Result; return m * Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho
( (
T left, T right, T left, T right,
@@ -111,7 +111,7 @@ namespace glm
# endif # endif
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH
( (
T left, T right, T left, T right,
@@ -136,7 +136,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH
( (
T left, T right, T left, T right,
@@ -161,7 +161,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho
( (
T left, T right, T left, T right,
@@ -177,7 +177,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum
( (
T left, T right, T left, T right,
@@ -192,7 +192,7 @@ namespace glm
# endif # endif
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH
( (
T left, T right, T left, T right,
@@ -218,7 +218,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH
( (
T left, T right, T left, T right,
@@ -244,7 +244,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar)
{ {
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED # if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
@@ -254,7 +254,7 @@ namespace glm
# endif # endif
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar)
{ {
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0)); assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
@@ -277,7 +277,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar)
{ {
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0)); assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
@@ -300,7 +300,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar)
{ {
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED # if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
@@ -310,7 +310,7 @@ namespace glm
# endif # endif
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar)
{ {
assert(width > static_cast<T>(0)); assert(width > static_cast<T>(0));
@@ -337,7 +337,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar)
{ {
assert(width > static_cast<T>(0)); assert(width > static_cast<T>(0));
@@ -364,7 +364,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear)
{ {
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED # if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
@@ -374,7 +374,7 @@ namespace glm
# endif # endif
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear)
{ {
T const range = tan(fovy / static_cast<T>(2)) * zNear; T const range = tan(fovy / static_cast<T>(2)) * zNear;
@@ -392,7 +392,7 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear)
{ {
T const range = tan(fovy / static_cast<T>(2)) * zNear; T const range = tan(fovy / static_cast<T>(2)) * zNear;
@@ -411,7 +411,7 @@ namespace glm
} }
// Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf // Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep)
{ {
T const range = tan(fovy / static_cast<T>(2)) * zNear; T const range = tan(fovy / static_cast<T>(2)) * zNear;
@@ -429,13 +429,13 @@ namespace glm
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear)
{ {
return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon<T>()); return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon<T>());
} }
template <typename T, typename U, precision P> template<typename T, typename U, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> project GLM_FUNC_QUALIFIER vec<3, T, P> project
( (
vec<3, T, P> const & obj, vec<3, T, P> const & obj,
@@ -461,7 +461,7 @@ namespace glm
return vec<3, T, P>(tmp); return vec<3, T, P>(tmp);
} }
template <typename T, typename U, precision P> template<typename T, typename U, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> unProject GLM_FUNC_QUALIFIER vec<3, T, P> unProject
( (
vec<3, T, P> const & win, vec<3, T, P> const & win,
@@ -488,7 +488,7 @@ namespace glm
return vec<3, T, P>(obj); return vec<3, T, P>(obj);
} }
template <typename T, precision P, typename U> template<typename T, precision P, typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> pickMatrix(vec<2, T, P> const & center, vec<2, T, P> const & delta, vec<4, U, P> const & viewport) GLM_FUNC_QUALIFIER mat<4, 4, T, P> pickMatrix(vec<2, T, P> const & center, vec<2, T, P> const & delta, vec<4, U, P> const & viewport)
{ {
assert(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0)); assert(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0));
@@ -507,7 +507,7 @@ namespace glm
return scale(Result, vec<3, T, P>(static_cast<T>(viewport[2]) / delta.x, static_cast<T>(viewport[3]) / delta.y, static_cast<T>(1))); return scale(Result, vec<3, T, P>(static_cast<T>(viewport[2]) / delta.x, static_cast<T>(viewport[3]) / delta.y, static_cast<T>(1)));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAt(vec<3, T, P> const & eye, vec<3, T, P> const & center, vec<3, T, P> const & up) GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAt(vec<3, T, P> const & eye, vec<3, T, P> const & center, vec<3, T, P> const & up)
{ {
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED # if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
@@ -517,7 +517,7 @@ namespace glm
# endif # endif
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtRH GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtRH
( (
vec<3, T, P> const & eye, vec<3, T, P> const & eye,
@@ -545,7 +545,7 @@ namespace glm
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtLH GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtLH
( (
vec<3, T, P> const & eye, vec<3, T, P> const & eye,

View File

@@ -37,22 +37,22 @@ namespace glm
/// Classic perlin noise. /// Classic perlin noise.
/// @see gtc_noise /// @see gtc_noise
template <int D, typename T, precision P, template<int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL T perlin( GLM_FUNC_DECL T perlin(
vecType<D, T, P> const & p); vecType<L, T, P> const& p);
/// Periodic perlin noise. /// Periodic perlin noise.
/// @see gtc_noise /// @see gtc_noise
template <int D, typename T, precision P, template<int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL T perlin( GLM_FUNC_DECL T perlin(
vecType<D, T, P> const & p, vecType<L, T, P> const& p,
vecType<D, T, P> const & rep); vecType<L, T, P> const& rep);
/// Simplex noise. /// Simplex noise.
/// @see gtc_noise /// @see gtc_noise
template <int D, typename T, precision P, template<int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL T simplex( GLM_FUNC_DECL T simplex(
vecType<D, T, P> const & p); vecType<L, T, P> const& p);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@@ -9,7 +9,7 @@
namespace glm{ namespace glm{
namespace gtc namespace gtc
{ {
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> grad4(T const & j, vec<4, T, P> const & ip) GLM_FUNC_QUALIFIER vec<4, T, P> grad4(T const & j, vec<4, T, P> const & ip)
{ {
vec<3, T, P> pXYZ = floor(fract(vec<3, T, P>(j) * vec<3, T, P>(ip)) * T(7)) * ip[2] - T(1); vec<3, T, P> pXYZ = floor(fract(vec<3, T, P>(j) * vec<3, T, P>(ip)) * T(7)) * ip[2] - T(1);
@@ -21,7 +21,7 @@ namespace gtc
}//namespace gtc }//namespace gtc
// Classic Perlin noise // Classic Perlin noise
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const & Position) GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const & Position)
{ {
vec<4, T, P> Pi = glm::floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0); vec<4, T, P> Pi = glm::floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
@@ -62,7 +62,7 @@ namespace gtc
} }
// Classic Perlin noise // Classic Perlin noise
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & Position) GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & Position)
{ {
vec<3, T, P> Pi0 = floor(Position); // Integer part for indexing vec<3, T, P> Pi0 = floor(Position); // Integer part for indexing
@@ -133,7 +133,7 @@ namespace gtc
} }
/* /*
// Classic Perlin noise // Classic Perlin noise
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & P) GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & P)
{ {
vec<3, T, P> Pi0 = floor(P); // Integer part for indexing vec<3, T, P> Pi0 = floor(P); // Integer part for indexing
@@ -206,7 +206,7 @@ namespace gtc
} }
*/ */
// Classic Perlin noise // Classic Perlin noise
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const & Position) GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const & Position)
{ {
vec<4, T, P> Pi0 = floor(Position); // Integer part for indexing vec<4, T, P> Pi0 = floor(Position); // Integer part for indexing
@@ -342,7 +342,7 @@ namespace gtc
} }
// Classic Perlin noise, periodic variant // Classic Perlin noise, periodic variant
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const & Position, vec<2, T, P> const & rep) GLM_FUNC_QUALIFIER T perlin(vec<2, T, P> const & Position, vec<2, T, P> const & rep)
{ {
vec<4, T, P> Pi = floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0); vec<4, T, P> Pi = floor(vec<4, T, P>(Position.x, Position.y, Position.x, Position.y)) + vec<4, T, P>(0.0, 0.0, 1.0, 1.0);
@@ -384,7 +384,7 @@ namespace gtc
} }
// Classic Perlin noise, periodic variant // Classic Perlin noise, periodic variant
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & Position, vec<3, T, P> const & rep) GLM_FUNC_QUALIFIER T perlin(vec<3, T, P> const & Position, vec<3, T, P> const & rep)
{ {
vec<3, T, P> Pi0 = mod(floor(Position), rep); // Integer part, modulo period vec<3, T, P> Pi0 = mod(floor(Position), rep); // Integer part, modulo period
@@ -455,7 +455,7 @@ namespace gtc
} }
// Classic Perlin noise, periodic version // Classic Perlin noise, periodic version
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const & Position, vec<4, T, P> const & rep) GLM_FUNC_QUALIFIER T perlin(vec<4, T, P> const & Position, vec<4, T, P> const & rep)
{ {
vec<4, T, P> Pi0 = mod(floor(Position), rep); // Integer part modulo rep vec<4, T, P> Pi0 = mod(floor(Position), rep); // Integer part modulo rep
@@ -588,7 +588,7 @@ namespace gtc
return T(2.2) * n_xyzw; return T(2.2) * n_xyzw;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, P> const & v) GLM_FUNC_QUALIFIER T simplex(glm::vec<2, T, P> const & v)
{ {
vec<4, T, P> const C = vec<4, T, P>( vec<4, T, P> const C = vec<4, T, P>(
@@ -645,7 +645,7 @@ namespace gtc
return T(130) * dot(m, g); return T(130) * dot(m, g);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T simplex(vec<3, T, P> const & v) GLM_FUNC_QUALIFIER T simplex(vec<3, T, P> const & v)
{ {
vec<2, T, P> const C(1.0 / 6.0, 1.0 / 3.0); vec<2, T, P> const C(1.0 / 6.0, 1.0 / 3.0);
@@ -720,7 +720,7 @@ namespace gtc
return T(42) * dot(m * m, vec<4, T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3))); return T(42) * dot(m * m, vec<4, T, P>(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T simplex(vec<4, T, P> const & v) GLM_FUNC_QUALIFIER T simplex(vec<4, T, P> const & v)
{ {
vec<4, T, P> const C( vec<4, T, P> const C(

View File

@@ -477,7 +477,7 @@ namespace glm
/// @see gtc_packing /// @see gtc_packing
/// @see vec<3, T, P> unpackRGBM(vec<4, T, P> const & p) /// @see vec<3, T, P> unpackRGBM(vec<4, T, P> const & p)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
template <int D, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> packRGBM(vec<3, T, P> const & rgb); GLM_FUNC_DECL vec<4, T, P> packRGBM(vec<3, T, P> const & rgb);
/// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values.
@@ -487,7 +487,7 @@ namespace glm
/// @see gtc_packing /// @see gtc_packing
/// @see vec<4, T, P> packRGBM(vec<3, float, P> const & v) /// @see vec<4, T, P> packRGBM(vec<3, float, P> const & v)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
template <int D, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm); GLM_FUNC_DECL vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm);
/// Returns an unsigned integer vector obtained by converting the components of a floating-point vector /// Returns an unsigned integer vector obtained by converting the components of a floating-point vector
@@ -496,48 +496,48 @@ namespace glm
/// the forth component specifies the 16 most-significant bits. /// the forth component specifies the 16 most-significant bits.
/// ///
/// @see gtc_packing /// @see gtc_packing
/// @see vecType<D, float, P> unpackHalf(vecType<D, uint16, P> const & p) /// @see vecType<L, float, P> unpackHalf(vecType<L, uint16, P> const & p)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, uint16, P> packHalf(vecType<D, float, P> const & v); GLM_FUNC_DECL vecType<L, uint16, P> packHalf(vecType<L, float, P> const & v);
/// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values. /// Returns a floating-point vector with components obtained by reinterpreting an integer vector as 16-bit floating-point numbers and converting them to 32-bit floating-point values.
/// The first component of the vector is obtained from the 16 least-significant bits of v; /// The first component of the vector is obtained from the 16 least-significant bits of v;
/// the forth component is obtained from the 16 most-significant bits of v. /// the forth component is obtained from the 16 most-significant bits of v.
/// ///
/// @see gtc_packing /// @see gtc_packing
/// @see vecType<D, uint16, P> packHalf(vecType<D, float, P> const & v) /// @see vecType<L, uint16, P> packHalf(vecType<L, float, P> const & v)
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, float, P> unpackHalf(vecType<D, uint16, P> const & p); GLM_FUNC_DECL vecType<L, float, P> unpackHalf(vecType<L, uint16, P> const & p);
/// Convert each component of the normalized floating-point vector into unsigned integer values. /// Convert each component of the normalized floating-point vector into unsigned integer values.
/// ///
/// @see gtc_packing /// @see gtc_packing
/// @see vecType<D, floatType, P> unpackUnorm(vecType<D, intType, P> const & p); /// @see vecType<L, floatType, P> unpackUnorm(vecType<L, intType, P> const & p);
template <int D, typename uintType, typename floatType, precision P, template <int, typename, precision> class vecType> template<length_t L, typename uintType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, uintType, P> packUnorm(vecType<D, floatType, P> const & v); GLM_FUNC_DECL vecType<L, uintType, P> packUnorm(vecType<L, floatType, P> const & v);
/// Convert each unsigned integer components of a vector to normalized floating-point values. /// Convert each unsigned integer components of a vector to normalized floating-point values.
/// ///
/// @see gtc_packing /// @see gtc_packing
/// @see vecType<D, intType, P> packUnorm(vecType<D, floatType, P> const & v) /// @see vecType<L, intType, P> packUnorm(vecType<L, floatType, P> const & v)
template <int D, typename uintType, typename floatType, precision P, template <int, typename, precision> class vecType> template<length_t L, typename uintType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, floatType, P> unpackUnorm(vecType<D, uintType, P> const & v); GLM_FUNC_DECL vecType<L, floatType, P> unpackUnorm(vecType<L, uintType, P> const & v);
/// Convert each component of the normalized floating-point vector into signed integer values. /// Convert each component of the normalized floating-point vector into signed integer values.
/// ///
/// @see gtc_packing /// @see gtc_packing
/// @see vecType<D, floatType, P> unpackSnorm(vecType<D, intType, P> const & p); /// @see vecType<L, floatType, P> unpackSnorm(vecType<L, intType, P> const & p);
template <int D, typename intType, typename floatType, precision P, template <int, typename, precision> class vecType> template<length_t L, typename intType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, intType, P> packSnorm(vecType<D, floatType, P> const & v); GLM_FUNC_DECL vecType<L, intType, P> packSnorm(vecType<L, floatType, P> const & v);
/// Convert each signed integer components of a vector to normalized floating-point values. /// Convert each signed integer components of a vector to normalized floating-point values.
/// ///
/// @see gtc_packing /// @see gtc_packing
/// @see vecType<D, intType, P> packSnorm(vecType<D, floatType, P> const & v) /// @see vecType<L, intType, P> packSnorm(vecType<L, floatType, P> const & v)
template <int D, typename intType, typename floatType, precision P, template <int, typename, precision> class vecType> template<length_t L, typename intType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, floatType, P> unpackSnorm(vecType<D, intType, P> const & v); GLM_FUNC_DECL vecType<L, floatType, P> unpackSnorm(vecType<L, intType, P> const & v);
/// Convert each component of the normalized floating-point vector into unsigned integer values. /// Convert each component of the normalized floating-point vector into unsigned integer values.
/// ///

View File

@@ -270,11 +270,11 @@ namespace detail
uint32 pack; uint32 pack;
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_half struct compute_half
{}; {};
template <precision P> template<precision P>
struct compute_half<1, P, vec> struct compute_half<1, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<1, uint16, P> pack(vec<1, float, P> const & v) GLM_FUNC_QUALIFIER static vec<1, uint16, P> pack(vec<1, float, P> const & v)
@@ -293,7 +293,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_half<2, P, vec> struct compute_half<2, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const & v) GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const & v)
@@ -312,7 +312,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_half<3, P, vec> struct compute_half<3, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const & v) GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const & v)
@@ -331,7 +331,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_half<4, P, vec> struct compute_half<4, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const & v) GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const & v)
@@ -640,7 +640,7 @@ namespace detail
} }
// Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html // Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const & rgb) GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const & rgb)
{ {
vec<3, T, P> const Color(rgb * static_cast<T>(1.0 / 6.0)); vec<3, T, P> const Color(rgb * static_cast<T>(1.0 / 6.0));
@@ -649,58 +649,58 @@ namespace detail
return vec<4, T, P>(Color / Alpha, Alpha); return vec<4, T, P>(Color / Alpha, Alpha);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm) GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm)
{ {
return vec<3, T, P>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast<T>(6); return vec<3, T, P>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast<T>(6);
} }
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, uint16, P> packHalf(vecType<D, float, P> const & v) GLM_FUNC_QUALIFIER vecType<L, uint16, P> packHalf(vecType<L, float, P> const & v)
{ {
return detail::compute_half<D, P, vecType>::pack(v); return detail::compute_half<L, P, vecType>::pack(v);
} }
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, float, P> unpackHalf(vecType<D, uint16, P> const & v) GLM_FUNC_QUALIFIER vecType<L, float, P> unpackHalf(vecType<L, uint16, P> const & v)
{ {
return detail::compute_half<D, P, vecType>::unpack(v); return detail::compute_half<L, P, vecType>::unpack(v);
} }
template <int D, typename uintType, typename floatType, precision P, template <int, typename, precision> class vecType> template<length_t L, typename uintType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, uintType, P> packUnorm(vecType<D, floatType, P> const & v) GLM_FUNC_QUALIFIER vecType<L, uintType, P> packUnorm(vecType<L, floatType, P> const & v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type"); GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
return vecType<D, uintType, P>(round(clamp(v, static_cast<floatType>(0), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<uintType>::max()))); return vecType<L, uintType, P>(round(clamp(v, static_cast<floatType>(0), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<uintType>::max())));
} }
template <int D, typename uintType, typename floatType, precision P, template <int, typename, precision> class vecType> template<length_t L, typename uintType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, floatType, P> unpackUnorm(vecType<D, uintType, P> const & v) GLM_FUNC_QUALIFIER vecType<L, floatType, P> unpackUnorm(vecType<L, uintType, P> const & v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type"); GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
return vecType<D, float, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<uintType>::max())); return vecType<L, float, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<uintType>::max()));
} }
template <int D, typename intType, typename floatType, precision P, template <int, typename, precision> class vecType> template<length_t L, typename intType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, intType, P> packSnorm(vecType<D, floatType, P> const & v) GLM_FUNC_QUALIFIER vecType<L, intType, P> packSnorm(vecType<L, floatType, P> const & v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type"); GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
return vecType<D, intType, P>(round(clamp(v , static_cast<floatType>(-1), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<intType>::max()))); return vecType<L, intType, P>(round(clamp(v , static_cast<floatType>(-1), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<intType>::max())));
} }
template <int D, typename intType, typename floatType, precision P, template <int, typename, precision> class vecType> template<length_t L, typename intType, typename floatType, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, floatType, P> unpackSnorm(vecType<D, intType, P> const & v) GLM_FUNC_QUALIFIER vecType<L, floatType, P> unpackSnorm(vecType<L, intType, P> const & v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type"); GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type"); GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
return clamp(vecType<D, floatType, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<intType>::max())), static_cast<floatType>(-1), static_cast<floatType>(1)); return clamp(vecType<L, floatType, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<intType>::max())), static_cast<floatType>(-1), static_cast<floatType>(1));
} }
GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const & v) GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const & v)

View File

@@ -29,7 +29,7 @@ namespace glm
/// @addtogroup gtc_quaternion /// @addtogroup gtc_quaternion
/// @{ /// @{
template <typename T, precision P = defaultp> template<typename T, precision P = defaultp>
struct tquat struct tquat
{ {
// -- Implementation detail -- // -- Implementation detail --
@@ -79,7 +79,7 @@ namespace glm
GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT_CTOR; GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, P> const & q) GLM_DEFAULT; GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, P> const & q) GLM_DEFAULT;
template <precision Q> template<precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, Q> const & q); GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, Q> const & q);
// -- Explicit basic constructors -- // -- Explicit basic constructors --
@@ -90,7 +90,7 @@ namespace glm
// -- Conversion constructors -- // -- Conversion constructors --
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tquat(tquat<U, Q> const & q); GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tquat(tquat<U, Q> const & q);
/// Explicit conversion operators /// Explicit conversion operators
@@ -116,81 +116,81 @@ namespace glm
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<T, P> const & m) GLM_DEFAULT; GLM_FUNC_DECL tquat<T, P> & operator=(tquat<T, P> const & m) GLM_DEFAULT;
template <typename U> template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<U, P> const & m); GLM_FUNC_DECL tquat<T, P> & operator=(tquat<U, P> const & m);
template <typename U> template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<U, P> const & q); GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<U, P> const & q);
template <typename U> template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator-=(tquat<U, P> const & q); GLM_FUNC_DECL tquat<T, P> & operator-=(tquat<U, P> const & q);
template <typename U> template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<U, P> const & q); GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<U, P> const & q);
template <typename U> template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator*=(U s); GLM_FUNC_DECL tquat<T, P> & operator*=(U s);
template <typename U> template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator/=(U s); GLM_FUNC_DECL tquat<T, P> & operator/=(U s);
}; };
// -- Unary bit operators -- // -- Unary bit operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q); GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator-(tquat<T, P> const & q); GLM_FUNC_DECL tquat<T, P> operator-(tquat<T, P> const & q);
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p); GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p); GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v); GLM_FUNC_DECL vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q); GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(tquat<T, P> const & q, vec<4, T, P> const & v); GLM_FUNC_DECL vec<4, T, P> operator*(tquat<T, P> const & q, vec<4, T, P> const & v);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q); GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, T const & s); GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, T const & s);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator*(T const & s, tquat<T, P> const & q); GLM_FUNC_DECL tquat<T, P> operator*(T const & s, tquat<T, P> const & q);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const & q, T const & s); GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const & q, T const & s);
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2); GLM_FUNC_DECL bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2);
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2); GLM_FUNC_DECL bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2);
/// Returns the length of the quaternion. /// Returns the length of the quaternion.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL T length(tquat<T, P> const & q); GLM_FUNC_DECL T length(tquat<T, P> const & q);
/// Returns the normalized quaternion. /// Returns the normalized quaternion.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const & q); GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const & q);
/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ... /// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL T dot(tquat<T, P> const & x, tquat<T, P> const & y); GLM_FUNC_DECL T dot(tquat<T, P> const & x, tquat<T, P> const & y);
/// Spherical linear interpolation of two quaternions. /// Spherical linear interpolation of two quaternions.
@@ -203,7 +203,7 @@ namespace glm
/// @tparam T Value type used to build the quaternion. Supported: half, float or double. /// @tparam T Value type used to build the quaternion. Supported: half, float or double.
/// @see gtc_quaternion /// @see gtc_quaternion
/// @see - slerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a) /// @see - slerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a); GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a);
/// Linear interpolation of two quaternions. /// Linear interpolation of two quaternions.
@@ -214,7 +214,7 @@ namespace glm
/// @param a Interpolation factor. The interpolation is defined in the range [0, 1]. /// @param a Interpolation factor. The interpolation is defined in the range [0, 1].
/// @tparam T Value type used to build the quaternion. Supported: half, float or double. /// @tparam T Value type used to build the quaternion. Supported: half, float or double.
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a); GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a);
/// Spherical linear interpolation of two quaternions. /// Spherical linear interpolation of two quaternions.
@@ -225,19 +225,19 @@ namespace glm
/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1]. /// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
/// @tparam T Value type used to build the quaternion. Supported: half, float or double. /// @tparam T Value type used to build the quaternion. Supported: half, float or double.
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a); GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a);
/// Returns the q conjugate. /// Returns the q conjugate.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const & q); GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const & q);
/// Returns the q inverse. /// Returns the q inverse.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const & q); GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const & q);
/// Rotates a quaternion from a vector of 3 components axis and an angle. /// Rotates a quaternion from a vector of 3 components axis and an angle.
@@ -247,68 +247,68 @@ namespace glm
/// @param axis Axis of the rotation /// @param axis Axis of the rotation
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & axis); GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & axis);
/// Returns euler angles, pitch as x, yaw as y, roll as z. /// Returns euler angles, pitch as x, yaw as y, roll as z.
/// The result is expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise. /// The result is expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat<T, P> const & x); GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat<T, P> const & x);
/// Returns roll value of euler angles expressed in radians. /// Returns roll value of euler angles expressed in radians.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL T roll(tquat<T, P> const & x); GLM_FUNC_DECL T roll(tquat<T, P> const & x);
/// Returns pitch value of euler angles expressed in radians. /// Returns pitch value of euler angles expressed in radians.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL T pitch(tquat<T, P> const & x); GLM_FUNC_DECL T pitch(tquat<T, P> const & x);
/// Returns yaw value of euler angles expressed in radians. /// Returns yaw value of euler angles expressed in radians.
/// ///
/// @see gtx_quaternion /// @see gtx_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL T yaw(tquat<T, P> const & x); GLM_FUNC_DECL T yaw(tquat<T, P> const & x);
/// Converts a quaternion to a 3 * 3 matrix. /// Converts a quaternion to a 3 * 3 matrix.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> mat3_cast(tquat<T, P> const & x); GLM_FUNC_DECL mat<3, 3, T, P> mat3_cast(tquat<T, P> const & x);
/// Converts a quaternion to a 4 * 4 matrix. /// Converts a quaternion to a 4 * 4 matrix.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> mat4_cast(tquat<T, P> const & x); GLM_FUNC_DECL mat<4, 4, T, P> mat4_cast(tquat<T, P> const & x);
/// Converts a 3 * 3 matrix to a quaternion. /// Converts a 3 * 3 matrix to a quaternion.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(mat<3, 3, T, P> const & x); GLM_FUNC_DECL tquat<T, P> quat_cast(mat<3, 3, T, P> const & x);
/// Converts a 4 * 4 matrix to a quaternion. /// Converts a 4 * 4 matrix to a quaternion.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(mat<4, 4, T, P> const & x); GLM_FUNC_DECL tquat<T, P> quat_cast(mat<4, 4, T, P> const & x);
/// Returns the quaternion rotation angle. /// Returns the quaternion rotation angle.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL T angle(tquat<T, P> const & x); GLM_FUNC_DECL T angle(tquat<T, P> const & x);
/// Returns the q rotation axis. /// Returns the q rotation axis.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> axis(tquat<T, P> const & x); GLM_FUNC_DECL vec<3, T, P> axis(tquat<T, P> const & x);
/// Build a quaternion from an angle and a normalized axis. /// Build a quaternion from an angle and a normalized axis.
@@ -317,7 +317,7 @@ namespace glm
/// @param axis Axis of the quaternion, must be normalized. /// @param axis Axis of the quaternion, must be normalized.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> angleAxis(T const & angle, vec<3, T, P> const & axis); GLM_FUNC_DECL tquat<T, P> angleAxis(T const & angle, vec<3, T, P> const & axis);
/// Returns the component-wise comparison result of x < y. /// Returns the component-wise comparison result of x < y.
@@ -325,7 +325,7 @@ namespace glm
/// @tparam quatType Floating-point quaternion types. /// @tparam quatType Floating-point quaternion types.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y); GLM_FUNC_DECL vec<4, bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x <= y. /// Returns the component-wise comparison of result x <= y.
@@ -333,7 +333,7 @@ namespace glm
/// @tparam quatType Floating-point quaternion types. /// @tparam quatType Floating-point quaternion types.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y); GLM_FUNC_DECL vec<4, bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x > y. /// Returns the component-wise comparison of result x > y.
@@ -341,7 +341,7 @@ namespace glm
/// @tparam quatType Floating-point quaternion types. /// @tparam quatType Floating-point quaternion types.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y); GLM_FUNC_DECL vec<4, bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x >= y. /// Returns the component-wise comparison of result x >= y.
@@ -349,7 +349,7 @@ namespace glm
/// @tparam quatType Floating-point quaternion types. /// @tparam quatType Floating-point quaternion types.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y); GLM_FUNC_DECL vec<4, bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x == y. /// Returns the component-wise comparison of result x == y.
@@ -357,7 +357,7 @@ namespace glm
/// @tparam quatType Floating-point quaternion types. /// @tparam quatType Floating-point quaternion types.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y); GLM_FUNC_DECL vec<4, bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x != y. /// Returns the component-wise comparison of result x != y.
@@ -365,7 +365,7 @@ namespace glm
/// @tparam quatType Floating-point quaternion types. /// @tparam quatType Floating-point quaternion types.
/// ///
/// @see gtc_quaternion /// @see gtc_quaternion
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y); GLM_FUNC_DECL vec<4, bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns true if x holds a NaN (not a number) /// Returns true if x holds a NaN (not a number)
@@ -377,7 +377,7 @@ namespace glm
/// /!\ When using compiler fast math, this function may fail. /// /!\ When using compiler fast math, this function may fail.
/// ///
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> isnan(tquat<T, P> const & x); GLM_FUNC_DECL vec<4, bool, P> isnan(tquat<T, P> const & x);
/// Returns true if x holds a positive infinity or negative /// Returns true if x holds a positive infinity or negative
@@ -387,7 +387,7 @@ namespace glm
/// representations. /// representations.
/// ///
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> isinf(tquat<T, P> const & x); GLM_FUNC_DECL vec<4, bool, P> isinf(tquat<T, P> const & x);
/// @} /// @}

View File

@@ -9,7 +9,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_dot<tquat<T, P>, T, Aligned> struct compute_dot<tquat<T, P>, T, Aligned>
{ {
static GLM_FUNC_QUALIFIER T call(tquat<T, P> const& a, tquat<T, P> const& b) static GLM_FUNC_QUALIFIER T call(tquat<T, P> const& a, tquat<T, P> const& b)
@@ -19,7 +19,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_quat_add struct compute_quat_add
{ {
static tquat<T, P> call(tquat<T, P> const& q, tquat<T, P> const& p) static tquat<T, P> call(tquat<T, P> const& q, tquat<T, P> const& p)
@@ -28,7 +28,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_quat_sub struct compute_quat_sub
{ {
static tquat<T, P> call(tquat<T, P> const& q, tquat<T, P> const& p) static tquat<T, P> call(tquat<T, P> const& q, tquat<T, P> const& p)
@@ -37,7 +37,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_quat_mul_scalar struct compute_quat_mul_scalar
{ {
static tquat<T, P> call(tquat<T, P> const& q, T s) static tquat<T, P> call(tquat<T, P> const& q, T s)
@@ -46,7 +46,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_quat_div_scalar struct compute_quat_div_scalar
{ {
static tquat<T, P> call(tquat<T, P> const& q, T s) static tquat<T, P> call(tquat<T, P> const& q, T s)
@@ -55,7 +55,7 @@ namespace detail
} }
}; };
template <typename T, precision P, bool Aligned> template<typename T, precision P, bool Aligned>
struct compute_quat_mul_vec4 struct compute_quat_mul_vec4
{ {
static vec<4, T, P> call(tquat<T, P> const & q, vec<4, T, P> const & v) static vec<4, T, P> call(tquat<T, P> const & q, vec<4, T, P> const & v)
@@ -67,14 +67,14 @@ namespace detail
// -- Component accesses -- // -- Component accesses --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[](typename tquat<T, P>::length_type i) GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[](typename tquat<T, P>::length_type i)
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
return (&x)[i]; return (&x)[i];
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[](typename tquat<T, P>::length_type i) const GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator[](typename tquat<T, P>::length_type i) const
{ {
assert(i >= 0 && i < this->length()); assert(i >= 0 && i < this->length());
@@ -84,7 +84,7 @@ namespace detail
// -- Implicit basic constructors -- // -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat() GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat()
# ifndef GLM_FORCE_NO_CTOR_INIT # ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0), z(0), w(1) : x(0), y(0), z(0), w(1)
@@ -93,38 +93,38 @@ namespace detail
# endif # endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, P> const & q) GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, P> const & q)
: x(q.x), y(q.y), z(q.z), w(q.w) : x(q.x), y(q.y), z(q.z), w(q.w)
{} {}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <precision Q> template<precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, Q> const & q) GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, Q> const & q)
: x(q.x), y(q.y), z(q.z), w(q.w) : x(q.x), y(q.y), z(q.z), w(q.w)
{} {}
// -- Explicit basic constructors -- // -- Explicit basic constructors --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tquat<T, P>::tquat(ctor) GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tquat<T, P>::tquat(ctor)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(T const & s, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(T const & s, vec<3, T, P> const & v)
: x(v.x), y(v.y), z(v.z), w(s) : x(v.x), y(v.y), z(v.z), w(s)
{} {}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(T const & w, T const & x, T const & y, T const & z) GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(T const & w, T const & x, T const & y, T const & z)
: x(x), y(y), z(z), w(w) : x(x), y(y), z(z), w(w)
{} {}
// -- Conversion constructors -- // -- Conversion constructors --
template <typename T, precision P> template<typename T, precision P>
template <typename U, precision Q> template<typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<U, Q> const & q) GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<U, Q> const & q)
: x(static_cast<T>(q.x)) : x(static_cast<T>(q.x))
, y(static_cast<T>(q.y)) , y(static_cast<T>(q.y))
@@ -132,7 +132,7 @@ namespace detail
, w(static_cast<T>(q.w)) , w(static_cast<T>(q.w))
{} {}
//template <typename valType> //template<typename valType>
//GLM_FUNC_QUALIFIER tquat<valType>::tquat //GLM_FUNC_QUALIFIER tquat<valType>::tquat
//( //(
// valType const & pitch, // valType const & pitch,
@@ -150,7 +150,7 @@ namespace detail
// this->z = c.x * c.y * s.z - s.x * s.y * c.z; // this->z = c.x * c.y * s.z - s.x * s.y * c.z;
//} //}
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(vec<3, T, P> const & u, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER tquat<T, P>::tquat(vec<3, T, P> const & u, vec<3, T, P> const & v)
{ {
vec<3, T, P> const LocalW(cross(u, v)); vec<3, T, P> const LocalW(cross(u, v));
@@ -160,7 +160,7 @@ namespace detail
*this = normalize(q); *this = normalize(q);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(vec<3, T, P> const & eulerAngle) GLM_FUNC_QUALIFIER tquat<T, P>::tquat(vec<3, T, P> const & eulerAngle)
{ {
vec<3, T, P> c = glm::cos(eulerAngle * T(0.5)); vec<3, T, P> c = glm::cos(eulerAngle * T(0.5));
@@ -172,39 +172,39 @@ namespace detail
this->z = c.x * c.y * s.z - s.x * s.y * c.z; this->z = c.x * c.y * s.z - s.x * s.y * c.z;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER tquat<T, P>::tquat(mat<3, 3, T, P> const & m)
{ {
*this = quat_cast(m); *this = quat_cast(m);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(mat<4, 4, T, P> const & m) GLM_FUNC_QUALIFIER tquat<T, P>::tquat(mat<4, 4, T, P> const & m)
{ {
*this = quat_cast(m); *this = quat_cast(m);
} }
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS # if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::operator mat<3, 3, T, P>() GLM_FUNC_QUALIFIER tquat<T, P>::operator mat<3, 3, T, P>()
{ {
return mat3_cast(*this); return mat3_cast(*this);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::operator mat<4, 4, T, P>() GLM_FUNC_QUALIFIER tquat<T, P>::operator mat<4, 4, T, P>()
{ {
return mat4_cast(*this); return mat4_cast(*this);
} }
# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS # endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> conjugate(tquat<T, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P> conjugate(tquat<T, P> const & q)
{ {
return tquat<T, P>(q.w, -q.x, -q.y, -q.z); return tquat<T, P>(q.w, -q.x, -q.y, -q.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> inverse(tquat<T, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P> inverse(tquat<T, P> const & q)
{ {
return conjugate(q) / dot(q, q); return conjugate(q) / dot(q, q);
@@ -213,7 +213,7 @@ namespace detail
// -- Unary arithmetic operators -- // -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const & q)
{ {
this->w = q.w; this->w = q.w;
@@ -224,8 +224,8 @@ namespace detail
} }
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS # endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<U, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<U, P> const & q)
{ {
this->w = static_cast<T>(q.w); this->w = static_cast<T>(q.w);
@@ -235,22 +235,22 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator+=(tquat<U, P> const& q) GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator+=(tquat<U, P> const& q)
{ {
return (*this = detail::compute_quat_add<T, P, detail::is_aligned<P>::value>::call(*this, tquat<T, P>(q))); return (*this = detail::compute_quat_add<T, P, detail::is_aligned<P>::value>::call(*this, tquat<T, P>(q)));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator-=(tquat<U, P> const& q) GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator-=(tquat<U, P> const& q)
{ {
return (*this = detail::compute_quat_sub<T, P, detail::is_aligned<P>::value>::call(*this, tquat<T, P>(q))); return (*this = detail::compute_quat_sub<T, P, detail::is_aligned<P>::value>::call(*this, tquat<T, P>(q)));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<U, P> const & r) GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<U, P> const & r)
{ {
tquat<T, P> const p(*this); tquat<T, P> const p(*this);
@@ -263,15 +263,15 @@ namespace detail
return *this; return *this;
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(U s) GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(U s)
{ {
return (*this = detail::compute_quat_mul_scalar<T, P, detail::is_aligned<P>::value>::call(*this, static_cast<U>(s))); return (*this = detail::compute_quat_mul_scalar<T, P, detail::is_aligned<P>::value>::call(*this, static_cast<U>(s)));
} }
template <typename T, precision P> template<typename T, precision P>
template <typename U> template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator/=(U s) GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator/=(U s)
{ {
return (*this = detail::compute_quat_div_scalar<T, P, detail::is_aligned<P>::value>::call(*this, static_cast<U>(s))); return (*this = detail::compute_quat_div_scalar<T, P, detail::is_aligned<P>::value>::call(*this, static_cast<U>(s)));
@@ -279,13 +279,13 @@ namespace detail
// -- Unary bit operators -- // -- Unary bit operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q)
{ {
return q; return q;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const & q)
{ {
return tquat<T, P>(-q.w, -q.x, -q.y, -q.z); return tquat<T, P>(-q.w, -q.x, -q.y, -q.z);
@@ -293,19 +293,19 @@ namespace detail
// -- Binary operators -- // -- Binary operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p) GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p)
{ {
return tquat<T, P>(q) += p; return tquat<T, P>(q) += p;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p) GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p)
{ {
return tquat<T, P>(q) *= p; return tquat<T, P>(q) *= p;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v)
{ {
vec<3, T, P> const QuatVector(q.x, q.y, q.z); vec<3, T, P> const QuatVector(q.x, q.y, q.z);
@@ -315,38 +315,38 @@ namespace detail
return v + ((uv * q.w) + uuv) * static_cast<T>(2); return v + ((uv * q.w) + uuv) * static_cast<T>(2);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q) GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q)
{ {
return glm::inverse(q) * v; return glm::inverse(q) * v;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(tquat<T, P> const& q, vec<4, T, P> const& v) GLM_FUNC_QUALIFIER vec<4, T, P> operator*(tquat<T, P> const& q, vec<4, T, P> const& v)
{ {
return detail::compute_quat_mul_vec4<T, P, detail::is_aligned<P>::value>::call(q, v); return detail::compute_quat_mul_vec4<T, P, detail::is_aligned<P>::value>::call(q, v);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q) GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q)
{ {
return glm::inverse(q) * v; return glm::inverse(q) * v;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, T const & s) GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const & q, T const & s)
{ {
return tquat<T, P>( return tquat<T, P>(
q.w * s, q.x * s, q.y * s, q.z * s); q.w * s, q.x * s, q.y * s, q.z * s);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator*(T const & s, tquat<T, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P> operator*(T const & s, tquat<T, P> const & q)
{ {
return q * s; return q * s;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const & q, T const & s) GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const & q, T const & s)
{ {
return tquat<T, P>( return tquat<T, P>(
@@ -355,13 +355,13 @@ namespace detail
// -- Boolean operators -- // -- Boolean operators --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2) GLM_FUNC_QUALIFIER bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2)
{ {
return (q1.x == q2.x) && (q1.y == q2.y) && (q1.z == q2.z) && (q1.w == q2.w); return (q1.x == q2.x) && (q1.y == q2.y) && (q1.z == q2.z) && (q1.w == q2.w);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2) GLM_FUNC_QUALIFIER bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2)
{ {
return (q1.x != q2.x) || (q1.y != q2.y) || (q1.z != q2.z) || (q1.w != q2.w); return (q1.x != q2.x) || (q1.y != q2.y) || (q1.z != q2.z) || (q1.w != q2.w);
@@ -369,13 +369,13 @@ namespace detail
// -- Operations -- // -- Operations --
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T length(tquat<T, P> const & q) GLM_FUNC_QUALIFIER T length(tquat<T, P> const & q)
{ {
return glm::sqrt(dot(q, q)); return glm::sqrt(dot(q, q));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> normalize(tquat<T, P> const & q) GLM_FUNC_QUALIFIER tquat<T, P> normalize(tquat<T, P> const & q)
{ {
T len = length(q); T len = length(q);
@@ -385,7 +385,7 @@ namespace detail
return tquat<T, P>(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen); return tquat<T, P>(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> cross(tquat<T, P> const & q1, tquat<T, P> const & q2) GLM_FUNC_QUALIFIER tquat<T, P> cross(tquat<T, P> const & q1, tquat<T, P> const & q2)
{ {
return tquat<T, P>( return tquat<T, P>(
@@ -396,7 +396,7 @@ namespace detail
} }
/* /*
// (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle)) // (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle))
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T const & a) GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
{ {
if(a <= T(0)) return x; if(a <= T(0)) return x;
@@ -433,7 +433,7 @@ namespace detail
k0 * x.z + k1 * y2.z); k0 * x.z + k1 * y2.z);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> mix2 GLM_FUNC_QUALIFIER tquat<T, P> mix2
( (
tquat<T, P> const & x, tquat<T, P> const & x,
@@ -471,7 +471,7 @@ namespace detail
} }
*/ */
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a) GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a)
{ {
T cosTheta = dot(x, y); T cosTheta = dot(x, y);
@@ -494,7 +494,7 @@ namespace detail
} }
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a) GLM_FUNC_QUALIFIER tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a)
{ {
// Lerp is only defined in [0, 1] // Lerp is only defined in [0, 1]
@@ -504,7 +504,7 @@ namespace detail
return x * (T(1) - a) + (y * a); return x * (T(1) - a) + (y * a);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a) GLM_FUNC_QUALIFIER tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a)
{ {
tquat<T, P> z = y; tquat<T, P> z = y;
@@ -537,7 +537,7 @@ namespace detail
} }
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & v)
{ {
vec<3, T, P> Tmp = v; vec<3, T, P> Tmp = v;
@@ -559,31 +559,31 @@ namespace detail
//return gtc::quaternion::cross(q, tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin)); //return gtc::quaternion::cross(q, tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> eulerAngles(tquat<T, P> const & x) GLM_FUNC_QUALIFIER vec<3, T, P> eulerAngles(tquat<T, P> const & x)
{ {
return vec<3, T, P>(pitch(x), yaw(x), roll(x)); return vec<3, T, P>(pitch(x), yaw(x), roll(x));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T roll(tquat<T, P> const & q) GLM_FUNC_QUALIFIER T roll(tquat<T, P> const & q)
{ {
return T(atan(T(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z)); return T(atan(T(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T pitch(tquat<T, P> const & q) GLM_FUNC_QUALIFIER T pitch(tquat<T, P> const & q)
{ {
return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z)); return T(atan(T(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const & q) GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const & q)
{ {
return asin(clamp(T(-2) * (q.x * q.z - q.w * q.y), T(-1), T(1))); return asin(clamp(T(-2) * (q.x * q.z - q.w * q.y), T(-1), T(1)));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat3_cast(tquat<T, P> const & q) GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat3_cast(tquat<T, P> const & q)
{ {
mat<3, 3, T, P> Result(T(1)); mat<3, 3, T, P> Result(T(1));
@@ -611,13 +611,13 @@ namespace detail
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat4_cast(tquat<T, P> const & q) GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat4_cast(tquat<T, P> const & q)
{ {
return mat<4, 4, T, P>(mat3_cast(q)); return mat<4, 4, T, P>(mat3_cast(q));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<3, 3, T, P> const & m) GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<3, 3, T, P> const & m)
{ {
T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2]; T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2];
@@ -681,19 +681,19 @@ namespace detail
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<4, 4, T, P> const & m4) GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<4, 4, T, P> const & m4)
{ {
return quat_cast(mat<3, 3, T, P>(m4)); return quat_cast(mat<3, 3, T, P>(m4));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T angle(tquat<T, P> const & x) GLM_FUNC_QUALIFIER T angle(tquat<T, P> const & x)
{ {
return acos(x.w) * T(2); return acos(x.w) * T(2);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> axis(tquat<T, P> const & x) GLM_FUNC_QUALIFIER vec<3, T, P> axis(tquat<T, P> const & x)
{ {
T tmp1 = static_cast<T>(1) - x.w * x.w; T tmp1 = static_cast<T>(1) - x.w * x.w;
@@ -703,7 +703,7 @@ namespace detail
return vec<3, T, P>(x.x * tmp2, x.y * tmp2, x.z * tmp2); return vec<3, T, P>(x.x * tmp2, x.y * tmp2, x.z * tmp2);
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const & angle, vec<3, T, P> const & v) GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const & angle, vec<3, T, P> const & v)
{ {
tquat<T, P> Result(uninitialize); tquat<T, P> Result(uninitialize);
@@ -718,7 +718,7 @@ namespace detail
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y) GLM_FUNC_QUALIFIER vec<4, bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y)
{ {
vec<4, bool, P> Result(uninitialize); vec<4, bool, P> Result(uninitialize);
@@ -727,7 +727,7 @@ namespace detail
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y) GLM_FUNC_QUALIFIER vec<4, bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
{ {
vec<4, bool, P> Result(uninitialize); vec<4, bool, P> Result(uninitialize);
@@ -736,7 +736,7 @@ namespace detail
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y) GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y)
{ {
vec<4, bool, P> Result(uninitialize); vec<4, bool, P> Result(uninitialize);
@@ -745,7 +745,7 @@ namespace detail
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y) GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y)
{ {
vec<4, bool, P> Result(uninitialize); vec<4, bool, P> Result(uninitialize);
@@ -754,7 +754,7 @@ namespace detail
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y) GLM_FUNC_QUALIFIER vec<4, bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y)
{ {
vec<4, bool, P> Result(uninitialize); vec<4, bool, P> Result(uninitialize);
@@ -763,7 +763,7 @@ namespace detail
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y) GLM_FUNC_QUALIFIER vec<4, bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y)
{ {
vec<4, bool, P> Result(uninitialize); vec<4, bool, P> Result(uninitialize);
@@ -772,7 +772,7 @@ namespace detail
return Result; return Result;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> isnan(tquat<T, P> const& q) GLM_FUNC_QUALIFIER vec<4, bool, P> isnan(tquat<T, P> const& q)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
@@ -780,7 +780,7 @@ namespace detail
return vec<4, bool, P>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w)); return vec<4, bool, P>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w));
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, bool, P> isinf(tquat<T, P> const& q) GLM_FUNC_QUALIFIER vec<4, bool, P> isinf(tquat<T, P> const& q)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");

View File

@@ -7,7 +7,7 @@ namespace glm{
namespace detail namespace detail
{ {
/* /*
template <precision P> template<precision P>
struct compute_quat_mul<float, P, true> struct compute_quat_mul<float, P, true>
{ {
static tquat<float, P> call(tquat<float, P> const& q1, tquat<float, P> const& q2) static tquat<float, P> call(tquat<float, P> const& q1, tquat<float, P> const& q2)
@@ -61,7 +61,7 @@ namespace detail
}; };
*/ */
template <precision P> template<precision P>
struct compute_dot<tquat<float, P>, float, true> struct compute_dot<tquat<float, P>, float, true>
{ {
static GLM_FUNC_QUALIFIER float call(tquat<float, P> const& x, tquat<float, P> const& y) static GLM_FUNC_QUALIFIER float call(tquat<float, P> const& x, tquat<float, P> const& y)
@@ -70,7 +70,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_quat_add<float, P, true> struct compute_quat_add<float, P, true>
{ {
static tquat<float, P> call(tquat<float, P> const& q, tquat<float, P> const& p) static tquat<float, P> call(tquat<float, P> const& q, tquat<float, P> const& p)
@@ -82,7 +82,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P> template<precision P>
struct compute_quat_add<double, P, true> struct compute_quat_add<double, P, true>
{ {
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b) static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
@@ -94,7 +94,7 @@ namespace detail
}; };
# endif # endif
template <precision P> template<precision P>
struct compute_quat_sub<float, P, true> struct compute_quat_sub<float, P, true>
{ {
static tquat<float, P> call(tquat<float, P> const& q, tquat<float, P> const& p) static tquat<float, P> call(tquat<float, P> const& q, tquat<float, P> const& p)
@@ -106,7 +106,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P> template<precision P>
struct compute_quat_sub<double, P, true> struct compute_quat_sub<double, P, true>
{ {
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b) static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
@@ -118,7 +118,7 @@ namespace detail
}; };
# endif # endif
template <precision P> template<precision P>
struct compute_quat_mul_scalar<float, P, true> struct compute_quat_mul_scalar<float, P, true>
{ {
static tquat<float, P> call(tquat<float, P> const& q, float s) static tquat<float, P> call(tquat<float, P> const& q, float s)
@@ -130,7 +130,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P> template<precision P>
struct compute_quat_mul_scalar<double, P, true> struct compute_quat_mul_scalar<double, P, true>
{ {
static tquat<double, P> call(tquat<double, P> const& q, double s) static tquat<double, P> call(tquat<double, P> const& q, double s)
@@ -142,7 +142,7 @@ namespace detail
}; };
# endif # endif
template <precision P> template<precision P>
struct compute_quat_div_scalar<float, P, true> struct compute_quat_div_scalar<float, P, true>
{ {
static tquat<float, P> call(tquat<float, P> const& q, float s) static tquat<float, P> call(tquat<float, P> const& q, float s)
@@ -154,7 +154,7 @@ namespace detail
}; };
# if GLM_ARCH & GLM_ARCH_AVX_BIT # if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P> template<precision P>
struct compute_quat_div_scalar<double, P, true> struct compute_quat_div_scalar<double, P, true>
{ {
static tquat<double, P> call(tquat<double, P> const& q, double s) static tquat<double, P> call(tquat<double, P> const& q, double s)
@@ -166,7 +166,7 @@ namespace detail
}; };
# endif # endif
template <precision P> template<precision P>
struct compute_quat_mul_vec4<float, P, true> struct compute_quat_mul_vec4<float, P, true>
{ {
static vec<4, float, P> call(tquat<float, P> const& q, vec<4, float, P> const& v) static vec<4, float, P> call(tquat<float, P> const& q, vec<4, float, P> const& v)

View File

@@ -32,7 +32,7 @@ namespace glm
/// @param Max /// @param Max
/// @tparam genType Value type. Currently supported: float or double scalars. /// @tparam genType Value type. Currently supported: float or double scalars.
/// @see gtc_random /// @see gtc_random
template <typename genTYpe> template<typename genTYpe>
GLM_FUNC_DECL genTYpe linearRand( GLM_FUNC_DECL genTYpe linearRand(
genTYpe Min, genTYpe Min,
genTYpe Max); genTYpe Max);
@@ -44,17 +44,17 @@ namespace glm
/// @tparam T Value type. Currently supported: float or double. /// @tparam T Value type. Currently supported: float or double.
/// @tparam vecType A vertor type: tvec1, tvec2, tvec3, tvec4 or compatible /// @tparam vecType A vertor type: tvec1, tvec2, tvec3, tvec4 or compatible
/// @see gtc_random /// @see gtc_random
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> linearRand( GLM_FUNC_DECL vecType<L, T, P> linearRand(
vecType<D, T, P> const & Min, vecType<L, T, P> const& Min,
vecType<D, T, P> const & Max); vecType<L, T, P> const& Max);
/// Generate random numbers in the interval [Min, Max], according a gaussian distribution /// Generate random numbers in the interval [Min, Max], according a gaussian distribution
/// ///
/// @param Mean /// @param Mean
/// @param Deviation /// @param Deviation
/// @see gtc_random /// @see gtc_random
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType gaussRand( GLM_FUNC_DECL genType gaussRand(
genType Mean, genType Mean,
genType Deviation); genType Deviation);
@@ -63,7 +63,7 @@ namespace glm
/// ///
/// @param Radius /// @param Radius
/// @see gtc_random /// @see gtc_random
template <typename T> template<typename T>
GLM_FUNC_DECL vec<2, T, defaultp> circularRand( GLM_FUNC_DECL vec<2, T, defaultp> circularRand(
T Radius); T Radius);
@@ -71,7 +71,7 @@ namespace glm
/// ///
/// @param Radius /// @param Radius
/// @see gtc_random /// @see gtc_random
template <typename T> template<typename T>
GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand( GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand(
T Radius); T Radius);
@@ -79,7 +79,7 @@ namespace glm
/// ///
/// @param Radius /// @param Radius
/// @see gtc_random /// @see gtc_random
template <typename T> template<typename T>
GLM_FUNC_DECL vec<2, T, defaultp> diskRand( GLM_FUNC_DECL vec<2, T, defaultp> diskRand(
T Radius); T Radius);
@@ -87,7 +87,7 @@ namespace glm
/// ///
/// @param Radius /// @param Radius
/// @see gtc_random /// @see gtc_random
template <typename T> template<typename T>
GLM_FUNC_DECL vec<3, T, defaultp> ballRand( GLM_FUNC_DECL vec<3, T, defaultp> ballRand(
T Radius); T Radius);

View File

@@ -10,13 +10,13 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <int D, typename T, precision P, template <int, class, precision> class vecType> template<length_t L, typename T, precision P, template<int, class, precision> class vecType>
struct compute_rand struct compute_rand
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(); GLM_FUNC_QUALIFIER static vecType<L, T, P> call();
}; };
template <precision P> template<precision P>
struct compute_rand<1, uint8, P, vec> struct compute_rand<1, uint8, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<1, uint8, P> call() GLM_FUNC_QUALIFIER static vec<1, uint8, P> call()
@@ -26,7 +26,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_rand<2, uint8, P, vec> struct compute_rand<2, uint8, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<2, uint8, P> call() GLM_FUNC_QUALIFIER static vec<2, uint8, P> call()
@@ -37,7 +37,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_rand<3, uint8, P, vec> struct compute_rand<3, uint8, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<3, uint8, P> call() GLM_FUNC_QUALIFIER static vec<3, uint8, P> call()
@@ -49,7 +49,7 @@ namespace detail
} }
}; };
template <precision P> template<precision P>
struct compute_rand<4, uint8, P, vec> struct compute_rand<4, uint8, P, vec>
{ {
GLM_FUNC_QUALIFIER static vec<4, uint8, P> call() GLM_FUNC_QUALIFIER static vec<4, uint8, P> call()
@@ -62,200 +62,200 @@ namespace detail
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_rand<D, uint16, P, vecType> struct compute_rand<L, uint16, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, uint16, P> call() GLM_FUNC_QUALIFIER static vecType<L, uint16, P> call()
{ {
return return
(vecType<D, uint16, P>(compute_rand<D, uint8, P, vecType>::call()) << static_cast<uint16>(8)) | (vecType<L, uint16, P>(compute_rand<L, uint8, P, vecType>::call()) << static_cast<uint16>(8)) |
(vecType<D, uint16, P>(compute_rand<D, uint8, P, vecType>::call()) << static_cast<uint16>(0)); (vecType<L, uint16, P>(compute_rand<L, uint8, P, vecType>::call()) << static_cast<uint16>(0));
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_rand<D, uint32, P, vecType> struct compute_rand<L, uint32, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, uint32, P> call() GLM_FUNC_QUALIFIER static vecType<L, uint32, P> call()
{ {
return return
(vecType<D, uint32, P>(compute_rand<D, uint16, P, vecType>::call()) << static_cast<uint32>(16)) | (vecType<L, uint32, P>(compute_rand<L, uint16, P, vecType>::call()) << static_cast<uint32>(16)) |
(vecType<D, uint32, P>(compute_rand<D, uint16, P, vecType>::call()) << static_cast<uint32>(0)); (vecType<L, uint32, P>(compute_rand<L, uint16, P, vecType>::call()) << static_cast<uint32>(0));
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_rand<D, uint64, P, vecType> struct compute_rand<L, uint64, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, uint64, P> call() GLM_FUNC_QUALIFIER static vecType<L, uint64, P> call()
{ {
return return
(vecType<D, uint64, P>(compute_rand<D, uint32, P, vecType>::call()) << static_cast<uint64>(32)) | (vecType<L, uint64, P>(compute_rand<L, uint32, P, vecType>::call()) << static_cast<uint64>(32)) |
(vecType<D, uint64, P>(compute_rand<D, uint32, P, vecType>::call()) << static_cast<uint64>(0)); (vecType<L, uint64, P>(compute_rand<L, uint32, P, vecType>::call()) << static_cast<uint64>(0));
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand struct compute_linearRand
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & Min, vecType<D, T, P> const & Max); GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & Min, vecType<L, T, P> const & Max);
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, int8, P, vecType> struct compute_linearRand<L, int8, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, int8, P> call(vecType<D, int8, P> const & Min, vecType<D, int8, P> const & Max) GLM_FUNC_QUALIFIER static vecType<L, int8, P> call(vecType<L, int8, P> const & Min, vecType<L, int8, P> const & Max)
{ {
return (vecType<D, int8, P>(compute_rand<D, uint8, P, vecType>::call() % vecType<D, uint8, P>(Max + static_cast<int8>(1) - Min))) + Min; return (vecType<L, int8, P>(compute_rand<L, uint8, P, vecType>::call() % vecType<L, uint8, P>(Max + static_cast<int8>(1) - Min))) + Min;
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, uint8, P, vecType> struct compute_linearRand<L, uint8, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, uint8, P> call(vecType<D, uint8, P> const & Min, vecType<D, uint8, P> const & Max) GLM_FUNC_QUALIFIER static vecType<L, uint8, P> call(vecType<L, uint8, P> const & Min, vecType<L, uint8, P> const & Max)
{ {
return (compute_rand<D, uint8, P, vecType>::call() % (Max + static_cast<uint8>(1) - Min)) + Min; return (compute_rand<L, uint8, P, vecType>::call() % (Max + static_cast<uint8>(1) - Min)) + Min;
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, int16, P, vecType> struct compute_linearRand<L, int16, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, int16, P> call(vecType<D, int16, P> const & Min, vecType<D, int16, P> const & Max) GLM_FUNC_QUALIFIER static vecType<L, int16, P> call(vecType<L, int16, P> const & Min, vecType<L, int16, P> const & Max)
{ {
return (vecType<D, int16, P>(compute_rand<D, uint16, P, vecType>::call() % vecType<D, uint16, P>(Max + static_cast<int16>(1) - Min))) + Min; return (vecType<L, int16, P>(compute_rand<L, uint16, P, vecType>::call() % vecType<L, uint16, P>(Max + static_cast<int16>(1) - Min))) + Min;
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, uint16, P, vecType> struct compute_linearRand<L, uint16, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, uint16, P> call(vecType<D, uint16, P> const & Min, vecType<D, uint16, P> const & Max) GLM_FUNC_QUALIFIER static vecType<L, uint16, P> call(vecType<L, uint16, P> const & Min, vecType<L, uint16, P> const & Max)
{ {
return (compute_rand<D, uint16, P, vecType>::call() % (Max + static_cast<uint16>(1) - Min)) + Min; return (compute_rand<L, uint16, P, vecType>::call() % (Max + static_cast<uint16>(1) - Min)) + Min;
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, int32, P, vecType> struct compute_linearRand<L, int32, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, int32, P> call(vecType<D, int32, P> const & Min, vecType<D, int32, P> const & Max) GLM_FUNC_QUALIFIER static vecType<L, int32, P> call(vecType<L, int32, P> const & Min, vecType<L, int32, P> const & Max)
{ {
return (vecType<D, int32, P>(compute_rand<D, uint32, P, vecType>::call() % vecType<D, uint32, P>(Max + static_cast<int32>(1) - Min))) + Min; return (vecType<L, int32, P>(compute_rand<L, uint32, P, vecType>::call() % vecType<L, uint32, P>(Max + static_cast<int32>(1) - Min))) + Min;
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, uint32, P, vecType> struct compute_linearRand<L, uint32, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, uint32, P> call(vecType<D, uint32, P> const & Min, vecType<D, uint32, P> const & Max) GLM_FUNC_QUALIFIER static vecType<L, uint32, P> call(vecType<L, uint32, P> const & Min, vecType<L, uint32, P> const & Max)
{ {
return (compute_rand<D, uint32, P, vecType>::call() % (Max + static_cast<uint32>(1) - Min)) + Min; return (compute_rand<L, uint32, P, vecType>::call() % (Max + static_cast<uint32>(1) - Min)) + Min;
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, int64, P, vecType> struct compute_linearRand<L, int64, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, int64, P> call(vecType<D, int64, P> const & Min, vecType<D, int64, P> const & Max) GLM_FUNC_QUALIFIER static vecType<L, int64, P> call(vecType<L, int64, P> const & Min, vecType<L, int64, P> const & Max)
{ {
return (vecType<D, int64, P>(compute_rand<D, uint64, P, vecType>::call() % vecType<D, uint64, P>(Max + static_cast<int64>(1) - Min))) + Min; return (vecType<L, int64, P>(compute_rand<L, uint64, P, vecType>::call() % vecType<L, uint64, P>(Max + static_cast<int64>(1) - Min))) + Min;
} }
}; };
template <int D, precision P, template <int, typename, precision> class vecType> template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, uint64, P, vecType> struct compute_linearRand<L, uint64, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, uint64, P> call(vecType<D, uint64, P> const & Min, vecType<D, uint64, P> const & Max) GLM_FUNC_QUALIFIER static vecType<L, uint64, P> call(vecType<L, uint64, P> const & Min, vecType<L, uint64, P> const & Max)
{ {
return (compute_rand<D, uint64, P, vecType>::call() % (Max + static_cast<uint64>(1) - Min)) + Min; return (compute_rand<L, uint64, P, vecType>::call() % (Max + static_cast<uint64>(1) - Min)) + Min;
} }
}; };
template <int D, template <int, typename, precision> class vecType> template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, float, lowp, vecType> struct compute_linearRand<L, float, lowp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, float, lowp> call(vecType<D, float, lowp> const & Min, vecType<D, float, lowp> const & Max) GLM_FUNC_QUALIFIER static vecType<L, float, lowp> call(vecType<L, float, lowp> const & Min, vecType<L, float, lowp> const & Max)
{ {
return vecType<D, float, lowp>(compute_rand<D, uint8, lowp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint8>::max()) * (Max - Min) + Min; return vecType<L, float, lowp>(compute_rand<L, uint8, lowp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint8>::max()) * (Max - Min) + Min;
} }
}; };
template <int D, template <int, typename, precision> class vecType> template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, float, mediump, vecType> struct compute_linearRand<L, float, mediump, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, float, mediump> call(vecType<D, float, mediump> const & Min, vecType<D, float, mediump> const & Max) GLM_FUNC_QUALIFIER static vecType<L, float, mediump> call(vecType<L, float, mediump> const & Min, vecType<L, float, mediump> const & Max)
{ {
return vecType<D, float, mediump>(compute_rand<D, uint16, mediump, vecType>::call()) / static_cast<float>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min; return vecType<L, float, mediump>(compute_rand<L, uint16, mediump, vecType>::call()) / static_cast<float>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min;
} }
}; };
template <int D, template <int, typename, precision> class vecType> template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, float, highp, vecType> struct compute_linearRand<L, float, highp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, float, highp> call(vecType<D, float, highp> const & Min, vecType<D, float, highp> const & Max) GLM_FUNC_QUALIFIER static vecType<L, float, highp> call(vecType<L, float, highp> const & Min, vecType<L, float, highp> const & Max)
{ {
return vecType<D, float, highp>(compute_rand<D, uint32, highp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min; return vecType<L, float, highp>(compute_rand<L, uint32, highp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
} }
}; };
template <int D, template <int, typename, precision> class vecType> template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, double, lowp, vecType> struct compute_linearRand<L, double, lowp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, double, lowp> call(vecType<D, double, lowp> const & Min, vecType<D, double, lowp> const & Max) GLM_FUNC_QUALIFIER static vecType<L, double, lowp> call(vecType<L, double, lowp> const & Min, vecType<L, double, lowp> const & Max)
{ {
return vecType<D, double, lowp>(compute_rand<D, uint16, lowp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min; return vecType<L, double, lowp>(compute_rand<L, uint16, lowp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min;
} }
}; };
template <int D, template <int, typename, precision> class vecType> template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, double, mediump, vecType> struct compute_linearRand<L, double, mediump, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, double, mediump> call(vecType<D, double, mediump> const & Min, vecType<D, double, mediump> const & Max) GLM_FUNC_QUALIFIER static vecType<L, double, mediump> call(vecType<L, double, mediump> const & Min, vecType<L, double, mediump> const & Max)
{ {
return vecType<D, double, mediump>(compute_rand<D, uint32, mediump, vecType>::call()) / static_cast<double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min; return vecType<L, double, mediump>(compute_rand<L, uint32, mediump, vecType>::call()) / static_cast<double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
} }
}; };
template <int D, template <int, typename, precision> class vecType> template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, double, highp, vecType> struct compute_linearRand<L, double, highp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, double, highp> call(vecType<D, double, highp> const & Min, vecType<D, double, highp> const & Max) GLM_FUNC_QUALIFIER static vecType<L, double, highp> call(vecType<L, double, highp> const & Min, vecType<L, double, highp> const & Max)
{ {
return vecType<D, double, highp>(compute_rand<D, uint64, highp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min; return vecType<L, double, highp>(compute_rand<L, uint64, highp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
} }
}; };
template <int D, template <int, typename, precision> class vecType> template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, long double, lowp, vecType> struct compute_linearRand<L, long double, lowp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, long double, lowp> call(vecType<D, long double, lowp> const & Min, vecType<D, long double, lowp> const & Max) GLM_FUNC_QUALIFIER static vecType<L, long double, lowp> call(vecType<L, long double, lowp> const & Min, vecType<L, long double, lowp> const & Max)
{ {
return vecType<D, long double, lowp>(compute_rand<D, uint32, lowp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min; return vecType<L, long double, lowp>(compute_rand<L, uint32, lowp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
} }
}; };
template <int D, template <int, typename, precision> class vecType> template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, long double, mediump, vecType> struct compute_linearRand<L, long double, mediump, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, long double, mediump> call(vecType<D, long double, mediump> const & Min, vecType<D, long double, mediump> const & Max) GLM_FUNC_QUALIFIER static vecType<L, long double, mediump> call(vecType<L, long double, mediump> const & Min, vecType<L, long double, mediump> const & Max)
{ {
return vecType<D, long double, mediump>(compute_rand<D, uint64, mediump, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min; return vecType<L, long double, mediump>(compute_rand<L, uint64, mediump, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
} }
}; };
template <int D, template <int, typename, precision> class vecType> template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<D, long double, highp, vecType> struct compute_linearRand<L, long double, highp, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<D, long double, highp> call(vecType<D, long double, highp> const & Min, vecType<D, long double, highp> const & Max) GLM_FUNC_QUALIFIER static vecType<L, long double, highp> call(vecType<L, long double, highp> const & Min, vecType<L, long double, highp> const & Max)
{ {
return vecType<D, long double, highp>(compute_rand<D, uint64, highp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min; return vecType<L, long double, highp>(compute_rand<L, uint64, highp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
} }
}; };
}//namespace detail }//namespace detail
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max) GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max)
{ {
return detail::compute_linearRand<1, genType, highp, vec>::call( return detail::compute_linearRand<1, genType, highp, vec>::call(
@@ -263,13 +263,13 @@ namespace detail
vec<1, genType, highp>(Max)).x; vec<1, genType, highp>(Max)).x;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> linearRand(vecType<D, T, P> const & Min, vecType<D, T, P> const & Max) GLM_FUNC_QUALIFIER vecType<L, T, P> linearRand(vecType<L, T, P> const & Min, vecType<L, T, P> const & Max)
{ {
return detail::compute_linearRand<D, T, P, vecType>::call(Min, Max); return detail::compute_linearRand<L, T, P, vecType>::call(Min, Max);
} }
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType gaussRand(genType Mean, genType Deviation) GLM_FUNC_QUALIFIER genType gaussRand(genType Mean, genType Deviation)
{ {
genType w, x1, x2; genType w, x1, x2;
@@ -285,13 +285,13 @@ namespace detail
return x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean; return x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> gaussRand(vecType<D, T, P> const & Mean, vecType<D, T, P> const & Deviation) GLM_FUNC_QUALIFIER vecType<L, T, P> gaussRand(vecType<L, T, P> const & Mean, vecType<L, T, P> const & Deviation)
{ {
return detail::functor2<D, T, P>::call(gaussRand, Mean, Deviation); return detail::functor2<L, T, P>::call(gaussRand, Mean, Deviation);
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER vec<2, T, defaultp> diskRand(T Radius) GLM_FUNC_QUALIFIER vec<2, T, defaultp> diskRand(T Radius)
{ {
vec<2, T, defaultp> Result(T(0)); vec<2, T, defaultp> Result(T(0));
@@ -309,7 +309,7 @@ namespace detail
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER vec<3, T, defaultp> ballRand(T Radius) GLM_FUNC_QUALIFIER vec<3, T, defaultp> ballRand(T Radius)
{ {
vec<3, T, defaultp> Result(T(0)); vec<3, T, defaultp> Result(T(0));
@@ -327,14 +327,14 @@ namespace detail
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER vec<2, T, defaultp> circularRand(T Radius) GLM_FUNC_QUALIFIER vec<2, T, defaultp> circularRand(T Radius)
{ {
T a = linearRand(T(0), T(6.283185307179586476925286766559f)); T a = linearRand(T(0), T(6.283185307179586476925286766559f));
return vec<2, T, defaultp>(cos(a), sin(a)) * Radius; return vec<2, T, defaultp>(cos(a), sin(a)) * Radius;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER vec<3, T, defaultp> sphericalRand(T Radius) GLM_FUNC_QUALIFIER vec<3, T, defaultp> sphericalRand(T Radius)
{ {
T z = linearRand(T(-1), T(1)); T z = linearRand(T(-1), T(1));

View File

@@ -30,7 +30,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType sec(genType angle); GLM_FUNC_DECL genType sec(genType angle);
/// Cosecant function. /// Cosecant function.
@@ -39,7 +39,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType csc(genType angle); GLM_FUNC_DECL genType csc(genType angle);
/// Cotangent function. /// Cotangent function.
@@ -48,7 +48,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType cot(genType angle); GLM_FUNC_DECL genType cot(genType angle);
/// Inverse secant function. /// Inverse secant function.
@@ -57,7 +57,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType asec(genType x); GLM_FUNC_DECL genType asec(genType x);
/// Inverse cosecant function. /// Inverse cosecant function.
@@ -66,7 +66,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType acsc(genType x); GLM_FUNC_DECL genType acsc(genType x);
/// Inverse cotangent function. /// Inverse cotangent function.
@@ -75,7 +75,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType acot(genType x); GLM_FUNC_DECL genType acot(genType x);
/// Secant hyperbolic function. /// Secant hyperbolic function.
@@ -83,7 +83,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType sech(genType angle); GLM_FUNC_DECL genType sech(genType angle);
/// Cosecant hyperbolic function. /// Cosecant hyperbolic function.
@@ -91,7 +91,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType csch(genType angle); GLM_FUNC_DECL genType csch(genType angle);
/// Cotangent hyperbolic function. /// Cotangent hyperbolic function.
@@ -99,7 +99,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType coth(genType angle); GLM_FUNC_DECL genType coth(genType angle);
/// Inverse secant hyperbolic function. /// Inverse secant hyperbolic function.
@@ -108,7 +108,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType asech(genType x); GLM_FUNC_DECL genType asech(genType x);
/// Inverse cosecant hyperbolic function. /// Inverse cosecant hyperbolic function.
@@ -117,7 +117,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType acsch(genType x); GLM_FUNC_DECL genType acsch(genType x);
/// Inverse cotangent hyperbolic function. /// Inverse cotangent hyperbolic function.
@@ -126,7 +126,7 @@ namespace glm
/// @tparam genType Floating-point scalar or vector types. /// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see gtc_reciprocal /// @see gtc_reciprocal
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType acoth(genType x); GLM_FUNC_DECL genType acoth(genType x);
/// @} /// @}

View File

@@ -7,37 +7,37 @@
namespace glm namespace glm
{ {
// sec // sec
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType sec(genType angle) GLM_FUNC_QUALIFIER genType sec(genType angle)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sec' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sec' only accept floating-point values");
return genType(1) / glm::cos(angle); return genType(1) / glm::cos(angle);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> sec(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> sec(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sec' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sec' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(sec, x); return detail::functor1<L, T, T, P>::call(sec, x);
} }
// csc // csc
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType csc(genType angle) GLM_FUNC_QUALIFIER genType csc(genType angle)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csc' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csc' only accept floating-point values");
return genType(1) / glm::sin(angle); return genType(1) / glm::sin(angle);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> csc(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> csc(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csc' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csc' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(csc, x); return detail::functor1<L, T, T, P>::call(csc, x);
} }
// cot // cot
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType cot(genType angle) GLM_FUNC_QUALIFIER genType cot(genType angle)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cot' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'cot' only accept floating-point values");
@@ -46,45 +46,45 @@ namespace glm
return glm::tan(pi_over_2 - angle); return glm::tan(pi_over_2 - angle);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> cot(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> cot(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cot' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cot' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(cot, x); return detail::functor1<L, T, T, P>::call(cot, x);
} }
// asec // asec
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType asec(genType x) GLM_FUNC_QUALIFIER genType asec(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asec' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asec' only accept floating-point values");
return acos(genType(1) / x); return acos(genType(1) / x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> asec(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> asec(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asec' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asec' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(asec, x); return detail::functor1<L, T, T, P>::call(asec, x);
} }
// acsc // acsc
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType acsc(genType x) GLM_FUNC_QUALIFIER genType acsc(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsc' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsc' only accept floating-point values");
return asin(genType(1) / x); return asin(genType(1) / x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> acsc(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> acsc(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsc' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsc' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(acsc, x); return detail::functor1<L, T, T, P>::call(acsc, x);
} }
// acot // acot
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType acot(genType x) GLM_FUNC_QUALIFIER genType acot(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acot' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acot' only accept floating-point values");
@@ -93,100 +93,100 @@ namespace glm
return pi_over_2 - atan(x); return pi_over_2 - atan(x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> acot(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> acot(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acot' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acot' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(acot, x); return detail::functor1<L, T, T, P>::call(acot, x);
} }
// sech // sech
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType sech(genType angle) GLM_FUNC_QUALIFIER genType sech(genType angle)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sech' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'sech' only accept floating-point values");
return genType(1) / glm::cosh(angle); return genType(1) / glm::cosh(angle);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> sech(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> sech(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sech' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sech' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(sech, x); return detail::functor1<L, T, T, P>::call(sech, x);
} }
// csch // csch
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType csch(genType angle) GLM_FUNC_QUALIFIER genType csch(genType angle)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csch' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'csch' only accept floating-point values");
return genType(1) / glm::sinh(angle); return genType(1) / glm::sinh(angle);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> csch(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> csch(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csch' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csch' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(csch, x); return detail::functor1<L, T, T, P>::call(csch, x);
} }
// coth // coth
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType coth(genType angle) GLM_FUNC_QUALIFIER genType coth(genType angle)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'coth' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'coth' only accept floating-point values");
return glm::cosh(angle) / glm::sinh(angle); return glm::cosh(angle) / glm::sinh(angle);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> coth(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> coth(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'coth' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'coth' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(coth, x); return detail::functor1<L, T, T, P>::call(coth, x);
} }
// asech // asech
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType asech(genType x) GLM_FUNC_QUALIFIER genType asech(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asech' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asech' only accept floating-point values");
return acosh(genType(1) / x); return acosh(genType(1) / x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> asech(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> asech(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asech' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asech' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(asech, x); return detail::functor1<L, T, T, P>::call(asech, x);
} }
// acsch // acsch
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType acsch(genType x) GLM_FUNC_QUALIFIER genType acsch(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsch' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acsch' only accept floating-point values");
return acsch(genType(1) / x); return acsch(genType(1) / x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> acsch(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> acsch(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsch' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsch' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(acsch, x); return detail::functor1<L, T, T, P>::call(acsch, x);
} }
// acoth // acoth
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType acoth(genType x) GLM_FUNC_QUALIFIER genType acoth(genType x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acoth' only accept floating-point values"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acoth' only accept floating-point values");
return atanh(genType(1) / x); return atanh(genType(1) / x);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> acoth(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> acoth(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acoth' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acoth' only accept floating-point inputs");
return detail::functor1<D, T, T, P>::call(acoth, x); return detail::functor1<L, T, T, P>::call(acoth, x);
} }
}//namespace glm }//namespace glm

View File

@@ -33,72 +33,72 @@ namespace glm
/// Return true if the value is a power of two number. /// Return true if the value is a power of two number.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL bool isPowerOfTwo(genIUType Value); GLM_FUNC_DECL bool isPowerOfTwo(genIUType Value);
/// Return true if the value is a power of two number. /// Return true if the value is a power of two number.
/// ///
/// @see gtc_round /// @see gtc_round
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> isPowerOfTwo(vecType<D, T, P> const & value); GLM_FUNC_DECL vecType<L, bool, P> isPowerOfTwo(vecType<L, T, P> const & value);
/// Return the power of two number which value is just higher the input value, /// Return the power of two number which value is just higher the input value,
/// round up to a power of two. /// round up to a power of two.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value); GLM_FUNC_DECL genIUType ceilPowerOfTwo(genIUType Value);
/// Return the power of two number which value is just higher the input value, /// Return the power of two number which value is just higher the input value,
/// round up to a power of two. /// round up to a power of two.
/// ///
/// @see gtc_round /// @see gtc_round
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> ceilPowerOfTwo(vecType<D, T, P> const & value); GLM_FUNC_DECL vecType<L, T, P> ceilPowerOfTwo(vecType<L, T, P> const & value);
/// Return the power of two number which value is just lower the input value, /// Return the power of two number which value is just lower the input value,
/// round down to a power of two. /// round down to a power of two.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value); GLM_FUNC_DECL genIUType floorPowerOfTwo(genIUType Value);
/// Return the power of two number which value is just lower the input value, /// Return the power of two number which value is just lower the input value,
/// round down to a power of two. /// round down to a power of two.
/// ///
/// @see gtc_round /// @see gtc_round
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> floorPowerOfTwo(vecType<D, T, P> const & value); GLM_FUNC_DECL vecType<L, T, P> floorPowerOfTwo(vecType<L, T, P> const & value);
/// Return the power of two number which value is the closet to the input value. /// Return the power of two number which value is the closet to the input value.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value); GLM_FUNC_DECL genIUType roundPowerOfTwo(genIUType Value);
/// Return the power of two number which value is the closet to the input value. /// Return the power of two number which value is the closet to the input value.
/// ///
/// @see gtc_round /// @see gtc_round
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> roundPowerOfTwo(vecType<D, T, P> const & value); GLM_FUNC_DECL vecType<L, T, P> roundPowerOfTwo(vecType<L, T, P> const & value);
/// Return true if the 'Value' is a multiple of 'Multiple'. /// Return true if the 'Value' is a multiple of 'Multiple'.
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple); GLM_FUNC_DECL bool isMultiple(genIUType Value, genIUType Multiple);
/// Return true if the 'Value' is a multiple of 'Multiple'. /// Return true if the 'Value' is a multiple of 'Multiple'.
/// ///
/// @see gtc_round /// @see gtc_round
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> isMultiple(vecType<D, T, P> const & Value, T Multiple); GLM_FUNC_DECL vecType<L, bool, P> isMultiple(vecType<L, T, P> const & Value, T Multiple);
/// Return true if the 'Value' is a multiple of 'Multiple'. /// Return true if the 'Value' is a multiple of 'Multiple'.
/// ///
/// @see gtc_round /// @see gtc_round
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, bool, P> isMultiple(vecType<D, T, P> const & Value, vecType<D, T, P> const & Multiple); GLM_FUNC_DECL vecType<L, bool, P> isMultiple(vecType<L, T, P> const & Value, vecType<L, T, P> const & Multiple);
/// Higher multiple number of Source. /// Higher multiple number of Source.
/// ///
@@ -107,7 +107,7 @@ namespace glm
/// @param Multiple Must be a null or positive value /// @param Multiple Must be a null or positive value
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple); GLM_FUNC_DECL genType ceilMultiple(genType Source, genType Multiple);
/// Higher multiple number of Source. /// Higher multiple number of Source.
@@ -117,8 +117,8 @@ namespace glm
/// @param Multiple Must be a null or positive value /// @param Multiple Must be a null or positive value
/// ///
/// @see gtc_round /// @see gtc_round
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> ceilMultiple(vecType<D, T, P> const & Source, vecType<D, T, P> const & Multiple); GLM_FUNC_DECL vecType<L, T, P> ceilMultiple(vecType<L, T, P> const & Source, vecType<L, T, P> const & Multiple);
/// Lower multiple number of Source. /// Lower multiple number of Source.
/// ///
@@ -127,7 +127,7 @@ namespace glm
/// @param Multiple Must be a null or positive value /// @param Multiple Must be a null or positive value
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType floorMultiple( GLM_FUNC_DECL genType floorMultiple(
genType Source, genType Source,
genType Multiple); genType Multiple);
@@ -139,10 +139,10 @@ namespace glm
/// @param Multiple Must be a null or positive value /// @param Multiple Must be a null or positive value
/// ///
/// @see gtc_round /// @see gtc_round
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> floorMultiple( GLM_FUNC_DECL vecType<L, T, P> floorMultiple(
vecType<D, T, P> const & Source, vecType<L, T, P> const& Source,
vecType<D, T, P> const & Multiple); vecType<L, T, P> const& Multiple);
/// Lower multiple number of Source. /// Lower multiple number of Source.
/// ///
@@ -151,7 +151,7 @@ namespace glm
/// @param Multiple Must be a null or positive value /// @param Multiple Must be a null or positive value
/// ///
/// @see gtc_round /// @see gtc_round
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType roundMultiple( GLM_FUNC_DECL genType roundMultiple(
genType Source, genType Source,
genType Multiple); genType Multiple);
@@ -163,10 +163,10 @@ namespace glm
/// @param Multiple Must be a null or positive value /// @param Multiple Must be a null or positive value
/// ///
/// @see gtc_round /// @see gtc_round
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> roundMultiple( GLM_FUNC_DECL vecType<L, T, P> roundMultiple(
vecType<D, T, P> const & Source, vecType<L, T, P> const& Source,
vecType<D, T, P> const & Multiple); vecType<L, T, P> const& Multiple);
/// @} /// @}
} //namespace glm } //namespace glm

View File

@@ -6,73 +6,73 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool compute = false> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool compute = false>
struct compute_ceilShift struct compute_ceilShift
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & v, T) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & v, T)
{ {
return v; return v;
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
struct compute_ceilShift<D, T, P, vecType, true> struct compute_ceilShift<L, T, P, vecType, true>
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & v, T Shift) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & v, T Shift)
{ {
return v | (v >> Shift); return v | (v >> Shift);
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool isSigned = true> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool isSigned = true>
struct compute_ceilPowerOfTwo struct compute_ceilPowerOfTwo
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
vecType<D, T, P> const Sign(sign(x)); vecType<L, T, P> const Sign(sign(x));
vecType<D, T, P> v(abs(x)); vecType<L, T, P> v(abs(x));
v = v - static_cast<T>(1); v = v - static_cast<T>(1);
v = v | (v >> static_cast<T>(1)); v = v | (v >> static_cast<T>(1));
v = v | (v >> static_cast<T>(2)); v = v | (v >> static_cast<T>(2));
v = v | (v >> static_cast<T>(4)); v = v | (v >> static_cast<T>(4));
v = compute_ceilShift<D, T, P, vecType, sizeof(T) >= 2>::call(v, 8); v = compute_ceilShift<L, T, P, vecType, sizeof(T) >= 2>::call(v, 8);
v = compute_ceilShift<D, T, P, vecType, sizeof(T) >= 4>::call(v, 16); v = compute_ceilShift<L, T, P, vecType, sizeof(T) >= 4>::call(v, 16);
v = compute_ceilShift<D, T, P, vecType, sizeof(T) >= 8>::call(v, 32); v = compute_ceilShift<L, T, P, vecType, sizeof(T) >= 8>::call(v, 32);
return (v + static_cast<T>(1)) * Sign; return (v + static_cast<T>(1)) * Sign;
} }
}; };
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
struct compute_ceilPowerOfTwo<D, T, P, vecType, false> struct compute_ceilPowerOfTwo<L, T, P, vecType, false>
{ {
GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
{ {
GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs"); GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
vecType<D, T, P> v(x); vecType<L, T, P> v(x);
v = v - static_cast<T>(1); v = v - static_cast<T>(1);
v = v | (v >> static_cast<T>(1)); v = v | (v >> static_cast<T>(1));
v = v | (v >> static_cast<T>(2)); v = v | (v >> static_cast<T>(2));
v = v | (v >> static_cast<T>(4)); v = v | (v >> static_cast<T>(4));
v = compute_ceilShift<D, T, P, vecType, sizeof(T) >= 2>::call(v, 8); v = compute_ceilShift<L, T, P, vecType, sizeof(T) >= 2>::call(v, 8);
v = compute_ceilShift<D, T, P, vecType, sizeof(T) >= 4>::call(v, 16); v = compute_ceilShift<L, T, P, vecType, sizeof(T) >= 4>::call(v, 16);
v = compute_ceilShift<D, T, P, vecType, sizeof(T) >= 8>::call(v, 32); v = compute_ceilShift<L, T, P, vecType, sizeof(T) >= 8>::call(v, 32);
return v + static_cast<T>(1); return v + static_cast<T>(1);
} }
}; };
template <bool is_float, bool is_signed> template<bool is_float, bool is_signed>
struct compute_ceilMultiple{}; struct compute_ceilMultiple{};
template <> template<>
struct compute_ceilMultiple<true, true> struct compute_ceilMultiple<true, true>
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple)
{ {
if(Source > genType(0)) if(Source > genType(0))
@@ -82,10 +82,10 @@ namespace detail
} }
}; };
template <> template<>
struct compute_ceilMultiple<false, false> struct compute_ceilMultiple<false, false>
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple)
{ {
genType Tmp = Source - genType(1); genType Tmp = Source - genType(1);
@@ -93,10 +93,10 @@ namespace detail
} }
}; };
template <> template<>
struct compute_ceilMultiple<false, true> struct compute_ceilMultiple<false, true>
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple)
{ {
if(Source > genType(0)) if(Source > genType(0))
@@ -109,13 +109,13 @@ namespace detail
} }
}; };
template <bool is_float, bool is_signed> template<bool is_float, bool is_signed>
struct compute_floorMultiple{}; struct compute_floorMultiple{};
template <> template<>
struct compute_floorMultiple<true, true> struct compute_floorMultiple<true, true>
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple)
{ {
if(Source >= genType(0)) if(Source >= genType(0))
@@ -125,10 +125,10 @@ namespace detail
} }
}; };
template <> template<>
struct compute_floorMultiple<false, false> struct compute_floorMultiple<false, false>
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple)
{ {
if(Source >= genType(0)) if(Source >= genType(0))
@@ -141,10 +141,10 @@ namespace detail
} }
}; };
template <> template<>
struct compute_floorMultiple<false, true> struct compute_floorMultiple<false, true>
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple)
{ {
if(Source >= genType(0)) if(Source >= genType(0))
@@ -157,13 +157,13 @@ namespace detail
} }
}; };
template <bool is_float, bool is_signed> template<bool is_float, bool is_signed>
struct compute_roundMultiple{}; struct compute_roundMultiple{};
template <> template<>
struct compute_roundMultiple<true, true> struct compute_roundMultiple<true, true>
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple)
{ {
if(Source >= genType(0)) if(Source >= genType(0))
@@ -176,10 +176,10 @@ namespace detail
} }
}; };
template <> template<>
struct compute_roundMultiple<false, false> struct compute_roundMultiple<false, false>
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple)
{ {
if(Source >= genType(0)) if(Source >= genType(0))
@@ -192,10 +192,10 @@ namespace detail
} }
}; };
template <> template<>
struct compute_roundMultiple<false, true> struct compute_roundMultiple<false, true>
{ {
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple) GLM_FUNC_QUALIFIER static genType call(genType Source, genType Multiple)
{ {
if(Source >= genType(0)) if(Source >= genType(0))
@@ -212,54 +212,54 @@ namespace detail
//////////////// ////////////////
// isPowerOfTwo // isPowerOfTwo
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER bool isPowerOfTwo(genType Value) GLM_FUNC_QUALIFIER bool isPowerOfTwo(genType Value)
{ {
genType const Result = glm::abs(Value); genType const Result = glm::abs(Value);
return !(Result & (Result - 1)); return !(Result & (Result - 1));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> isPowerOfTwo(vecType<D, T, P> const & Value) GLM_FUNC_QUALIFIER vecType<L, bool, P> isPowerOfTwo(vecType<L, T, P> const & Value)
{ {
vecType<D, T, P> const Result(abs(Value)); vecType<L, T, P> const Result(abs(Value));
return equal(Result & (Result - 1), vecType<D, T, P>(0)); return equal(Result & (Result - 1), vecType<L, T, P>(0));
} }
////////////////// //////////////////
// ceilPowerOfTwo // ceilPowerOfTwo
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value) GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value)
{ {
return detail::compute_ceilPowerOfTwo<1, genType, defaultp, vec, std::numeric_limits<genType>::is_signed>::call(vec<1, genType, defaultp>(value)).x; return detail::compute_ceilPowerOfTwo<1, genType, defaultp, vec, std::numeric_limits<genType>::is_signed>::call(vec<1, genType, defaultp>(value)).x;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> ceilPowerOfTwo(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> ceilPowerOfTwo(vecType<L, T, P> const & v)
{ {
return detail::compute_ceilPowerOfTwo<D, T, P, vecType, std::numeric_limits<T>::is_signed>::call(v); return detail::compute_ceilPowerOfTwo<L, T, P, vecType, std::numeric_limits<T>::is_signed>::call(v);
} }
/////////////////// ///////////////////
// floorPowerOfTwo // floorPowerOfTwo
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value) GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value)
{ {
return isPowerOfTwo(value) ? value : static_cast<genType>(1) << findMSB(value); return isPowerOfTwo(value) ? value : static_cast<genType>(1) << findMSB(value);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> floorPowerOfTwo(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> floorPowerOfTwo(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(floorPowerOfTwo, v); return detail::functor1<L, T, T, P>::call(floorPowerOfTwo, v);
} }
/////////////////// ///////////////////
// roundPowerOfTwo // roundPowerOfTwo
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType roundPowerOfTwo(genIUType value) GLM_FUNC_QUALIFIER genIUType roundPowerOfTwo(genIUType value)
{ {
if(isPowerOfTwo(value)) if(isPowerOfTwo(value))
@@ -270,75 +270,75 @@ namespace detail
return (next - value) < (value - prev) ? next : prev; return (next - value) < (value - prev) ? next : prev;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> roundPowerOfTwo(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> roundPowerOfTwo(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(roundPowerOfTwo, v); return detail::functor1<L, T, T, P>::call(roundPowerOfTwo, v);
} }
//////////////// ////////////////
// isMultiple // isMultiple
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER bool isMultiple(genType Value, genType Multiple) GLM_FUNC_QUALIFIER bool isMultiple(genType Value, genType Multiple)
{ {
return isMultiple(vec<1, genType>(Value), vec<1, genType>(Multiple)).x; return isMultiple(vec<1, genType>(Value), vec<1, genType>(Multiple)).x;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> isMultiple(vecType<D, T, P> const & Value, T Multiple) GLM_FUNC_QUALIFIER vecType<L, bool, P> isMultiple(vecType<L, T, P> const & Value, T Multiple)
{ {
return (Value % Multiple) == vecType<D, T, P>(0); return (Value % Multiple) == vecType<L, T, P>(0);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, bool, P> isMultiple(vecType<D, T, P> const & Value, vecType<D, T, P> const & Multiple) GLM_FUNC_QUALIFIER vecType<L, bool, P> isMultiple(vecType<L, T, P> const & Value, vecType<L, T, P> const & Multiple)
{ {
return (Value % Multiple) == vecType<D, T, P>(0); return (Value % Multiple) == vecType<L, T, P>(0);
} }
////////////////////// //////////////////////
// ceilMultiple // ceilMultiple
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType ceilMultiple(genType Source, genType Multiple) GLM_FUNC_QUALIFIER genType ceilMultiple(genType Source, genType Multiple)
{ {
return detail::compute_ceilMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); return detail::compute_ceilMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> ceilMultiple(vecType<D, T, P> const & Source, vecType<D, T, P> const & Multiple) GLM_FUNC_QUALIFIER vecType<L, T, P> ceilMultiple(vecType<L, T, P> const & Source, vecType<L, T, P> const & Multiple)
{ {
return detail::functor2<D, T, P>::call(ceilMultiple, Source, Multiple); return detail::functor2<L, T, P>::call(ceilMultiple, Source, Multiple);
} }
////////////////////// //////////////////////
// floorMultiple // floorMultiple
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType floorMultiple(genType Source, genType Multiple) GLM_FUNC_QUALIFIER genType floorMultiple(genType Source, genType Multiple)
{ {
return detail::compute_floorMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); return detail::compute_floorMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> floorMultiple(vecType<D, T, P> const & Source, vecType<D, T, P> const & Multiple) GLM_FUNC_QUALIFIER vecType<L, T, P> floorMultiple(vecType<L, T, P> const & Source, vecType<L, T, P> const & Multiple)
{ {
return detail::functor2<D, T, P>::call(floorMultiple, Source, Multiple); return detail::functor2<L, T, P>::call(floorMultiple, Source, Multiple);
} }
////////////////////// //////////////////////
// roundMultiple // roundMultiple
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType roundMultiple(genType Source, genType Multiple) GLM_FUNC_QUALIFIER genType roundMultiple(genType Source, genType Multiple)
{ {
return detail::compute_roundMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple); return detail::compute_roundMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> roundMultiple(vecType<D, T, P> const & Source, vecType<D, T, P> const & Multiple) GLM_FUNC_QUALIFIER vecType<L, T, P> roundMultiple(vecType<L, T, P> const & Source, vecType<L, T, P> const & Multiple)
{ {
return detail::functor2<D, T, P>::call(roundMultiple, Source, Multiple); return detail::functor2<L, T, P>::call(roundMultiple, Source, Multiple);
} }
}//namespace glm }//namespace glm

View File

@@ -60,7 +60,7 @@ namespace glm
/// Return the constant address to the data of the input parameter. /// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename genType> template<typename genType>
GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const & vec); GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const& v);
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr

View File

@@ -11,271 +11,199 @@ namespace glm
/// Return the constant address to the data of the vector input. /// Return the constant address to the data of the vector input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, P> const& v)
(
vec<2, T, P> const & vec
)
{ {
return &(vec.x); return &(v.x);
} }
//! Return the address to the data of the vector input. //! Return the address to the data of the vector input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, P>& v)
(
vec<2, T, P> & vec
)
{ {
return &(vec.x); return &(v.x);
} }
/// Return the constant address to the data of the vector input. /// Return the constant address to the data of the vector input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, P> const& v)
(
vec<3, T, P> const & vec
)
{ {
return &(vec.x); return &(v.x);
} }
//! Return the address to the data of the vector input. //! Return the address to the data of the vector input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, P>& v)
(
vec<3, T, P> & vec
)
{ {
return &(vec.x); return &(v.x);
} }
/// Return the constant address to the data of the vector input. /// Return the constant address to the data of the vector input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, P> const& v)
(
vec<4, T, P> const & vec
)
{ {
return &(vec.x); return &(v.x);
} }
//! Return the address to the data of the vector input. //! Return the address to the data of the vector input.
//! From GLM_GTC_type_ptr extension. //! From GLM_GTC_type_ptr extension.
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, P>& v)
(
vec<4, T, P> & vec
)
{ {
return &(vec.x); return &(v.x);
} }
/// Return the constant address to the data of the matrix input. /// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, P> const& m)
(
mat<2, 2, T, P> const& mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
//! Return the address to the data of the matrix input. //! Return the address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, P>& m)
(
mat<2, 2, T, P> & mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the constant address to the data of the matrix input. /// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, P> const& m)
(
mat<3, 3, T, P> const& mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
//! Return the address to the data of the matrix input. //! Return the address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, P>& m)
(
mat<3, 3, T, P> & mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the constant address to the data of the matrix input. /// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, P> const& m)
(
mat<4, 4, T, P> const& mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
//! Return the address to the data of the matrix input. //! Return the address to the data of the matrix input.
//! From GLM_GTC_type_ptr extension. //! From GLM_GTC_type_ptr extension.
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, P>& m)
(
mat<4, 4, T, P> & mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the constant address to the data of the matrix input. /// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, P> const& m)
(
mat<2, 3, T, P> const& mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
//! Return the address to the data of the matrix input. //! Return the address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, P>& m)
(
mat<2, 3, T, P> & mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the constant address to the data of the matrix input. /// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, P> const& m)
(
mat<3, 2, T, P> const& mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
//! Return the address to the data of the matrix input. //! Return the address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, P>& m)
(
mat<3, 2, T, P> & mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the constant address to the data of the matrix input. /// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, P> const& m)
(
mat<2, 4, T, P> const& mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
//! Return the address to the data of the matrix input. //! Return the address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, P>& m)
(
mat<2, 4, T, P> & mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the constant address to the data of the matrix input. /// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, P> const& m)
(
mat<4, 2, T, P> const& mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
//! Return the address to the data of the matrix input. //! Return the address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, P>& m)
(
mat<4, 2, T, P> & mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the constant address to the data of the matrix input. /// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, P> const& m)
(
mat<3, 4, T, P> const& mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
//! Return the address to the data of the matrix input. //! Return the address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, P>& m)
(
mat<3, 4, T, P> & mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the constant address to the data of the matrix input. /// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, P> const& m)
(
mat<4, 3, T, P> const& mat
)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the address to the data of the matrix input. /// Return the address to the data of the matrix input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, P> & mat) GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, P>& m)
{ {
return &(mat[0].x); return &(m[0].x);
} }
/// Return the constant address to the data of the input parameter. /// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr GLM_FUNC_QUALIFIER T const * value_ptr(tquat<T, P> const& q)
(
tquat<T, P> const & q
)
{ {
return &(q[0]); return &(q[0]);
} }
@@ -283,18 +211,15 @@ namespace glm
/// Return the address to the data of the quaternion input. /// Return the address to the data of the quaternion input.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template<typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr GLM_FUNC_QUALIFIER T* value_ptr(tquat<T, P>& q)
(
tquat<T, P> & q
)
{ {
return &(q[0]); return &(q[0]);
} }
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER vec<2, T, defaultp> make_vec2(T const * const ptr) GLM_FUNC_QUALIFIER vec<2, T, defaultp> make_vec2(T const *const ptr)
{ {
vec<2, T, defaultp> Result; vec<2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(vec<2, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(vec<2, T, defaultp>));
@@ -303,8 +228,8 @@ namespace glm
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER vec<3, T, defaultp> make_vec3(T const * const ptr) GLM_FUNC_QUALIFIER vec<3, T, defaultp> make_vec3(T const *const ptr)
{ {
vec<3, T, defaultp> Result; vec<3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(vec<3, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(vec<3, T, defaultp>));
@@ -313,8 +238,8 @@ namespace glm
/// Build a vector from a pointer. /// Build a vector from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER vec<4, T, defaultp> make_vec4(T const * const ptr) GLM_FUNC_QUALIFIER vec<4, T, defaultp> make_vec4(T const *const ptr)
{ {
vec<4, T, defaultp> Result; vec<4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(vec<4, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(vec<4, T, defaultp>));
@@ -323,8 +248,8 @@ namespace glm
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2x2(T const * const ptr) GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2x2(T const *const ptr)
{ {
mat<2, 2, T, defaultp> Result; mat<2, 2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<2, 2, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(mat<2, 2, T, defaultp>));
@@ -333,8 +258,8 @@ namespace glm
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<2, 3, T, defaultp> make_mat2x3(T const * const ptr) GLM_FUNC_QUALIFIER mat<2, 3, T, defaultp> make_mat2x3(T const *const ptr)
{ {
mat<2, 3, T, defaultp> Result; mat<2, 3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<2, 3, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(mat<2, 3, T, defaultp>));
@@ -343,8 +268,8 @@ namespace glm
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<2, 4, T, defaultp> make_mat2x4(T const * const ptr) GLM_FUNC_QUALIFIER mat<2, 4, T, defaultp> make_mat2x4(T const *const ptr)
{ {
mat<2, 4, T, defaultp> Result; mat<2, 4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<2, 4, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(mat<2, 4, T, defaultp>));
@@ -353,8 +278,8 @@ namespace glm
/// Build a matrix from a pointer. /// Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<3, 2, T, defaultp> make_mat3x2(T const * const ptr) GLM_FUNC_QUALIFIER mat<3, 2, T, defaultp> make_mat3x2(T const *const ptr)
{ {
mat<3, 2, T, defaultp> Result; mat<3, 2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<3, 2, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(mat<3, 2, T, defaultp>));
@@ -363,8 +288,8 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3x3(T const * const ptr) GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3x3(T const *const ptr)
{ {
mat<3, 3, T, defaultp> Result; mat<3, 3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<3, 3, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(mat<3, 3, T, defaultp>));
@@ -373,8 +298,8 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<3, 4, T, defaultp> make_mat3x4(T const * const ptr) GLM_FUNC_QUALIFIER mat<3, 4, T, defaultp> make_mat3x4(T const *const ptr)
{ {
mat<3, 4, T, defaultp> Result; mat<3, 4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<3, 4, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(mat<3, 4, T, defaultp>));
@@ -383,8 +308,8 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 2, T, defaultp> make_mat4x2(T const * const ptr) GLM_FUNC_QUALIFIER mat<4, 2, T, defaultp> make_mat4x2(T const *const ptr)
{ {
mat<4, 2, T, defaultp> Result; mat<4, 2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<4, 2, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(mat<4, 2, T, defaultp>));
@@ -393,8 +318,8 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 3, T, defaultp> make_mat4x3(T const * const ptr) GLM_FUNC_QUALIFIER mat<4, 3, T, defaultp> make_mat4x3(T const *const ptr)
{ {
mat<4, 3, T, defaultp> Result; mat<4, 3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<4, 3, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(mat<4, 3, T, defaultp>));
@@ -403,8 +328,8 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4x4(T const * const ptr) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4x4(T const *const ptr)
{ {
mat<4, 4, T, defaultp> Result; mat<4, 4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<4, 4, T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(mat<4, 4, T, defaultp>));
@@ -413,32 +338,32 @@ namespace glm
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2(T const * const ptr) GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2(T const *const ptr)
{ {
return make_mat2x2(ptr); return make_mat2x2(ptr);
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3(T const * const ptr) GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3(T const *const ptr)
{ {
return make_mat3x3(ptr); return make_mat3x3(ptr);
} }
//! Build a matrix from a pointer. //! Build a matrix from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4(T const * const ptr) GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4(T const *const ptr)
{ {
return make_mat4x4(ptr); return make_mat4x4(ptr);
} }
//! Build a quaternion from a pointer. //! Build a quaternion from a pointer.
/// @see gtc_type_ptr /// @see gtc_type_ptr
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER tquat<T, defaultp> make_quat(T const * const ptr) GLM_FUNC_QUALIFIER tquat<T, defaultp> make_quat(T const *const ptr)
{ {
tquat<T, defaultp> Result; tquat<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tquat<T, defaultp>)); memcpy(value_ptr(Result), ptr, sizeof(tquat<T, defaultp>));

View File

@@ -29,27 +29,27 @@ namespace glm
/// Return the next ULP value(s) after the input value(s). /// Return the next ULP value(s) after the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType next_float(genType const & x); GLM_FUNC_DECL genType next_float(genType const & x);
/// Return the previous ULP value(s) before the input value(s). /// Return the previous ULP value(s) before the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType prev_float(genType const & x); GLM_FUNC_DECL genType prev_float(genType const & x);
/// Return the value(s) ULP distance after the input value(s). /// Return the value(s) ULP distance after the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType next_float(genType const & x, uint const & Distance); GLM_FUNC_DECL genType next_float(genType const & x, uint const & Distance);
/// Return the value(s) ULP distance before the input value(s). /// Return the value(s) ULP distance before the input value(s).
/// @see gtc_ulp /// @see gtc_ulp
template <typename genType> template<typename genType>
GLM_FUNC_DECL genType prev_float(genType const & x, uint const & Distance); GLM_FUNC_DECL genType prev_float(genType const & x, uint const & Distance);
/// Return the distance in the number of ULP between 2 scalars. /// Return the distance in the number of ULP between 2 scalars.
/// @see gtc_ulp /// @see gtc_ulp
template <typename T> template<typename T>
GLM_FUNC_DECL uint float_distance(T const & x, T const & y); GLM_FUNC_DECL uint float_distance(T const & x, T const & y);
/// Return the distance in the number of ULP between 2 vectors. /// Return the distance in the number of ULP between 2 vectors.

View File

@@ -171,7 +171,7 @@ namespace detail
namespace glm namespace glm
{ {
template <> template<>
GLM_FUNC_QUALIFIER float next_float(float const & x) GLM_FUNC_QUALIFIER float next_float(float const & x)
{ {
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
@@ -185,7 +185,7 @@ namespace glm
# endif # endif
} }
template <> template<>
GLM_FUNC_QUALIFIER double next_float(double const & x) GLM_FUNC_QUALIFIER double next_float(double const & x)
{ {
# if GLM_HAS_CXX11_STL # if GLM_HAS_CXX11_STL
@@ -199,10 +199,10 @@ namespace glm
# endif # endif
} }
template<int D, typename T, precision P, template<int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> next_float(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> next_float(vecType<L, T, P> const & x)
{ {
vecType<D, T, P> Result(uninitialize); vecType<L, T, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = next_float(x[i]); Result[i] = next_float(x[i]);
return Result; return Result;
@@ -234,16 +234,16 @@ namespace glm
# endif # endif
} }
template<int D, typename T, precision P, template<int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> prev_float(vecType<D, T, P> const & x) GLM_FUNC_QUALIFIER vecType<L, T, P> prev_float(vecType<L, T, P> const & x)
{ {
vecType<D, T, P> Result(uninitialize); vecType<L, T, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = prev_float(x[i]); Result[i] = prev_float(x[i]);
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER T next_float(T const & x, uint const & ulps) GLM_FUNC_QUALIFIER T next_float(T const & x, uint const & ulps)
{ {
T temp = x; T temp = x;
@@ -252,16 +252,16 @@ namespace glm
return temp; return temp;
} }
template<int D, typename T, precision P, template<int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> next_float(vecType<D, T, P> const & x, vecType<D, uint, P> const & ulps) GLM_FUNC_QUALIFIER vecType<L, T, P> next_float(vecType<L, T, P> const & x, vecType<L, uint, P> const & ulps)
{ {
vecType<D, T, P> Result(uninitialize); vecType<L, T, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = next_float(x[i], ulps[i]); Result[i] = next_float(x[i], ulps[i]);
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER T prev_float(T const & x, uint const & ulps) GLM_FUNC_QUALIFIER T prev_float(T const & x, uint const & ulps)
{ {
T temp = x; T temp = x;
@@ -270,16 +270,16 @@ namespace glm
return temp; return temp;
} }
template<int D, typename T, precision P, template<int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> prev_float(vecType<D, T, P> const & x, vecType<D, uint, P> const & ulps) GLM_FUNC_QUALIFIER vecType<L, T, P> prev_float(vecType<L, T, P> const & x, vecType<L, uint, P> const & ulps)
{ {
vecType<D, T, P> Result(uninitialize); vecType<L, T, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = prev_float(x[i], ulps[i]); Result[i] = prev_float(x[i], ulps[i]);
return Result; return Result;
} }
template <typename T> template<typename T>
GLM_FUNC_QUALIFIER uint float_distance(T const & x, T const & y) GLM_FUNC_QUALIFIER uint float_distance(T const & x, T const & y)
{ {
uint ulp = 0; uint ulp = 0;
@@ -310,10 +310,10 @@ namespace glm
return ulp; return ulp;
} }
template<int D, typename T, precision P, template<int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, uint, P> float_distance(vecType<D, T, P> const & x, vecType<D, T, P> const & y) GLM_FUNC_QUALIFIER vecType<L, uint, P> float_distance(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{ {
vecType<D, uint, P> Result(uninitialize); vecType<L, uint, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = float_distance(x[i], y[i]); Result[i] = float_distance(x[i], y[i]);
return Result; return Result;

View File

@@ -35,24 +35,24 @@ namespace glm
/// Minimum comparison between 2 variables and returns 2 associated variable values /// Minimum comparison between 2 variables and returns 2 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vec<2, U, P> associatedMin( GLM_FUNC_DECL vec<2, U, P> associatedMin(
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b); vecType<L, T, P> const& y, vecType<L, U, P> const & b);
/// Minimum comparison between 2 variables and returns 2 associated variable values /// Minimum comparison between 2 variables and returns 2 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMin( GLM_FUNC_DECL vecType<L, U, P> associatedMin(
T x, const vecType<D, U, P>& a, T x, const vecType<L, U, P>& a,
T y, const vecType<D, U, P>& b); T y, const vecType<L, U, P>& b);
/// Minimum comparison between 2 variables and returns 2 associated variable values /// Minimum comparison between 2 variables and returns 2 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMin( GLM_FUNC_DECL vecType<L, U, P> associatedMin(
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b); vecType<L, T, P> const& y, U b);
/// Minimum comparison between 3 variables and returns 3 associated variable values /// Minimum comparison between 3 variables and returns 3 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
@@ -64,11 +64,11 @@ namespace glm
/// Minimum comparison between 3 variables and returns 3 associated variable values /// Minimum comparison between 3 variables and returns 3 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMin( GLM_FUNC_DECL vecType<L, U, P> associatedMin(
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b, vecType<L, T, P> const& y, vecType<L, U, P> const & b,
vecType<D, T, P> const & z, vecType<D, U, P> const & c); vecType<L, T, P> const& z, vecType<L, U, P> const & c);
/// Minimum comparison between 4 variables and returns 4 associated variable values /// Minimum comparison between 4 variables and returns 4 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
@@ -81,30 +81,30 @@ namespace glm
/// Minimum comparison between 4 variables and returns 4 associated variable values /// Minimum comparison between 4 variables and returns 4 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMin( GLM_FUNC_DECL vecType<L, U, P> associatedMin(
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b, vecType<L, T, P> const& y, vecType<L, U, P> const & b,
vecType<D, T, P> const & z, vecType<D, U, P> const & c, vecType<L, T, P> const& z, vecType<L, U, P> const & c,
vecType<D, T, P> const & w, vecType<D, U, P> const & d); vecType<L, T, P> const& w, vecType<L, U, P> const & d);
/// Minimum comparison between 4 variables and returns 4 associated variable values /// Minimum comparison between 4 variables and returns 4 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMin( GLM_FUNC_DECL vecType<L, U, P> associatedMin(
T x, vecType<D, U, P> const & a, T x, vecType<L, U, P> const & a,
T y, vecType<D, U, P> const & b, T y, vecType<L, U, P> const & b,
T z, vecType<D, U, P> const & c, T z, vecType<L, U, P> const & c,
T w, vecType<D, U, P> const & d); T w, vecType<L, U, P> const & d);
/// Minimum comparison between 4 variables and returns 4 associated variable values /// Minimum comparison between 4 variables and returns 4 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMin( GLM_FUNC_DECL vecType<L, U, P> associatedMin(
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b, vecType<L, T, P> const& y, U b,
vecType<D, T, P> const & z, U c, vecType<L, T, P> const& z, U c,
vecType<D, T, P> const & w, U d); vecType<L, T, P> const& w, U d);
/// Maximum comparison between 2 variables and returns 2 associated variable values /// Maximum comparison between 2 variables and returns 2 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
@@ -113,24 +113,24 @@ namespace glm
/// Maximum comparison between 2 variables and returns 2 associated variable values /// Maximum comparison between 2 variables and returns 2 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vec<2, U, P> associatedMax( GLM_FUNC_DECL vec<2, U, P> associatedMax(
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b); vecType<L, T, P> const& y, vecType<L, U, P> const & b);
/// Maximum comparison between 2 variables and returns 2 associated variable values /// Maximum comparison between 2 variables and returns 2 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> associatedMax( GLM_FUNC_DECL vecType<L, T, P> associatedMax(
T x, vecType<D, U, P> const & a, T x, vecType<L, U, P> const & a,
T y, vecType<D, U, P> const & b); T y, vecType<L, U, P> const & b);
/// Maximum comparison between 2 variables and returns 2 associated variable values /// Maximum comparison between 2 variables and returns 2 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMax( GLM_FUNC_DECL vecType<L, U, P> associatedMax(
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b); vecType<L, T, P> const& y, U b);
/// Maximum comparison between 3 variables and returns 3 associated variable values /// Maximum comparison between 3 variables and returns 3 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
@@ -142,27 +142,27 @@ namespace glm
/// Maximum comparison between 3 variables and returns 3 associated variable values /// Maximum comparison between 3 variables and returns 3 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMax( GLM_FUNC_DECL vecType<L, U, P> associatedMax(
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b, vecType<L, T, P> const& y, vecType<L, U, P> const & b,
vecType<D, T, P> const & z, vecType<D, U, P> const & c); vecType<L, T, P> const& z, vecType<L, U, P> const & c);
/// Maximum comparison between 3 variables and returns 3 associated variable values /// Maximum comparison between 3 variables and returns 3 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> associatedMax( GLM_FUNC_DECL vecType<L, T, P> associatedMax(
T x, vecType<D, U, P> const & a, T x, vecType<L, U, P> const & a,
T y, vecType<D, U, P> const & b, T y, vecType<L, U, P> const & b,
T z, vecType<D, U, P> const & c); T z, vecType<L, U, P> const & c);
/// Maximum comparison between 3 variables and returns 3 associated variable values /// Maximum comparison between 3 variables and returns 3 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMax( GLM_FUNC_DECL vecType<L, U, P> associatedMax(
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b, vecType<L, T, P> const& y, U b,
vecType<D, T, P> const & z, U c); vecType<L, T, P> const& z, U c);
/// Maximum comparison between 4 variables and returns 4 associated variable values /// Maximum comparison between 4 variables and returns 4 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
@@ -175,30 +175,30 @@ namespace glm
/// Maximum comparison between 4 variables and returns 4 associated variable values /// Maximum comparison between 4 variables and returns 4 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMax( GLM_FUNC_DECL vecType<L, U, P> associatedMax(
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b, vecType<L, T, P> const& y, vecType<L, U, P> const & b,
vecType<D, T, P> const & z, vecType<D, U, P> const & c, vecType<L, T, P> const& z, vecType<L, U, P> const & c,
vecType<D, T, P> const & w, vecType<D, U, P> const & d); vecType<L, T, P> const& w, vecType<L, U, P> const & d);
/// Maximum comparison between 4 variables and returns 4 associated variable values /// Maximum comparison between 4 variables and returns 4 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMax( GLM_FUNC_DECL vecType<L, U, P> associatedMax(
T x, vecType<D, U, P> const & a, T x, vecType<L, U, P> const & a,
T y, vecType<D, U, P> const & b, T y, vecType<L, U, P> const & b,
T z, vecType<D, U, P> const & c, T z, vecType<L, U, P> const & c,
T w, vecType<D, U, P> const & d); T w, vecType<L, U, P> const & d);
/// Maximum comparison between 4 variables and returns 4 associated variable values /// Maximum comparison between 4 variables and returns 4 associated variable values
/// @see gtx_associated_min_max /// @see gtx_associated_min_max
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, U, P> associatedMax( GLM_FUNC_DECL vecType<L, U, P> associatedMax(
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b, vecType<L, T, P> const& y, U b,
vecType<D, T, P> const & z, U c, vecType<L, T, P> const& z, U c,
vecType<D, T, P> const & w, U d); vecType<L, T, P> const& w, U d);
/// @} /// @}
} //namespace glm } //namespace glm

View File

@@ -10,40 +10,40 @@ GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b)
return x < y ? a : b; return x < y ? a : b;
} }
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vec<2, U, P> associatedMin GLM_FUNC_QUALIFIER vec<2, U, P> associatedMin
( (
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b vecType<L, T, P> const& y, vecType<L, U, P> const & b
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] < y[i] ? a[i] : b[i]; Result[i] = x[i] < y[i] ? a[i] : b[i];
return Result; return Result;
} }
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMin GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMin
( (
T x, const vecType<D, U, P>& a, T x, const vecType<L, U, P>& a,
T y, const vecType<D, U, P>& b T y, const vecType<L, U, P>& b
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x < y ? a[i] : b[i]; Result[i] = x < y ? a[i] : b[i];
return Result; return Result;
} }
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMin GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMin
( (
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b vecType<L, T, P> const& y, U b
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] < y[i] ? a : b; Result[i] = x[i] < y[i] ? a : b;
return Result; return Result;
@@ -62,15 +62,15 @@ GLM_FUNC_QUALIFIER U associatedMin
return Result; return Result;
} }
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMin GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMin
( (
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b, vecType<L, T, P> const& y, vecType<L, U, P> const & b,
vecType<D, T, P> const & z, vecType<D, U, P> const & c vecType<L, T, P> const& z, vecType<L, U, P> const & c
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]); Result[i] = x[i] < y[i] ? (x[i] < z[i] ? a[i] : c[i]) : (y[i] < z[i] ? b[i] : c[i]);
return Result; return Result;
@@ -95,16 +95,16 @@ GLM_FUNC_QUALIFIER U associatedMin
} }
// Min comparison between 4 variables // Min comparison between 4 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMin GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMin
( (
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b, vecType<L, T, P> const& y, vecType<L, U, P> const & b,
vecType<D, T, P> const & z, vecType<D, U, P> const & c, vecType<L, T, P> const& z, vecType<L, U, P> const & c,
vecType<D, T, P> const & w, vecType<D, U, P> const & d vecType<L, T, P> const& w, vecType<L, U, P> const & d
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
{ {
T Test1 = min(x[i], y[i]); T Test1 = min(x[i], y[i]);
@@ -117,19 +117,19 @@ GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMin
} }
// Min comparison between 4 variables // Min comparison between 4 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMin GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMin
( (
T x, vecType<D, U, P> const & a, T x, vecType<L, U, P> const & a,
T y, vecType<D, U, P> const & b, T y, vecType<L, U, P> const & b,
T z, vecType<D, U, P> const & c, T z, vecType<L, U, P> const & c,
T w, vecType<D, U, P> const & d T w, vecType<L, U, P> const & d
) )
{ {
T Test1 = min(x, y); T Test1 = min(x, y);
T Test2 = min(z, w); T Test2 = min(z, w);
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
{ {
U Result1 = x < y ? a[i] : b[i]; U Result1 = x < y ? a[i] : b[i];
@@ -140,16 +140,16 @@ GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMin
} }
// Min comparison between 4 variables // Min comparison between 4 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMin GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMin
( (
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b, vecType<L, T, P> const& y, U b,
vecType<D, T, P> const & z, U c, vecType<L, T, P> const& z, U c,
vecType<D, T, P> const & w, U d vecType<L, T, P> const& w, U d
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
{ {
T Test1 = min(x[i], y[i]); T Test1 = min(x[i], y[i]);
@@ -169,42 +169,42 @@ GLM_FUNC_QUALIFIER U associatedMax(T x, U a, T y, U b)
} }
// Max comparison between 2 variables // Max comparison between 2 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vec<2, U, P> associatedMax GLM_FUNC_QUALIFIER vec<2, U, P> associatedMax
( (
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b vecType<L, T, P> const& y, vecType<L, U, P> const & b
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] > y[i] ? a[i] : b[i]; Result[i] = x[i] > y[i] ? a[i] : b[i];
return Result; return Result;
} }
// Max comparison between 2 variables // Max comparison between 2 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> associatedMax GLM_FUNC_QUALIFIER vecType<L, T, P> associatedMax
( (
T x, vecType<D, U, P> const & a, T x, vecType<L, U, P> const & a,
T y, vecType<D, U, P> const & b T y, vecType<L, U, P> const & b
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x > y ? a[i] : b[i]; Result[i] = x > y ? a[i] : b[i];
return Result; return Result;
} }
// Max comparison between 2 variables // Max comparison between 2 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMax GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMax
( (
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b vecType<L, T, P> const& y, U b
) )
{ {
vecType<D, T, P> Result(uninitialize); vecType<L, T, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] > y[i] ? a : b; Result[i] = x[i] > y[i] ? a : b;
return Result; return Result;
@@ -224,45 +224,45 @@ GLM_FUNC_QUALIFIER U associatedMax
} }
// Max comparison between 3 variables // Max comparison between 3 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMax GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMax
( (
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b, vecType<L, T, P> const& y, vecType<L, U, P> const & b,
vecType<D, T, P> const & z, vecType<D, U, P> const & c vecType<L, T, P> const& z, vecType<L, U, P> const & c
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]); Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a[i] : c[i]) : (y[i] > z[i] ? b[i] : c[i]);
return Result; return Result;
} }
// Max comparison between 3 variables // Max comparison between 3 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> associatedMax GLM_FUNC_QUALIFIER vecType<L, T, P> associatedMax
( (
T x, vecType<D, U, P> const & a, T x, vecType<L, U, P> const & a,
T y, vecType<D, U, P> const & b, T y, vecType<L, U, P> const & b,
T z, vecType<D, U, P> const & c T z, vecType<L, U, P> const & c
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]); Result[i] = x > y ? (x > z ? a[i] : c[i]) : (y > z ? b[i] : c[i]);
return Result; return Result;
} }
// Max comparison between 3 variables // Max comparison between 3 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMax GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMax
( (
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b, vecType<L, T, P> const& y, U b,
vecType<D, T, P> const & z, U c vecType<L, T, P> const& z, U c
) )
{ {
vecType<D, T, P> Result(uninitialize); vecType<L, T, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c); Result[i] = x[i] > y[i] ? (x[i] > z[i] ? a : c) : (y[i] > z[i] ? b : c);
return Result; return Result;
@@ -287,16 +287,16 @@ GLM_FUNC_QUALIFIER U associatedMax
} }
// Max comparison between 4 variables // Max comparison between 4 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMax GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMax
( (
vecType<D, T, P> const & x, vecType<D, U, P> const & a, vecType<L, T, P> const& x, vecType<L, U, P> const & a,
vecType<D, T, P> const & y, vecType<D, U, P> const & b, vecType<L, T, P> const& y, vecType<L, U, P> const & b,
vecType<D, T, P> const & z, vecType<D, U, P> const & c, vecType<L, T, P> const& z, vecType<L, U, P> const & c,
vecType<D, T, P> const & w, vecType<D, U, P> const & d vecType<L, T, P> const& w, vecType<L, U, P> const & d
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
{ {
T Test1 = max(x[i], y[i]); T Test1 = max(x[i], y[i]);
@@ -309,19 +309,19 @@ GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMax
} }
// Max comparison between 4 variables // Max comparison between 4 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMax GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMax
( (
T x, vecType<D, U, P> const & a, T x, vecType<L, U, P> const & a,
T y, vecType<D, U, P> const & b, T y, vecType<L, U, P> const & b,
T z, vecType<D, U, P> const & c, T z, vecType<L, U, P> const & c,
T w, vecType<D, U, P> const & d T w, vecType<L, U, P> const & d
) )
{ {
T Test1 = max(x, y); T Test1 = max(x, y);
T Test2 = max(z, w); T Test2 = max(z, w);
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
{ {
U Result1 = x > y ? a[i] : b[i]; U Result1 = x > y ? a[i] : b[i];
@@ -332,16 +332,16 @@ GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMax
} }
// Max comparison between 4 variables // Max comparison between 4 variables
template<int D, typename T, typename U, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, U, P> associatedMax GLM_FUNC_QUALIFIER vecType<L, U, P> associatedMax
( (
vecType<D, T, P> const & x, U a, vecType<L, T, P> const& x, U a,
vecType<D, T, P> const & y, U b, vecType<L, T, P> const& y, U b,
vecType<D, T, P> const & z, U c, vecType<L, T, P> const& z, U c,
vecType<D, T, P> const & w, U d vecType<L, T, P> const& w, U d
) )
{ {
vecType<D, U, P> Result(uninitialize); vecType<L, U, P> Result(uninitialize);
for(length_t i = 0, n = Result.length(); i < n; ++i) for(length_t i = 0, n = Result.length(); i < n; ++i)
{ {
T Test1 = max(x[i], y[i]); T Test1 = max(x[i], y[i]);

View File

@@ -29,25 +29,25 @@ namespace glm
/// @{ /// @{
/// @see gtx_bit /// @see gtx_bit
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType highestBitValue(genIUType Value); GLM_FUNC_DECL genIUType highestBitValue(genIUType Value);
/// @see gtx_bit /// @see gtx_bit
template <typename genIUType> template<typename genIUType>
GLM_FUNC_DECL genIUType lowestBitValue(genIUType Value); GLM_FUNC_DECL genIUType lowestBitValue(genIUType Value);
/// Find the highest bit set to 1 in a integer variable and return its value. /// Find the highest bit set to 1 in a integer variable and return its value.
/// ///
/// @see gtx_bit /// @see gtx_bit
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<D, T, P> highestBitValue(vecType<D, T, P> const & value); GLM_FUNC_DECL vecType<L, T, P> highestBitValue(vecType<L, T, P> const & value);
/// Return the power of two number which value is just higher the input value. /// Return the power of two number which value is just higher the input value.
/// Deprecated, use ceilPowerOfTwo from GTC_round instead /// Deprecated, use ceilPowerOfTwo from GTC_round instead
/// ///
/// @see gtc_round /// @see gtc_round
/// @see gtx_bit /// @see gtx_bit
template <typename genIUType> template<typename genIUType>
GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value); GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value);
/// Return the power of two number which value is just higher the input value. /// Return the power of two number which value is just higher the input value.
@@ -55,15 +55,15 @@ namespace glm
/// ///
/// @see gtc_round /// @see gtc_round
/// @see gtx_bit /// @see gtx_bit
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_DEPRECATED GLM_FUNC_DECL vecType<D, T, P> powerOfTwoAbove(vecType<D, T, P> const & value); GLM_DEPRECATED GLM_FUNC_DECL vecType<L, T, P> powerOfTwoAbove(vecType<L, T, P> const & value);
/// Return the power of two number which value is just lower the input value. /// Return the power of two number which value is just lower the input value.
/// Deprecated, use floorPowerOfTwo from GTC_round instead /// Deprecated, use floorPowerOfTwo from GTC_round instead
/// ///
/// @see gtc_round /// @see gtc_round
/// @see gtx_bit /// @see gtx_bit
template <typename genIUType> template<typename genIUType>
GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value); GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoBelow(genIUType Value);
/// Return the power of two number which value is just lower the input value. /// Return the power of two number which value is just lower the input value.
@@ -71,15 +71,15 @@ namespace glm
/// ///
/// @see gtc_round /// @see gtc_round
/// @see gtx_bit /// @see gtx_bit
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_DEPRECATED GLM_FUNC_DECL vecType<D, T, P> powerOfTwoBelow(vecType<D, T, P> const & value); GLM_DEPRECATED GLM_FUNC_DECL vecType<L, T, P> powerOfTwoBelow(vecType<L, T, P> const & value);
/// Return the power of two number which value is the closet to the input value. /// Return the power of two number which value is the closet to the input value.
/// Deprecated, use roundPowerOfTwo from GTC_round instead /// Deprecated, use roundPowerOfTwo from GTC_round instead
/// ///
/// @see gtc_round /// @see gtc_round
/// @see gtx_bit /// @see gtx_bit
template <typename genIUType> template<typename genIUType>
GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value); GLM_DEPRECATED GLM_FUNC_DECL genIUType powerOfTwoNearest(genIUType Value);
/// Return the power of two number which value is the closet to the input value. /// Return the power of two number which value is the closet to the input value.
@@ -87,8 +87,8 @@ namespace glm
/// ///
/// @see gtc_round /// @see gtc_round
/// @see gtx_bit /// @see gtx_bit
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_DEPRECATED GLM_FUNC_DECL vecType<D, T, P> powerOfTwoNearest(vecType<D, T, P> const & value); GLM_DEPRECATED GLM_FUNC_DECL vecType<L, T, P> powerOfTwoNearest(vecType<L, T, P> const & value);
/// @} /// @}
} //namespace glm } //namespace glm

View File

@@ -6,7 +6,7 @@ namespace glm
/////////////////// ///////////////////
// highestBitValue // highestBitValue
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value) GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value)
{ {
genIUType tmp = Value; genIUType tmp = Value;
@@ -19,61 +19,61 @@ namespace glm
return result; return result;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> highestBitValue(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> highestBitValue(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(highestBitValue, v); return detail::functor1<L, T, T, P>::call(highestBitValue, v);
} }
/////////////////// ///////////////////
// lowestBitValue // lowestBitValue
template <typename genIUType> template<typename genIUType>
GLM_FUNC_QUALIFIER genIUType lowestBitValue(genIUType Value) GLM_FUNC_QUALIFIER genIUType lowestBitValue(genIUType Value)
{ {
return (Value & (~Value + 1)); return (Value & (~Value + 1));
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> lowestBitValue(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> lowestBitValue(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(lowestBitValue, v); return detail::functor1<L, T, T, P>::call(lowestBitValue, v);
} }
/////////////////// ///////////////////
// powerOfTwoAbove // powerOfTwoAbove
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType powerOfTwoAbove(genType value) GLM_FUNC_QUALIFIER genType powerOfTwoAbove(genType value)
{ {
return isPowerOfTwo(value) ? value : highestBitValue(value) << 1; return isPowerOfTwo(value) ? value : highestBitValue(value) << 1;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> powerOfTwoAbove(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> powerOfTwoAbove(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(powerOfTwoAbove, v); return detail::functor1<L, T, T, P>::call(powerOfTwoAbove, v);
} }
/////////////////// ///////////////////
// powerOfTwoBelow // powerOfTwoBelow
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType powerOfTwoBelow(genType value) GLM_FUNC_QUALIFIER genType powerOfTwoBelow(genType value)
{ {
return isPowerOfTwo(value) ? value : highestBitValue(value); return isPowerOfTwo(value) ? value : highestBitValue(value);
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> powerOfTwoBelow(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> powerOfTwoBelow(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(powerOfTwoBelow, v); return detail::functor1<L, T, T, P>::call(powerOfTwoBelow, v);
} }
///////////////////// /////////////////////
// powerOfTwoNearest // powerOfTwoNearest
template <typename genType> template<typename genType>
GLM_FUNC_QUALIFIER genType powerOfTwoNearest(genType value) GLM_FUNC_QUALIFIER genType powerOfTwoNearest(genType value)
{ {
if(isPowerOfTwo(value)) if(isPowerOfTwo(value))
@@ -84,10 +84,10 @@ namespace glm
return (next - value) < (value - prev) ? next : prev; return (next - value) < (value - prev) ? next : prev;
} }
template <int D, typename T, precision P, template <int, typename, precision> class vecType> template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<D, T, P> powerOfTwoNearest(vecType<D, T, P> const & v) GLM_FUNC_QUALIFIER vecType<L, T, P> powerOfTwoNearest(vecType<L, T, P> const & v)
{ {
return detail::functor1<D, T, T, P>::call(powerOfTwoNearest, v); return detail::functor1<L, T, T, P>::call(powerOfTwoNearest, v);
} }
}//namespace glm }//namespace glm

View File

@@ -30,14 +30,14 @@ namespace glm
/// Find the point on a straight line which is the closet of a point. /// Find the point on a straight line which is the closet of a point.
/// @see gtx_closest_point /// @see gtx_closest_point
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> closestPointOnLine( GLM_FUNC_DECL vec<3, T, P> closestPointOnLine(
vec<3, T, P> const & point, vec<3, T, P> const & point,
vec<3, T, P> const & a, vec<3, T, P> const & a,
vec<3, T, P> const & b); vec<3, T, P> const & b);
/// 2d lines work as well /// 2d lines work as well
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> closestPointOnLine( GLM_FUNC_DECL vec<2, T, P> closestPointOnLine(
vec<2, T, P> const & point, vec<2, T, P> const & point,
vec<2, T, P> const & a, vec<2, T, P> const & a,

View File

@@ -3,7 +3,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> closestPointOnLine GLM_FUNC_QUALIFIER vec<3, T, P> closestPointOnLine
( (
vec<3, T, P> const & point, vec<3, T, P> const & point,
@@ -23,7 +23,7 @@ namespace glm
return a + LineDirection * Distance; return a + LineDirection * Distance;
} }
template <typename T, precision P> template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<2, T, P> closestPointOnLine GLM_FUNC_QUALIFIER vec<2, T, P> closestPointOnLine
( (
vec<2, T, P> const & point, vec<2, T, P> const & point,

Some files were not shown because too many files have changed in this diff Show More