Renamed P (for precision) template argument to Q (for qualifier)

This commit is contained in:
Christophe Riccio 2017-08-16 01:22:50 +02:00
parent e76fca75a0
commit faf1da52b7
176 changed files with 9392 additions and 9408 deletions

View File

@ -23,20 +23,20 @@ namespace detail
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<2, T, P> permute(vec<2, T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> permute(vec<2, T, Q> const& x)
{
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> permute(vec<3, T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> permute(vec<3, T, Q> const& x)
{
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> permute(vec<4, T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> permute(vec<4, T, Q> const& x)
{
return mod289(((x * static_cast<T>(34)) + static_cast<T>(1)) * x);
}
@ -47,38 +47,38 @@ namespace detail
return T(1.79284291400159) - T(0.85373472095314) * r;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<2, T, P> taylorInvSqrt(vec<2, T, P> const& r)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> taylorInvSqrt(vec<2, T, Q> const& r)
{
return T(1.79284291400159) - T(0.85373472095314) * r;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> taylorInvSqrt(vec<3, T, P> const& r)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> taylorInvSqrt(vec<3, T, Q> const& r)
{
return T(1.79284291400159) - T(0.85373472095314) * r;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> taylorInvSqrt(vec<4, T, P> const& r)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> taylorInvSqrt(vec<4, T, Q> const& r)
{
return T(1.79284291400159) - T(0.85373472095314) * r;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<2, T, P> fade(vec<2, T, P> const& t)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> fade(vec<2, T, Q> const& t)
{
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> fade(vec<3, T, P> const& t)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> fade(vec<3, T, Q> const& t)
{
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> fade(vec<4, T, P> const& t)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> fade(vec<4, T, Q> const& t)
{
return (t * t * t) * (t * (t * T(6) - T(15)) + T(10));
}

View File

@ -20,27 +20,27 @@ namespace detail
char _buffer[1];
};
template<int N, typename T, qualifier P, int E0, int E1, int E2, int E3, bool Aligned>
template<int N, typename T, qualifier Q, int E0, int E1, int E2, int E3, bool Aligned>
struct _swizzle_base1 : public _swizzle_base0<T, N>
{
};
template<typename T, qualifier P, int E0, int E1, bool Aligned>
struct _swizzle_base1<2, T, P, E0,E1,-1,-2, Aligned> : public _swizzle_base0<T, 2>
template<typename T, qualifier Q, int E0, int E1, bool Aligned>
struct _swizzle_base1<2, T, Q, 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, Q> operator ()() const { return vec<2, T, Q>(this->elem(E0), this->elem(E1)); }
};
template<typename T, qualifier 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>
template<typename T, qualifier Q, int E0, int E1, int E2, bool Aligned>
struct _swizzle_base1<3, T, Q, 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, Q> operator ()() const { return vec<3, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2)); }
};
template<typename T, qualifier 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>
template<typename T, qualifier Q, int E0, int E1, int E2, int E3, bool Aligned>
struct _swizzle_base1<4, T, Q, 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, Q> operator ()() const { return vec<4, T, Q>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
};
// Internal class for implementing swizzle operators
@ -54,7 +54,7 @@ namespace detail
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).
*/
template<int N, typename T, qualifier P, int E0, int E1, int E2, int E3, int DUPLICATE_ELEMENTS>
template<int N, typename T, qualifier Q, 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>
{
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t)
@ -64,7 +64,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec<N, T, P> const& that)
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec<N, T, Q> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e = t; }
@ -73,7 +73,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER void operator -= (vec<N, T, P> const& that)
GLM_FUNC_QUALIFIER void operator -= (vec<N, T, Q> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e -= t; }
@ -81,7 +81,7 @@ namespace detail
_apply_op(that, op());
}
GLM_FUNC_QUALIFIER void operator += (vec<N, T, P> const& that)
GLM_FUNC_QUALIFIER void operator += (vec<N, T, Q> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e += t; }
@ -89,7 +89,7 @@ namespace detail
_apply_op(that, op());
}
GLM_FUNC_QUALIFIER void operator *= (vec<N, T, P> const& that)
GLM_FUNC_QUALIFIER void operator *= (vec<N, T, Q> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e *= t; }
@ -97,7 +97,7 @@ namespace detail
_apply_op(that, op());
}
GLM_FUNC_QUALIFIER void operator /= (vec<N, T, P> const& that)
GLM_FUNC_QUALIFIER void operator /= (vec<N, T, Q> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e /= t; }
@ -118,7 +118,7 @@ namespace detail
protected:
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, Q> const& that, U op)
{
// Make a copy of the data in this == &that.
// The copier should optimize out the copy in cases where the function is
@ -132,7 +132,7 @@ namespace detail
};
// Specialization for swizzles containing duplicate elements. These cannot be modified.
template<int N, typename T, qualifier P, int E0, int E1, int E2, int E3>
template<int N, typename T, qualifier Q, 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 Stub {};
@ -146,7 +146,7 @@ namespace detail
}
};
template<int N, typename T, qualifier P, int E0, int E1, int E2, int E3>
template<int N, typename T, qualifier Q, 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)>
{
typedef _swizzle_base2<N, T, P, E0, E1, E2, E3, (E0 == E1 || E0 == E2 || E0 == E3 || E1 == E2 || E1 == E3 || E2 == E3)> base_type;
@ -159,8 +159,8 @@ namespace detail
//
// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros
//
#define GLM_SWIZZLE_TEMPLATE1 template<int N, typename T, qualifier P, int E0, int E1, int E2, int E3>
#define GLM_SWIZZLE_TEMPLATE2 template<int N, typename T, qualifier P, int E0, int E1, int E2, int E3, int F0, int F1, int F2, int F3>
#define GLM_SWIZZLE_TEMPLATE1 template<int N, typename T, qualifier Q, int E0, int E1, int E2, int E3>
#define GLM_SWIZZLE_TEMPLATE2 template<int N, typename T, qualifier Q, 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_TYPE2 _swizzle<N, T, P, F0, F1, F2, F3>
@ -297,10 +297,10 @@ namespace glm
}
#define GLM_SWIZZLE2_2_MEMBERS(T, P, E0,E1) \
struct { detail::_swizzle<2, T, P, 0,0,-1,-2> E0 ## E0; }; \
struct { detail::_swizzle<2, T, P, 0,1,-1,-2> E0 ## E1; }; \
struct { detail::_swizzle<2, T, P, 1,0,-1,-2> E1 ## E0; }; \
struct { detail::_swizzle<2, T, P, 1,1,-1,-2> E1 ## E1; };
struct { detail::_swizzle<2, T, Q, 0,0,-1,-2> E0 ## E0; }; \
struct { detail::_swizzle<2, T, Q, 0,1,-1,-2> E0 ## E1; }; \
struct { detail::_swizzle<2, T, Q, 1,0,-1,-2> E1 ## E0; }; \
struct { detail::_swizzle<2, T, Q, 1,1,-1,-2> E1 ## E1; };
#define GLM_SWIZZLE2_3_MEMBERS(T, P, E0,E1) \
struct { detail::_swizzle<3,T, P, 0,0,0,-1> E0 ## E0 ## E0; }; \
@ -342,33 +342,33 @@ namespace glm
struct { detail::_swizzle<2,T, P, 2,2,-1,-2> E2 ## E2; };
#define GLM_SWIZZLE3_3_MEMBERS(T, P ,E0,E1,E2) \
struct { detail::_swizzle<3, T, P, 0,0,0,-1> E0 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, P, 0,0,1,-1> E0 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, P, 0,0,2,-1> E0 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, P, 0,1,0,-1> E0 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, P, 0,1,1,-1> E0 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, P, 0,1,2,-1> E0 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, P, 0,2,0,-1> E0 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, P, 0,2,1,-1> E0 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, P, 0,2,2,-1> E0 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, P, 1,0,0,-1> E1 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, P, 1,0,1,-1> E1 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, P, 1,0,2,-1> E1 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, P, 1,1,0,-1> E1 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, P, 1,1,1,-1> E1 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, P, 1,1,2,-1> E1 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, P, 1,2,0,-1> E1 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, P, 1,2,1,-1> E1 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, P, 1,2,2,-1> E1 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, P, 2,0,0,-1> E2 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, P, 2,0,1,-1> E2 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, P, 2,0,2,-1> E2 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, P, 2,1,0,-1> E2 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, P, 2,1,1,-1> E2 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, P, 2,1,2,-1> E2 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, P, 2,2,0,-1> E2 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, P, 2,2,1,-1> E2 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, P, 2,2,2,-1> E2 ## E2 ## E2; };
struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; };
#define GLM_SWIZZLE3_4_MEMBERS(T, P, E0,E1,E2) \
struct { detail::_swizzle<4,T, P, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \
@ -472,325 +472,325 @@ namespace glm
struct { detail::_swizzle<2,T, P, 3,3,-1,-2> E3 ## E3; };
#define GLM_SWIZZLE4_3_MEMBERS(T, P, E0,E1,E2,E3) \
struct { detail::_swizzle<3, T, P, 0,0,0,-1> E0 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, P, 0,0,1,-1> E0 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, P, 0,0,2,-1> E0 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, P, 0,0,3,-1> E0 ## E0 ## E3; }; \
struct { detail::_swizzle<3, T, P, 0,1,0,-1> E0 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, P, 0,1,1,-1> E0 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, P, 0,1,2,-1> E0 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, P, 0,1,3,-1> E0 ## E1 ## E3; }; \
struct { detail::_swizzle<3, T, P, 0,2,0,-1> E0 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, P, 0,2,1,-1> E0 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, P, 0,2,2,-1> E0 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, P, 0,2,3,-1> E0 ## E2 ## E3; }; \
struct { detail::_swizzle<3, T, P, 0,3,0,-1> E0 ## E3 ## E0; }; \
struct { detail::_swizzle<3, T, P, 0,3,1,-1> E0 ## E3 ## E1; }; \
struct { detail::_swizzle<3, T, P, 0,3,2,-1> E0 ## E3 ## E2; }; \
struct { detail::_swizzle<3, T, P, 0,3,3,-1> E0 ## E3 ## E3; }; \
struct { detail::_swizzle<3, T, P, 1,0,0,-1> E1 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, P, 1,0,1,-1> E1 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, P, 1,0,2,-1> E1 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, P, 1,0,3,-1> E1 ## E0 ## E3; }; \
struct { detail::_swizzle<3, T, P, 1,1,0,-1> E1 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, P, 1,1,1,-1> E1 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, P, 1,1,2,-1> E1 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, P, 1,1,3,-1> E1 ## E1 ## E3; }; \
struct { detail::_swizzle<3, T, P, 1,2,0,-1> E1 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, P, 1,2,1,-1> E1 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, P, 1,2,2,-1> E1 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, P, 1,2,3,-1> E1 ## E2 ## E3; }; \
struct { detail::_swizzle<3, T, P, 1,3,0,-1> E1 ## E3 ## E0; }; \
struct { detail::_swizzle<3, T, P, 1,3,1,-1> E1 ## E3 ## E1; }; \
struct { detail::_swizzle<3, T, P, 1,3,2,-1> E1 ## E3 ## E2; }; \
struct { detail::_swizzle<3, T, P, 1,3,3,-1> E1 ## E3 ## E3; }; \
struct { detail::_swizzle<3, T, P, 2,0,0,-1> E2 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, P, 2,0,1,-1> E2 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, P, 2,0,2,-1> E2 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, P, 2,0,3,-1> E2 ## E0 ## E3; }; \
struct { detail::_swizzle<3, T, P, 2,1,0,-1> E2 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, P, 2,1,1,-1> E2 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, P, 2,1,2,-1> E2 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, P, 2,1,3,-1> E2 ## E1 ## E3; }; \
struct { detail::_swizzle<3, T, P, 2,2,0,-1> E2 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, P, 2,2,1,-1> E2 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, P, 2,2,2,-1> E2 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, P, 2,2,3,-1> E2 ## E2 ## E3; }; \
struct { detail::_swizzle<3, T, P, 2,3,0,-1> E2 ## E3 ## E0; }; \
struct { detail::_swizzle<3, T, P, 2,3,1,-1> E2 ## E3 ## E1; }; \
struct { detail::_swizzle<3, T, P, 2,3,2,-1> E2 ## E3 ## E2; }; \
struct { detail::_swizzle<3, T, P, 2,3,3,-1> E2 ## E3 ## E3; }; \
struct { detail::_swizzle<3, T, P, 3,0,0,-1> E3 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, P, 3,0,1,-1> E3 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, P, 3,0,2,-1> E3 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, P, 3,0,3,-1> E3 ## E0 ## E3; }; \
struct { detail::_swizzle<3, T, P, 3,1,0,-1> E3 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, P, 3,1,1,-1> E3 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, P, 3,1,2,-1> E3 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, P, 3,1,3,-1> E3 ## E1 ## E3; }; \
struct { detail::_swizzle<3, T, P, 3,2,0,-1> E3 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, P, 3,2,1,-1> E3 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, P, 3,2,2,-1> E3 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, P, 3,2,3,-1> E3 ## E2 ## E3; }; \
struct { detail::_swizzle<3, T, P, 3,3,0,-1> E3 ## E3 ## E0; }; \
struct { detail::_swizzle<3, T, P, 3,3,1,-1> E3 ## E3 ## E1; }; \
struct { detail::_swizzle<3, T, P, 3,3,2,-1> E3 ## E3 ## E2; }; \
struct { detail::_swizzle<3, T, P, 3,3,3,-1> E3 ## E3 ## E3; };
struct { detail::_swizzle<3, T, Q, 0,0,0,-1> E0 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 0,0,1,-1> E0 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 0,0,2,-1> E0 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 0,0,3,-1> E0 ## E0 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 0,1,0,-1> E0 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 0,1,1,-1> E0 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 0,1,2,-1> E0 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 0,1,3,-1> E0 ## E1 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 0,2,0,-1> E0 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 0,2,1,-1> E0 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 0,2,2,-1> E0 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 0,2,3,-1> E0 ## E2 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 0,3,0,-1> E0 ## E3 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 0,3,1,-1> E0 ## E3 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 0,3,2,-1> E0 ## E3 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 0,3,3,-1> E0 ## E3 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 1,0,0,-1> E1 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 1,0,1,-1> E1 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 1,0,2,-1> E1 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 1,0,3,-1> E1 ## E0 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 1,1,0,-1> E1 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 1,1,1,-1> E1 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 1,1,2,-1> E1 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 1,1,3,-1> E1 ## E1 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 1,2,0,-1> E1 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 1,2,1,-1> E1 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 1,2,2,-1> E1 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 1,2,3,-1> E1 ## E2 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 1,3,0,-1> E1 ## E3 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 1,3,1,-1> E1 ## E3 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 1,3,2,-1> E1 ## E3 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 1,3,3,-1> E1 ## E3 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 2,0,0,-1> E2 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 2,0,1,-1> E2 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 2,0,2,-1> E2 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 2,0,3,-1> E2 ## E0 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 2,1,0,-1> E2 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 2,1,1,-1> E2 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 2,1,2,-1> E2 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 2,1,3,-1> E2 ## E1 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 2,2,0,-1> E2 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 2,2,1,-1> E2 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 2,2,2,-1> E2 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 2,2,3,-1> E2 ## E2 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 2,3,0,-1> E2 ## E3 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 2,3,1,-1> E2 ## E3 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 2,3,2,-1> E2 ## E3 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 2,3,3,-1> E2 ## E3 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 3,0,0,-1> E3 ## E0 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 3,0,1,-1> E3 ## E0 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 3,0,2,-1> E3 ## E0 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 3,0,3,-1> E3 ## E0 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 3,1,0,-1> E3 ## E1 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 3,1,1,-1> E3 ## E1 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 3,1,2,-1> E3 ## E1 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 3,1,3,-1> E3 ## E1 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 3,2,0,-1> E3 ## E2 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 3,2,1,-1> E3 ## E2 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 3,2,2,-1> E3 ## E2 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 3,2,3,-1> E3 ## E2 ## E3; }; \
struct { detail::_swizzle<3, T, Q, 3,3,0,-1> E3 ## E3 ## E0; }; \
struct { detail::_swizzle<3, T, Q, 3,3,1,-1> E3 ## E3 ## E1; }; \
struct { detail::_swizzle<3, T, Q, 3,3,2,-1> E3 ## E3 ## E2; }; \
struct { detail::_swizzle<3, T, Q, 3,3,3,-1> E3 ## E3 ## E3; };
#define GLM_SWIZZLE4_4_MEMBERS(T, P, E0,E1,E2,E3) \
struct { detail::_swizzle<4, T, P, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, P, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, P, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, P, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, P, 3,3,3,3> E3 ## E3 ## E3 ## E3; };
struct { detail::_swizzle<4, T, Q, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \
struct { detail::_swizzle<4, T, Q, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \
struct { detail::_swizzle<4, T, Q, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \
struct { detail::_swizzle<4, T, Q, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \
struct { detail::_swizzle<4, T, Q, 3,3,3,3> E3 ## E3 ## E3 ## E3; };

View File

@ -4,42 +4,42 @@
#pragma once
#define GLM_SWIZZLE_GEN_VEC2_ENTRY(T, P, CONST, A, B) \
vec<2, T, P> A ## B() CONST \
vec<2, T, Q> A ## B() CONST \
{ \
return vec<2, T, P>(this->A, this->B); \
return vec<2, T, Q>(this->A, this->B); \
}
#define GLM_SWIZZLE_GEN_VEC3_ENTRY(T, P, CONST, A, B, C) \
vec<3, T, P> A ## B ## C() CONST \
vec<3, T, Q> A ## B ## C() CONST \
{ \
return vec<3, T, P>(this->A, this->B, this->C); \
return vec<3, T, Q>(this->A, this->B, this->C); \
}
#define GLM_SWIZZLE_GEN_VEC4_ENTRY(T, P, CONST, A, B, C, D) \
vec<4, T, P> A ## B ## C ## D() CONST \
vec<4, T, Q> A ## B ## C ## D() CONST \
{ \
return vec<4, T, P>(this->A, this->B, this->C, this->D); \
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
}
#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \
template<typename T> \
vec<L, T, P> vec<L, T, P>::A ## B() CONST \
vec<L, T, Q> vec<L, T, Q>::A ## B() CONST \
{ \
return vec<2, T, P>(this->A, this->B); \
return vec<2, T, Q>(this->A, this->B); \
}
#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \
template<typename T> \
vec<3, T, P> vec<L, T, P>::A ## B ## C() CONST \
vec<3, T, Q> vec<L, T, Q>::A ## B ## C() CONST \
{ \
return vec<3, T, P>(this->A, this->B, this->C); \
return vec<3, T, Q>(this->A, this->B, this->C); \
}
#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \
template<typename T> \
vec<4, T, P> vec<L, T, P>::A ## B ## C ## D() CONST \
vec<4, T, Q> vec<L, T, Q>::A ## B ## C ## D() CONST \
{ \
return vec<4, T, P>(this->A, this->B, this->C, this->D); \
return vec<4, T, Q>(this->A, this->B, this->C, this->D); \
}
#define GLM_MUTABLE

View File

@ -11,120 +11,120 @@
namespace glm{
namespace detail
{
template<length_t L, typename R, typename T, qualifier P>
template<length_t L, typename R, typename T, qualifier Q>
struct functor1{};
template<typename R, typename T, qualifier P>
struct functor1<1, R, T, P>
template<typename R, typename T, qualifier Q>
struct functor1<1, R, T, Q>
{
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, Q> call(R (*Func) (T x), vec<1, T, Q> const& v)
{
return vec<1, R, P>(Func(v.x));
return vec<1, R, Q>(Func(v.x));
}
};
template<typename R, typename T, qualifier P>
struct functor1<2, R, T, P>
template<typename R, typename T, qualifier Q>
struct functor1<2, R, T, Q>
{
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, Q> call(R (*Func) (T x), vec<2, T, Q> const& v)
{
return vec<2, R, P>(Func(v.x), Func(v.y));
return vec<2, R, Q>(Func(v.x), Func(v.y));
}
};
template<typename R, typename T, qualifier P>
struct functor1<3, R, T, P>
template<typename R, typename T, qualifier Q>
struct functor1<3, R, T, Q>
{
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, Q> call(R (*Func) (T x), vec<3, T, Q> const& v)
{
return vec<3, R, P>(Func(v.x), Func(v.y), Func(v.z));
return vec<3, R, Q>(Func(v.x), Func(v.y), Func(v.z));
}
};
template<typename R, typename T, qualifier P>
struct functor1<4, R, T, P>
template<typename R, typename T, qualifier Q>
struct functor1<4, R, T, Q>
{
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, Q> call(R (*Func) (T x), vec<4, T, Q> const& v)
{
return vec<4, R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
return vec<4, R, Q>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
}
};
template<length_t L, typename T, qualifier P>
template<length_t L, typename T, qualifier Q>
struct functor2{};
template<typename T, qualifier P>
struct functor2<1, T, P>
template<typename T, qualifier Q>
struct functor2<1, T, Q>
{
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, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, vec<1, T, Q> const& b)
{
return vec<1, T, P>(Func(a.x, b.x));
return vec<1, T, Q>(Func(a.x, b.x));
}
};
template<typename T, qualifier P>
struct functor2<2, T, P>
template<typename T, qualifier Q>
struct functor2<2, T, Q>
{
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, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, vec<2, T, Q> const& b)
{
return vec<2, T, P>(Func(a.x, b.x), Func(a.y, b.y));
return vec<2, T, Q>(Func(a.x, b.x), Func(a.y, b.y));
}
};
template<typename T, qualifier P>
struct functor2<3, T, P>
template<typename T, qualifier Q>
struct functor2<3, T, Q>
{
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, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, vec<3, T, Q> const& b)
{
return vec<3, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
return vec<3, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
}
};
template<typename T, qualifier P>
struct functor2<4, T, P>
template<typename T, qualifier Q>
struct functor2<4, T, Q>
{
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, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
return vec<4, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
return vec<4, T, Q>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
}
};
template<length_t L, typename T, qualifier P>
template<length_t L, typename T, qualifier Q>
struct functor2_vec_sca{};
template<typename T, qualifier P>
struct functor2_vec_sca<1, T, P>
template<typename T, qualifier Q>
struct functor2_vec_sca<1, T, Q>
{
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, Q> call(T (*Func) (T x, T y), vec<1, T, Q> const& a, T b)
{
return vec<1, T, P>(Func(a.x, b));
return vec<1, T, Q>(Func(a.x, b));
}
};
template<typename T, qualifier P>
struct functor2_vec_sca<2, T, P>
template<typename T, qualifier Q>
struct functor2_vec_sca<2, T, Q>
{
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, Q> call(T (*Func) (T x, T y), vec<2, T, Q> const& a, T b)
{
return vec<2, T, P>(Func(a.x, b), Func(a.y, b));
return vec<2, T, Q>(Func(a.x, b), Func(a.y, b));
}
};
template<typename T, qualifier P>
struct functor2_vec_sca<3, T, P>
template<typename T, qualifier Q>
struct functor2_vec_sca<3, T, Q>
{
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, Q> call(T (*Func) (T x, T y), vec<3, T, Q> const& a, T b)
{
return vec<3, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
return vec<3, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
}
};
template<typename T, qualifier P>
struct functor2_vec_sca<4, T, P>
template<typename T, qualifier Q>
struct functor2_vec_sca<4, T, Q>
{
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, Q> call(T (*Func) (T x, T y), vec<4, T, Q> const& a, T b)
{
return vec<4, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
return vec<4, T, Q>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
}
};
}//namespace detail

View File

@ -38,8 +38,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> abs(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> abs(vec<L, T, Q> const& x);
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
///
@ -49,8 +49,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> sign(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> sign(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer that is less then or equal to x.
///
@ -60,8 +60,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> floor(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> floor(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer to x
/// whose absolute value is not larger than the absolute value of x.
@ -72,8 +72,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> trunc(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> trunc(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
@ -87,8 +87,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> round(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> round(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer to x.
/// A fractional part of 0.5 will round toward the nearest even
@ -101,8 +101,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/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>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> roundEven(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> roundEven(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer
/// that is greater than or equal to x.
@ -113,8 +113,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> ceil(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> ceil(vec<L, T, Q> const& x);
/// Return x - floor(x).
///
@ -133,8 +133,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> fract(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> fract(vec<L, T, Q> const& x);
/// Modulus. Returns x - y * floor(x / y)
/// for each component in x using the floating point value y.
@ -155,8 +155,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> mod(vec<L, T, P> const& x, T y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, T y);
/// Modulus. Returns x - y * floor(x / y)
/// for each component in x using the floating point value y.
@ -167,8 +167,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> mod(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns the fractional part of x and sets i to the integer
/// part (as a whole number floating point value). Both the
@ -199,8 +199,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> min(vec<L, T, P> const& x, T y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> min(vec<L, T, Q> const& x, T y);
/// Returns y if y < x; otherwise, it returns x.
///
@ -210,8 +210,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> min(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> min(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns y if x < y; otherwise, it returns x.
///
@ -230,8 +230,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> max(vec<L, T, P> const& x, T y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> max(vec<L, T, Q> const& x, T y);
/// Returns y if x < y; otherwise, it returns x.
///
@ -241,8 +241,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> max(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> max(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns min(max(x, minVal), maxVal) for each component in x
/// using the floating-point values minVal and maxVal.
@ -263,8 +263,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> clamp(vec<L, T, P> const& x, T minVal, T maxVal);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> clamp(vec<L, T, Q> const& x, T minVal, T maxVal);
/// Returns min(max(x, minVal), maxVal) for each component in x
/// using the floating-point values minVal and maxVal.
@ -275,8 +275,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> clamp(vec<L, T, P> const& x, vec<L, T, P> const& minVal, vec<L, T, P> const& maxVal);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> clamp(vec<L, T, Q> const& x, vec<L, T, Q> const& minVal, vec<L, T, Q> const& maxVal);
/// If genTypeU is a floating scalar or vector:
/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
@ -323,11 +323,11 @@ namespace glm
template<typename genTypeT, typename genTypeU>
GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a);
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_DECL vec<L, T, P> mix(vec<L, T, P> const& x, vec<L, T, P> const& y, vec<L, U, P> const& a);
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a);
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_DECL vec<L, T, P> mix(vec<L, T, P> const& x, vec<L, T, P> const& y, U a);
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a);
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
///
@ -344,8 +344,8 @@ namespace glm
///
/// @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>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> step(T edge, vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> step(T edge, vec<L, T, Q> const& x);
/// Returns 0.0 if x < edge, otherwise it returns 1.0.
///
@ -355,8 +355,8 @@ namespace glm
///
/// @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>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> step(vec<L, T, P> const& edge, vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> step(vec<L, T, Q> const& edge, vec<L, T, Q> const& x);
/// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
/// performs smooth Hermite interpolation between 0 and 1
@ -375,11 +375,11 @@ namespace glm
template<typename genType>
GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x);
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> smoothstep(T edge0, T edge1, vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> smoothstep(T edge0, T edge1, vec<L, T, Q> const& x);
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> smoothstep(vec<L, T, P> const& edge0, vec<L, T, P> const& edge1, vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> smoothstep(vec<L, T, Q> const& edge0, vec<L, T, Q> const& edge1, vec<L, T, Q> const& x);
/// Returns true if x holds a NaN (not a number)
/// representation in the underlying implementation's set of
@ -395,8 +395,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> isnan(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isnan(vec<L, T, Q> const& x);
/// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's
@ -410,8 +410,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> isinf(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isinf(vec<L, T, Q> const& x);
/// Returns a signed integer value representing
/// the encoding of a floating-point value. The floating-point
@ -430,8 +430,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, qualifier P>
GLM_FUNC_DECL vec<L, int, P> floatBitsToInt(vec<L, float, P> const& v);
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, int, Q> floatBitsToInt(vec<L, float, Q> const& v);
/// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint
@ -450,8 +450,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, qualifier P>
GLM_FUNC_DECL vec<L, uint, P> floatBitsToUint(vec<L, float, P> const& v);
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, uint, Q> floatBitsToUint(vec<L, float, Q> const& v);
/// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value.
@ -474,8 +474,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, qualifier P>
GLM_FUNC_DECL vec<L, float, P> intBitsToFloat(vec<L, int, P> const& v);
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, float, Q> intBitsToFloat(vec<L, int, Q> const& v);
/// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value.
@ -498,8 +498,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, qualifier P>
GLM_FUNC_DECL vec<L, float, P> uintBitsToFloat(vec<L, uint, P> const& v);
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, float, Q> uintBitsToFloat(vec<L, uint, Q> const& v);
/// Computes and returns a * b + c.
///

View File

@ -107,53 +107,53 @@ namespace detail
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_abs_vector
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
return detail::functor1<L, T, T, P>::call(abs, x);
return detail::functor1<L, T, T, Q>::call(abs, x);
}
};
template<length_t L, typename T, typename U, qualifier P, bool Aligned>
template<length_t L, typename T, typename U, qualifier Q, bool Aligned>
struct compute_mix_vector
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x, vec<L, T, P> const& y, vec<L, U, P> const& a)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a)
{
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
return vec<L, T, P>(vec<L, U, P>(x) + a * vec<L, U, P>(y - x));
return vec<L, T, Q>(vec<L, U, Q>(x) + a * vec<L, U, Q>(y - x));
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
struct compute_mix_vector<L, T, bool, P, Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_mix_vector<L, T, bool, Q, Aligned>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x, vec<L, T, P> const& y, vec<L, bool, P> const& a)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, bool, Q> const& a)
{
vec<L, T, P> Result;
vec<L, T, Q> Result;
for(length_t i = 0; i < x.length(); ++i)
Result[i] = a[i] ? y[i] : x[i];
return Result;
}
};
template<length_t L, typename T, typename U, qualifier P, bool Aligned>
template<length_t L, typename T, typename U, qualifier Q, bool Aligned>
struct compute_mix_scalar
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x, vec<L, T, P> const& y, U const& a)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> 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");
return vec<L, T, P>(vec<L, U, P>(x) + a * vec<L, U, P>(y - x));
return vec<L, T, Q>(vec<L, U, Q>(x) + a * vec<L, U, Q>(y - x));
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
struct compute_mix_scalar<L, T, bool, P, Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_mix_scalar<L, T, bool, Q, Aligned>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x, vec<L, T, P> const& y, bool const& a)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y, bool const& a)
{
return a ? y : x;
}
@ -179,127 +179,127 @@ namespace detail
}
};
template<length_t L, typename T, qualifier P, bool isFloat, bool Aligned>
template<length_t L, typename T, qualifier Q, bool isFloat, bool Aligned>
struct compute_sign
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
return vec<L, T, P>(glm::lessThan(vec<L, T, P>(0), x)) - vec<L, T, P>(glm::lessThan(x, vec<L, T, P>(0)));
return vec<L, T, Q>(glm::lessThan(vec<L, T, Q>(0), x)) - vec<L, T, Q>(glm::lessThan(x, vec<L, T, Q>(0)));
}
};
# if GLM_ARCH == GLM_ARCH_X86
template<length_t L, typename T, qualifier P, bool Aligned>
struct compute_sign<L, T, P, false, Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_sign<L, T, Q, false, Aligned>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
T const Shift(static_cast<T>(sizeof(T) * 8 - 1));
vec<L, T, P> const y(vec<L, typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
vec<L, T, Q> const y(vec<L, typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
return (x >> Shift) | y;
}
};
# endif
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_floor
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
return detail::functor1<L, T, T, P>::call(std::floor, x);
return detail::functor1<L, T, T, Q>::call(std::floor, x);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_ceil
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
return detail::functor1<L, T, T, P>::call(std::ceil, x);
return detail::functor1<L, T, T, Q>::call(std::ceil, x);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_fract
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
return x - floor(x);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_trunc
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
return detail::functor1<L, T, T, P>::call(trunc, x);
return detail::functor1<L, T, T, Q>::call(trunc, x);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_round
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
return detail::functor1<L, T, T, P>::call(round, x);
return detail::functor1<L, T, T, Q>::call(round, x);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_mod
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& a, vec<L, T, P> const& b)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> 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.");
return a - b * floor(a / b);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_min_vector
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x, vec<L, T, P> const& y)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
{
return detail::functor2<L, T, P>::call(min, x, y);
return detail::functor2<L, T, Q>::call(min, x, y);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_max_vector
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x, vec<L, T, P> const& y)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
{
return detail::functor2<L, T, P>::call(max, x, y);
return detail::functor2<L, T, Q>::call(max, x, y);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_clamp_vector
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x, vec<L, T, P> const& minVal, vec<L, T, P> const& maxVal)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& minVal, vec<L, T, Q> const& maxVal)
{
return min(max(x, minVal), maxVal);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_step_vector
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& edge, vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& edge, vec<L, T, Q> const& x)
{
return mix(vec<L, T, P>(1), vec<L, T, P>(0), glm::lessThan(x, edge));
return mix(vec<L, T, Q>(1), vec<L, T, Q>(0), glm::lessThan(x, edge));
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_smoothstep_vector
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& edge0, vec<L, T, P> const& edge1, vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& edge0, vec<L, T, Q> const& edge1, vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs");
vec<L, T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)));
vec<L, T, Q> 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);
}
};
@ -311,10 +311,10 @@ namespace detail
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> abs(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> abs(vec<L, T, Q> const& x)
{
return detail::compute_abs_vector<L, T, P, detail::is_aligned<P>::value>::call(x);
return detail::compute_abs_vector<L, T, Q, detail::is_aligned<Q>::value>::call(x);
}
// sign
@ -329,37 +329,37 @@ namespace detail
return detail::compute_sign<1, genFIType, defaultp, std::numeric_limits<genFIType>::is_iec559, highp>::call(vec<1, genFIType>(x)).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> sign(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> sign(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(
std::numeric_limits<T>::is_iec559 || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer),
"'sign' only accept signed inputs");
return detail::compute_sign<L, T, P, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
return detail::compute_sign<L, T, Q, std::numeric_limits<T>::is_iec559, detail::is_aligned<Q>::value>::call(x);
}
// floor
using ::std::floor;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> floor(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> floor(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'floor' only accept floating-point inputs.");
return detail::compute_floor<L, T, P, detail::is_aligned<P>::value>::call(x);
return detail::compute_floor<L, T, Q, detail::is_aligned<Q>::value>::call(x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> trunc(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> trunc(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'trunc' only accept floating-point inputs");
return detail::compute_trunc<L, T, P, detail::is_aligned<P>::value>::call(x);
return detail::compute_trunc<L, T, Q, detail::is_aligned<Q>::value>::call(x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> round(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> round(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'round' only accept floating-point inputs");
return detail::compute_round<L, T, P, detail::is_aligned<P>::value>::call(x);
return detail::compute_round<L, T, Q, detail::is_aligned<Q>::value>::call(x);
}
/*
@ -405,20 +405,20 @@ namespace detail
//}
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> roundEven(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> roundEven(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'roundEven' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(roundEven, x);
return detail::functor1<L, T, T, Q>::call(roundEven, x);
}
// ceil
using ::std::ceil;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> ceil(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> ceil(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ceil' only accept floating-point inputs");
return detail::compute_ceil<L, T, P, detail::is_aligned<P>::value>::call(x);
return detail::compute_ceil<L, T, Q, detail::is_aligned<Q>::value>::call(x);
}
// fract
@ -428,11 +428,11 @@ namespace detail
return fract(vec<1, genType>(x)).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> fract(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> fract(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fract' only accept floating-point inputs");
return detail::compute_fract<L, T, P, detail::is_aligned<P>::value>::call(x);
return detail::compute_fract<L, T, Q, detail::is_aligned<Q>::value>::call(x);
}
// mod
@ -448,16 +448,16 @@ namespace detail
# endif
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> mod(vec<L, T, P> const& x, T y)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> mod(vec<L, T, Q> const& x, T y)
{
return detail::compute_mod<L, T, P, detail::is_aligned<P>::value>::call(x, vec<L, T, P>(y));
return detail::compute_mod<L, T, Q, detail::is_aligned<Q>::value>::call(x, vec<L, T, Q>(y));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> mod(vec<L, T, P> const& x, vec<L, T, P> const& y)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> mod(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
{
return detail::compute_mod<L, T, P, detail::is_aligned<P>::value>::call(x, y);
return detail::compute_mod<L, T, Q, detail::is_aligned<Q>::value>::call(x, y);
}
// modf
@ -468,34 +468,34 @@ namespace detail
return std::modf(x, &i);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> modf(vec<1, T, P> const& x, vec<1, T, P> & i)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> modf(vec<1, T, Q> const& x, vec<1, T, Q> & i)
{
return vec<1, T, P>(
return vec<1, T, Q>(
modf(x.x, i.x));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<2, T, P> modf(vec<2, T, P> const& x, vec<2, T, P> & i)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> modf(vec<2, T, Q> const& x, vec<2, T, Q> & i)
{
return vec<2, T, P>(
return vec<2, T, Q>(
modf(x.x, i.x),
modf(x.y, i.y));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> modf(vec<3, T, P> const& x, vec<3, T, P> & i)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> modf(vec<3, T, Q> const& x, vec<3, T, Q> & i)
{
return vec<3, T, P>(
return vec<3, T, Q>(
modf(x.x, i.x),
modf(x.y, i.y),
modf(x.z, i.z));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> modf(vec<4, T, P> const& x, vec<4, T, P> & i)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> modf(vec<4, T, Q> const& x, vec<4, T, Q> & i)
{
return vec<4, T, P>(
return vec<4, T, Q>(
modf(x.x, i.x),
modf(x.y, i.y),
modf(x.z, i.z),
@ -511,31 +511,31 @@ namespace detail
//CHAR_BIT - 1)));
// min
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> min(vec<L, T, P> const& a, T b)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> min(vec<L, T, Q> const& a, T b)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs");
return detail::compute_min_vector<L, T, P, detail::is_aligned<P>::value>::call(a, vec<L, T, P>(b));
return detail::compute_min_vector<L, T, Q, detail::is_aligned<Q>::value>::call(a, vec<L, T, Q>(b));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> min(vec<L, T, P> const& a, vec<L, T, P> const& b)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> min(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
{
return detail::compute_min_vector<L, T, P, detail::is_aligned<P>::value>::call(a, b);
return detail::compute_min_vector<L, T, Q, detail::is_aligned<Q>::value>::call(a, b);
}
// max
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> max(vec<L, T, P> const& a, T b)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> max(vec<L, T, Q> const& a, T b)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs");
return detail::compute_max_vector<L, T, P, detail::is_aligned<P>::value>::call(a, vec<L, T, P>(b));
return detail::compute_max_vector<L, T, Q, detail::is_aligned<Q>::value>::call(a, vec<L, T, Q>(b));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> max(vec<L, T, P> const& a, vec<L, T, P> const& b)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> max(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
{
return detail::compute_max_vector<L, T, P, detail::is_aligned<P>::value>::call(a, b);
return detail::compute_max_vector<L, T, Q, detail::is_aligned<Q>::value>::call(a, b);
}
// clamp
@ -546,18 +546,18 @@ namespace detail
return min(max(x, minVal), maxVal);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> clamp(vec<L, T, P> const& x, T minVal, T maxVal)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> clamp(vec<L, T, Q> 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");
return detail::compute_clamp_vector<L, T, P, detail::is_aligned<P>::value>::call(x, vec<L, T, P>(minVal), vec<L, T, P>(maxVal));
return detail::compute_clamp_vector<L, T, Q, detail::is_aligned<Q>::value>::call(x, vec<L, T, Q>(minVal), vec<L, T, Q>(maxVal));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> clamp(vec<L, T, P> const& x, vec<L, T, P> const& minVal, vec<L, T, P> const& maxVal)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> clamp(vec<L, T, Q> const& x, vec<L, T, Q> const& minVal, vec<L, T, Q> 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");
return detail::compute_clamp_vector<L, T, P, detail::is_aligned<P>::value>::call(x, minVal, maxVal);
return detail::compute_clamp_vector<L, T, Q, detail::is_aligned<Q>::value>::call(x, minVal, maxVal);
}
template<typename genTypeT, typename genTypeU>
@ -566,16 +566,16 @@ namespace detail
return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a);
}
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> mix(vec<L, T, P> const& x, vec<L, T, P> const& y, U a)
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U a)
{
return detail::compute_mix_scalar<L, T, U, P, detail::is_aligned<P>::value>::call(x, y, a);
return detail::compute_mix_scalar<L, T, U, Q, detail::is_aligned<Q>::value>::call(x, y, a);
}
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> mix(vec<L, T, P> const& x, vec<L, T, P> const& y, vec<L, U, P> const& a)
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> mix(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a)
{
return detail::compute_mix_vector<L, T, U, P, detail::is_aligned<P>::value>::call(x, y, a);
return detail::compute_mix_vector<L, T, U, Q, detail::is_aligned<Q>::value>::call(x, y, a);
}
// step
@ -585,16 +585,16 @@ namespace detail
return mix(static_cast<genType>(1), static_cast<genType>(0), glm::lessThan(x, edge));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> step(T edge, vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> step(T edge, vec<L, T, Q> const& x)
{
return detail::compute_step_vector<L, T, P, detail::is_aligned<P>::value>::call(vec<L, T, P>(edge), x);
return detail::compute_step_vector<L, T, Q, detail::is_aligned<Q>::value>::call(vec<L, T, Q>(edge), x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> step(vec<L, T, P> const& edge, vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> step(vec<L, T, Q> const& edge, vec<L, T, Q> const& x)
{
return detail::compute_step_vector<L, T, P, detail::is_aligned<P>::value>::call(edge, x);
return detail::compute_step_vector<L, T, Q, detail::is_aligned<Q>::value>::call(edge, x);
}
// smoothstep
@ -607,16 +607,16 @@ namespace detail
return tmp * tmp * (genType(3) - genType(2) * tmp);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> smoothstep(T edge0, T edge1, vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> smoothstep(T edge0, T edge1, vec<L, T, Q> const& x)
{
return detail::compute_smoothstep_vector<L, T, P, detail::is_aligned<P>::value>::call(vec<L, T, P>(edge0), vec<L, T, P>(edge1), x);
return detail::compute_smoothstep_vector<L, T, Q, detail::is_aligned<Q>::value>::call(vec<L, T, Q>(edge0), vec<L, T, Q>(edge1), x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> smoothstep(vec<L, T, P> const& edge0, vec<L, T, P> const& edge1, vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> smoothstep(vec<L, T, Q> const& edge0, vec<L, T, Q> const& edge1, vec<L, T, Q> const& x)
{
return detail::compute_smoothstep_vector<L, T, P, detail::is_aligned<P>::value>::call(edge0, edge1, x);
return detail::compute_smoothstep_vector<L, T, Q, detail::is_aligned<Q>::value>::call(edge0, edge1, x);
}
# if GLM_HAS_CXX11_STL
@ -647,12 +647,12 @@ namespace detail
}
# endif
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, bool, P> isnan(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> isnan(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
return detail::functor1<L, bool, T, P>::call(isnan, x);
return detail::functor1<L, bool, T, Q>::call(isnan, x);
}
# if GLM_HAS_CXX11_STL
@ -686,12 +686,12 @@ namespace detail
}
# endif
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, bool, P> isinf(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> isinf(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
return detail::functor1<L, bool, T, P>::call(isinf, x);
return detail::functor1<L, bool, T, Q>::call(isinf, x);
}
GLM_FUNC_QUALIFIER int floatBitsToInt(float const& v)
@ -707,10 +707,10 @@ namespace detail
return u.out;
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER vec<L, int, P> floatBitsToInt(vec<L, float, P> const& v)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, int, Q> floatBitsToInt(vec<L, float, Q> const& v)
{
return reinterpret_cast<vec<L, int, P>&>(const_cast<vec<L, float, P>&>(v));
return reinterpret_cast<vec<L, int, Q>&>(const_cast<vec<L, float, Q>&>(v));
}
GLM_FUNC_QUALIFIER uint floatBitsToUint(float const& v)
@ -726,10 +726,10 @@ namespace detail
return u.out;
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER vec<L, uint, P> floatBitsToUint(vec<L, float, P> const& v)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, uint, Q> floatBitsToUint(vec<L, float, Q> const& v)
{
return reinterpret_cast<vec<L, uint, P>&>(const_cast<vec<L, float, P>&>(v));
return reinterpret_cast<vec<L, uint, Q>&>(const_cast<vec<L, float, Q>&>(v));
}
GLM_FUNC_QUALIFIER float intBitsToFloat(int const& v)
@ -745,10 +745,10 @@ namespace detail
return u.out;
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER vec<L, float, P> intBitsToFloat(vec<L, int, P> const& v)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, float, Q> intBitsToFloat(vec<L, int, Q> const& v)
{
return reinterpret_cast<vec<L, float, P>&>(const_cast<vec<L, int, P>&>(v));
return reinterpret_cast<vec<L, float, Q>&>(const_cast<vec<L, int, Q>&>(v));
}
GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const& v)
@ -764,10 +764,10 @@ namespace detail
return u.out;
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER vec<L, float, P> uintBitsToFloat(vec<L, uint, P> const& v)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, float, Q> uintBitsToFloat(vec<L, uint, Q> const& v)
{
return reinterpret_cast<vec<L, float, P>&>(const_cast<vec<L, uint, P>&>(v));
return reinterpret_cast<vec<L, float, Q>&>(const_cast<vec<L, uint, Q>&>(v));
}
template<typename genType>
@ -784,41 +784,41 @@ namespace detail
return std::frexp(x, &exp);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> frexp(vec<1, T, P> const& x, vec<1, int, P>& exp)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> frexp(vec<1, T, Q> const& x, vec<1, int, Q>& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
return vec<1, T, P>(std::frexp(x.x, &exp.x));
return vec<1, T, Q>(std::frexp(x.x, &exp.x));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<2, T, P> frexp(vec<2, T, P> const& x, vec<2, int, P>& exp)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> frexp(vec<2, T, Q> const& x, vec<2, int, Q>& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
return vec<2, T, P>(
return vec<2, T, Q>(
frexp(x.x, exp.x),
frexp(x.y, exp.y));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> frexp(vec<3, T, P> const& x, vec<3, int, P>& exp)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> frexp(vec<3, T, Q> const& x, vec<3, int, Q>& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
return vec<3, T, P>(
return vec<3, T, Q>(
frexp(x.x, exp.x),
frexp(x.y, exp.y),
frexp(x.z, exp.z));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> frexp(vec<4, T, P> const& x, vec<4, int, P>& exp)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> frexp(vec<4, T, Q> const& x, vec<4, int, Q>& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
return vec<4, T, P>(
return vec<4, T, Q>(
frexp(x.x, exp.x),
frexp(x.y, exp.y),
frexp(x.z, exp.z),
@ -833,42 +833,42 @@ namespace detail
return std::ldexp(x, exp);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> ldexp(vec<1, T, P> const& x, vec<1, int, P> const& exp)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> ldexp(vec<1, T, Q> const& x, vec<1, int, Q> const& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
return vec<1, T, P>(
return vec<1, T, Q>(
ldexp(x.x, exp.x));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<2, T, P> ldexp(vec<2, T, P> const& x, vec<2, int, P> const& exp)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> ldexp(vec<2, T, Q> const& x, vec<2, int, Q> const& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
return vec<2, T, P>(
return vec<2, T, Q>(
ldexp(x.x, exp.x),
ldexp(x.y, exp.y));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> ldexp(vec<3, T, P> const& x, vec<3, int, P> const& exp)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> ldexp(vec<3, T, Q> const& x, vec<3, int, Q> const& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
return vec<3, T, P>(
return vec<3, T, Q>(
ldexp(x.x, exp.x),
ldexp(x.y, exp.y),
ldexp(x.z, exp.z));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> ldexp(vec<4, T, P> const& x, vec<4, int, P> const& exp)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> ldexp(vec<4, T, Q> const& x, vec<4, int, Q> const& exp)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
return vec<4, T, P>(
return vec<4, T, Q>(
ldexp(x.x, exp.x),
ldexp(x.y, exp.y),
ldexp(x.z, exp.z),

View File

@ -10,10 +10,10 @@
namespace glm{
namespace detail
{
template<qualifier P>
template<qualifier Q>
struct compute_abs_vector<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, Q> const& v)
{
vec<4, float, P> result;
result.data = glm_vec4_abs(v.data);
@ -21,21 +21,21 @@ namespace detail
}
};
template<qualifier P>
struct compute_abs_vector<4, int, P, true>
template<qualifier Q>
struct compute_abs_vector<4, int, Q, true>
{
GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const& v)
GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v)
{
vec<4, int, P> result;
vec<4, int, Q> result;
result.data = glm_ivec4_abs(v.data);
return result;
}
};
template<qualifier P>
template<qualifier Q>
struct compute_floor<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, Q> const& v)
{
vec<4, float, P> result;
result.data = glm_vec4_floor(v.data);
@ -43,10 +43,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_ceil<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, Q> const& v)
{
vec<4, float, P> result;
result.data = glm_vec4_ceil(v.data);
@ -54,10 +54,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_fract<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, Q> const& v)
{
vec<4, float, P> result;
result.data = glm_vec4_fract(v.data);
@ -65,10 +65,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_round<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, Q> const& v)
{
vec<4, float, P> result;
result.data = glm_vec4_round(v.data);
@ -76,10 +76,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_mod<4, float, P, 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, Q> const& x, vec<4, float, Q> const& y)
{
vec<4, float, P> result;
result.data = glm_vec4_mod(x.data, y.data);
@ -87,10 +87,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_min_vector<4, float, P, 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, Q> const& v1, vec<4, float, Q> const& v2)
{
vec<4, float, P> result;
result.data = _mm_min_ps(v1.data, v2.data);
@ -98,10 +98,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_min_vector<4, int32, P, 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, Q> const& v1, vec<4, int32, Q> const& v2)
{
vec<4, int32, P> result;
result.data = _mm_min_epi32(v1.data, v2.data);
@ -109,10 +109,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_min_vector<4, uint32, P, 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, Q> const& v1, vec<4, uint32, Q> const& v2)
{
vec<4, uint32, P> result;
result.data = _mm_min_epu32(v1.data, v2.data);
@ -120,10 +120,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_max_vector<4, float, P, 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, Q> const& v1, vec<4, float, Q> const& v2)
{
vec<4, float, P> result;
result.data = _mm_max_ps(v1.data, v2.data);
@ -131,10 +131,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_max_vector<4, int32, P, 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, Q> const& v1, vec<4, int32, Q> const& v2)
{
vec<4, int32, P> result;
result.data = _mm_max_epi32(v1.data, v2.data);
@ -142,10 +142,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_max_vector<4, uint32, P, 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, Q> const& v1, vec<4, uint32, Q> const& v2)
{
vec<4, uint32, P> result;
result.data = _mm_max_epu32(v1.data, v2.data);
@ -153,10 +153,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_clamp_vector<4, float, P, 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, Q> const& x, vec<4, float, Q> const& minVal, vec<4, float, Q> const& maxVal)
{
vec<4, float, P> result;
result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data);
@ -164,10 +164,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_clamp_vector<4, int32, P, 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, Q> const& x, vec<4, int32, Q> const& minVal, vec<4, int32, Q> const& maxVal)
{
vec<4, int32, P> result;
result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data);
@ -175,10 +175,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_clamp_vector<4, uint32, P, 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, Q> const& x, vec<4, uint32, Q> const& minVal, vec<4, uint32, Q> const& maxVal)
{
vec<4, uint32, P> result;
result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data);
@ -186,10 +186,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_mix_vector<4, float, bool, P, 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, Q> const& x, vec<4, float, Q> const& y, vec<4, bool, Q> const& a)
{
__m128i const Load = _mm_set_epi32(-static_cast<int>(a.w), -static_cast<int>(a.z), -static_cast<int>(a.y), -static_cast<int>(a.x));
__m128 const Mask = _mm_castsi128_ps(Load);
@ -204,10 +204,10 @@ namespace detail
}
};
/* FIXME
template<qualifier P>
template<qualifier Q>
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, Q> const& edge, vec<4, float, Q> const& x)
{
vec<4, float, P> Result;
result.data = glm_vec4_step(edge.data, x.data);
@ -215,10 +215,10 @@ namespace detail
}
};
*/
template<qualifier P>
template<qualifier Q>
struct compute_smoothstep_vector<4, float, P, 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, Q> const& edge0, vec<4, float, Q> const& edge1, vec<4, float, Q> const& x)
{
vec<4, float, P> Result;
Result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data);

View File

@ -28,8 +28,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> pow(vec<L, T, P> const& base, vec<L, T, P> const& exponent);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> pow(vec<L, T, Q> const& base, vec<L, T, Q> const& exponent);
/// 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> exp(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> exp(vec<L, T, Q> const& v);
/// Returns the natural logarithm of v, i.e.,
/// returns the value y which satisfies the equation x = e^y.
@ -52,8 +52,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> log(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> log(vec<L, T, Q> const& v);
/// Returns 2 raised to the v power.
///
@ -63,8 +63,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> exp2(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> exp2(vec<L, T, Q> const& v);
/// Returns the base 2 log of x, i.e., returns the value y,
/// which satisfies the equation x = 2 ^ y.
@ -75,8 +75,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> log2(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> log2(vec<L, T, Q> const& v);
/// Returns the positive square root of v.
///
@ -86,8 +86,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> sqrt(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> sqrt(vec<L, T, Q> const& v);
/// Returns the reciprocal of the positive square root of v.
///
@ -97,8 +97,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> inversesqrt(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> inversesqrt(vec<L, T, Q> const& v);
/// @}
}//namespace glm

View File

@ -20,28 +20,28 @@ namespace detail
}
# endif
template<length_t L, typename T, qualifier P, bool isFloat, bool Aligned>
template<length_t L, typename T, qualifier Q, bool isFloat, bool Aligned>
struct compute_log2
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(log2, v);
return detail::functor1<L, T, T, Q>::call(log2, v);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_sqrt
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
return detail::functor1<L, T, T, P>::call(std::sqrt, x);
return detail::functor1<L, T, T, Q>::call(std::sqrt, x);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_inversesqrt
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
return static_cast<T>(1) / sqrt(x);
}
@ -66,26 +66,26 @@ namespace detail
// pow
using std::pow;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> pow(vec<L, T, P> const& base, vec<L, T, P> const& exponent)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> pow(vec<L, T, Q> const& base, vec<L, T, Q> const& exponent)
{
return detail::functor2<L, T, P>::call(pow, base, exponent);
return detail::functor2<L, T, Q>::call(pow, base, exponent);
}
// exp
using std::exp;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> exp(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> exp(vec<L, T, Q> const& x)
{
return detail::functor1<L, T, T, P>::call(exp, x);
return detail::functor1<L, T, T, Q>::call(exp, x);
}
// log
using std::log;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> log(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> log(vec<L, T, Q> const& x)
{
return detail::functor1<L, T, T, P>::call(log, x);
return detail::functor1<L, T, T, Q>::call(log, x);
}
//exp2, ln2 = 0.69314718055994530941723212145818f
@ -97,10 +97,10 @@ namespace detail
return std::exp(static_cast<genType>(0.69314718055994530941723212145818) * x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> exp2(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> exp2(vec<L, T, Q> const& x)
{
return detail::functor1<L, T, T, P>::call(exp2, x);
return detail::functor1<L, T, T, Q>::call(exp2, x);
}
// log2, ln2 = 0.69314718055994530941723212145818f
@ -110,19 +110,19 @@ namespace detail
return log2(vec<1, genType>(x)).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> log2(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> log2(vec<L, T, Q> const& x)
{
return detail::compute_log2<L, T, P, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
return detail::compute_log2<L, T, Q, std::numeric_limits<T>::is_iec559, detail::is_aligned<Q>::value>::call(x);
}
// sqrt
using std::sqrt;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> sqrt(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> sqrt(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs");
return detail::compute_sqrt<L, T, P, detail::is_aligned<P>::value>::call(x);
return detail::compute_sqrt<L, T, Q, detail::is_aligned<Q>::value>::call(x);
}
// inversesqrt
@ -132,11 +132,11 @@ namespace detail
return static_cast<genType>(1) / sqrt(x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> inversesqrt(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> inversesqrt(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs");
return detail::compute_inversesqrt<L, T, P, detail::is_aligned<P>::value>::call(x);
return detail::compute_inversesqrt<L, T, Q, detail::is_aligned<Q>::value>::call(x);
}
}//namespace glm

View File

@ -8,10 +8,10 @@
namespace glm{
namespace detail
{
template<qualifier P>
template<qualifier Q>
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, Q> const& v)
{
vec<4, float, P> Result;
Result.data = _mm_sqrt_ps(v.data);

View File

@ -24,8 +24,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL T length(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL T length(vec<L, T, Q> const& x);
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
///
@ -34,8 +34,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL T distance(vec<L, T, P> const& p0, vec<L, T, P> const& p1);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL T distance(vec<L, T, Q> const& p0, vec<L, T, Q> const& p1);
/// Returns the dot product of x and y, i.e., result = x * y.
///
@ -44,8 +44,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL T dot(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL T dot(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns the cross product of x and y.
///
@ -53,8 +53,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> cross(vec<3, T, P> const& x, vec<3, T, P> const& y);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y);
/// Returns a vector in the same direction as x but with length of 1.
/// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error.
@ -64,8 +64,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> normalize(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> normalize(vec<L, T, Q> const& x);
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
///
@ -74,11 +74,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> faceforward(
vec<L, T, P> const& N,
vec<L, T, P> const& I,
vec<L, T, P> const& Nref);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> faceforward(
vec<L, T, Q> const& N,
vec<L, T, Q> const& I,
vec<L, T, Q> const& Nref);
/// For the incident vector I and surface orientation N,
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
@ -88,10 +88,10 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> reflect(
vec<L, T, P> const& I,
vec<L, T, P> const& N);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> reflect(
vec<L, T, Q> const& I,
vec<L, T, Q> const& N);
/// For the incident vector I and surface normal N,
/// and the ratio of indices of refraction eta,
@ -102,10 +102,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> refract(
vec<L, T, P> const& I,
vec<L, T, P> const& N,
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> refract(
vec<L, T, Q> const& I,
vec<L, T, Q> const& N,
T eta);
/// @}

View File

@ -10,19 +10,19 @@
namespace glm{
namespace detail
{
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_length
{
GLM_FUNC_QUALIFIER static T call(vec<L, T, P> const& v)
GLM_FUNC_QUALIFIER static T call(vec<L, T, Q> const& v)
{
return sqrt(dot(v, v));
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_distance
{
GLM_FUNC_QUALIFIER static T call(vec<L, T, P> const& p0, vec<L, T, P> const& p1)
GLM_FUNC_QUALIFIER static T call(vec<L, T, Q> const& p0, vec<L, T, Q> const& p1)
{
return length(p1 - p0);
}
@ -31,63 +31,63 @@ namespace detail
template<typename V, typename T, bool Aligned>
struct compute_dot{};
template<typename T, qualifier P, bool Aligned>
struct compute_dot<vec<1, T, P>, T, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_dot<vec<1, T, Q>, 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, Q> const& a, vec<1, T, Q> const& b)
{
return a.x * b.x;
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_dot<vec<2, T, P>, T, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_dot<vec<2, T, Q>, 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, Q> const& a, vec<2, T, Q> const& b)
{
vec<2, T, P> tmp(a * b);
vec<2, T, Q> tmp(a * b);
return tmp.x + tmp.y;
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_dot<vec<3, T, P>, T, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_dot<vec<3, T, Q>, 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, Q> const& a, vec<3, T, Q> const& b)
{
vec<3, T, P> tmp(a * b);
vec<3, T, Q> tmp(a * b);
return tmp.x + tmp.y + tmp.z;
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_dot<vec<4, T, P>, T, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_dot<vec<4, T, Q>, 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, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> tmp(a * b);
vec<4, T, Q> tmp(a * b);
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
}
};
template<typename T, qualifier P, bool Aligned>
template<typename T, qualifier Q, bool Aligned>
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, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' accepts only floating-point inputs");
return vec<3, T, P>(
return vec<3, T, Q>(
x.y * y.z - y.y * x.z,
x.z * y.x - y.z * x.x,
x.x * y.y - y.x * x.y);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_normalize
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
@ -95,10 +95,10 @@ namespace detail
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_faceforward
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& N, vec<L, T, P> const& I, vec<L, T, P> const& Nref)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& N, vec<L, T, Q> const& I, vec<L, T, Q> const& Nref)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
@ -106,19 +106,19 @@ namespace detail
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_reflect
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& I, vec<L, T, P> const& N)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& I, vec<L, T, Q> const& N)
{
return I - N * dot(N, I) * static_cast<T>(2);
}
};
template<length_t L, typename T, qualifier P, bool Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_refract
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& I, vec<L, T, P> const& N, T eta)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& I, vec<L, T, Q> const& N, T eta)
{
T const dotValue(dot(N, I));
T const k(static_cast<T>(1) - eta * eta * (static_cast<T>(1) - dotValue * dotValue));
@ -136,12 +136,12 @@ namespace detail
return abs(x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER T length(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T length(vec<L, T, Q> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' accepts only floating-point inputs");
return detail::compute_length<L, T, P, detail::is_aligned<P>::value>::call(v);
return detail::compute_length<L, T, Q, detail::is_aligned<Q>::value>::call(v);
}
// distance
@ -153,10 +153,10 @@ namespace detail
return length(p1 - p0);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER T distance(vec<L, T, P> const& p0, vec<L, T, P> const& p1)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T distance(vec<L, T, Q> const& p0, vec<L, T, Q> const& p1)
{
return detail::compute_distance<L, T, P, detail::is_aligned<P>::value>::call(p0, p1);
return detail::compute_distance<L, T, Q, detail::is_aligned<Q>::value>::call(p0, p1);
}
// dot
@ -167,25 +167,25 @@ namespace detail
return x * y;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER T dot(vec<L, T, P> const& x, vec<L, T, P> const& y)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T dot(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
return detail::compute_dot<vec<L, T, P>, T, detail::is_aligned<P>::value>::call(x, y);
return detail::compute_dot<vec<L, T, Q>, T, detail::is_aligned<Q>::value>::call(x, y);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T dot(tquat<T, P> const& x, tquat<T, P> const& y)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T dot(tquat<T, Q> const& x, tquat<T, Q> const& y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
return detail::compute_dot<tquat<T, P>, T, detail::is_aligned<P>::value>::call(x, y);
return detail::compute_dot<tquat<T, Q>, T, detail::is_aligned<Q>::value>::call(x, y);
}
// cross
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> cross(vec<3, T, P> const& x, vec<3, T, P> const& y)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> cross(vec<3, T, Q> const& x, vec<3, T, Q> const& y)
{
return detail::compute_cross<T, P, detail::is_aligned<P>::value>::call(x, y);
return detail::compute_cross<T, Q, detail::is_aligned<Q>::value>::call(x, y);
}
// normalize
@ -197,12 +197,12 @@ namespace detail
return x < genType(0) ? genType(-1) : genType(1);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> normalize(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> normalize(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
return detail::compute_normalize<L, T, P, detail::is_aligned<P>::value>::call(x);
return detail::compute_normalize<L, T, Q, detail::is_aligned<Q>::value>::call(x);
}
// faceforward
@ -212,10 +212,10 @@ namespace detail
return dot(Nref, I) < static_cast<genType>(0) ? N : -N;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> faceforward(vec<L, T, P> const& N, vec<L, T, P> const& I, vec<L, T, P> const& Nref)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> faceforward(vec<L, T, Q> const& N, vec<L, T, Q> const& I, vec<L, T, Q> const& Nref)
{
return detail::compute_faceforward<L, T, P, detail::is_aligned<P>::value>::call(N, I, Nref);
return detail::compute_faceforward<L, T, Q, detail::is_aligned<Q>::value>::call(N, I, Nref);
}
// reflect
@ -225,10 +225,10 @@ namespace detail
return I - N * dot(N, I) * genType(2);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> reflect(vec<L, T, P> const& I, vec<L, T, P> const& N)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> reflect(vec<L, T, Q> const& I, vec<L, T, Q> const& N)
{
return detail::compute_reflect<L, T, P, detail::is_aligned<P>::value>::call(I, N);
return detail::compute_reflect<L, T, Q, detail::is_aligned<Q>::value>::call(I, N);
}
// refract
@ -241,11 +241,11 @@ namespace detail
return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast<genType>(k >= static_cast<genType>(0));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> refract(vec<L, T, P> const& I, vec<L, T, P> const& N, T eta)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> refract(vec<L, T, Q> const& I, vec<L, T, Q> const& N, T eta)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' accepts only floating-point inputs");
return detail::compute_refract<L, T, P, detail::is_aligned<P>::value>::call(I, N, eta);
return detail::compute_refract<L, T, Q, detail::is_aligned<Q>::value>::call(I, N, eta);
}
}//namespace glm

View File

@ -8,37 +8,37 @@
namespace glm{
namespace detail
{
template<qualifier P>
template<qualifier Q>
struct compute_length<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, Q> const& v)
{
return _mm_cvtss_f32(glm_vec4_length(v.data));
}
};
template<qualifier P>
template<qualifier Q>
struct compute_distance<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, Q> const& p0, vec<4, float, Q> const& p1)
{
return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data));
}
};
template<qualifier P>
template<qualifier Q>
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, Q> const& x, vec<4, float, Q> const& y)
{
return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data));
}
};
template<qualifier P>
template<qualifier Q>
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, Q> const& a, vec<3, float, Q> const& b)
{
__m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x);
__m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x);
@ -46,14 +46,14 @@ namespace detail
vec<4, float, P> Result;
Result.data = xpd0;
return vec<3, float, P>(Result);
return vec<3, float, Q>(Result);
}
};
template<qualifier P>
template<qualifier Q>
struct compute_normalize<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, Q> const& v)
{
vec<4, float, P> Result;
Result.data = glm_vec4_normalize(v.data);
@ -61,10 +61,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_faceforward<4, float, P, 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, Q> const& N, vec<4, float, Q> const& I, vec<4, float, Q> const& Nref)
{
vec<4, float, P> Result;
Result.data = glm_vec4_faceforward(N.data, I.data, Nref.data);
@ -72,10 +72,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_reflect<4, float, P, 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, Q> const& I, vec<4, float, Q> const& N)
{
vec<4, float, P> Result;
Result.data = glm_vec4_reflect(I.data, N.data);
@ -83,10 +83,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
struct compute_refract<4, float, P, 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, Q> const& I, vec<4, float, Q> const& N, float eta)
{
vec<4, float, P> Result;
Result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, qualifier P>
GLM_FUNC_DECL vec<L, uint, P> uaddCarry(
vec<L, uint, P> const& x,
vec<L, uint, P> const& y,
vec<L, uint, P> & carry);
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, uint, Q> uaddCarry(
vec<L, uint, Q> const& x,
vec<L, uint, Q> const& y,
vec<L, uint, Q> & carry);
/// Subtracts the 32-bit unsigned integer y from x, returning
/// 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, qualifier P>
GLM_FUNC_DECL vec<L, uint, P> usubBorrow(
vec<L, uint, P> const& x,
vec<L, uint, P> const& y,
vec<L, uint, P> & borrow);
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, uint, Q> usubBorrow(
vec<L, uint, Q> const& x,
vec<L, uint, Q> const& y,
vec<L, uint, Q> & borrow);
/// Multiplies 32-bit integers x and y, producing a 64-bit
/// 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, qualifier P>
template<length_t L, qualifier Q>
GLM_FUNC_DECL void umulExtended(
vec<L, uint, P> const& x,
vec<L, uint, P> const& y,
vec<L, uint, P> & msb,
vec<L, uint, P> & lsb);
vec<L, uint, Q> const& x,
vec<L, uint, Q> const& y,
vec<L, uint, Q> & msb,
vec<L, uint, Q> & lsb);
/// Multiplies 32-bit integers x and y, producing a 64-bit
/// 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, qualifier P>
template<length_t L, qualifier Q>
GLM_FUNC_DECL void imulExtended(
vec<L, int, P> const& x,
vec<L, int, P> const& y,
vec<L, int, P> & msb,
vec<L, int, P> & lsb);
vec<L, int, Q> const& x,
vec<L, int, Q> const& y,
vec<L, int, Q> & msb,
vec<L, int, Q> & lsb);
/// Extracts bits [offset, offset + bits - 1] from value,
/// returning them in the least significant bits of the result.
@ -96,9 +96,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> bitfieldExtract(
vec<L, T, P> const& Value,
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> bitfieldExtract(
vec<L, T, Q> const& Value,
int Offset,
int Bits);
@ -117,10 +117,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> bitfieldInsert(
vec<L, T, P> const& Base,
vec<L, T, P> const& Insert,
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> bitfieldInsert(
vec<L, T, Q> const& Base,
vec<L, T, Q> const& Insert,
int Offset,
int Bits);
@ -133,8 +133,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> bitfieldReverse(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> bitfieldReverse(vec<L, T, Q> const& v);
/// Returns the number of bits set to 1 in the binary representation of value.
///
@ -152,8 +152,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, int, P> bitCount(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, int, Q> bitCount(vec<L, T, Q> const& v);
/// Returns the bit number of the least significant bit set to
/// 1 in the binary representation of value.
@ -175,8 +175,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, int, P> findLSB(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, int, Q> findLSB(vec<L, T, Q> const& v);
/// 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.
@ -200,8 +200,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8 Integer Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, int, P> findMSB(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, int, Q> findMSB(vec<L, T, Q> const& v);
/// @}
}//namespace glm

View File

@ -30,37 +30,37 @@ namespace detail
return Bits >= static_cast<T>(sizeof(T) * 8) ? ~static_cast<T>(0) : (static_cast<T>(1) << Bits) - static_cast<T>(1);
}
template<length_t L, typename T, glm::qualifier P, bool Aligned, bool EXEC>
template<length_t L, typename T, qualifier Q, bool Aligned, bool EXEC>
struct compute_bitfieldReverseStep
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v, T, T)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v, T, T)
{
return v;
}
};
template<length_t L, typename T, glm::qualifier P, bool Aligned>
struct compute_bitfieldReverseStep<L, T, P, Aligned, true>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_bitfieldReverseStep<L, T, Q, Aligned, true>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v, T Mask, T Shift)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v, T Mask, T Shift)
{
return (v & Mask) << Shift | (v & (~Mask)) >> Shift;
}
};
template<length_t L, typename T, glm::qualifier P, bool Aligned, bool EXEC>
template<length_t L, typename T, qualifier Q, bool Aligned, bool EXEC>
struct compute_bitfieldBitCountStep
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v, T, T)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v, T, T)
{
return v;
}
};
template<length_t L, typename T, glm::qualifier P, bool Aligned>
struct compute_bitfieldBitCountStep<L, T, P, Aligned, true>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_bitfieldBitCountStep<L, T, Q, Aligned, true>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v, T Mask, T Shift)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v, T Mask, T Shift)
{
return (v & Mask) + ((v >> Shift) & Mask);
}
@ -104,37 +104,37 @@ namespace detail
# endif
# endif//GLM_HAS_BITSCAN_WINDOWS
template<length_t L, typename T, qualifier P, bool EXEC = true>
template<length_t L, typename T, qualifier Q, bool EXEC = true>
struct compute_findMSB_step_vec
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x, T Shift)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, T Shift)
{
return x | (x >> Shift);
}
};
template<length_t L, typename T, qualifier P>
struct compute_findMSB_step_vec<L, T, P, false>
template<length_t L, typename T, qualifier Q>
struct compute_findMSB_step_vec<L, T, Q, false>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x, T)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, T)
{
return x;
}
};
template<length_t L, typename T, qualifier P, int>
template<length_t L, typename T, qualifier Q, int>
struct compute_findMSB_vec
{
GLM_FUNC_QUALIFIER static vec<L, int, P> call(vec<L, T, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, int, Q> call(vec<L, T, Q> const& v)
{
vec<L, T, P> x(v);
x = compute_findMSB_step_vec<L, T, P, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 1));
x = compute_findMSB_step_vec<L, T, P, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 2));
x = compute_findMSB_step_vec<L, T, P, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 4));
x = compute_findMSB_step_vec<L, T, P, sizeof(T) * 8 >= 16>::call(x, static_cast<T>( 8));
x = compute_findMSB_step_vec<L, T, P, sizeof(T) * 8 >= 32>::call(x, static_cast<T>(16));
x = compute_findMSB_step_vec<L, T, P, sizeof(T) * 8 >= 64>::call(x, static_cast<T>(32));
return vec<L, int, P>(sizeof(T) * 8 - 1) - glm::bitCount(~x);
vec<L, T, Q> x(v);
x = compute_findMSB_step_vec<L, T, Q, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 1));
x = compute_findMSB_step_vec<L, T, Q, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 2));
x = compute_findMSB_step_vec<L, T, Q, sizeof(T) * 8 >= 8>::call(x, static_cast<T>( 4));
x = compute_findMSB_step_vec<L, T, Q, sizeof(T) * 8 >= 16>::call(x, static_cast<T>( 8));
x = compute_findMSB_step_vec<L, T, Q, sizeof(T) * 8 >= 32>::call(x, static_cast<T>(16));
x = compute_findMSB_step_vec<L, T, Q, sizeof(T) * 8 >= 64>::call(x, static_cast<T>(32));
return vec<L, int, Q>(sizeof(T) * 8 - 1) - glm::bitCount(~x);
}
};
@ -147,12 +147,12 @@ namespace detail
return IsNotNull ? int(Result) : -1;
}
template<length_t L, typename T, qualifier P>
struct compute_findMSB_vec<L, T, P, 32>
template<length_t L, typename T, qualifier Q>
struct compute_findMSB_vec<L, T, Q, 32>
{
GLM_FUNC_QUALIFIER static vec<L, int, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, int, Q> call(vec<L, T, Q> const& x)
{
return detail::functor1<L, int, T, P>::call(compute_findMSB_32, x);
return detail::functor1<L, int, T, Q>::call(compute_findMSB_32, x);
}
};
@ -165,12 +165,12 @@ namespace detail
return IsNotNull ? int(Result) : -1;
}
template<length_t L, typename T, qualifier P>
struct compute_findMSB_vec<L, T, P, 64>
template<length_t L, typename T, qualifier Q>
struct compute_findMSB_vec<L, T, Q, 64>
{
GLM_FUNC_QUALIFIER static vec<L, int, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, int, Q> call(vec<L, T, Q> const& x)
{
return detail::functor1<L, int, T, P>::call(compute_findMSB_64, x);
return detail::functor1<L, int, T, Q>::call(compute_findMSB_64, x);
}
};
# endif
@ -186,13 +186,13 @@ namespace detail
return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER vec<L, uint, P> uaddCarry(vec<L, uint, P> const& x, vec<L, uint, P> const& y, vec<L, uint, P>& Carry)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, uint, Q> uaddCarry(vec<L, uint, Q> const& x, vec<L, uint, Q> const& y, vec<L, uint, Q>& Carry)
{
vec<L, uint64, P> Value64(vec<L, uint64, P>(x) + vec<L, uint64, P>(y));
vec<L, uint64, P> Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
Carry = mix(vec<L, uint32, P>(0), vec<L, uint32, P>(1), greaterThan(Value64, Max32));
return vec<L, uint32,P>(Value64 % (Max32 + static_cast<uint64>(1)));
vec<L, uint64, Q> Value64(vec<L, uint64, Q>(x) + vec<L, uint64, Q>(y));
vec<L, uint64, Q> Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
Carry = mix(vec<L, uint32, Q>(0), vec<L, uint32, Q>(1), greaterThan(Value64, Max32));
return vec<L, uint32, Q>(Value64 % (Max32 + static_cast<uint64>(1)));
}
// 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)));
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER vec<L, uint, P> usubBorrow(vec<L, uint, P> const& x, vec<L, uint, P> const& y, vec<L, uint, P>& Borrow)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, uint, Q> usubBorrow(vec<L, uint, Q> const& x, vec<L, uint, Q> const& y, vec<L, uint, Q>& Borrow)
{
Borrow = mix(vec<L, uint, P>(1), vec<L, uint, P>(0), greaterThanEqual(x, y));
vec<L, uint, P> const YgeX(y - x);
vec<L, uint, P> const XgeY(vec<L, uint32, P>((static_cast<int64>(1) << static_cast<int64>(32)) + (vec<L, int64, P>(y) - vec<L, int64, P>(x))));
Borrow = mix(vec<L, uint, Q>(1), vec<L, uint, Q>(0), greaterThanEqual(x, y));
vec<L, uint, Q> const YgeX(y - x);
vec<L, uint, Q> const XgeY(vec<L, uint32, Q>((static_cast<int64>(1) << static_cast<int64>(32)) + (vec<L, int64, Q>(y) - vec<L, int64, Q>(x))));
return mix(XgeY, YgeX, greaterThanEqual(y, x));
}
@ -226,14 +226,14 @@ namespace detail
lsb = static_cast<uint>(Value64);
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER void umulExtended(vec<L, uint, P> const& x, vec<L, uint, P> const& y, vec<L, uint, P>& msb, vec<L, uint, P>& lsb)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER void umulExtended(vec<L, uint, Q> const& x, vec<L, uint, Q> const& y, vec<L, uint, Q>& msb, vec<L, uint, Q>& lsb)
{
GLM_STATIC_ASSERT(sizeof(uint) == sizeof(uint32), "uint and uint32 size mismatch");
vec<L, uint64, P> Value64(vec<L, uint64, P>(x) * vec<L, uint64, P>(y));
msb = vec<L, uint32, P>(Value64 >> static_cast<uint64>(32));
lsb = vec<L, uint32, P>(Value64);
vec<L, uint64, Q> Value64(vec<L, uint64, Q>(x) * vec<L, uint64, Q>(y));
msb = vec<L, uint32, Q>(Value64 >> static_cast<uint64>(32));
lsb = vec<L, uint32, Q>(Value64);
}
// imulExtended
@ -246,14 +246,14 @@ namespace detail
lsb = static_cast<int>(Value64);
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER void imulExtended(vec<L, int, P> const& x, vec<L, int, P> const& y, vec<L, int, P>& msb, vec<L, int, P>& lsb)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER void imulExtended(vec<L, int, Q> const& x, vec<L, int, Q> const& y, vec<L, int, Q>& msb, vec<L, int, Q>& lsb)
{
GLM_STATIC_ASSERT(sizeof(int) == sizeof(int32), "int and int32 size mismatch");
vec<L, int64, P> Value64(vec<L, int64, P>(x) * vec<L, int64, P>(y));
lsb = vec<L, int32, P>(Value64 & static_cast<int64>(0xFFFFFFFF));
msb = vec<L, int32, P>((Value64 >> static_cast<int64>(32)) & static_cast<int64>(0xFFFFFFFF));
vec<L, int64, Q> Value64(vec<L, int64, Q>(x) * vec<L, int64, Q>(y));
lsb = vec<L, int32, Q>(Value64 & static_cast<int64>(0xFFFFFFFF));
msb = vec<L, int32, Q>((Value64 >> static_cast<int64>(32)) & static_cast<int64>(0xFFFFFFFF));
}
// bitfieldExtract
@ -263,8 +263,8 @@ namespace detail
return bitfieldExtract(vec<1, genIUType>(Value), Offset, Bits).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldExtract(vec<L, T, P> const& Value, int Offset, int Bits)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldExtract(vec<L, T, Q> const& Value, int Offset, int Bits)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldExtract' only accept integer inputs");
@ -278,8 +278,8 @@ namespace detail
return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldInsert(vec<L, T, P> const& Base, vec<L, T, P> const& Insert, int Offset, int Bits)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldInsert(vec<L, T, Q> const& Base, vec<L, T, Q> const& Insert, int Offset, int Bits)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldInsert' only accept integer values");
@ -294,16 +294,16 @@ namespace detail
return bitfieldReverse(glm::vec<1, genType, glm::defaultp>(x)).x;
}
template<length_t L, typename T, glm::qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldReverse(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldReverse(vec<L, T, Q> const& v)
{
vec<L, T, P> x(v);
x = detail::compute_bitfieldReverseStep<L, T, P, detail::is_aligned<P>::value, sizeof(T) * 8>= 2>::call(x, static_cast<T>(0x5555555555555555ull), static_cast<T>( 1));
x = detail::compute_bitfieldReverseStep<L, T, P, detail::is_aligned<P>::value, sizeof(T) * 8>= 4>::call(x, static_cast<T>(0x3333333333333333ull), static_cast<T>( 2));
x = detail::compute_bitfieldReverseStep<L, T, P, detail::is_aligned<P>::value, sizeof(T) * 8>= 8>::call(x, static_cast<T>(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4));
x = detail::compute_bitfieldReverseStep<L, T, P, detail::is_aligned<P>::value, sizeof(T) * 8>= 16>::call(x, static_cast<T>(0x00FF00FF00FF00FFull), static_cast<T>( 8));
x = detail::compute_bitfieldReverseStep<L, T, P, detail::is_aligned<P>::value, sizeof(T) * 8>= 32>::call(x, static_cast<T>(0x0000FFFF0000FFFFull), static_cast<T>(16));
x = detail::compute_bitfieldReverseStep<L, T, P, detail::is_aligned<P>::value, sizeof(T) * 8>= 64>::call(x, static_cast<T>(0x00000000FFFFFFFFull), static_cast<T>(32));
vec<L, T, Q> x(v);
x = detail::compute_bitfieldReverseStep<L, T, Q, detail::is_aligned<Q>::value, sizeof(T) * 8>= 2>::call(x, static_cast<T>(0x5555555555555555ull), static_cast<T>( 1));
x = detail::compute_bitfieldReverseStep<L, T, Q, detail::is_aligned<Q>::value, sizeof(T) * 8>= 4>::call(x, static_cast<T>(0x3333333333333333ull), static_cast<T>( 2));
x = detail::compute_bitfieldReverseStep<L, T, Q, detail::is_aligned<Q>::value, sizeof(T) * 8>= 8>::call(x, static_cast<T>(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4));
x = detail::compute_bitfieldReverseStep<L, T, Q, detail::is_aligned<Q>::value, sizeof(T) * 8>= 16>::call(x, static_cast<T>(0x00FF00FF00FF00FFull), static_cast<T>( 8));
x = detail::compute_bitfieldReverseStep<L, T, Q, detail::is_aligned<Q>::value, sizeof(T) * 8>= 32>::call(x, static_cast<T>(0x0000FFFF0000FFFFull), static_cast<T>(16));
x = detail::compute_bitfieldReverseStep<L, T, Q, detail::is_aligned<Q>::value, sizeof(T) * 8>= 64>::call(x, static_cast<T>(0x00000000FFFFFFFFull), static_cast<T>(32));
return x;
}
@ -314,22 +314,22 @@ namespace detail
return bitCount(glm::vec<1, genType, glm::defaultp>(x)).x;
}
template<length_t L, typename T, glm::qualifier P>
GLM_FUNC_QUALIFIER vec<L, int, P> bitCount(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, int, Q> bitCount(vec<L, T, Q> const& v)
{
# if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(push)
# pragma warning(disable : 4310) //cast truncates constant value
# endif
vec<L, typename detail::make_unsigned<T>::type, P> x(*reinterpret_cast<vec<L, typename detail::make_unsigned<T>::type, P> const *>(&v));
x = detail::compute_bitfieldBitCountStep<L, typename detail::make_unsigned<T>::type, P, 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, 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, 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, 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, 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, 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 vec<L, int, P>(x);
vec<L, typename detail::make_unsigned<T>::type, Q> x(*reinterpret_cast<vec<L, typename detail::make_unsigned<T>::type, Q> const *>(&v));
x = detail::compute_bitfieldBitCountStep<L, typename detail::make_unsigned<T>::type, Q, detail::is_aligned<Q>::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, Q, detail::is_aligned<Q>::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, Q, detail::is_aligned<Q>::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, Q, detail::is_aligned<Q>::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, Q, detail::is_aligned<Q>::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, Q, detail::is_aligned<Q>::value, sizeof(T) * 8>= 64>::call(x, typename detail::make_unsigned<T>::type(0x00000000FFFFFFFFull), typename detail::make_unsigned<T>::type(32));
return vec<L, int, Q>(x);
# if GLM_COMPILER & GLM_COMPILER_VC
# pragma warning(pop)
@ -345,12 +345,12 @@ namespace detail
return detail::compute_findLSB<genIUType, sizeof(genIUType) * 8>::call(Value);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, int, P> findLSB(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, int, Q> findLSB(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findLSB' only accept integer values");
return detail::functor1<L, int, T, P>::call(findLSB, x);
return detail::functor1<L, int, T, Q>::call(findLSB, x);
}
// findMSB
@ -362,12 +362,12 @@ namespace detail
return findMSB(vec<1, genIUType>(v)).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, int, P> findMSB(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, int, Q> findMSB(vec<L, T, Q> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findMSB' only accept integer values");
return detail::compute_findMSB_vec<L, T, P, sizeof(T) * 8>::call(v);
return detail::compute_findMSB_vec<L, T, Q, sizeof(T) * 8>::call(v);
}
}//namespace glm

View File

@ -11,7 +11,7 @@ namespace detail
template<glm::qualifier P>
struct compute_bitfieldReverseStep<4, uint32, P, 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, Q> const& v, uint32 Mask, uint32 Shift)
{
__m128i const set0 = v.data;
@ -32,7 +32,7 @@ namespace detail
template<glm::qualifier P>
struct compute_bitfieldBitCountStep<4, uint32, P, 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, Q> const& v, uint32 Mask, uint32 Shift)
{
__m128i const set0 = v.data;

View File

@ -34,58 +34,58 @@
namespace glm{
namespace detail
{
template<typename T, qualifier P>
struct outerProduct_trait<2, 2, T, P>
template<typename T, qualifier Q>
struct outerProduct_trait<2, 2, T, Q>
{
typedef mat<2, 2, T, P> type;
typedef mat<2, 2, T, Q> type;
};
template<typename T, qualifier P>
struct outerProduct_trait<2, 3, T, P>
template<typename T, qualifier Q>
struct outerProduct_trait<2, 3, T, Q>
{
typedef mat<3, 2, T, P> type;
typedef mat<3, 2, T, Q> type;
};
template<typename T, qualifier P>
struct outerProduct_trait<2, 4, T, P>
template<typename T, qualifier Q>
struct outerProduct_trait<2, 4, T, Q>
{
typedef mat<4, 2, T, P> type;
typedef mat<4, 2, T, Q> type;
};
template<typename T, qualifier P>
struct outerProduct_trait<3, 2, T, P>
template<typename T, qualifier Q>
struct outerProduct_trait<3, 2, T, Q>
{
typedef mat<2, 3, T, P> type;
typedef mat<2, 3, T, Q> type;
};
template<typename T, qualifier P>
struct outerProduct_trait<3, 3, T, P>
template<typename T, qualifier Q>
struct outerProduct_trait<3, 3, T, Q>
{
typedef mat<3, 3, T, P> type;
typedef mat<3, 3, T, Q> type;
};
template<typename T, qualifier P>
struct outerProduct_trait<3, 4, T, P>
template<typename T, qualifier Q>
struct outerProduct_trait<3, 4, T, Q>
{
typedef mat<4, 3, T, P> type;
typedef mat<4, 3, T, Q> type;
};
template<typename T, qualifier P>
struct outerProduct_trait<4, 2, T, P>
template<typename T, qualifier Q>
struct outerProduct_trait<4, 2, T, Q>
{
typedef mat<2, 4, T, P> type;
typedef mat<2, 4, T, Q> type;
};
template<typename T, qualifier P>
struct outerProduct_trait<4, 3, T, P>
template<typename T, qualifier Q>
struct outerProduct_trait<4, 3, T, Q>
{
typedef mat<3, 4, T, P> type;
typedef mat<3, 4, T, Q> type;
};
template<typename T, qualifier P>
struct outerProduct_trait<4, 4, T, P>
template<typename T, qualifier Q>
struct outerProduct_trait<4, 4, T, Q>
{
typedef mat<4, 4, T, P> type;
typedef mat<4, 4, T, Q> type;
};
}//namespace detail
@ -100,8 +100,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template<typename T, qualifier P, template<typename, qualifier> class matType>
GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const& x, matType<T, P> const& y);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL mat<C, R, T, Q> matrixCompMult(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y);
/// Treats the first parameter c as a column vector
/// and the second parameter r as a row vector
@ -109,8 +109,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template<length_t DA, length_t DB, typename T, qualifier P>
GLM_FUNC_DECL typename detail::outerProduct_trait<DA, DB, T, P>::type outerProduct(vec<DA, T, P> const& c, vec<DB, T, P> const& r);
template<length_t DA, length_t DB, typename T, qualifier Q>
GLM_FUNC_DECL typename detail::outerProduct_trait<DA, DB, T, Q>::type outerProduct(vec<DA, T, Q> const& c, vec<DB, T, Q> const& r);
/// Returns the transposed matrix of x
///
@ -118,8 +118,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template<typename T, qualifier P, template<typename, qualifier> class matType>
GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const& x);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL typename mat<C, R, T, Q>::transpose_type transpose(mat<C, R, T, Q> const& x);
/// Return the determinant of a squared matrix.
///
@ -127,8 +127,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template<typename T, qualifier P, template<typename, qualifier> class matType>
GLM_FUNC_DECL T determinant(matType<T, P> const& m);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL T determinant(mat<C, R, T, Q> const& m);
/// Return the inverse of a squared matrix.
///
@ -136,8 +136,8 @@ 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template<typename T, qualifier P, template<typename, qualifier> class matType>
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const& m);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL mat<C, R, T, Q> inverse(mat<C, R, T, Q> const& m);
/// @}
}//namespace glm

View File

@ -7,27 +7,27 @@
namespace glm{
namespace detail
{
template<template<length_t, length_t, typename, qualifier> class matType, length_t C, length_t R, typename T, qualifier P, bool Aligned>
template<length_t C, length_t R, typename T, qualifier Q, bool Aligned>
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 mat<C, R, T, Q> call(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y)
{
matType<C, R, T, P> Result;
mat<C, R, T, Q> Result;
for(length_t i = 0; i < Result.length(); ++i)
Result[i] = x[i] * y[i];
return Result;
}
};
template<template<length_t, length_t, typename, qualifier> class matType, length_t C, length_t R, typename T, qualifier P, bool Aligned>
template<length_t C, length_t R, typename T, qualifier Q, bool Aligned>
struct compute_transpose{};
template<typename T, qualifier P, bool Aligned>
struct compute_transpose<mat, 2, 2, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_transpose<2, 2, T, Q, 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, Q> call(mat<2, 2, T, Q> const& m)
{
mat<2, 2, T, P> Result;
mat<2, 2, T, Q> Result;
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[1][0] = m[0][1];
@ -36,12 +36,12 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_transpose<mat, 2, 3, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_transpose<2, 3, T, Q, 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, Q> call(mat<2, 3, T, Q> const& m)
{
mat<3,2, T, P> Result;
mat<3,2, T, Q> Result;
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[1][0] = m[0][1];
@ -52,12 +52,12 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_transpose<mat, 2, 4, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_transpose<2, 4, T, Q, 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, Q> call(mat<2, 4, T, Q> const& m)
{
mat<4, 2, T, P> Result;
mat<4, 2, T, Q> Result;
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[1][0] = m[0][1];
@ -70,12 +70,12 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_transpose<mat, 3, 2, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_transpose<3, 2, T, Q, 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, Q> call(mat<3, 2, T, Q> const& m)
{
mat<2, 3, T, P> Result;
mat<2, 3, T, Q> Result;
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -86,12 +86,12 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_transpose<mat, 3, 3, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_transpose<3, 3, T, Q, 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, Q> call(mat<3, 3, T, Q> const& m)
{
mat<3, 3, T, P> Result;
mat<3, 3, T, Q> Result;
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -107,12 +107,12 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_transpose<mat, 3, 4, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_transpose<3, 4, T, Q, 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, Q> call(mat<3, 4, T, Q> const& m)
{
mat<4, 3, T, P> Result;
mat<4, 3, T, Q> Result;
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -129,12 +129,12 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_transpose<mat, 4, 2, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_transpose<4, 2, T, Q, 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, Q> call(mat<4, 2, T, Q> const& m)
{
mat<2, 4, T, P> Result;
mat<2, 4, T, Q> Result;
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -147,12 +147,12 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_transpose<mat, 4, 3, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_transpose<4, 3, T, Q, 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, Q> call(mat<4, 3, T, Q> const& m)
{
mat<3, 4, T, P> Result;
mat<3, 4, T, Q> Result;
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -169,12 +169,12 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_transpose<mat, 4, 4, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_transpose<4, 4, T, Q, 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, Q> call(mat<4, 4, T, Q> const& m)
{
mat<4, 4, T, P> Result;
mat<4, 4, T, Q> Result;
Result[0][0] = m[0][0];
Result[0][1] = m[1][0];
Result[0][2] = m[2][0];
@ -198,22 +198,22 @@ namespace detail
}
};
template<template<length_t, length_t, typename, qualifier> class matType, length_t C, length_t R, typename T, qualifier P, bool Aligned>
template<length_t C, length_t R, typename T, qualifier Q, bool Aligned>
struct compute_determinant{};
template<typename T, qualifier P, bool Aligned>
struct compute_determinant<mat, 2, 2, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_determinant<2, 2, T, Q, Aligned>
{
GLM_FUNC_QUALIFIER static T call(mat<2, 2, T, P> const& m)
GLM_FUNC_QUALIFIER static T call(mat<2, 2, T, Q> const& m)
{
return m[0][0] * m[1][1] - m[1][0] * m[0][1];
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_determinant<mat, 3, 3, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_determinant<3, 3, T, Q, Aligned>
{
GLM_FUNC_QUALIFIER static T call(mat<3, 3, T, P> const& m)
GLM_FUNC_QUALIFIER static T call(mat<3, 3, T, Q> const& m)
{
return
+ m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])
@ -222,10 +222,10 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_determinant<mat, 4, 4, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_determinant<4, 4, T, Q, Aligned>
{
GLM_FUNC_QUALIFIER static T call(mat<4, 4, T, P> const& m)
GLM_FUNC_QUALIFIER static T call(mat<4, 4, T, Q> const& m)
{
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
@ -234,7 +234,7 @@ namespace detail
T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];
T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];
vec<4, T, P> DetCof(
vec<4, T, Q> DetCof(
+ (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02),
- (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04),
+ (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05),
@ -246,19 +246,19 @@ namespace detail
}
};
template<template<length_t, length_t, typename, qualifier> class matType, length_t C, length_t R, typename T, qualifier P, bool Aligned>
template<length_t C, length_t R, typename T, qualifier Q, bool Aligned>
struct compute_inverse{};
template<typename T, qualifier P, bool Aligned>
struct compute_inverse<mat, 2, 2, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_inverse<2, 2, T, Q, 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, Q> call(mat<2, 2, T, Q> const& m)
{
T OneOverDeterminant = static_cast<T>(1) / (
+ m[0][0] * m[1][1]
- m[1][0] * m[0][1]);
mat<2, 2, T, P> Inverse(
mat<2, 2, T, Q> Inverse(
+ m[1][1] * OneOverDeterminant,
- m[0][1] * OneOverDeterminant,
- m[1][0] * OneOverDeterminant,
@ -268,17 +268,17 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_inverse<mat, 3, 3, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_inverse<3, 3, T, Q, 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, Q> call(mat<3, 3, T, Q> const& m)
{
T OneOverDeterminant = static_cast<T>(1) / (
+ m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])
- m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2])
+ m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]));
mat<3, 3, T, P> Inverse;
mat<3, 3, T, Q> Inverse;
Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]) * OneOverDeterminant;
Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]) * OneOverDeterminant;
Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]) * OneOverDeterminant;
@ -293,10 +293,10 @@ namespace detail
}
};
template<typename T, qualifier P, bool Aligned>
struct compute_inverse<mat, 4, 4, T, P, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_inverse<4, 4, T, Q, 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, Q> call(mat<4, 4, T, Q> const& m)
{
T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3];
@ -322,30 +322,30 @@ namespace detail
T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1];
T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
vec<4, T, P> Fac0(Coef00, Coef00, Coef02, Coef03);
vec<4, T, P> Fac1(Coef04, Coef04, Coef06, Coef07);
vec<4, T, P> Fac2(Coef08, Coef08, Coef10, Coef11);
vec<4, T, P> Fac3(Coef12, Coef12, Coef14, Coef15);
vec<4, T, P> Fac4(Coef16, Coef16, Coef18, Coef19);
vec<4, T, P> Fac5(Coef20, Coef20, Coef22, Coef23);
vec<4, T, Q> Fac0(Coef00, Coef00, Coef02, Coef03);
vec<4, T, Q> Fac1(Coef04, Coef04, Coef06, Coef07);
vec<4, T, Q> Fac2(Coef08, Coef08, Coef10, Coef11);
vec<4, T, Q> Fac3(Coef12, Coef12, Coef14, Coef15);
vec<4, T, Q> Fac4(Coef16, Coef16, Coef18, Coef19);
vec<4, T, Q> Fac5(Coef20, Coef20, Coef22, Coef23);
vec<4, T, P> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]);
vec<4, T, P> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]);
vec<4, T, P> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]);
vec<4, T, P> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]);
vec<4, T, Q> Vec0(m[1][0], m[0][0], m[0][0], m[0][0]);
vec<4, T, Q> Vec1(m[1][1], m[0][1], m[0][1], m[0][1]);
vec<4, T, Q> Vec2(m[1][2], m[0][2], m[0][2], m[0][2]);
vec<4, T, Q> Vec3(m[1][3], m[0][3], m[0][3], m[0][3]);
vec<4, T, P> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);
vec<4, T, P> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);
vec<4, T, P> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);
vec<4, T, P> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);
vec<4, T, Q> Inv0(Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2);
vec<4, T, Q> Inv1(Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4);
vec<4, T, Q> Inv2(Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5);
vec<4, T, Q> Inv3(Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5);
vec<4, T, P> SignA(+1, -1, +1, -1);
vec<4, T, P> SignB(-1, +1, -1, +1);
mat<4, 4, T, P> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB);
vec<4, T, Q> SignA(+1, -1, +1, -1);
vec<4, T, Q> SignB(-1, +1, -1, +1);
mat<4, 4, T, Q> Inverse(Inv0 * SignA, Inv1 * SignB, Inv2 * SignA, Inv3 * SignB);
vec<4, T, P> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);
vec<4, T, Q> Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]);
vec<4, T, P> Dot0(m[0] * Row0);
vec<4, T, Q> Dot0(m[0] * Row0);
T Dot1 = (Dot0.x + Dot0.y) + (Dot0.z + Dot0.w);
T OneOverDeterminant = static_cast<T>(1) / Dot1;
@ -355,43 +355,43 @@ namespace detail
};
}//namespace detail
template<length_t C, length_t R, typename T, qualifier P, template<length_t, length_t, typename, qualifier> 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)
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<C, R, T, Q> matrixCompMult(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y)
{
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<C, R, T, Q, detail::is_aligned<Q>::value>::call(x, y);
}
template<length_t DA, length_t DB, typename T, qualifier P>
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<DA, DB, T, P>::type outerProduct(vec<DA, T, P> const& c, vec<DB, T, P> const& r)
template<length_t DA, length_t DB, typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<DA, DB, T, Q>::type outerProduct(vec<DA, T, Q> const& c, vec<DB, T, Q> const& r)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'outerProduct' only accept floating-point inputs");
typename detail::outerProduct_trait<DA, DB, T, P>::type m;
typename detail::outerProduct_trait<DA, DB, T, Q>::type m;
for(length_t i = 0; i < m.length(); ++i)
m[i] = c * r[i];
return m;
}
template<length_t C, length_t R, typename T, qualifier P, template<length_t, length_t, typename, qualifier> class matType>
GLM_FUNC_QUALIFIER typename matType<C, R, T, P>::transpose_type transpose(matType<C, R, T, P> const& m)
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<C, R, T, Q>::transpose_type transpose(mat<C, R, T, Q> const& m)
{
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<C, R, T, Q, detail::is_aligned<Q>::value>::call(m);
}
template<length_t C, length_t R, typename T, qualifier P, template<length_t, length_t, typename, qualifier> class matType>
GLM_FUNC_QUALIFIER T determinant(matType<C, R, T, P> const& m)
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T determinant(mat<C, R, T, Q> const& m)
{
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<C, R, T, Q, detail::is_aligned<Q>::value>::call(m);
}
template<length_t C, length_t R, typename T, qualifier P, template<length_t, length_t, typename, qualifier> class matType>
GLM_FUNC_QUALIFIER matType<C, R, T, P> inverse(matType<C, R, T, P> const& m)
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<C, R, T, Q> inverse(mat<C, R, T, Q> const& m)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs");
return detail::compute_inverse<matType, C, R, T, P, detail::is_aligned<P>::value>::call(m);
return detail::compute_inverse<C, R, T, Q, detail::is_aligned<Q>::value>::call(m);
}
}//namespace glm

View File

@ -11,12 +11,12 @@
namespace glm{
namespace detail
{
template<qualifier P>
template<qualifier Q>
struct compute_matrixCompMult<mat, 4, 4, float, P, true>
{
GLM_STATIC_ASSERT(detail::is_aligned<P>::value, "Specialization requires aligned");
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const& x, mat<4, 4, float, P> const& y)
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, Q> const& x, mat<4, 4, float, Q> const& y)
{
mat<4, 4, float, P> Result;
glm_mat4_matrixCompMult(
@ -27,10 +27,10 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
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, Q> const& m)
{
mat<4, 4, float, P> Result;
glm_mat4_transpose(
@ -40,19 +40,19 @@ namespace detail
}
};
template<qualifier P>
template<qualifier Q>
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, Q> const& m)
{
return _mm_cvtss_f32(glm_mat4_determinant(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data)));
}
};
template<qualifier P>
template<qualifier Q>
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, Q> const& m)
{
mat<4, 4, float, P> Result;
glm_mat4_inverse(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data), *reinterpret_cast<__m128(*)[4]>(&Result[0].data));

View File

@ -30,8 +30,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, P> radians(vec<L, T, P> const& degrees);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> radians(vec<L, T, Q> const& degrees);
/// Converts radians to degrees and returns the result.
///
@ -41,8 +41,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, P> degrees(vec<L, T, P> const& radians);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> degrees(vec<L, T, Q> const& radians);
/// The standard trigonometric sine function.
/// The values returned by this function will range from [-1, 1].
@ -53,8 +53,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> sin(vec<L, T, P> const& angle);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> sin(vec<L, T, Q> const& angle);
/// The standard trigonometric cosine function.
/// The values returned by this function will range from [-1, 1].
@ -65,8 +65,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> cos(vec<L, T, P> const& angle);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> cos(vec<L, T, Q> const& angle);
/// The standard trigonometric tangent function.
///
@ -76,8 +76,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> tan(vec<L, T, P> const& angle);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> tan(vec<L, T, Q> const& angle);
/// Arc sine. Returns an angle whose sine is x.
/// The range of values returned by this function is [-PI/2, PI/2].
@ -89,8 +89,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> asin(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> asin(vec<L, T, Q> const& x);
/// Arc cosine. Returns an angle whose sine is x.
/// The range of values returned by this function is [0, PI].
@ -102,8 +102,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> acos(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> acos(vec<L, T, Q> const& x);
/// Arc tangent. Returns an angle whose tangent is y/x.
/// The signs of x and y are used to determine what
@ -117,8 +117,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> atan(vec<L, T, P> const& y, vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> atan(vec<L, T, Q> const& y, vec<L, T, Q> const& 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].
@ -129,8 +129,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> atan(vec<L, T, P> const& y_over_x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> atan(vec<L, T, Q> const& y_over_x);
/// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2
///
@ -140,8 +140,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> sinh(vec<L, T, P> const& angle);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> sinh(vec<L, T, Q> const& angle);
/// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2
///
@ -151,8 +151,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> cosh(vec<L, T, P> const& angle);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> cosh(vec<L, T, Q> const& angle);
/// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)
///
@ -162,8 +162,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> tanh(vec<L, T, P> const& angle);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> tanh(vec<L, T, Q> const& angle);
/// Arc hyperbolic sine; returns the inverse of sinh.
///
@ -173,8 +173,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> asinh(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> asinh(vec<L, T, Q> const& x);
/// Arc hyperbolic cosine; returns the non-negative inverse
/// of cosh. Results are undefined if x < 1.
@ -185,8 +185,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> acosh(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> acosh(vec<L, T, Q> const& x);
/// Arc hyperbolic tangent; returns the inverse of tanh.
/// Results are undefined if abs(x) >= 1.
@ -197,8 +197,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> atanh(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> atanh(vec<L, T, Q> const& x);
/// @}
}//namespace glm

View File

@ -16,10 +16,10 @@ namespace glm
return degrees * static_cast<genType>(0.01745329251994329576923690768489);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, P> radians(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> radians(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(radians, v);
return detail::functor1<L, T, T, Q>::call(radians, v);
}
// degrees
@ -31,55 +31,55 @@ namespace glm
return radians * static_cast<genType>(57.295779513082320876798154814105);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, P> degrees(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> degrees(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(degrees, v);
return detail::functor1<L, T, T, Q>::call(degrees, v);
}
// sin
using ::std::sin;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> sin(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> sin(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(sin, v);
return detail::functor1<L, T, T, Q>::call(sin, v);
}
// cos
using std::cos;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> cos(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> cos(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(cos, v);
return detail::functor1<L, T, T, Q>::call(cos, v);
}
// tan
using std::tan;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> tan(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> tan(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(tan, v);
return detail::functor1<L, T, T, Q>::call(tan, v);
}
// asin
using std::asin;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> asin(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> asin(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(asin, v);
return detail::functor1<L, T, T, Q>::call(asin, v);
}
// acos
using std::acos;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> acos(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> acos(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(acos, v);
return detail::functor1<L, T, T, Q>::call(acos, v);
}
// atan
@ -91,45 +91,45 @@ namespace glm
return ::std::atan2(y, x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> atan(vec<L, T, P> const& a, vec<L, T, P> const& b)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> atan(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
{
return detail::functor2<L, T, P>::call(::std::atan2, a, b);
return detail::functor2<L, T, Q>::call(::std::atan2, a, b);
}
using std::atan;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> atan(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> atan(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(atan, v);
return detail::functor1<L, T, T, Q>::call(atan, v);
}
// sinh
using std::sinh;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> sinh(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> sinh(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(sinh, v);
return detail::functor1<L, T, T, Q>::call(sinh, v);
}
// cosh
using std::cosh;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> cosh(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> cosh(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(cosh, v);
return detail::functor1<L, T, T, Q>::call(cosh, v);
}
// tanh
using std::tanh;
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> tanh(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> tanh(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(tanh, v);
return detail::functor1<L, T, T, Q>::call(tanh, v);
}
// asinh
@ -145,10 +145,10 @@ namespace glm
}
# endif
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> asinh(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> asinh(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(asinh, v);
return detail::functor1<L, T, T, Q>::call(asinh, v);
}
// acosh
@ -166,10 +166,10 @@ namespace glm
}
# endif
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> acosh(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> acosh(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(acosh, v);
return detail::functor1<L, T, T, Q>::call(acosh, v);
}
// atanh
@ -187,10 +187,10 @@ namespace glm
}
# endif
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> atanh(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> atanh(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(atanh, v);
return detail::functor1<L, T, T, Q>::call(atanh, v);
}
}//namespace glm

View File

@ -30,8 +30,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> lessThan(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> lessThan(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns the component-wise comparison of result x <= y.
///
@ -40,8 +40,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> lessThanEqual(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> lessThanEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns the component-wise comparison of result x > y.
///
@ -50,8 +50,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> greaterThan(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> greaterThan(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns the component-wise comparison of result x >= y.
///
@ -60,8 +60,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> greaterThanEqual(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> greaterThanEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns the component-wise comparison of result x == y.
///
@ -70,8 +70,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> equal(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns the component-wise comparison of result x != y.
///
@ -80,8 +80,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> notEqual(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns true if any component of x is true.
///
@ -89,8 +89,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template<length_t L, qualifier P>
GLM_FUNC_DECL bool any(vec<L, bool, P> const& v);
template<length_t L, qualifier Q>
GLM_FUNC_DECL bool any(vec<L, bool, Q> const& v);
/// Returns true if all components of x are true.
///
@ -98,8 +98,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template<length_t L, qualifier P>
GLM_FUNC_DECL bool all(vec<L, bool, P> const& v);
template<length_t L, qualifier Q>
GLM_FUNC_DECL bool all(vec<L, bool, Q> const& v);
/// Returns the component-wise logical complement of x.
/// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
@ -108,8 +108,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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
template<length_t L, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> not_(vec<L, bool, P> const& v);
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> not_(vec<L, bool, Q> const& v);
/// @}
}//namespace glm

View File

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

View File

@ -33,8 +33,8 @@ namespace glm
# endif
};
template<length_t L, typename T, qualifier P = defaultp> struct vec;
template<length_t C, length_t R, typename T, qualifier P = defaultp> struct mat;
template<length_t L, typename T, qualifier Q = defaultp> struct vec;
template<length_t C, length_t R, typename T, qualifier Q = defaultp> struct mat;
namespace detail
{

View File

@ -8,24 +8,24 @@
namespace glm{
namespace detail
{
template<length_t Columns, length_t Rows, typename T, qualifier P>
template<length_t C, length_t R, typename T, qualifier Q>
struct outerProduct_trait{};
}//namespace detail
#if GLM_HAS_TEMPLATE_ALIASES
template <typename T, qualifier P = defaultp> using tmat2x2 = mat<2, 2, T, P>;
template <typename T, qualifier P = defaultp> using tmat2x3 = mat<2, 3, T, P>;
template <typename T, qualifier P = defaultp> using tmat2x4 = mat<2, 4, T, P>;
template <typename T, qualifier P = defaultp> using tmat3x2 = mat<3, 2, T, P>;
template <typename T, qualifier P = defaultp> using tmat3x3 = mat<3, 3, T, P>;
template <typename T, qualifier P = defaultp> using tmat3x4 = mat<3, 4, T, P>;
template <typename T, qualifier P = defaultp> using tmat4x2 = mat<4, 2, T, P>;
template <typename T, qualifier P = defaultp> using tmat4x3 = mat<4, 3, T, P>;
template <typename T, qualifier P = defaultp> using tmat4x4 = mat<4, 4, T, P>;
template <typename T, qualifier Q = defaultp> using tmat2x2 = mat<2, 2, T, Q>;
template <typename T, qualifier Q = defaultp> using tmat2x3 = mat<2, 3, T, Q>;
template <typename T, qualifier Q = defaultp> using tmat2x4 = mat<2, 4, T, Q>;
template <typename T, qualifier Q = defaultp> using tmat3x2 = mat<3, 2, T, Q>;
template <typename T, qualifier Q = defaultp> using tmat3x3 = mat<3, 3, T, Q>;
template <typename T, qualifier Q = defaultp> using tmat3x4 = mat<3, 4, T, Q>;
template <typename T, qualifier Q = defaultp> using tmat4x2 = mat<4, 2, T, Q>;
template <typename T, qualifier Q = defaultp> using tmat4x3 = mat<4, 3, T, Q>;
template <typename T, qualifier Q = defaultp> using tmat4x4 = mat<4, 4, T, Q>;
#endif//GLM_HAS_TEMPLATE_ALIASES
template<typename T, qualifier P, template<typename, qualifier> class matType>
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const& m);
template<length_t C, length_t R, typename T, qualifier Q>
GLM_FUNC_DECL mat<C, R, T, Q> inverse(mat<C, R, T, Q> const& m);
/// @addtogroup core_precision
/// @{

View File

@ -11,13 +11,13 @@
namespace glm
{
template<typename T, qualifier P>
struct mat<2, 2, T, P>
template<typename T, qualifier Q>
struct mat<2, 2, T, Q>
{
typedef vec<2, T, P> col_type;
typedef vec<2, T, P> row_type;
typedef mat<2, 2, T, P> type;
typedef mat<2, 2, T, P> transpose_type;
typedef vec<2, T, Q> col_type;
typedef vec<2, T, Q> row_type;
typedef mat<2, 2, T, Q> type;
typedef mat<2, 2, T, Q> transpose_type;
typedef T value_type;
private:
@ -35,7 +35,7 @@ namespace glm
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<2, 2, T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<2, 2, T, Q> const& m) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL mat(mat<2, 2, T, Q> const& m);
@ -56,125 +56,125 @@ namespace glm
template<typename U, typename V>
GLM_FUNC_DECL mat(
vec<2, U, P> const& v1,
vec<2, V, P> const& v2);
vec<2, U, Q> const& v1,
vec<2, V, Q> const& v2);
// -- Matrix conversions --
template<typename U, qualifier Q>
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<4, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
// -- Unary arithmetic operators --
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, Q> & operator=(mat<2, 2, T, Q> const& v) GLM_DEFAULT;
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, Q> & operator=(mat<2, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(U s);
GLM_FUNC_DECL mat<2, 2, T, Q> & operator+=(U s);
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, Q> & operator+=(mat<2, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(U s);
GLM_FUNC_DECL mat<2, 2, T, Q> & operator-=(U s);
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, Q> & operator-=(mat<2, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(U s);
GLM_FUNC_DECL mat<2, 2, T, Q> & operator*=(U s);
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, Q> & operator*=(mat<2, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(U s);
GLM_FUNC_DECL mat<2, 2, T, Q> & operator/=(U s);
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, Q> & operator/=(mat<2, 2, U, Q> const& m);
// -- Increment and decrement operators --
GLM_FUNC_DECL mat<2, 2, T, P> & operator++ ();
GLM_FUNC_DECL mat<2, 2, T, P> & operator-- ();
GLM_FUNC_DECL mat<2, 2, T, P> operator++(int);
GLM_FUNC_DECL mat<2, 2, T, P> operator--(int);
GLM_FUNC_DECL mat<2, 2, T, Q> & operator++ ();
GLM_FUNC_DECL mat<2, 2, T, Q> & operator-- ();
GLM_FUNC_DECL mat<2, 2, T, Q> operator++(int);
GLM_FUNC_DECL mat<2, 2, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator*(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator*(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
} //namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -8,37 +8,37 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, Q> const& m)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 2, T, P> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0);
this->value[1] = col_type(0, scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat
(
T const& x0, T const& y0,
T const& x1, T const& y1
@ -48,8 +48,8 @@ namespace glm
this->value[1] = col_type(x1, y1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(col_type const& v0, col_type const& v1)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(col_type const& v0, col_type const& v1)
{
this->value[0] = v0;
this->value[1] = v1;
@ -57,9 +57,9 @@ namespace glm
// -- Conversion constructors --
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>::mat
(
X1 const& x1, Y1 const& y1,
X2 const& x2, Y2 const& y2
@ -69,9 +69,9 @@ namespace glm
this->value[1] = col_type(static_cast<T>(x2), value_type(y2));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>::mat(vec<2, V1, Q> const& v1, vec<2, V2, Q> const& v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
@ -79,65 +79,65 @@ namespace glm
// -- mat2x2 matrix conversions --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, U, Q> const& m)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 2, U, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<3, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<4, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<3, 2, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<2, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<4, 2, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<3, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>::mat(mat<4, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -145,15 +145,15 @@ namespace glm
// -- Accesses --
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template<typename T, qualifier 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
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type const& mat<2, 2, T, Q>::operator[](typename mat<2, 2, T, Q>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@ -162,8 +162,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -171,237 +171,237 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 2, T, Q>::operator=(mat<2, 2, U, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 2, T, Q>::operator+=(U scalar)
{
this->value[0] += scalar;
this->value[1] += scalar;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 2, T, Q>::operator+=(mat<2, 2, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 2, T, Q>::operator-=(U scalar)
{
this->value[0] -= scalar;
this->value[1] -= scalar;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 2, T, Q>::operator-=(mat<2, 2, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 2, T, Q>::operator*=(U scalar)
{
this->value[0] *= scalar;
this->value[1] *= scalar;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 2, T, Q>::operator*=(mat<2, 2, U, Q> const& m)
{
return (*this = *this * m);
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 2, T, Q>::operator/=(U scalar)
{
this->value[0] /= scalar;
this->value[1] /= scalar;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 2, T, Q>::operator/=(mat<2, 2, U, Q> const& m)
{
return *this *= inverse(m);
}
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q>& mat<2, 2, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator++(int)
{
mat<2, 2, T, P> Result(*this);
mat<2, 2, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> mat<2, 2, T, Q>::operator--(int)
{
mat<2, 2, T, P> Result(*this);
mat<2, 2, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m)
{
return m;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
-m[0],
-m[1]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m, T scalar)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
m[0] + scalar,
m[1] + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(T scalar, mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
m[0] + scalar,
m[1] + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator+(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m, T scalar)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
m[0] - scalar,
m[1] - scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(T scalar, mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
scalar - m[0],
scalar - m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator-(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m, T scalar)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(T scalar, mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator*
(
mat<2, 2, T, P> const& m,
typename mat<2, 2, T, P>::row_type const& v
mat<2, 2, T, Q> const& m,
typename mat<2, 2, T, Q>::row_type const& v
)
{
return vec<2, T, P>(
return vec<2, T, Q>(
m[0][0] * v.x + m[1][0] * v.y,
m[0][1] * v.x + m[1][1] * v.y);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator*
(
typename mat<2, 2, T, P>::col_type const& v,
mat<2, 2, T, P> const& m
typename mat<2, 2, T, Q>::col_type const& v,
mat<2, 2, T, Q> const& m
)
{
return vec<2, T, P>(
return vec<2, T, Q>(
v.x * m[0][0] + v.y * m[0][1],
v.x * m[1][0] + v.y * m[1][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
@ -410,10 +410,10 @@ namespace glm
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<2, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<2, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
@ -424,51 +424,51 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m, T scalar)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
m[0] / scalar,
m[1] / scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(T scalar, mat<2, 2, T, Q> const& m)
{
return mat<2, 2, T, P>(
return mat<2, 2, T, Q>(
scalar / m[0],
scalar / m[1]);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::col_type operator/(mat<2, 2, T, Q> const& m, typename mat<2, 2, T, Q>::row_type const& v)
{
return inverse(m) * v;
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, Q>::row_type operator/(typename mat<2, 2, T, Q>::col_type const& v, mat<2, 2, T, Q> const& m)
{
return v * inverse(m);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator/(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
mat<2, 2, T, P> m1_copy(m1);
mat<2, 2, T, Q> m1_copy(m1);
return m1_copy /= m2;
}
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, P> const& m1, mat<2, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}

View File

@ -12,13 +12,13 @@
namespace glm
{
template<typename T, qualifier P>
struct mat<2, 3, T, P>
template<typename T, qualifier Q>
struct mat<2, 3, T, Q>
{
typedef vec<3, T, P> col_type;
typedef vec<2, T, P> row_type;
typedef mat<2, 3, T, P> type;
typedef mat<3, 2, T, P> transpose_type;
typedef vec<3, T, Q> col_type;
typedef vec<2, T, Q> row_type;
typedef mat<2, 3, T, Q> type;
typedef mat<3, 2, T, Q> transpose_type;
typedef T value_type;
private:
@ -36,7 +36,7 @@ namespace glm
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<2, 3, T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<2, 3, T, Q> const& m) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL mat(mat<2, 3, T, Q> const& m);
@ -57,106 +57,106 @@ namespace glm
template<typename U, typename V>
GLM_FUNC_DECL mat(
vec<3, U, P> const& v1,
vec<3, V, P> const& v2);
vec<3, U, Q> const& v1,
vec<3, V, Q> const& v2);
// -- Matrix conversions --
template<typename U, qualifier Q>
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<3, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
// -- Unary arithmetic operators --
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, Q> & operator=(mat<2, 3, T, Q> const& m) GLM_DEFAULT;
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, Q> & operator=(mat<2, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(U s);
GLM_FUNC_DECL mat<2, 3, T, Q> & operator+=(U s);
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, Q> & operator+=(mat<2, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(U s);
GLM_FUNC_DECL mat<2, 3, T, Q> & operator-=(U s);
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, Q> & operator-=(mat<2, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator*=(U s);
GLM_FUNC_DECL mat<2, 3, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator/=(U s);
GLM_FUNC_DECL mat<2, 3, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL mat<2, 3, T, P> & operator++ ();
GLM_FUNC_DECL mat<2, 3, T, P> & operator-- ();
GLM_FUNC_DECL mat<2, 3, T, P> operator++(int);
GLM_FUNC_DECL mat<2, 3, T, P> operator--(int);
GLM_FUNC_DECL mat<2, 3, T, Q> & operator++ ();
GLM_FUNC_DECL mat<2, 3, T, Q> & operator-- ();
GLM_FUNC_DECL mat<2, 3, T, Q> operator++(int);
GLM_FUNC_DECL mat<2, 3, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<2, 3, T, Q>::col_type operator*(mat<2, 3, T, Q> const& m, typename mat<2, 3, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<2, 3, T, Q>::row_type operator*(typename mat<2, 3, T, Q>::col_type const& v, mat<2, 3, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 3, T, P> operator/(mat<2, 3, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -6,37 +6,37 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 3, T, Q> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, Q> const& m)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 3, T, P> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0, 0);
this->value[1] = col_type(0, scalar, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat
(
T x0, T y0, T z0,
T x1, T y1, T z1
@ -46,8 +46,8 @@ namespace glm
this->value[1] = col_type(x1, y1, z1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(col_type const& v0, col_type const& v1)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(col_type const& v0, col_type const& v1)
{
this->value[0] = v0;
this->value[1] = v1;
@ -55,11 +55,11 @@ namespace glm
// -- Conversion constructors --
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat
(
X1 x1, Y1 y1, Z1 z1,
X2 x2, Y2 y2, Z2 z2
@ -69,9 +69,9 @@ namespace glm
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>::mat(vec<3, V1, Q> const& v1, vec<3, V2, Q> const& v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
@ -79,65 +79,65 @@ namespace glm
// -- Matrix conversions --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, U, Q> const& m)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 3, U, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<3, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<4, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<2, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<3, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<3, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<4, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>::mat(mat<4, 3, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -145,15 +145,15 @@ namespace glm
// -- Accesses --
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type & mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template<typename T, qualifier 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
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type const& mat<2, 3, T, Q>::operator[](typename mat<2, 3, T, Q>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@ -162,8 +162,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -171,63 +171,63 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 3, T, Q>::operator=(mat<2, 3, U, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<2, 3, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 3, T, Q>::operator+=(mat<2, 3, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 3, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 3, T, Q>::operator-=(mat<2, 3, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 3, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<2, 3, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -236,131 +236,131 @@ namespace glm
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> & mat<2, 3, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator++(int)
{
mat<2, 3, T, P> Result(*this);
mat<2, 3, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> mat<2, 3, T, Q>::operator--(int)
{
mat<2, 3, T, P> Result(*this);
mat<2, 3, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m)
{
return m;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
-m[0],
-m[1]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m, T scalar)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m[0] + scalar,
m[1] + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator+(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m, T scalar)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m[0] - scalar,
m[1] - scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator-(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m, T scalar)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(T scalar, mat<2, 3, T, Q> const& m)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::col_type operator*
(
mat<2, 3, T, P> const& m,
typename mat<2, 3, T, P>::row_type const& v)
mat<2, 3, T, Q> const& m,
typename mat<2, 3, T, Q>::row_type const& v)
{
return typename mat<2, 3, T, P>::col_type(
return typename mat<2, 3, T, Q>::col_type(
m[0][0] * v.x + m[1][0] * v.y,
m[0][1] * v.x + m[1][1] * v.y,
m[0][2] * v.x + m[1][2] * v.y);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::row_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, Q>::row_type operator*
(
typename mat<2, 3, T, P>::col_type const& v,
mat<2, 3, T, P> const& m)
typename mat<2, 3, T, Q>::col_type const& v,
mat<2, 3, T, Q> const& m)
{
return typename mat<2, 3, T, P>::row_type(
return typename mat<2, 3, T, Q>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<2, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
@ -369,8 +369,8 @@ namespace glm
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<3, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
@ -386,7 +386,7 @@ namespace glm
T SrcB20 = m2[2][0];
T SrcB21 = m2[2][1];
mat<3, 3, T, P> Result;
mat<3, 3, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01;
@ -399,10 +399,10 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<2, 3, T, P> const& m1, mat<4, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<2, 3, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
@ -417,32 +417,32 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(mat<2, 3, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(mat<2, 3, T, Q> const& m, T scalar)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m[0] / scalar,
m[1] / scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator/(T scalar, mat<2, 3, T, Q> const& m)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
scalar / m[0],
scalar / m[1]);
}
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}

View File

@ -12,13 +12,13 @@
namespace glm
{
template<typename T, qualifier P>
struct mat<2, 4, T, P>
template<typename T, qualifier Q>
struct mat<2, 4, T, Q>
{
typedef vec<4, T, P> col_type;
typedef vec<2, T, P> row_type;
typedef mat<2, 4, T, P> type;
typedef mat<4, 2, T, P> transpose_type;
typedef vec<4, T, Q> col_type;
typedef vec<2, T, Q> row_type;
typedef mat<2, 4, T, Q> type;
typedef mat<4, 2, T, Q> transpose_type;
typedef T value_type;
private:
@ -36,7 +36,7 @@ namespace glm
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<2, 4, T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<2, 4, T, Q> const& m) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL mat(mat<2, 4, T, Q> const& m);
@ -59,106 +59,106 @@ namespace glm
template<typename U, typename V>
GLM_FUNC_DECL mat(
vec<4, U, P> const& v1,
vec<4, V, P> const& v2);
vec<4, U, Q> const& v1,
vec<4, V, Q> const& v2);
// -- Matrix conversions --
template<typename U, qualifier Q>
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<3, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
// -- Unary arithmetic operators --
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, Q> & operator=(mat<2, 4, T, Q> const& m) GLM_DEFAULT;
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, Q> & operator=(mat<2, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(U s);
GLM_FUNC_DECL mat<2, 4, T, Q> & operator+=(U s);
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, Q> & operator+=(mat<2, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(U s);
GLM_FUNC_DECL mat<2, 4, T, Q> & operator-=(U s);
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, Q> & operator-=(mat<2, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator*=(U s);
GLM_FUNC_DECL mat<2, 4, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator/=(U s);
GLM_FUNC_DECL mat<2, 4, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL mat<2, 4, T, P> & operator++ ();
GLM_FUNC_DECL mat<2, 4, T, P> & operator-- ();
GLM_FUNC_DECL mat<2, 4, T, P> operator++(int);
GLM_FUNC_DECL mat<2, 4, T, P> operator--(int);
GLM_FUNC_DECL mat<2, 4, T, Q> & operator++ ();
GLM_FUNC_DECL mat<2, 4, T, Q> & operator-- ();
GLM_FUNC_DECL mat<2, 4, T, Q> operator++(int);
GLM_FUNC_DECL mat<2, 4, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 4, T, P> operator/(mat<2, 4, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -6,38 +6,38 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 4, T, Q> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, Q> const& m)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 4, T, P> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(T scalar)
{
value_type const Zero(0);
this->value[0] = col_type(scalar, Zero, Zero, Zero);
this->value[1] = col_type(Zero, scalar, Zero, Zero);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat
(
T x0, T y0, T z0, T w0,
T x1, T y1, T z1, T w1
@ -47,8 +47,8 @@ namespace glm
this->value[1] = col_type(x1, y1, z1, w1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(col_type const& v0, col_type const& v1)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(col_type const& v0, col_type const& v1)
{
this->value[0] = v0;
this->value[1] = v1;
@ -56,11 +56,11 @@ namespace glm
// -- Conversion constructors --
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat
(
X1 x1, Y1 y1, Z1 z1, W1 w1,
X2 x2, Y2 y2, Z2 z2, W2 w2
@ -70,9 +70,9 @@ namespace glm
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>::mat(vec<4, V1, Q> const& v1, vec<4, V2, Q> const& v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
@ -80,65 +80,65 @@ namespace glm
// -- Matrix conversions --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, U, Q> const& m)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 4, U, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<3, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<4, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<2, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<3, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<3, 4, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<4, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>::mat(mat<4, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@ -146,15 +146,15 @@ namespace glm
// -- Accesses --
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type & mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template<typename T, qualifier 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
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type const& mat<2, 4, T, Q>::operator[](typename mat<2, 4, T, Q>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@ -163,8 +163,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -172,63 +172,63 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 4, T, Q>::operator=(mat<2, 4, U, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 4, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 4, T, Q>::operator+=(mat<2, 4, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 4, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 4, T, Q>::operator-=(mat<2, 4, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<2, 4, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<2, 4, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -237,124 +237,124 @@ namespace glm
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q>& mat<2, 4, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator++(int)
{
mat<2, 4, T, P> Result(*this);
mat<2, 4, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> mat<2, 4, T, Q>::operator--(int)
{
mat<2, 4, T, P> Result(*this);
mat<2, 4, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m)
{
return m;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
-m[0],
-m[1]);
}
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m, T scalar)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m[0] + scalar,
m[1] + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator+(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m, T scalar)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m[0] - scalar,
m[1] - scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator-(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m, T scalar)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(T scalar, mat<2, 4, T, Q> const& m)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m[0] * scalar,
m[1] * scalar);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::col_type operator*(mat<2, 4, T, Q> const& m, typename mat<2, 4, T, Q>::row_type const& v)
{
return typename mat<2, 4, T, P>::col_type(
return typename mat<2, 4, T, Q>::col_type(
m[0][0] * v.x + m[1][0] * v.y,
m[0][1] * v.x + m[1][1] * v.y,
m[0][2] * v.x + m[1][2] * v.y,
m[0][3] * v.x + m[1][3] * v.y);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, Q>::row_type operator*(typename mat<2, 4, T, Q>::col_type const& v, mat<2, 4, T, Q> const& m)
{
return typename mat<2, 4, T, P>::row_type(
return typename mat<2, 4, T, Q>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<4, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
@ -374,7 +374,7 @@ namespace glm
T SrcB30 = m2[3][0];
T SrcB31 = m2[3][1];
mat<4, 4, T, P> Result;
mat<4, 4, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01;
@ -394,10 +394,10 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<2, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<2, 2, T, Q> const& m2)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
@ -408,10 +408,10 @@ namespace glm
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<2, 4, T, P> const& m1, mat<3, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<2, 4, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
@ -426,32 +426,32 @@ namespace glm
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(mat<2, 4, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(mat<2, 4, T, Q> const& m, T scalar)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m[0] / scalar,
m[1] / scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator/(T scalar, mat<2, 4, T, Q> const& m)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
scalar / m[0],
scalar / m[1]);
}
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}

View File

@ -12,13 +12,13 @@
namespace glm
{
template<typename T, qualifier P>
struct mat<3, 2, T, P>
template<typename T, qualifier Q>
struct mat<3, 2, T, Q>
{
typedef vec<2, T, P> col_type;
typedef vec<3, T, P> row_type;
typedef mat<3, 2, T, P> type;
typedef mat<2, 3, T, P> transpose_type;
typedef vec<2, T, Q> col_type;
typedef vec<3, T, Q> row_type;
typedef mat<3, 2, T, Q> type;
typedef mat<2, 3, T, Q> transpose_type;
typedef T value_type;
private:
@ -36,7 +36,7 @@ namespace glm
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<3, 2, T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<3, 2, T, Q> const& m) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL mat(mat<3, 2, T, Q> const& m);
@ -63,107 +63,107 @@ namespace glm
template<typename V1, typename V2, typename V3>
GLM_FUNC_DECL mat(
vec<2, V1, P> const& v1,
vec<2, V2, P> const& v2,
vec<2, V3, P> const& v3);
vec<2, V1, Q> const& v1,
vec<2, V2, Q> const& v2,
vec<2, V3, Q> const& v3);
// -- Matrix conversions --
template<typename U, qualifier Q>
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<3, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
// -- Unary arithmetic operators --
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, Q> & operator=(mat<3, 2, T, Q> const& m) GLM_DEFAULT;
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, Q> & operator=(mat<3, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(U s);
GLM_FUNC_DECL mat<3, 2, T, Q> & operator+=(U s);
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, Q> & operator+=(mat<3, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(U s);
GLM_FUNC_DECL mat<3, 2, T, Q> & operator-=(U s);
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, Q> & operator-=(mat<3, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator*=(U s);
GLM_FUNC_DECL mat<3, 2, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator/=(U s);
GLM_FUNC_DECL mat<3, 2, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL mat<3, 2, T, P> & operator++ ();
GLM_FUNC_DECL mat<3, 2, T, P> & operator-- ();
GLM_FUNC_DECL mat<3, 2, T, P> operator++(int);
GLM_FUNC_DECL mat<3, 2, T, P> operator--(int);
GLM_FUNC_DECL mat<3, 2, T, Q> & operator++ ();
GLM_FUNC_DECL mat<3, 2, T, Q> & operator-- ();
GLM_FUNC_DECL mat<3, 2, T, Q> operator++(int);
GLM_FUNC_DECL mat<3, 2, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 2, T, P> operator/(mat<3, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2);
}//namespace glm

View File

@ -6,14 +6,14 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 2, T, Q> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -21,25 +21,25 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, Q> const& m)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 2, T, P> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0);
this->value[1] = col_type(0, scalar);
this->value[2] = col_type(0, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat
(
T x0, T y0,
T x1, T y1,
@ -51,8 +51,8 @@ namespace glm
this->value[2] = col_type(x2, y2);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat
(
col_type const& v0,
col_type const& v1,
@ -66,12 +66,12 @@ namespace glm
// -- Conversion constructors --
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat
(
X1 x1, Y1 y1,
X2 x2, Y2 y2,
@ -83,13 +83,13 @@ namespace glm
this->value[2] = col_type(static_cast<T>(x3), value_type(y3));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat
(
vec<2, V1, P> const& v1,
vec<2, V2, P> const& v2,
vec<2, V3, P> const& v3
vec<2, V1, Q> const& v1,
vec<2, V2, Q> const& v2,
vec<2, V3, Q> const& v3
)
{
this->value[0] = col_type(v1);
@ -99,73 +99,73 @@ namespace glm
// -- Matrix conversions --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, U, Q> const& m)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 2, U, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<4, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<2, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(T(0));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<2, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(T(0));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<3, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<4, 2, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>::mat(mat<4, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -174,15 +174,15 @@ namespace glm
// -- Accesses --
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type & mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template<typename T, qualifier 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
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type const& mat<3, 2, T, Q>::operator[](typename mat<3, 2, T, Q>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@ -191,8 +191,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -201,9 +201,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 2, T, Q>::operator=(mat<3, 2, U, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -211,9 +211,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 2, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -221,9 +221,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 2, T, Q>::operator+=(mat<3, 2, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -231,9 +231,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 2, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -241,9 +241,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 2, T, Q>::operator-=(mat<3, 2, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -251,9 +251,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 2, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -261,9 +261,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 2, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -273,8 +273,8 @@ namespace glm
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
@ -282,8 +282,8 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q>& mat<3, 2, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
@ -291,34 +291,34 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator++(int)
{
mat<3, 2, T, P> Result(*this);
mat<3, 2, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> mat<3, 2, T, Q>::operator--(int)
{
mat<3, 2, T, P> Result(*this);
mat<3, 2, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m)
{
return m;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
-m[0],
-m[1],
-m[2]);
@ -326,79 +326,79 @@ namespace glm
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m, T scalar)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator+(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m, T scalar)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator-(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m, T scalar)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(T scalar, mat<3, 2, T, Q> const& m)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::col_type operator*(mat<3, 2, T, Q> const& m, typename mat<3, 2, T, Q>::row_type const& v)
{
return typename mat<3, 2, T, P>::col_type(
return typename mat<3, 2, T, Q>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, Q>::row_type operator*(typename mat<3, 2, T, Q>::col_type const& v, mat<3, 2, T, Q> const& m)
{
return typename mat<3, 2, T, P>::row_type(
return typename mat<3, 2, T, Q>::row_type(
v.x * m[0][0] + v.y * m[0][1],
v.x * m[1][0] + v.y * m[1][1],
v.x * m[2][0] + v.y * m[2][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<2, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
@ -414,7 +414,7 @@ namespace glm
const T SrcB11 = m2[1][1];
const T SrcB12 = m2[1][2];
mat<2, 2, T, P> Result;
mat<2, 2, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;
@ -422,10 +422,10 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<3, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
@ -434,10 +434,10 @@ namespace glm
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<3, 2, T, P> const& m1, mat<4, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<3, 2, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
@ -448,19 +448,19 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(mat<3, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(mat<3, 2, T, Q> const& m, T scalar)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator/(T scalar, mat<3, 2, T, Q> const& m)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
@ -468,14 +468,14 @@ namespace glm
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, P> const& m1, mat<3, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, Q> const& m1, mat<3, 2, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}

View File

@ -11,13 +11,13 @@
namespace glm
{
template<typename T, qualifier P>
struct mat<3, 3, T, P>
template<typename T, qualifier Q>
struct mat<3, 3, T, Q>
{
typedef vec<3, T, P> col_type;
typedef vec<3, T, P> row_type;
typedef mat<3, 3, T, P> type;
typedef mat<3, 3, T, P> transpose_type;
typedef vec<3, T, Q> col_type;
typedef vec<3, T, Q> row_type;
typedef mat<3, 3, T, Q> type;
typedef mat<3, 3, T, Q> transpose_type;
typedef T value_type;
private:
@ -35,7 +35,7 @@ namespace glm
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<3, 3, T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<3, 3, T, Q> const& m) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL mat(mat<3, 3, T, Q> const& m);
@ -62,126 +62,126 @@ namespace glm
template<typename V1, typename V2, typename V3>
GLM_FUNC_DECL mat(
vec<3, V1, P> const& v1,
vec<3, V2, P> const& v2,
vec<3, V3, P> const& v3);
vec<3, V1, Q> const& v1,
vec<3, V2, Q> const& v2,
vec<3, V3, Q> const& v3);
// -- Matrix conversions --
template<typename U, qualifier Q>
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<4, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
// -- Unary arithmetic operators --
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, Q> & operator=(mat<3, 3, T, Q> const& m) GLM_DEFAULT;
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, Q> & operator=(mat<3, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(U s);
GLM_FUNC_DECL mat<3, 3, T, Q> & operator+=(U s);
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, Q> & operator+=(mat<3, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(U s);
GLM_FUNC_DECL mat<3, 3, T, Q> & operator-=(U s);
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, Q> & operator-=(mat<3, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(U s);
GLM_FUNC_DECL mat<3, 3, T, Q> & operator*=(U s);
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, Q> & operator*=(mat<3, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(U s);
GLM_FUNC_DECL mat<3, 3, T, Q> & operator/=(U s);
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, Q> & operator/=(mat<3, 3, U, Q> const& m);
// -- Increment and decrement operators --
GLM_FUNC_DECL mat<3, 3, T, P> & operator++();
GLM_FUNC_DECL mat<3, 3, T, P> & operator--();
GLM_FUNC_DECL mat<3, 3, T, P> operator++(int);
GLM_FUNC_DECL mat<3, 3, T, P> operator--(int);
GLM_FUNC_DECL mat<3, 3, T, Q> & operator++();
GLM_FUNC_DECL mat<3, 3, T, Q> & operator--();
GLM_FUNC_DECL mat<3, 3, T, Q> operator++(int);
GLM_FUNC_DECL mat<3, 3, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -8,14 +8,14 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 3, T, Q> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -23,25 +23,25 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, Q> const& m)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 3, T, P> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0, 0);
this->value[1] = col_type(0, scalar, 0);
this->value[2] = col_type(0, 0, scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat
(
T x0, T y0, T z0,
T x1, T y1, T z1,
@ -53,8 +53,8 @@ namespace glm
this->value[2] = col_type(x2, y2, z2);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat
(
col_type const& v0,
col_type const& v1,
@ -68,12 +68,12 @@ namespace glm
// -- Conversion constructors --
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat
(
X1 x1, Y1 y1, Z1 z1,
X2 x2, Y2 y2, Z2 z2,
@ -85,13 +85,13 @@ namespace glm
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat
(
vec<3, V1, P> const& v1,
vec<3, V2, P> const& v2,
vec<3, V3, P> const& v3
vec<3, V1, Q> const& v1,
vec<3, V2, Q> const& v2,
vec<3, V3, Q> const& v3
)
{
this->value[0] = col_type(v1);
@ -101,73 +101,73 @@ namespace glm
// -- Matrix conversions --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, U, Q> const& m)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 3, U, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<4, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<2, 3, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<2, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<4, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<3, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q>::mat(mat<4, 3, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -176,15 +176,15 @@ namespace glm
// -- Accesses --
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type & mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template<typename T, qualifier 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
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type const& mat<3, 3, T, Q>::operator[](typename mat<3, 3, T, Q>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@ -193,8 +193,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -203,9 +203,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 3, T, Q>::operator=(mat<3, 3, U, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -213,9 +213,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 3, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -223,9 +223,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 3, T, Q>::operator+=(mat<3, 3, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -233,9 +233,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 3, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -243,9 +243,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 3, T, Q>::operator-=(mat<3, 3, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -253,9 +253,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 3, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -263,16 +263,16 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 3, T, Q>::operator*=(mat<3, 3, U, Q> const& m)
{
return (*this = *this * m);
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 3, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -280,17 +280,17 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 3, T, Q>::operator/=(mat<3, 3, U, Q> const& m)
{
return *this *= inverse(m);
}
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
@ -298,8 +298,8 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> & mat<3, 3, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
@ -307,34 +307,34 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator++(int)
{
mat<3, 3, T, P> Result(*this);
mat<3, 3, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat<3, 3, T, Q>::operator--(int)
{
mat<3, 3, T, P> Result(*this);
mat<3, 3, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m)
{
return m;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
-m[0],
-m[1],
-m[2]);
@ -342,98 +342,98 @@ namespace glm
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m, T scalar)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(T scalar, mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator+(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m, T scalar)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(T scalar, mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
scalar - m[0],
scalar - m[1],
scalar - m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator-(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m, T scalar)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(T scalar, mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator*(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v)
{
return typename mat<3, 3, T, P>::col_type(
return typename mat<3, 3, T, Q>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z,
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator*(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m)
{
return typename mat<3, 3, T, P>::row_type(
return typename mat<3, 3, T, Q>::row_type(
m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z,
m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z,
m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
@ -455,7 +455,7 @@ namespace glm
T const SrcB21 = m2[2][1];
T const SrcB22 = m2[2][2];
mat<3, 3, T, P> Result;
mat<3, 3, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02;
@ -468,10 +468,10 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<2, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
@ -480,10 +480,10 @@ namespace glm
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<3, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<3, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
@ -498,53 +498,53 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m, T scalar)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(T scalar, mat<3, 3, T, Q> const& m)
{
return mat<3, 3, T, P>(
return mat<3, 3, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::col_type operator/(mat<3, 3, T, Q> const& m, typename mat<3, 3, T, Q>::row_type const& v)
{
return inverse(m) * v;
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, Q>::row_type operator/(typename mat<3, 3, T, Q>::col_type const& v, mat<3, 3, T, Q> const& m)
{
return v * inverse(m);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator/(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
mat<3, 3, T, P> m1_copy(m1);
mat<3, 3, T, Q> m1_copy(m1);
return m1_copy /= m2;
}
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, P> const& m1, mat<3, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}

View File

@ -12,13 +12,13 @@
namespace glm
{
template<typename T, qualifier P>
struct mat<3, 4, T, P>
template<typename T, qualifier Q>
struct mat<3, 4, T, Q>
{
typedef vec<4, T, P> col_type;
typedef vec<3, T, P> row_type;
typedef mat<3, 4, T, P> type;
typedef mat<4, 3, T, P> transpose_type;
typedef vec<4, T, Q> col_type;
typedef vec<3, T, Q> row_type;
typedef mat<3, 4, T, Q> type;
typedef mat<4, 3, T, Q> transpose_type;
typedef T value_type;
private:
@ -36,7 +36,7 @@ namespace glm
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<3, 4, T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<3, 4, T, Q> const& m) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL mat(mat<3, 4, T, Q> const& m);
@ -63,107 +63,107 @@ namespace glm
template<typename V1, typename V2, typename V3>
GLM_FUNC_DECL mat(
vec<4, V1, P> const& v1,
vec<4, V2, P> const& v2,
vec<4, V3, P> const& v3);
vec<4, V1, Q> const& v1,
vec<4, V2, Q> const& v2,
vec<4, V3, Q> const& v3);
// -- Matrix conversions --
template<typename U, qualifier Q>
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<3, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
// -- Unary arithmetic operators --
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, Q> & operator=(mat<3, 4, T, Q> const& m) GLM_DEFAULT;
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, Q> & operator=(mat<3, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(U s);
GLM_FUNC_DECL mat<3, 4, T, Q> & operator+=(U s);
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, Q> & operator+=(mat<3, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(U s);
GLM_FUNC_DECL mat<3, 4, T, Q> & operator-=(U s);
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, Q> & operator-=(mat<3, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator*=(U s);
GLM_FUNC_DECL mat<3, 4, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator/=(U s);
GLM_FUNC_DECL mat<3, 4, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL mat<3, 4, T, P> & operator++();
GLM_FUNC_DECL mat<3, 4, T, P> & operator--();
GLM_FUNC_DECL mat<3, 4, T, P> operator++(int);
GLM_FUNC_DECL mat<3, 4, T, P> operator--(int);
GLM_FUNC_DECL mat<3, 4, T, Q> & operator++();
GLM_FUNC_DECL mat<3, 4, T, Q> & operator--();
GLM_FUNC_DECL mat<3, 4, T, Q> operator++(int);
GLM_FUNC_DECL mat<3, 4, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<3, 4, T, Q>::col_type operator*(mat<3, 4, T, Q> const& m, typename mat<3, 4, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<3, 4, T, Q>::row_type operator*(typename mat<3, 4, T, Q>::col_type const& v, mat<3, 4, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 4, T, P> operator/(mat<3, 4, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -6,14 +6,14 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 4, T, Q> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -21,25 +21,25 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, Q> const& m)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 4, T, P> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0, 0, 0);
this->value[1] = col_type(0, scalar, 0, 0);
this->value[2] = col_type(0, 0, scalar, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat
(
T x0, T y0, T z0, T w0,
T x1, T y1, T z1, T w1,
@ -51,8 +51,8 @@ namespace glm
this->value[2] = col_type(x2, y2, z2, w2);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat
(
col_type const& v0,
col_type const& v1,
@ -66,12 +66,12 @@ namespace glm
// -- Conversion constructors --
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat
(
X1 x1, Y1 y1, Z1 z1, W1 w1,
X2 x2, Y2 y2, Z2 z2, W2 w2,
@ -83,13 +83,13 @@ namespace glm
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3), value_type(w3));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat
(
vec<4, V1, P> const& v1,
vec<4, V2, P> const& v2,
vec<4, V3, P> const& v3
vec<4, V1, Q> const& v1,
vec<4, V2, Q> const& v2,
vec<4, V3, Q> const& v3
)
{
this->value[0] = col_type(v1);
@ -99,73 +99,73 @@ namespace glm
// -- Matrix conversions --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, U, Q> const& m)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 4, U, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<4, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<2, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<3, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<2, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<4, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>::mat(mat<4, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@ -174,15 +174,15 @@ namespace glm
// -- Accesses --
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type & mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template<typename T, qualifier 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
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type const& mat<3, 4, T, Q>::operator[](typename mat<3, 4, T, Q>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@ -191,8 +191,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -201,9 +201,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 4, T, Q>::operator=(mat<3, 4, U, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -211,9 +211,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 4, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -221,9 +221,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 4, T, Q>::operator+=(mat<3, 4, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -231,9 +231,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 4, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -241,9 +241,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 4, T, Q>::operator-=(mat<3, 4, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -251,9 +251,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<3, 4, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -261,9 +261,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<3, 4, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -273,8 +273,8 @@ namespace glm
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
@ -282,8 +282,8 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q>& mat<3, 4, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
@ -291,34 +291,34 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator++(int)
{
mat<3, 4, T, P> Result(*this);
mat<3, 4, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> mat<3, 4, T, Q>::operator--(int)
{
mat<3, 4, T, P> Result(*this);
mat<3, 4, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m)
{
return m;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
-m[0],
-m[1],
-m[2]);
@ -326,89 +326,89 @@ namespace glm
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m, T scalar)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator+(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m, T scalar)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator-(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m, T scalar)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(T scalar, mat<3, 4, T, Q> const& m)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::col_type operator*
(
mat<3, 4, T, P> const& m,
typename mat<3, 4, T, P>::row_type const& v
mat<3, 4, T, Q> const& m,
typename mat<3, 4, T, Q>::row_type const& v
)
{
return typename mat<3, 4, T, P>::col_type(
return typename mat<3, 4, T, Q>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z,
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z,
m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::row_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, Q>::row_type operator*
(
typename mat<3, 4, T, P>::col_type const& v,
mat<3, 4, T, P> const& m
typename mat<3, 4, T, Q>::col_type const& v,
mat<3, 4, T, Q> const& m
)
{
return typename mat<3, 4, T, P>::row_type(
return typename mat<3, 4, T, Q>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3],
v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<4, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
@ -436,7 +436,7 @@ namespace glm
const T SrcB31 = m2[3][1];
const T SrcB32 = m2[3][2];
mat<4, 4, T, P> Result;
mat<4, 4, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02;
@ -456,10 +456,10 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<2, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<2, 3, T, Q> const& m2)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
@ -470,10 +470,10 @@ namespace glm
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const& m1, mat<3, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<3, 4, T, Q> const& m1, mat<3, 3, T, Q> const& m2)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
@ -488,19 +488,19 @@ namespace glm
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(mat<3, 4, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(mat<3, 4, T, Q> const& m, T scalar)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator/(T scalar, mat<3, 4, T, Q> const& m)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
@ -508,14 +508,14 @@ namespace glm
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}

View File

@ -12,13 +12,13 @@
namespace glm
{
template<typename T, qualifier P>
struct mat<4, 2, T, P>
template<typename T, qualifier Q>
struct mat<4, 2, T, Q>
{
typedef vec<2, T, P> col_type;
typedef vec<4, T, P> row_type;
typedef mat<4, 2, T, P> type;
typedef mat<2, 4, T, P> transpose_type;
typedef vec<2, T, Q> col_type;
typedef vec<4, T, Q> row_type;
typedef mat<4, 2, T, Q> type;
typedef mat<2, 4, T, Q> transpose_type;
typedef T value_type;
private:
@ -36,7 +36,7 @@ namespace glm
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<4, 2, T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL mat(mat<4, 2, T, Q> const& m);
@ -67,108 +67,108 @@ namespace glm
template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL mat(
vec<2, V1, P> const& v1,
vec<2, V2, P> const& v2,
vec<2, V3, P> const& v3,
vec<2, V4, P> const& v4);
vec<2, V1, Q> const& v1,
vec<2, V2, Q> const& v2,
vec<2, V3, Q> const& v3,
vec<2, V4, Q> const& v4);
// -- Matrix conversions --
template<typename U, qualifier Q>
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<3, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
// -- Unary arithmetic operators --
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, Q> & operator=(mat<4, 2, T, Q> const& m) GLM_DEFAULT;
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, Q> & operator=(mat<4, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(U s);
GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(U s);
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, Q> & operator+=(mat<4, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(U s);
GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(U s);
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, Q> & operator-=(mat<4, 2, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator*=(U s);
GLM_FUNC_DECL mat<4, 2, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator/=(U s);
GLM_FUNC_DECL mat<4, 2, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL mat<4, 2, T, P> & operator++ ();
GLM_FUNC_DECL mat<4, 2, T, P> & operator-- ();
GLM_FUNC_DECL mat<4, 2, T, P> operator++(int);
GLM_FUNC_DECL mat<4, 2, T, P> operator--(int);
GLM_FUNC_DECL mat<4, 2, T, Q> & operator++ ();
GLM_FUNC_DECL mat<4, 2, T, Q> & operator-- ();
GLM_FUNC_DECL mat<4, 2, T, Q> operator++(int);
GLM_FUNC_DECL mat<4, 2, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 2, T, P> operator/(mat<4, 2, T, P> const& m, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -6,14 +6,14 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 2, T, Q> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -22,9 +22,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, Q> const& m)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 2, T, P> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -32,8 +32,8 @@ namespace glm
this->value[3] = m.value[3];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0);
this->value[1] = col_type(0, scalar);
@ -41,8 +41,8 @@ namespace glm
this->value[3] = col_type(0, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat
(
T x0, T y0,
T x1, T y1,
@ -56,8 +56,8 @@ namespace glm
this->value[3] = col_type(x3, y3);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat
(
col_type const& v0,
col_type const& v1,
@ -73,13 +73,13 @@ namespace glm
// -- Conversion constructors --
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3,
typename X4, typename Y4>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat
(
X1 x1, Y1 y1,
X2 x2, Y2 y2,
@ -93,14 +93,14 @@ namespace glm
this->value[3] = col_type(static_cast<T>(x4), value_type(y4));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>::mat
(
vec<2, V1, P> const& v1,
vec<2, V2, P> const& v2,
vec<2, V3, P> const& v3,
vec<2, V4, P> const& v4
vec<2, V1, Q> const& v1,
vec<2, V2, Q> const& v2,
vec<2, V3, Q> const& v3,
vec<2, V4, Q> const& v4
)
{
this->value[0] = col_type(v1);
@ -111,9 +111,9 @@ namespace glm
// -- Conversion --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, U, Q> const& m)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 2, U, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -121,8 +121,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -130,8 +130,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<3, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -139,8 +139,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -148,8 +148,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<2, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -157,8 +157,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<3, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -166,8 +166,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<2, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -175,8 +175,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<4, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -184,8 +184,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>::mat(mat<3, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -195,15 +195,15 @@ namespace glm
// -- Accesses --
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type & mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template<typename T, qualifier 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
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type const& mat<4, 2, T, Q>::operator[](typename mat<4, 2, T, Q>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@ -212,8 +212,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -223,9 +223,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<4, 2, T, Q>::operator=(mat<4, 2, U, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -234,9 +234,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 2, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -245,9 +245,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 2, T, Q>::operator+=(mat<4, 2, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -256,9 +256,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 2, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -267,9 +267,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 2, T, Q>::operator-=(mat<4, 2, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -278,9 +278,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 2, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -289,9 +289,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 2, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -302,8 +302,8 @@ namespace glm
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
@ -312,8 +312,8 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> & mat<4, 2, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
@ -322,34 +322,34 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator++(int)
{
mat<4, 2, T, P> Result(*this);
mat<4, 2, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> mat<4, 2, T, Q>::operator--(int)
{
mat<4, 2, T, P> Result(*this);
mat<4, 2, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m)
{
return m;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
-m[0],
-m[1],
-m[2],
@ -358,86 +358,86 @@ namespace glm
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar,
m[3] + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar,
m[3] - scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v)
{
return typename mat<4, 2, T, P>::col_type(
return typename mat<4, 2, T, Q>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * 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, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m)
{
return typename mat<4, 2, T, P>::row_type(
return typename mat<4, 2, T, Q>::row_type(
v.x * m[0][0] + v.y * m[0][1],
v.x * m[1][0] + v.y * m[1][1],
v.x * m[2][0] + v.y * m[2][1],
v.x * m[3][0] + v.y * m[3][1]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<2, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
@ -457,7 +457,7 @@ namespace glm
T const SrcB12 = m2[1][2];
T const SrcB13 = m2[1][3];
mat<2, 2, T, P> Result;
mat<2, 2, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
@ -465,10 +465,10 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<3, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return mat<3, 2, T, P>(
return mat<3, 2, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
@ -477,10 +477,10 @@ 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]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const& m1, mat<4, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
@ -491,20 +491,20 @@ 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]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(mat<4, 2, T, P> const& m, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar,
m[3] / scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m)
{
return mat<4, 2, T, P>(
return mat<4, 2, T, Q>(
scalar / m[0],
scalar / m[1],
scalar / m[2],
@ -513,14 +513,14 @@ namespace glm
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, P> const& m1, mat<4, 2, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}

View File

@ -12,13 +12,13 @@
namespace glm
{
template<typename T, qualifier P>
struct mat<4, 3, T, P>
template<typename T, qualifier Q>
struct mat<4, 3, T, Q>
{
typedef vec<3, T, P> col_type;
typedef vec<4, T, P> row_type;
typedef mat<4, 3, T, P> type;
typedef mat<3, 4, T, P> transpose_type;
typedef vec<3, T, Q> col_type;
typedef vec<4, T, Q> row_type;
typedef mat<4, 3, T, Q> type;
typedef mat<3, 4, T, Q> transpose_type;
typedef T value_type;
private:
@ -36,7 +36,7 @@ namespace glm
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<4, 3, T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<4, 3, T, Q> const& m) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL mat(mat<4, 3, T, Q> const& m);
@ -67,108 +67,108 @@ namespace glm
template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL mat(
vec<3, V1, P> const& v1,
vec<3, V2, P> const& v2,
vec<3, V3, P> const& v3,
vec<3, V4, P> const& v4);
vec<3, V1, Q> const& v1,
vec<3, V2, Q> const& v2,
vec<3, V3, Q> const& v3,
vec<3, V4, Q> const& v4);
// -- Matrix conversions --
template<typename U, qualifier Q>
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<3, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
// -- Unary arithmetic operators --
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, Q> & operator=(mat<4, 3, T, Q> const& m) GLM_DEFAULT;
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, Q> & operator=(mat<4, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(U s);
GLM_FUNC_DECL mat<4, 3, T, Q> & operator+=(U s);
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, Q> & operator+=(mat<4, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(U s);
GLM_FUNC_DECL mat<4, 3, T, Q> & operator-=(U s);
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, Q> & operator-=(mat<4, 3, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator*=(U s);
GLM_FUNC_DECL mat<4, 3, T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator/=(U s);
GLM_FUNC_DECL mat<4, 3, T, Q> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL mat<4, 3, T, P>& operator++();
GLM_FUNC_DECL mat<4, 3, T, P>& operator--();
GLM_FUNC_DECL mat<4, 3, T, P> operator++(int);
GLM_FUNC_DECL mat<4, 3, T, P> operator--(int);
GLM_FUNC_DECL mat<4, 3, T, Q>& operator++();
GLM_FUNC_DECL mat<4, 3, T, Q>& operator--();
GLM_FUNC_DECL mat<4, 3, T, Q> operator++(int);
GLM_FUNC_DECL mat<4, 3, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(T const& s, mat<4, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<4, 3, T, Q>::col_type operator*(mat<4, 3, T, Q> const& m, typename mat<4, 3, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<4, 3, T, Q>::row_type operator*(typename mat<4, 3, T, Q>::col_type const& v, mat<4, 3, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 3, T, P> operator/(mat<4, 3, T, P> const& m, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 3, T, P> operator/(T const& s, mat<4, 3, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -6,14 +6,14 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 3, T, Q> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -22,9 +22,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, Q> const& m)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 3, T, P> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@ -32,8 +32,8 @@ namespace glm
this->value[3] = m.value[3];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(T const& s)
{
this->value[0] = col_type(s, 0, 0);
this->value[1] = col_type(0, s, 0);
@ -41,8 +41,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat
(
T const& x0, T const& y0, T const& z0,
T const& x1, T const& y1, T const& z1,
@ -56,8 +56,8 @@ namespace glm
this->value[3] = col_type(x3, y3, z3);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat
(
col_type const& v0,
col_type const& v1,
@ -73,13 +73,13 @@ namespace glm
// -- Conversion constructors --
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3,
typename X4, typename Y4, typename Z4>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat
(
X1 const& x1, Y1 const& y1, Z1 const& z1,
X2 const& x2, Y2 const& y2, Z2 const& z2,
@ -93,14 +93,14 @@ namespace glm
this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>::mat
(
vec<3, V1, P> const& v1,
vec<3, V2, P> const& v2,
vec<3, V3, P> const& v3,
vec<3, V4, P> const& v4
vec<3, V1, Q> const& v1,
vec<3, V2, Q> const& v2,
vec<3, V3, Q> const& v3,
vec<3, V4, Q> const& v4
)
{
this->value[0] = col_type(v1);
@ -111,9 +111,9 @@ namespace glm
// -- Matrix conversions --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, U, Q> const& m)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 3, U, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -121,8 +121,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@ -130,8 +130,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<3, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -139,8 +139,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -148,8 +148,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<2, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -157,8 +157,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<3, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@ -166,8 +166,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<2, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -175,8 +175,8 @@ namespace glm
this->value[3] = col_type(0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<4, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@ -184,8 +184,8 @@ namespace glm
this->value[3] = col_type(m[3], 0);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>::mat(mat<3, 4, T, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -195,15 +195,15 @@ namespace glm
// -- Accesses --
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type & mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template<typename T, qualifier 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
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type const& mat<4, 3, T, Q>::operator[](typename mat<4, 3, T, Q>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@ -212,8 +212,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -223,9 +223,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<4, 3, T, Q>::operator=(mat<4, 3, U, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -234,9 +234,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 3, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -245,9 +245,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 3, T, Q>::operator+=(mat<4, 3, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -256,9 +256,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 3, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -267,9 +267,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 3, T, Q>::operator-=(mat<4, 3, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -278,9 +278,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 3, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -289,9 +289,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 3, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -302,8 +302,8 @@ namespace glm
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
@ -312,8 +312,8 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> & mat<4, 3, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
@ -322,34 +322,34 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator++(int)
{
mat<4, 3, T, P> Result(*this);
mat<4, 3, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> mat<4, 3, T, Q>::operator--(int)
{
mat<4, 3, T, P> Result(*this);
mat<4, 3, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m)
{
return m;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
-m[0],
-m[1],
-m[2],
@ -358,95 +358,95 @@ namespace glm
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m, T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m, T const& s)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator+(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m, T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m, T const& s)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m[0] - s,
m[1] - s,
m[2] - s,
m[3] - s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator-(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m, T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m, T const& s)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(T const& s, mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(T const& s, mat<4, 3, T, Q> const& m)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::col_type operator*
(
mat<4, 3, T, P> const& m,
typename mat<4, 3, T, P>::row_type const& v)
mat<4, 3, T, Q> const& m,
typename mat<4, 3, T, Q>::row_type const& v)
{
return typename mat<4, 3, T, P>::col_type(
return typename mat<4, 3, T, Q>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * 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, qualifier P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::row_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, Q>::row_type operator*
(
typename mat<4, 3, T, P>::col_type const& v,
mat<4, 3, T, P> const& m)
typename mat<4, 3, T, Q>::col_type const& v,
mat<4, 3, T, Q> const& m)
{
return typename mat<4, 3, T, P>::row_type(
return typename mat<4, 3, T, Q>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2],
v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2],
v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<2, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return mat<2, 3, T, P>(
return mat<2, 3, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
@ -455,8 +455,8 @@ 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]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<3, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
@ -484,7 +484,7 @@ namespace glm
T const SrcB22 = m2[2][2];
T const SrcB23 = m2[2][3];
mat<3, 3, T, P> Result;
mat<3, 3, T, Q> Result;
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03;
@ -497,10 +497,10 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const& m1, mat<4, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator*(mat<4, 3, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
@ -515,20 +515,20 @@ 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]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(mat<4, 3, T, P> const& m, T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(mat<4, 3, T, Q> const& m, T const& s)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
m[0] / s,
m[1] / s,
m[2] / s,
m[3] / s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(T const& s, mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, Q> operator/(T const& s, mat<4, 3, T, Q> const& m)
{
return mat<4, 3, T, P>(
return mat<4, 3, T, Q>(
s / m[0],
s / m[1],
s / m[2],
@ -537,14 +537,14 @@ namespace glm
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, P> const& m1, mat<4, 3, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, Q> const& m1, mat<4, 3, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}

View File

@ -11,13 +11,13 @@
namespace glm
{
template<typename T, qualifier P>
struct mat<4, 4, T, P>
template<typename T, qualifier Q>
struct mat<4, 4, T, Q>
{
typedef vec<4, T, P> col_type;
typedef vec<4, T, P> row_type;
typedef mat<4, 4, T, P> type;
typedef mat<4, 4, T, P> transpose_type;
typedef vec<4, T, Q> col_type;
typedef vec<4, T, Q> row_type;
typedef mat<4, 4, T, Q> type;
typedef mat<4, 4, T, Q> transpose_type;
typedef T value_type;
private:
@ -35,7 +35,7 @@ namespace glm
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<4, 4, T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m);
@ -66,127 +66,127 @@ namespace glm
template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL mat(
vec<4, V1, P> const& v1,
vec<4, V2, P> const& v2,
vec<4, V3, P> const& v3,
vec<4, V4, P> const& v4);
vec<4, V1, Q> const& v1,
vec<4, V2, Q> const& v2,
vec<4, V3, Q> const& v3,
vec<4, V4, Q> const& v4);
// -- Matrix conversions --
template<typename U, qualifier Q>
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<3, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
// -- Unary arithmetic operators --
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, Q> & operator=(mat<4, 4, T, Q> const& m) GLM_DEFAULT;
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, Q> & operator=(mat<4, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(U s);
GLM_FUNC_DECL mat<4, 4, T, Q> & operator+=(U s);
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, Q> & operator+=(mat<4, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(U s);
GLM_FUNC_DECL mat<4, 4, T, Q> & operator-=(U s);
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, Q> & operator-=(mat<4, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(U s);
GLM_FUNC_DECL mat<4, 4, T, Q> & operator*=(U s);
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, Q> & operator*=(mat<4, 4, U, Q> const& m);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(U s);
GLM_FUNC_DECL mat<4, 4, T, Q> & operator/=(U s);
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, Q> & operator/=(mat<4, 4, U, Q> const& m);
// -- Increment and decrement operators --
GLM_FUNC_DECL mat<4, 4, T, P> & operator++();
GLM_FUNC_DECL mat<4, 4, T, P> & operator--();
GLM_FUNC_DECL mat<4, 4, T, P> operator++(int);
GLM_FUNC_DECL mat<4, 4, T, P> operator--(int);
GLM_FUNC_DECL mat<4, 4, T, Q> & operator++();
GLM_FUNC_DECL mat<4, 4, T, Q> & operator--();
GLM_FUNC_DECL mat<4, 4, T, Q> operator++(int);
GLM_FUNC_DECL mat<4, 4, T, Q> operator--(int);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(T const& s, mat<4, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(T const& s, mat<4, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const& s);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(T const& s, mat<4, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator*(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator*(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s);
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> operator/(T const& s, mat<4, 4, T, P> const& m);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v);
template<typename T, qualifier 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);
template<typename T, qualifier Q>
GLM_FUNC_DECL typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m);
template<typename T, qualifier P>
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, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -8,14 +8,14 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 4, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -24,9 +24,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, Q> const& m)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 4, T, P> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -34,8 +34,8 @@ namespace glm
this->value[3] = m[3];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(T const& s)
{
this->value[0] = col_type(s, 0, 0, 0);
this->value[1] = col_type(0, s, 0, 0);
@ -43,8 +43,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat
(
T const& x0, T const& y0, T const& z0, T const& w0,
T const& x1, T const& y1, T const& z1, T const& w1,
@ -58,8 +58,8 @@ namespace glm
this->value[3] = col_type(x3, y3, z3, w3);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat
(
col_type const& v0,
col_type const& v1,
@ -73,12 +73,9 @@ namespace glm
this->value[3] = v3;
}
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
(
mat<4, 4, U, Q> const& m
)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 4, U, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@ -88,13 +85,13 @@ namespace glm
// -- Conversions --
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3,
typename X4, typename Y4, typename Z4, typename W4>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat
(
X1 const& x1, Y1 const& y1, Z1 const& z1, W1 const& w1,
X2 const& x2, Y2 const& y2, Z2 const& z2, W2 const& w2,
@ -128,14 +125,14 @@ namespace glm
this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4), value_type(w4));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>::mat
(
vec<4, V1, P> const& v1,
vec<4, V2, P> const& v2,
vec<4, V3, P> const& v3,
vec<4, V4, P> const& v4
vec<4, V1, Q> const& v1,
vec<4, V2, Q> const& v2,
vec<4, V3, Q> const& v3,
vec<4, V4, Q> const& v4
)
{
GLM_STATIC_ASSERT(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
@ -151,8 +148,8 @@ namespace glm
// -- Matrix conversions --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
@ -160,8 +157,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<3, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@ -169,8 +166,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<2, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@ -178,8 +175,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<3, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
@ -187,8 +184,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<2, 4, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -196,8 +193,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 2, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
@ -205,8 +202,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<3, 4, T, Q> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@ -214,8 +211,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>::mat(mat<4, 3, T, Q> const& m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@ -225,15 +222,15 @@ namespace glm
// -- Accesses --
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type & mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template<typename T, qualifier 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
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type const& mat<4, 4, T, Q>::operator[](typename mat<4, 4, T, Q>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@ -242,8 +239,8 @@ namespace glm
// -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, T, Q> const& m)
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
@ -255,9 +252,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<4, 4, T, Q>::operator=(mat<4, 4, U, Q> const& m)
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
@ -268,9 +265,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<4, 4, T, Q>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@ -279,9 +276,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q>& mat<4, 4, T, Q>::operator+=(mat<4, 4, U, Q> const& m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@ -290,9 +287,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 4, T, Q>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@ -301,9 +298,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 4, T, Q>::operator-=(mat<4, 4, U, Q> const& m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@ -312,9 +309,9 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 4, T, Q>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@ -323,16 +320,16 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 4, T, Q>::operator*=(mat<4, 4, U, Q> const& m)
{
return (*this = *this * m);
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 4, T, Q>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@ -341,17 +338,17 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & mat<4, 4, T, Q>::operator/=(mat<4, 4, U, Q> const& m)
{
return *this *= inverse(m);
}
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator++()
{
++this->value[0];
++this->value[1];
@ -360,8 +357,8 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> & mat<4, 4, T, Q>::operator--()
{
--this->value[0];
--this->value[1];
@ -370,34 +367,34 @@ namespace glm
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator++(int)
{
mat<4, 4, T, P> Result(*this);
mat<4, 4, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat<4, 4, T, Q>::operator--(int)
{
mat<4, 4, T, P> Result(*this);
mat<4, 4, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary constant operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m)
{
return m;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
-m[0],
-m[1],
-m[2],
@ -406,91 +403,91 @@ namespace glm
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m, T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m, T const& s)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(T const& s, mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(T const& s, mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator+(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m, T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m, T const& s)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
m[0] - s,
m[1] - s,
m[2] - s,
m[3] - s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(T const& s, mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(T const& s, mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
s - m[0],
s - m[1],
s - m[2],
s - m[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator-(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m, T const & s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m, T const & s)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(T const& s, mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(T const& s, mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator*
(
mat<4, 4, T, P> const& m,
typename mat<4, 4, T, P>::row_type const& v
mat<4, 4, T, Q> const& m,
typename mat<4, 4, T, Q>::row_type const& v
)
{
/*
@ -509,24 +506,24 @@ namespace glm
__m128 a2 = _mm_add_ps(a0, a1);
return typename mat<4, 4, T, P>::col_type(a2);
return typename mat<4, 4, T, Q>::col_type(a2);
*/
typename mat<4, 4, T, P>::col_type const Mov0(v[0]);
typename mat<4, 4, T, P>::col_type const Mov1(v[1]);
typename mat<4, 4, T, P>::col_type const Mul0 = m[0] * Mov0;
typename mat<4, 4, T, P>::col_type const Mul1 = m[1] * Mov1;
typename mat<4, 4, T, P>::col_type const Add0 = Mul0 + Mul1;
typename mat<4, 4, T, P>::col_type const Mov2(v[2]);
typename mat<4, 4, T, P>::col_type const Mov3(v[3]);
typename mat<4, 4, T, P>::col_type const Mul2 = m[2] * Mov2;
typename mat<4, 4, T, P>::col_type const Mul3 = m[3] * Mov3;
typename mat<4, 4, T, P>::col_type const Add1 = Mul2 + Mul3;
typename mat<4, 4, T, P>::col_type const Add2 = Add0 + Add1;
typename mat<4, 4, T, Q>::col_type const Mov0(v[0]);
typename mat<4, 4, T, Q>::col_type const Mov1(v[1]);
typename mat<4, 4, T, Q>::col_type const Mul0 = m[0] * Mov0;
typename mat<4, 4, T, Q>::col_type const Mul1 = m[1] * Mov1;
typename mat<4, 4, T, Q>::col_type const Add0 = Mul0 + Mul1;
typename mat<4, 4, T, Q>::col_type const Mov2(v[2]);
typename mat<4, 4, T, Q>::col_type const Mov3(v[3]);
typename mat<4, 4, T, Q>::col_type const Mul2 = m[2] * Mov2;
typename mat<4, 4, T, Q>::col_type const Mul3 = m[3] * Mov3;
typename mat<4, 4, T, Q>::col_type const Add1 = Mul2 + Mul3;
typename mat<4, 4, T, Q>::col_type const Add2 = Add0 + Add1;
return Add2;
/*
return typename mat<4, 4, T, P>::col_type(
return typename mat<4, 4, T, Q>::col_type(
m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3],
m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3],
m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3],
@ -534,24 +531,24 @@ namespace glm
*/
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator*
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator*
(
typename mat<4, 4, T, P>::col_type const& v,
mat<4, 4, T, P> const& m
typename mat<4, 4, T, Q>::col_type const& v,
mat<4, 4, T, Q> const& m
)
{
return typename mat<4, 4, T, P>::row_type(
return typename mat<4, 4, T, Q>::row_type(
m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3],
m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3],
m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][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, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<2, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<2, 4, T, Q> const& m2)
{
return mat<2, 4, T, P>(
return mat<2, 4, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
@ -562,10 +559,10 @@ 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]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<3, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<3, 4, T, Q> const& m2)
{
return mat<3, 4, T, P>(
return mat<3, 4, T, Q>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
@ -580,20 +577,20 @@ 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]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator*(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
typename mat<4, 4, T, P>::col_type const SrcA0 = m1[0];
typename mat<4, 4, T, P>::col_type const SrcA1 = m1[1];
typename mat<4, 4, T, P>::col_type const SrcA2 = m1[2];
typename mat<4, 4, T, P>::col_type const SrcA3 = m1[3];
typename mat<4, 4, T, Q>::col_type const SrcA0 = m1[0];
typename mat<4, 4, T, Q>::col_type const SrcA1 = m1[1];
typename mat<4, 4, T, Q>::col_type const SrcA2 = m1[2];
typename mat<4, 4, T, Q>::col_type const SrcA3 = m1[3];
typename mat<4, 4, T, P>::col_type const SrcB0 = m2[0];
typename mat<4, 4, T, P>::col_type const SrcB1 = m2[1];
typename mat<4, 4, T, P>::col_type const SrcB2 = m2[2];
typename mat<4, 4, T, P>::col_type const SrcB3 = m2[3];
typename mat<4, 4, T, Q>::col_type const SrcB0 = m2[0];
typename mat<4, 4, T, Q>::col_type const SrcB1 = m2[1];
typename mat<4, 4, T, Q>::col_type const SrcB2 = m2[2];
typename mat<4, 4, T, Q>::col_type const SrcB3 = m2[3];
mat<4, 4, T, P> Result;
mat<4, 4, T, Q> Result;
Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3];
Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3];
Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3];
@ -601,55 +598,55 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m, T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m, T const& s)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
m[0] / s,
m[1] / s,
m[2] / s,
m[3] / s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(T const& s, mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(T const& s, mat<4, 4, T, Q> const& m)
{
return mat<4, 4, T, P>(
return mat<4, 4, T, Q>(
s / m[0],
s / m[1],
s / m[2],
s / m[3]);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::col_type operator/(mat<4, 4, T, Q> const& m, typename mat<4, 4, T, Q>::row_type const& v)
{
return inverse(m) * v;
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, Q>::row_type operator/(typename mat<4, 4, T, Q>::col_type const& v, mat<4, 4, T, Q> const& m)
{
return v * inverse(m);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> operator/(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
mat<4, 4, T, P> m1_copy(m1);
mat<4, 4, T, Q> m1_copy(m1);
return m1_copy /= m2;
}
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, P> const& m1, mat<4, 4, T, P> const& m2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, Q> const& m1, mat<4, 4, T, Q> const& m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}

View File

@ -103,10 +103,10 @@ namespace detail
}//namespace detail
#if GLM_HAS_TEMPLATE_ALIASES
template <typename T, qualifier P = defaultp> using tvec1 = vec<1, T, P>;
template <typename T, qualifier P = defaultp> using tvec2 = vec<2, T, P>;
template <typename T, qualifier P = defaultp> using tvec3 = vec<3, T, P>;
template <typename T, qualifier P = defaultp> using tvec4 = vec<4, T, P>;
template <typename T, qualifier Q = defaultp> using tvec1 = vec<1, T, Q>;
template <typename T, qualifier Q = defaultp> using tvec2 = vec<2, T, Q>;
template <typename T, qualifier Q = defaultp> using tvec3 = vec<3, T, Q>;
template <typename T, qualifier Q = defaultp> using tvec4 = vec<4, T, Q>;
#endif//GLM_HAS_TEMPLATE_ALIASES
typedef vec<1, float, highp> highp_vec1_t;

View File

@ -16,14 +16,14 @@
namespace glm
{
template<typename T, qualifier P>
struct vec<1, T, P>
template<typename T, qualifier Q>
struct vec<1, T, Q>
{
// -- Implementation detail --
typedef T value_type;
typedef vec type;
typedef vec<1, bool, P> bool_type;
typedef vec<1, bool, Q> bool_type;
// -- Data --
@ -114,7 +114,7 @@ namespace glm
/*
# if(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED))
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, Q, tvec1, E0, -1,-2,-3> const& that)
{
*this = that();
}
@ -125,23 +125,23 @@ namespace glm
GLM_FUNC_DECL vec & operator=(vec const& v) GLM_DEFAULT;
template<typename U>
GLM_FUNC_DECL vec & operator=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator+=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator+=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator-=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator-=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator*=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator*=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator/=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator/=(vec<1, U, Q> const& v);
// -- Increment and decrement operators --
@ -155,145 +155,145 @@ namespace glm
template<typename U>
GLM_FUNC_DECL vec & operator%=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator%=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator&=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator|=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator^=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator<<=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator>>=(vec<1, U, Q> const& v);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator+(vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator-(vec<1, T, Q> const& v);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator+(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator*(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator/(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator%(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator&(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator|(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator^(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator<<(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator>>(T scalar, vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<1, T, P> operator~(vec<1, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<1, T, Q> operator~(vec<1, T, Q> const& v);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(vec<1, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2);
template<qualifier P>
GLM_FUNC_DECL vec<1, bool, P> operator&&(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2);
template<qualifier Q>
GLM_FUNC_DECL vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2);
template<qualifier P>
GLM_FUNC_DECL vec<1, bool, P> operator||(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2);
template<qualifier Q>
GLM_FUNC_DECL vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -6,68 +6,68 @@ namespace glm
// -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec()
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<1, T, Q> const& v)
: x(v.x)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, T, Q> const& v)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<1, T, P> const& v)
: x(v.x)
{}
// -- Explicit basic constructors --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(T scalar)
: x(scalar)
{}
// -- Conversion vector constructors --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<1, U, Q> const& v)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<1, U, P> const& v)
: x(static_cast<T>(v.x))
{}
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<2, U, Q> const& v)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<2, U, P> const& v)
: x(static_cast<T>(v.x))
{}
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<3, U, Q> const& v)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<3, U, P> const& v)
: x(static_cast<T>(v.x))
{}
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(vec<4, U, Q> const& v)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, Q>::vec(vec<4, U, P> const& v)
: x(static_cast<T>(v.x))
{}
// -- Component accesses --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T & vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T & vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type i)
{
assert(i >= 0 && i < this->length());
return (&x)[i];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const& vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i) const
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const& vec<1, T, Q>::operator[](typename vec<1, T, Q>::length_type i) const
{
assert(i >= 0 && i < this->length());
return (&x)[i];
@ -76,81 +76,81 @@ namespace glm
// -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator=(vec<1, T, Q> const& v)
{
this->x = v.x;
return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator=(vec<1, U, Q> const& v)
{
this->x = static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator+=(U scalar)
{
this->x += static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator+=(vec<1, U, Q> const& v)
{
this->x += static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator-=(U scalar)
{
this->x -= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator-=(vec<1, U, Q> const& v)
{
this->x -= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator*=(U scalar)
{
this->x *= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator*=(vec<1, U, Q> const& v)
{
this->x *= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator/=(U scalar)
{
this->x /= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator/=(vec<1, U, Q> const& v)
{
this->x /= static_cast<T>(v.x);
return *this;
@ -158,129 +158,129 @@ namespace glm
// -- Increment and decrement operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator++()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator++()
{
++this->x;
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator--()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator--()
{
--this->x;
return *this;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator++(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> vec<1, T, Q>::operator++(int)
{
vec<1, T, P> Result(*this);
vec<1, T, Q> Result(*this);
++*this;
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator--(int)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> vec<1, T, Q>::operator--(int)
{
vec<1, T, P> Result(*this);
vec<1, T, Q> Result(*this);
--*this;
return Result;
}
// -- Unary bit operators --
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator%=(U scalar)
{
this->x %= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator%=(vec<1, U, Q> const& v)
{
this->x %= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator&=(U scalar)
{
this->x &= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator&=(vec<1, U, Q> const& v)
{
this->x &= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator|=(U scalar)
{
this->x |= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator|=(vec<1, U, Q> const& v)
{
this->x |= U(v.x);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator^=(U scalar)
{
this->x ^= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator^=(vec<1, U, Q> const& v)
{
this->x ^= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator<<=(U scalar)
{
this->x <<= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator<<=(vec<1, U, Q> const& v)
{
this->x <<= static_cast<T>(v.x);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, Q> & vec<1, T, Q>::operator>>=(U scalar)
{
this->x >>= static_cast<T>(scalar);
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
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, Q> & vec<1, T, Q>::operator>>=(vec<1, U, Q> const& v)
{
this->x >>= static_cast<T>(v.x);
return *this;
@ -288,264 +288,264 @@ namespace glm
// -- Unary constant operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(vec<1, T, Q> const& v)
{
return v;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
-v.x);
}
// -- Binary arithmetic operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v.x + scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar + v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator+(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x + v2.x);
}
//operator-
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v.x - scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar - v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator-(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x - v2.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator*(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v.x * scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator*(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar * v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator*(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x * v2.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator/(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v.x / scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator/(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar / v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator/(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x / v2.x);
}
// -- Binary bit operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator%(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v.x % scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator%(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar % v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator%(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x % v2.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator&(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v.x & scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator&(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar & v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator&(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x & v2.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator|(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v.x | scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator|(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar | v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator|(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x | v2.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator^(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v.x ^ scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator^(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar ^ v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator^(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x ^ v2.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator<<(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
static_cast<T>(v.x << scalar));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator<<(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar << v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator<<(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x << v2.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const& v, T scalar)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator>>(vec<1, T, Q> const& v, T scalar)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v.x >> scalar);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(T scalar, vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator>>(T scalar, vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
scalar >> v.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator>>(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return vec<1, T, P>(
return vec<1, T, Q>(
v1.x >> v2.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator~(vec<1, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, T, Q> operator~(vec<1, T, Q> const& v)
{
return vec<1, T, P>(
return vec<1, T, Q>(
~v.x);
}
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return detail::compute_equal<T>::call(v1.x, v2.x);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, P> const& v1, vec<1, T, P> const& v2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, Q> const& v1, vec<1, T, Q> const& v2)
{
return !(v1 == v2);
}
template<qualifier P>
GLM_FUNC_QUALIFIER vec<1, bool, P> operator&&(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2)
template<qualifier Q>
GLM_FUNC_QUALIFIER vec<1, bool, Q> operator&&(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2)
{
return vec<1, bool, P>(v1.x && v2.x);
return vec<1, bool, Q>(v1.x && v2.x);
}
template<qualifier P>
GLM_FUNC_QUALIFIER vec<1, bool, P> operator||(vec<1, bool, P> const& v1, vec<1, bool, P> const& v2)
template<qualifier Q>
GLM_FUNC_QUALIFIER vec<1, bool, Q> operator||(vec<1, bool, Q> const& v1, vec<1, bool, Q> const& v2)
{
return vec<1, bool, P>(v1.x || v2.x);
return vec<1, bool, Q>(v1.x || v2.x);
}
}//namespace glm

View File

@ -15,14 +15,14 @@
namespace glm
{
template<typename T, qualifier P>
struct vec<2, T, P>
template<typename T, qualifier Q>
struct vec<2, T, Q>
{
// -- Implementation detail --
typedef T value_type;
typedef vec type;
typedef vec<2, bool, P> bool_type;
typedef vec<2, bool, Q> bool_type;
// -- Data --
@ -102,7 +102,7 @@ namespace glm
template<typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(A x, B y);
template<typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& x, vec<1, B, P> const& y);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, Q> const& x, vec<1, B, Q> const& y);
// -- Conversion vector constructors --
@ -120,7 +120,7 @@ namespace glm
// -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
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, Q, E0, E1,-1,-2> const& that)
{
*this = that();
}
@ -131,31 +131,31 @@ namespace glm
GLM_FUNC_DECL vec& operator=(vec const& v) GLM_DEFAULT;
template<typename U>
GLM_FUNC_DECL vec& operator=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec& operator=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec& operator+=(U scalar);
template<typename U>
GLM_FUNC_DECL vec& operator+=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec& operator+=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec& operator+=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec& operator+=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec& operator-=(U scalar);
template<typename U>
GLM_FUNC_DECL vec& operator-=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec& operator-=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec& operator-=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec& operator-=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec& operator*=(U scalar);
template<typename U>
GLM_FUNC_DECL vec& operator*=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec& operator*=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec& operator*=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec& operator*=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec& operator/=(U scalar);
template<typename U>
GLM_FUNC_DECL vec& operator/=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec& operator/=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec& operator/=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec& operator/=(vec<2, U, Q> const& v);
// -- Increment and decrement operators --
@ -169,217 +169,217 @@ namespace glm
template<typename U>
GLM_FUNC_DECL vec & operator%=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator%=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec & operator%=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator&=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec & operator&=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator|=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec & operator|=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator^=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec & operator^=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator<<=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec & operator<<=(vec<2, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator>>=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<2, U, P> const& v);
GLM_FUNC_DECL vec & operator>>=(vec<2, U, Q> const& v);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator+(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator+(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator+(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator+(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator-(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator-(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator-(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator-(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator*(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator*(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator*(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator*(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator*(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator/(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator/(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator/(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator/(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator/(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator%(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator%(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator%(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator%(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator%(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator&(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator&(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator&(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator&(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator&(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator|(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator|(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator|(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator|(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator|(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator^(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator^(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator^(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator^(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator^(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator<<(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator<<(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator<<(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<2, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator>>(T scalar, vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator>>(T scalar, vec<2, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<1, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<1, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator>>(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<2, T, P> operator~(vec<2, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<2, T, Q> operator~(vec<2, T, Q> const& v);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(vec<2, T, P> const& v1, vec<2, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(vec<2, T, Q> const& v1, vec<2, T, Q> const& v2);
template<qualifier P>
GLM_FUNC_DECL vec<2, bool, P> operator&&(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2);
template<qualifier Q>
GLM_FUNC_DECL vec<2, bool, Q> operator&&(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2);
template<qualifier P>
GLM_FUNC_DECL vec<2, bool, P> operator||(vec<2, bool, P> const& v1, vec<2, bool, P> const& v2);
template<qualifier Q>
GLM_FUNC_DECL vec<2, bool, Q> operator||(vec<2, bool, Q> const& v1, vec<2, bool, Q> const& v2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

File diff suppressed because it is too large Load Diff

View File

@ -15,14 +15,14 @@
namespace glm
{
template<typename T, qualifier P>
struct vec<3, T, P>
template<typename T, qualifier Q>
struct vec<3, T, Q>
{
// -- Implementation detail --
typedef T value_type;
typedef vec type;
typedef vec<3, bool, P> bool_type;
typedef vec<3, bool, Q> bool_type;
// -- Data --
@ -102,7 +102,7 @@ namespace glm
template<typename X, typename Y, typename Z>
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(X x, Y y, Z z);
template<typename X, typename Y, typename Z>
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _y, vec<1, Z, P> const& _z);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _y, vec<1, Z, Q> const& _z);
// -- Conversion vector constructors --
@ -129,19 +129,19 @@ namespace glm
// -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
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, Q, E0, E1, E2, -1> const& that)
{
*this = that();
}
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, Q, E0, E1, -1, -2> const& v, T const& scalar)
{
*this = vec(v(), scalar);
}
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, Q, E0, E1, -1, -2> const& v)
{
*this = vec(scalar, v());
}
@ -152,31 +152,31 @@ namespace glm
GLM_FUNC_DECL vec & operator=(vec const& v) GLM_DEFAULT;
template<typename U>
GLM_FUNC_DECL vec & operator=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator+=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator+=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator+=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator+=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator-=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator-=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator-=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator-=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator*=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator*=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator*=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator*=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator/=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator/=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator/=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator/=(vec<3, U, Q> const& v);
// -- Increment and decrement operators --
@ -190,217 +190,217 @@ namespace glm
template<typename U>
GLM_FUNC_DECL vec & operator%=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator%=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator%=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator&=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator&=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator|=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator|=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator^=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator^=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator<<=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator<<=(vec<3, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec & operator>>=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<3, U, P> const& v);
GLM_FUNC_DECL vec & operator>>=(vec<3, U, Q> const& v);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v, vec<1, T, P> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator+(T scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator+(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator+(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator+(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator-(T scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator-(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator-(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator-(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator*(T scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator*(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator*(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator/(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator/(T scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator/(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator/(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator/(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator%(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator%(T const& scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator%(T const& scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator%(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator%(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const& v1, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator&(vec<3, T, Q> const& v1, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator&(T scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator&(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator&(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator&(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator|(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator|(T scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator|(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator|(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator|(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator^(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator^(T scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator^(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator^(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator^(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator<<(T scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator<<(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator<<(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<3, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator>>(T scalar, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator>>(T scalar, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<1, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<1, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator>>(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator~(vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator~(vec<3, T, Q> const& v);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(vec<3, T, P> const& v1, vec<3, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(vec<3, T, Q> const& v1, vec<3, T, Q> const& v2);
template<qualifier P>
GLM_FUNC_DECL vec<3, bool, P> operator&&(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2);
template<qualifier Q>
GLM_FUNC_DECL vec<3, bool, Q> operator&&(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2);
template<qualifier P>
GLM_FUNC_DECL vec<3, bool, P> operator||(vec<3, bool, P> const& v1, vec<3, bool, P> const& v2);
template<qualifier Q>
GLM_FUNC_DECL vec<3, bool, Q> operator||(vec<3, bool, Q> const& v1, vec<3, bool, Q> const& v2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

File diff suppressed because it is too large Load Diff

View File

@ -15,14 +15,14 @@
namespace glm
{
template<typename T, qualifier P>
struct vec<4, T, P>
template<typename T, qualifier Q>
struct vec<4, T, Q>
{
// -- Implementation detail --
typedef T value_type;
typedef vec<4, T, P> type;
typedef vec<4, bool, P> bool_type;
typedef vec<4, T, Q> type;
typedef vec<4, bool, Q> bool_type;
// -- Data --
@ -90,7 +90,7 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT;
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, Q> const& v) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v);
@ -105,7 +105,7 @@ namespace glm
template<typename X, typename Y, typename Z, typename W>
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(X _x, Y _y, Z _z, W _w);
template<typename X, typename Y, typename Z, typename W>
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, P> const& _x, vec<1, Y, P> const& _Y, vec<1, Z, P> const& _z, vec<1, W, P> const& _w);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, X, Q> const& _x, vec<1, Y, Q> const& _Y, vec<1, Z, Q> const& _z, vec<1, W, Q> const& _w);
// -- Conversion vector constructors --
@ -150,302 +150,302 @@ namespace glm
// -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
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, Q, E0, E1, E2, E3> const& that)
{
*this = that();
}
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, Q, E0, E1, -1, -2> const& v, detail::_swizzle<2, T, Q, F0, F1, -1, -2> const& u)
{
*this = vec<4, T, P>(v(), u());
*this = vec<4, T, Q>(v(), u());
}
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, Q, E0, E1, -1, -2> const& v)
{
*this = vec<4, T, P>(x, y, v());
*this = vec<4, T, Q>(x, y, v());
}
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, Q, E0, E1, -1, -2> const& v, T const& w)
{
*this = vec<4, T, P>(x, v(), w);
*this = vec<4, T, Q>(x, v(), w);
}
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, Q, E0, E1, -1, -2> const& v, T const& z, T const& w)
{
*this = vec<4, T, P>(v(), z, w);
*this = vec<4, T, Q>(v(), z, w);
}
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, Q, E0, E1, E2, -1> const& v, T const& w)
{
*this = vec<4, T, P>(v(), w);
*this = vec<4, T, Q>(v(), w);
}
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, Q, E0, E1, E2, -1> const& v)
{
*this = vec<4, T, P>(x, v());
*this = vec<4, T, Q>(x, v());
}
# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
// -- Unary arithmetic operators --
GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, T, P> const& v) GLM_DEFAULT;
GLM_FUNC_DECL vec<4, T, Q>& operator=(vec<4, T, Q> const& v) GLM_DEFAULT;
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q>& operator=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator+=(U scalar);
GLM_FUNC_DECL vec<4, T, Q>& operator+=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q>& operator+=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator+=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q>& operator+=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator-=(U scalar);
GLM_FUNC_DECL vec<4, T, Q>& operator-=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q>& operator-=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator-=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q>& operator-=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator*=(U scalar);
GLM_FUNC_DECL vec<4, T, Q>& operator*=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator*=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q>& operator*=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator*=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q>& operator*=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator/=(U scalar);
GLM_FUNC_DECL vec<4, T, Q>& operator/=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q>& operator/=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P>& operator/=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q>& operator/=(vec<4, U, Q> const& v);
// -- Increment and decrement operators --
GLM_FUNC_DECL vec<4, T, P> & operator++();
GLM_FUNC_DECL vec<4, T, P> & operator--();
GLM_FUNC_DECL vec<4, T, P> operator++(int);
GLM_FUNC_DECL vec<4, T, P> operator--(int);
GLM_FUNC_DECL vec<4, T, Q> & operator++();
GLM_FUNC_DECL vec<4, T, Q> & operator--();
GLM_FUNC_DECL vec<4, T, Q> operator++(int);
GLM_FUNC_DECL vec<4, T, Q> operator--(int);
// -- Unary bit operators --
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator%=(U scalar);
GLM_FUNC_DECL vec<4, T, Q> & operator%=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator%=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator%=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator&=(U scalar);
GLM_FUNC_DECL vec<4, T, Q> & operator&=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator&=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator&=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator|=(U scalar);
GLM_FUNC_DECL vec<4, T, Q> & operator|=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator|=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator|=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator^=(U scalar);
GLM_FUNC_DECL vec<4, T, Q> & operator^=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator^=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator^=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator<<=(U scalar);
GLM_FUNC_DECL vec<4, T, Q> & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator<<=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator<<=(vec<4, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator>>=(U scalar);
GLM_FUNC_DECL vec<4, T, Q> & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator>>=(vec<1, U, Q> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, Q> & operator>>=(vec<4, U, Q> const& v);
};
// -- Unary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator+(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator+(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<1, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator+(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator+(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator-(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator-(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<1, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator-(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator-(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator*(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator*(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<1, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator*(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator/(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<1, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<1, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator/(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator/(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<1, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator/(vec<1, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator/(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator%(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator%(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator%(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator%(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator%(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator%(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator&(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator&(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator&(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator&(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator&(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator&(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator|(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator|(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator|(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator|(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator|(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator|(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator^(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator^(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator^(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator^(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator^(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator^(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator<<(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator<<(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator<<(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const& v, T scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<4, T, Q> const& v, T scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const& v, vec<1, T, P> const& scalar);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<4, T, Q> const& v, vec<1, T, Q> const& scalar);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator>>(T scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator>>(T scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<1, T, P> const& scalar, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<1, T, Q> const& scalar, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator>>(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator~(vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator~(vec<4, T, Q> const& v);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(vec<4, T, P> const& v1, vec<4, T, P> const& v2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(vec<4, T, Q> const& v1, vec<4, T, Q> const& v2);
template<qualifier P>
GLM_FUNC_DECL vec<4, bool, P> operator&&(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2);
template<qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> operator&&(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2);
template<qualifier P>
GLM_FUNC_DECL vec<4, bool, P> operator||(vec<4, bool, P> const& v1, vec<4, bool, P> const& v2);
template<qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> operator||(vec<4, bool, Q> const& v1, vec<4, bool, Q> const& v2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

File diff suppressed because it is too large Load Diff

View File

@ -51,10 +51,10 @@ namespace detail
};
# endif// GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
template<qualifier P>
template<qualifier Q>
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, Q> const& a, vec<4, float, Q> const& b)
{
vec<4, float, P> Result;
Result.data = _mm_add_ps(a.data, b.data);
@ -63,10 +63,10 @@ namespace detail
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier P>
template<qualifier Q>
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, Q> const& a, vec<4, double, Q> const& b)
{
vec<4, double, P> Result;
Result.data = _mm256_add_pd(a.data, b.data);
@ -75,10 +75,10 @@ namespace detail
};
# endif
template<qualifier P>
template<qualifier Q>
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, Q> const& a, vec<4, float, Q> const& b)
{
vec<4, float, P> Result;
Result.data = _mm_sub_ps(a.data, b.data);
@ -87,10 +87,10 @@ namespace detail
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier P>
template<qualifier Q>
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, Q> const& a, vec<4, double, Q> const& b)
{
vec<4, double, P> Result;
Result.data = _mm256_sub_pd(a.data, b.data);
@ -99,10 +99,10 @@ namespace detail
};
# endif
template<qualifier P>
template<qualifier Q>
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, Q> const& a, vec<4, float, Q> const& b)
{
vec<4, float, P> Result;
Result.data = _mm_mul_ps(a.data, b.data);
@ -111,10 +111,10 @@ namespace detail
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier P>
template<qualifier Q>
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, Q> const& a, vec<4, double, Q> const& b)
{
vec<4, double, P> Result;
Result.data = _mm256_mul_pd(a.data, b.data);
@ -123,10 +123,10 @@ namespace detail
};
# endif
template<qualifier P>
template<qualifier Q>
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, Q> const& a, vec<4, float, Q> const& b)
{
vec<4, float, P> Result;
Result.data = _mm_div_ps(a.data, b.data);
@ -135,10 +135,10 @@ namespace detail
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier P>
template<qualifier Q>
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, Q> const& a, vec<4, double, Q> const& b)
{
vec<4, double, P> Result;
Result.data = _mm256_div_pd(a.data, b.data);
@ -158,181 +158,181 @@ namespace detail
}
};
template<typename T, qualifier P>
struct compute_vec4_and<T, P, true, 32, true>
template<typename T, qualifier Q>
struct compute_vec4_and<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm_and_si128(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template<typename T, qualifier P>
struct compute_vec4_and<T, P, true, 64, true>
template<typename T, qualifier Q>
struct compute_vec4_and<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm256_and_si256(a.data, b.data);
return Result;
}
};
# endif
template<typename T, qualifier P>
struct compute_vec4_or<T, P, true, 32, true>
template<typename T, qualifier Q>
struct compute_vec4_or<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm_or_si128(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template<typename T, qualifier P>
struct compute_vec4_or<T, P, true, 64, true>
template<typename T, qualifier Q>
struct compute_vec4_or<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm256_or_si256(a.data, b.data);
return Result;
}
};
# endif
template<typename T, qualifier P>
struct compute_vec4_xor<T, P, true, 32, true>
template<typename T, qualifier Q>
struct compute_vec4_xor<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm_xor_si128(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template<typename T, qualifier P>
struct compute_vec4_xor<T, P, true, 64, true>
template<typename T, qualifier Q>
struct compute_vec4_xor<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm256_xor_si256(a.data, b.data);
return Result;
}
};
# endif
template<typename T, qualifier P>
struct compute_vec4_shift_left<T, P, true, 32, true>
template<typename T, qualifier Q>
struct compute_vec4_shift_left<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm_sll_epi32(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template<typename T, qualifier P>
struct compute_vec4_shift_left<T, P, true, 64, true>
template<typename T, qualifier Q>
struct compute_vec4_shift_left<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm256_sll_epi64(a.data, b.data);
return Result;
}
};
# endif
template<typename T, qualifier P>
struct compute_vec4_shift_right<T, P, true, 32, true>
template<typename T, qualifier Q>
struct compute_vec4_shift_right<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm_srl_epi32(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template<typename T, qualifier P>
struct compute_vec4_shift_right<T, P, true, 64, true>
template<typename T, qualifier Q>
struct compute_vec4_shift_right<T, Q, 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, Q> call(vec<4, T, Q> const& a, vec<4, T, Q> const& b)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm256_srl_epi64(a.data, b.data);
return Result;
}
};
# endif
template<typename T, qualifier P>
struct compute_vec4_bitwise_not<T, P, true, 32, true>
template<typename T, qualifier Q>
struct compute_vec4_bitwise_not<T, Q, true, 32, true>
{
static vec<4, T, P> call(vec<4, T, P> const& v)
static vec<4, T, Q> call(vec<4, T, Q> const& v)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1));
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template<typename T, qualifier P>
struct compute_vec4_bitwise_not<T, P, true, 64, true>
template<typename T, qualifier Q>
struct compute_vec4_bitwise_not<T, Q, true, 64, true>
{
static vec<4, T, P> call(vec<4, T, P> const& v)
static vec<4, T, Q> call(vec<4, T, Q> const& v)
{
vec<4, T, P> Result;
vec<4, T, Q> Result;
Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1));
return Result;
}
};
# endif
template<qualifier P>
template<qualifier Q>
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, Q> const& v1, vec<4, float, Q> const& v2)
{
return _mm_movemask_ps(_mm_cmpeq_ps(v1.data, v2.data)) != 0;
}
};
template<qualifier P>
template<qualifier Q>
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, Q> const& v1, vec<4, int32, Q> const& v2)
{
return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0;
}
};
template<qualifier P>
template<qualifier Q>
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, Q> const& v1, vec<4, float, Q> const& v2)
{
return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0;
}
};
template<qualifier P>
template<qualifier Q>
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, Q> const& v1, vec<4, int32, Q> const& v2)
{
return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0;
}

View File

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

View File

@ -38,9 +38,13 @@ namespace glm
/// Build a mask of 'count' bits
///
/// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Signed and unsigned integer scalar types
/// @tparam P Value from qualifier enum
///
/// @see gtc_bitfield
template<typename T, qualifier P, template<typename, qualifier> class vecIUType>
GLM_FUNC_DECL vecIUType<T, P> mask(vecIUType<T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mask(vec<L, T, Q> const& v);
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
///
@ -51,8 +55,8 @@ namespace glm
/// Rotate all bits to the right. All the bits dropped in the right side are inserted back on the left side.
///
/// @see gtc_bitfield
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const& In, int Shift);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> bitfieldRotateRight(vec<L, T, Q> 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.
///
@ -63,8 +67,8 @@ namespace glm
/// Rotate all bits to the left. All the bits dropped in the left side are inserted back on the right side.
///
/// @see gtc_bitfield
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> bitfieldRotateLeft(vec<L, T, P> const& In, int Shift);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> bitfieldRotateLeft(vec<L, T, Q> const& In, int Shift);
/// Set to 1 a range of bits.
///
@ -75,8 +79,8 @@ namespace glm
/// Set to 1 a range of bits.
///
/// @see gtc_bitfield
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> bitfieldFillOne(vec<L, T, P> const& Value, int FirstBit, int BitCount);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> bitfieldFillOne(vec<L, T, Q> const& Value, int FirstBit, int BitCount);
/// Set to 0 a range of bits.
///
@ -87,8 +91,8 @@ namespace glm
/// Set to 0 a range of bits.
///
/// @see gtc_bitfield
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> bitfieldFillZero(vec<L, T, P> const& Value, int FirstBit, int BitCount);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> bitfieldFillZero(vec<L, T, Q> const& Value, int FirstBit, int BitCount);
/// Interleaves the bits of x and y.
/// The first bit is the first bit of x followed by the first bit of y.

View File

@ -230,12 +230,12 @@ namespace detail
return Bits >= sizeof(genIUType) * 8 ? ~static_cast<genIUType>(0) : (static_cast<genIUType>(1) << Bits) - static_cast<genIUType>(1);
}
template<length_t L, typename T, qualifier P, template<length_t, typename, qualifier> class vecIUType>
GLM_FUNC_QUALIFIER vecIUType<L, T, P> mask(vecIUType<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> mask(vec<L, T, Q> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'mask' accepts only integer values");
return detail::functor1<L, T, T, P>::call(mask, v);
return detail::functor1<L, T, T, Q>::call(mask, v);
}
template<typename genIType>
@ -247,8 +247,8 @@ namespace detail
return (In << static_cast<genIType>(Shift)) | (In >> static_cast<genIType>(BitSize - Shift));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldRotateRight(vec<L, T, P> const& In, int Shift)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldRotateRight(vec<L, T, Q> const& In, int Shift)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values");
@ -265,8 +265,8 @@ namespace detail
return (In >> static_cast<genIType>(Shift)) | (In << static_cast<genIType>(BitSize - Shift));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldRotateLeft(vec<L, T, P> const& In, int Shift)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldRotateLeft(vec<L, T, Q> const& In, int Shift)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
@ -280,8 +280,8 @@ namespace detail
return Value | static_cast<genIUType>(mask(BitCount) << FirstBit);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldFillOne(vec<L, T, P> const& Value, int FirstBit, int BitCount)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldFillOne(vec<L, T, Q> const& Value, int FirstBit, int BitCount)
{
return Value | static_cast<T>(mask(BitCount) << FirstBit);
}
@ -292,8 +292,8 @@ namespace detail
return Value & static_cast<genIUType>(~(mask(BitCount) << FirstBit));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> bitfieldFillZero(vec<L, T, P> const& Value, int FirstBit, int BitCount)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldFillZero(vec<L, T, Q> const& Value, int FirstBit, int BitCount)
{
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.
/// IEC 61966-2-1:1999 / Rec. 709 specification https://www.w3.org/Graphics/Color/srgb
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const& ColorLinear);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> convertLinearToSRGB(vec<L, T, Q> const& ColorLinear);
/// 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
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> convertLinearToSRGB(vec<L, T, P> const& ColorLinear, T Gamma);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> convertLinearToSRGB(vec<L, T, Q> const& ColorLinear, T Gamma);
/// 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
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const& ColorSRGB);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> convertSRGBToLinear(vec<L, T, Q> const& ColorSRGB);
/// 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
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> convertSRGBToLinear(vec<L, T, P> const& ColorSRGB, T Gamma);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> convertSRGBToLinear(vec<L, T, Q> const& ColorSRGB, T Gamma);
/// @}
} //namespace glm

View File

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

View File

@ -30,8 +30,8 @@ namespace glm
/// True if this expression is satisfied.
///
/// @see gtc_epsilon
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> epsilonEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const& epsilon);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> epsilonEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T const& epsilon);
/// Returns the component-wise comparison of |x - y| < epsilon.
/// True if this expression is satisfied.
@ -44,8 +44,8 @@ namespace glm
/// True if this expression is not satisfied.
///
/// @see gtc_epsilon
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> epsilonNotEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const& epsilon);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> epsilonNotEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T const& epsilon);
/// Returns the component-wise comparison of |x - y| >= epsilon.
/// True if this expression is not satisfied.

View File

@ -33,16 +33,16 @@ namespace glm
return abs(x - y) < epsilon;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, bool, P> epsilonEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const& epsilon)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> epsilonEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T const& epsilon)
{
return lessThan(abs(x - y), vec<L, T, P>(epsilon));
return lessThan(abs(x - y), vec<L, T, Q>(epsilon));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, bool, P> epsilonEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, vec<L, T, P> const& epsilon)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> epsilonEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& epsilon)
{
return lessThan(abs(x - y), vec<L, T, P>(epsilon));
return lessThan(abs(x - y), vec<L, T, Q>(epsilon));
}
template<>
@ -57,29 +57,29 @@ namespace glm
return abs(x - y) >= epsilon;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, bool, P> epsilonNotEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, T const& epsilon)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> epsilonNotEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T const& epsilon)
{
return greaterThanEqual(abs(x - y), vec<L, T, P>(epsilon));
return greaterThanEqual(abs(x - y), vec<L, T, Q>(epsilon));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, bool, P> epsilonNotEqual(vec<L, T, P> const& x, vec<L, T, P> const& y, vec<L, T, P> const& epsilon)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> epsilonNotEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& epsilon)
{
return greaterThanEqual(abs(x - y), vec<L, T, P>(epsilon));
return greaterThanEqual(abs(x - y), vec<L, T, Q>(epsilon));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonEqual(tquat<T, P> const& x, tquat<T, P> const& y, T const& epsilon)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonEqual(tquat<T, Q> const& x, tquat<T, Q> const& y, T const& epsilon)
{
vec<4, T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
return lessThan(abs(v), vec<4, T, P>(epsilon));
vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
return lessThan(abs(v), vec<4, T, Q>(epsilon));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> epsilonNotEqual(tquat<T, P> const& x, tquat<T, P> const& y, T const& epsilon)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> epsilonNotEqual(tquat<T, Q> const& x, tquat<T, Q> const& y, T const& epsilon)
{
vec<4, T, P> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
return greaterThanEqual(abs(v), vec<4, T, P>(epsilon));
vec<4, T, Q> v(x.x - y.x, x.y - y.y, x.z - y.z, x.w - y.w);
return greaterThanEqual(abs(v), vec<4, T, Q>(epsilon));
}
}//namespace glm

View File

@ -39,11 +39,11 @@ namespace glm
/// 2D gauss function
///
/// @see gtc_epsilon
template<typename T, qualifier P>
template<typename T, qualifier Q>
GLM_FUNC_DECL T gauss(
vec<2, T, P> const& Coord,
vec<2, T, P> const& ExpectedValue,
vec<2, T, P> const& StandardDeviation);
vec<2, T, Q> const& Coord,
vec<2, T, Q> const& ExpectedValue,
vec<2, T, Q> const& StandardDeviation);
/// @}
}//namespace glm

View File

@ -16,15 +16,15 @@ namespace glm
return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast<T>(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast<T>(6.28318530717958647692528676655900576)));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T gauss
(
vec<2, T, P> const& Coord,
vec<2, T, P> const& ExpectedValue,
vec<2, T, P> const& StandardDeviation
vec<2, T, Q> const& Coord,
vec<2, T, Q> const& ExpectedValue,
vec<2, T, Q> const& StandardDeviation
)
{
vec<2, T, P> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast<T>(2) * StandardDeviation * StandardDeviation);
vec<2, T, Q> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast<T>(2) * StandardDeviation * StandardDeviation);
return exp(-(Squared.x + Squared.y));
}
}//namespace glm

View File

@ -54,8 +54,8 @@ namespace glm
/// @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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> mod(vec<L, T, P> const& x, T y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, T y);
/// Modulus. Returns x % y
/// for each component in x using the floating point value y.
@ -65,8 +65,8 @@ namespace glm
/// @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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> mod(vec<L, T, P> const& x, vec<L, T, P> const& y);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> mod(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
@ -77,8 +77,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see gtc_integer
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, int, P> iround(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, int, Q> iround(vec<L, T, Q> const& x);
/// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the
@ -89,8 +89,8 @@ namespace glm
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see gtc_integer
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, uint, P> uround(vec<L, T, P> const& x);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, uint, Q> uround(vec<L, T, Q> const& x);
/// @}
} //namespace glm

View File

@ -4,24 +4,24 @@
namespace glm{
namespace detail
{
template<length_t L, typename T, qualifier P, bool Aligned>
struct compute_log2<L, T, P, false, Aligned>
template<length_t L, typename T, qualifier Q, bool Aligned>
struct compute_log2<L, T, Q, false, Aligned>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v)
{
//Equivalent to return findMSB(vec); but save one function call in ASM with VC
//return findMSB(vec);
return vec<L, T, P>(detail::compute_findMSB_vec<L, T, P, sizeof(T) * 8>::call(v));
return vec<L, T, Q>(detail::compute_findMSB_vec<L, T, Q, sizeof(T) * 8>::call(v));
}
};
# if GLM_HAS_BITSCAN_WINDOWS
template<qualifier P, bool Aligned>
struct compute_log2<4, int, P, false, Aligned>
template<qualifier Q, bool Aligned>
struct compute_log2<4, int, Q, false, Aligned>
{
GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const& v)
GLM_FUNC_QUALIFIER static vec<4, int, Q> call(vec<4, int, Q> const& v)
{
vec<4, int, P> Result;
vec<4, int, Q> Result;
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.x), v.x);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.y), v.y);
_BitScanReverse(reinterpret_cast<unsigned long*>(&Result.z), v.z);
@ -40,13 +40,13 @@ namespace detail
return static_cast<int>(x + static_cast<genType>(0.5));
}
template<glm::length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, int, P> iround(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, int, Q> iround(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'iround' only accept floating-point inputs");
assert(all(lessThanEqual(vec<L, T, P>(0), x)));
assert(all(lessThanEqual(vec<L, T, Q>(0), x)));
return vec<L, int, P>(x + static_cast<T>(0.5));
return vec<L, int, Q>(x + static_cast<T>(0.5));
}
template<typename genType>
@ -58,12 +58,12 @@ namespace detail
return static_cast<uint>(x + static_cast<genType>(0.5));
}
template<glm::length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, uint, P> uround(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, uint, Q> uround(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'uround' only accept floating-point inputs");
assert(all(lessThanEqual(vec<L, T, P>(0), x)));
assert(all(lessThanEqual(vec<L, T, Q>(0), x)));
return vec<L, uint, P>(x + static_cast<T>(0.5));
return vec<L, uint, Q>(x + static_cast<T>(0.5));
}
}//namespace glm

View File

@ -3,35 +3,35 @@
namespace glm
{
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> affineInverse(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> affineInverse(mat<3, 3, T, Q> const& m)
{
mat<2, 2, T, P> const Inv(inverse(mat<2, 2, T, P>(m)));
mat<2, 2, T, Q> const Inv(inverse(mat<2, 2, T, Q>(m)));
return mat<3, 3, T, P>(
vec<3, T, P>(Inv[0], static_cast<T>(0)),
vec<3, T, P>(Inv[1], static_cast<T>(0)),
vec<3, T, P>(-Inv * vec<2, T, P>(m[2]), static_cast<T>(1)));
return mat<3, 3, T, Q>(
vec<3, T, Q>(Inv[0], static_cast<T>(0)),
vec<3, T, Q>(Inv[1], static_cast<T>(0)),
vec<3, T, Q>(-Inv * vec<2, T, Q>(m[2]), static_cast<T>(1)));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> affineInverse(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> affineInverse(mat<4, 4, T, Q> const& m)
{
mat<3, 3, T, P> const Inv(inverse(mat<3, 3, T, P>(m)));
mat<3, 3, T, Q> const Inv(inverse(mat<3, 3, T, Q>(m)));
return mat<4, 4, T, P>(
vec<4, T, P>(Inv[0], static_cast<T>(0)),
vec<4, T, P>(Inv[1], static_cast<T>(0)),
vec<4, T, P>(Inv[2], static_cast<T>(0)),
vec<4, T, P>(-Inv * vec<3, T, P>(m[3]), static_cast<T>(1)));
return mat<4, 4, T, Q>(
vec<4, T, Q>(Inv[0], static_cast<T>(0)),
vec<4, T, Q>(Inv[1], static_cast<T>(0)),
vec<4, T, Q>(Inv[2], static_cast<T>(0)),
vec<4, T, Q>(-Inv * vec<3, T, Q>(m[3]), static_cast<T>(1)));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> inverseTranspose(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, Q> inverseTranspose(mat<2, 2, T, Q> const& m)
{
T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
mat<2, 2, T, P> Inverse(
mat<2, 2, T, Q> Inverse(
+ m[1][1] / Determinant,
- m[0][1] / Determinant,
- m[1][0] / Determinant,
@ -40,15 +40,15 @@ namespace glm
return Inverse;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> inverseTranspose(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> inverseTranspose(mat<3, 3, T, Q> const& m)
{
T Determinant =
+ m[0][0] * (m[1][1] * m[2][2] - m[1][2] * m[2][1])
- m[0][1] * (m[1][0] * m[2][2] - m[1][2] * m[2][0])
+ m[0][2] * (m[1][0] * m[2][1] - m[1][1] * m[2][0]);
mat<3, 3, T, P> Inverse;
mat<3, 3, T, Q> Inverse;
Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]);
Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]);
Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]);
@ -63,8 +63,8 @@ namespace glm
return Inverse;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> inverseTranspose(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> inverseTranspose(mat<4, 4, T, Q> const& m)
{
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
@ -86,7 +86,7 @@ namespace glm
T SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2];
T SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
mat<4, 4, T, P> Inverse;
mat<4, 4, T, Q> Inverse;
Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02);
Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04);
Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05);

View File

@ -52,12 +52,12 @@ namespace glm
/// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f
/// @endcode
/// @see gtc_matrix_transform
/// @see - translate(mat<4, 4, T, P> const& m, T x, T y, T z)
/// @see - translate(vec<3, T, P> const& v)
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> translate(
mat<4, 4, T, P> const& m,
vec<3, T, P> const& v);
/// @see - translate(mat<4, 4, T, Q> const& m, T x, T y, T z)
/// @see - translate(vec<3, T, Q> const& v)
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> translate(
mat<4, 4, T, Q> const& m,
vec<3, T, Q> const& v);
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
///
@ -66,13 +66,13 @@ namespace glm
/// @param axis Rotation axis, recommended to be normalized.
/// @tparam T Value type used to build the matrix. Supported: half, float or double.
/// @see gtc_matrix_transform
/// @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)
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> rotate(
mat<4, 4, T, P> const& m,
/// @see - rotate(mat<4, 4, T, Q> const& m, T angle, T x, T y, T z)
/// @see - rotate(T angle, vec<3, T, Q> const& v)
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> rotate(
mat<4, 4, T, Q> const& m,
T angle,
vec<3, T, P> const& axis);
vec<3, T, Q> const& axis);
/// Builds a scale 4 * 4 matrix created from 3 scalars.
///
@ -80,12 +80,12 @@ namespace glm
/// @param v Ratio of scaling for each axis.
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double.
/// @see gtc_matrix_transform
/// @see - scale(mat<4, 4, T, P> const& m, T x, T y, T z)
/// @see - scale(vec<3, T, P> const& v)
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> scale(
mat<4, 4, T, P> const& m,
vec<3, T, P> const& v);
/// @see - scale(mat<4, 4, T, Q> const& m, T x, T y, T z)
/// @see - scale(vec<3, T, Q> const& v)
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> scale(
mat<4, 4, T, Q> const& m,
vec<3, T, Q> const& v);
/// Creates a matrix for an orthographic parallel viewing volume, using the default handedness.
///
@ -382,12 +382,12 @@ namespace glm
/// @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.
/// @see gtc_matrix_transform
template<typename T, typename U, qualifier P>
GLM_FUNC_DECL vec<3, T, P> project(
vec<3, T, P> const& obj,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const& viewport);
template<typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> project(
vec<3, T, Q> const& obj,
mat<4, 4, T, Q> const& model,
mat<4, 4, T, Q> const& proj,
vec<4, U, Q> const& viewport);
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
///
@ -399,12 +399,12 @@ namespace glm
/// @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.
/// @see gtc_matrix_transform
template<typename T, typename U, qualifier P>
GLM_FUNC_DECL vec<3, T, P> unProject(
vec<3, T, P> const& win,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const& viewport);
template<typename T, typename U, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> unProject(
vec<3, T, Q> const& win,
mat<4, 4, T, Q> const& model,
mat<4, 4, T, Q> const& proj,
vec<4, U, Q> const& viewport);
/// Define a picking region
///
@ -414,11 +414,11 @@ namespace glm
/// @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.
/// @see gtc_matrix_transform
template<typename T, qualifier P, typename U>
GLM_FUNC_DECL mat<4, 4, T, P> pickMatrix(
vec<2, T, P> const& center,
vec<2, T, P> const& delta,
vec<4, U, P> const& viewport);
template<typename T, qualifier Q, typename U>
GLM_FUNC_DECL mat<4, 4, T, Q> pickMatrix(
vec<2, T, Q> const& center,
vec<2, T, Q> const& delta,
vec<4, U, Q> const& viewport);
/// Build a look at view matrix based on the default handedness.
///
@ -427,11 +427,11 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @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)
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> lookAt(
vec<3, T, P> const& eye,
vec<3, T, P> const& center,
vec<3, T, P> const& up);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> lookAt(
vec<3, T, Q> const& eye,
vec<3, T, Q> const& center,
vec<3, T, Q> const& up);
/// Build a right handed look at view matrix.
///
@ -440,11 +440,11 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @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)
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> lookAtRH(
vec<3, T, P> const& eye,
vec<3, T, P> const& center,
vec<3, T, P> const& up);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> lookAtRH(
vec<3, T, Q> const& eye,
vec<3, T, Q> const& center,
vec<3, T, Q> const& up);
/// Build a left handed look at view matrix.
///
@ -453,11 +453,11 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @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)
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> lookAtLH(
vec<3, T, P> const& eye,
vec<3, T, P> const& center,
vec<3, T, P> const& up);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> lookAtLH(
vec<3, T, Q> const& eye,
vec<3, T, Q> const& center,
vec<3, T, Q> const& up);
/// @}
}//namespace glm

View File

@ -7,25 +7,25 @@
namespace glm
{
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(mat<4, 4, T, P> const& m, vec<3, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> translate(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v)
{
mat<4, 4, T, P> Result(m);
mat<4, 4, T, Q> Result(m);
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
return Result;
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v)
{
T const a = angle;
T const c = cos(a);
T const s = sin(a);
vec<3, T, P> axis(normalize(v));
vec<3, T, P> temp((T(1) - c) * axis);
vec<3, T, Q> axis(normalize(v));
vec<3, T, Q> temp((T(1) - c) * axis);
mat<4, 4, T, P> Rotate;
mat<4, 4, T, Q> Rotate;
Rotate[0][0] = c + temp[0] * axis[0];
Rotate[0][1] = temp[0] * axis[1] + s * axis[2];
Rotate[0][2] = temp[0] * axis[2] - s * axis[1];
@ -38,7 +38,7 @@ namespace glm
Rotate[2][1] = temp[2] * axis[1] - s * axis[0];
Rotate[2][2] = c + temp[2] * axis[2];
mat<4, 4, T, P> Result;
mat<4, 4, T, Q> Result;
Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2];
Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2];
Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2];
@ -46,15 +46,15 @@ namespace glm
return Result;
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> rotate_slow(mat<4, 4, T, Q> const& m, T angle, vec<3, T, Q> const& v)
{
T const a = angle;
T const c = cos(a);
T const s = sin(a);
mat<4, 4, T, P> Result;
mat<4, 4, T, Q> Result;
vec<3, T, P> axis = normalize(v);
vec<3, T, Q> axis = normalize(v);
Result[0][0] = c + (static_cast<T>(1) - c) * axis.x * axis.x;
Result[0][1] = (static_cast<T>(1) - c) * axis.x * axis.y + s * axis.z;
@ -71,14 +71,14 @@ namespace glm
Result[2][2] = c + (static_cast<T>(1) - c) * axis.z * axis.z;
Result[2][3] = static_cast<T>(0);
Result[3] = vec<4, T, P>(0, 0, 0, 1);
Result[3] = vec<4, T, Q>(0, 0, 0, 1);
return m * Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(mat<4, 4, T, P> const& m, vec<3, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v)
{
mat<4, 4, T, P> Result;
mat<4, 4, T, Q> Result;
Result[0] = m[0] * v[0];
Result[1] = m[1] * v[1];
Result[2] = m[2] * v[2];
@ -86,10 +86,10 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale_slow(mat<4, 4, T, P> const& m, vec<3, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> scale_slow(mat<4, 4, T, Q> const& m, vec<3, T, Q> const& v)
{
mat<4, 4, T, P> Result(T(1));
mat<4, 4, T, Q> Result(T(1));
Result[0][0] = v.x;
Result[1][1] = v.y;
Result[2][2] = v.z;
@ -435,16 +435,16 @@ namespace glm
return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon<T>());
}
template<typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> project
template<typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> project
(
vec<3, T, P> const& obj,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const& viewport
vec<3, T, Q> const& obj,
mat<4, 4, T, Q> const& model,
mat<4, 4, T, Q> const& proj,
vec<4, U, Q> const& viewport
)
{
vec<4, T, P> tmp = vec<4, T, P>(obj, static_cast<T>(1));
vec<4, T, Q> tmp = vec<4, T, Q>(obj, static_cast<T>(1));
tmp = model * tmp;
tmp = proj * tmp;
@ -458,21 +458,21 @@ namespace glm
tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]);
tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]);
return vec<3, T, P>(tmp);
return vec<3, T, Q>(tmp);
}
template<typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> unProject
template<typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> unProject
(
vec<3, T, P> const& win,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const& viewport
vec<3, T, Q> const& win,
mat<4, 4, T, Q> const& model,
mat<4, 4, T, Q> const& proj,
vec<4, U, Q> const& viewport
)
{
mat<4, 4, T, P> Inverse = inverse(proj * model);
mat<4, 4, T, Q> Inverse = inverse(proj * model);
vec<4, T, P> tmp = vec<4, T, P>(win, T(1));
vec<4, T, Q> tmp = vec<4, T, Q>(win, T(1));
tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]);
tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]);
# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE
@ -482,33 +482,33 @@ namespace glm
tmp = tmp * static_cast<T>(2) - static_cast<T>(1);
# endif
vec<4, T, P> obj = Inverse * tmp;
vec<4, T, Q> obj = Inverse * tmp;
obj /= obj.w;
return vec<3, T, P>(obj);
return vec<3, T, Q>(obj);
}
template<typename T, qualifier 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)
template<typename T, qualifier Q, typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> pickMatrix(vec<2, T, Q> const& center, vec<2, T, Q> const& delta, vec<4, U, Q> const& viewport)
{
assert(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0));
mat<4, 4, T, P> Result(static_cast<T>(1));
mat<4, 4, T, Q> Result(static_cast<T>(1));
if(!(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0)))
return Result; // Error
vec<3, T, P> Temp(
vec<3, T, Q> Temp(
(static_cast<T>(viewport[2]) - static_cast<T>(2) * (center.x - static_cast<T>(viewport[0]))) / delta.x,
(static_cast<T>(viewport[3]) - static_cast<T>(2) * (center.y - static_cast<T>(viewport[1]))) / delta.y,
static_cast<T>(0));
// Translate and scale the picked region to the entire window
Result = translate(Result, Temp);
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, Q>(static_cast<T>(viewport[2]) / delta.x, static_cast<T>(viewport[3]) / delta.y, static_cast<T>(1)));
}
template<typename T, qualifier 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)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAt(vec<3, T, Q> const& eye, vec<3, T, Q> const& center, vec<3, T, Q> const& up)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return lookAtLH(eye, center, up);
@ -517,19 +517,19 @@ namespace glm
# endif
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtRH
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtRH
(
vec<3, T, P> const& eye,
vec<3, T, P> const& center,
vec<3, T, P> const& up
vec<3, T, Q> const& eye,
vec<3, T, Q> const& center,
vec<3, T, Q> const& up
)
{
vec<3, T, P> const f(normalize(center - eye));
vec<3, T, P> const s(normalize(cross(f, up)));
vec<3, T, P> const u(cross(s, f));
vec<3, T, Q> const f(normalize(center - eye));
vec<3, T, Q> const s(normalize(cross(f, up)));
vec<3, T, Q> const u(cross(s, f));
mat<4, 4, T, P> Result(1);
mat<4, 4, T, Q> Result(1);
Result[0][0] = s.x;
Result[1][0] = s.y;
Result[2][0] = s.z;
@ -545,19 +545,19 @@ namespace glm
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtLH
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> lookAtLH
(
vec<3, T, P> const& eye,
vec<3, T, P> const& center,
vec<3, T, P> const& up
vec<3, T, Q> const& eye,
vec<3, T, Q> const& center,
vec<3, T, Q> const& up
)
{
vec<3, T, P> const f(normalize(center - eye));
vec<3, T, P> const s(normalize(cross(up, f)));
vec<3, T, P> const u(cross(f, s));
vec<3, T, Q> const f(normalize(center - eye));
vec<3, T, Q> const s(normalize(cross(up, f)));
vec<3, T, Q> const u(cross(f, s));
mat<4, 4, T, P> Result(1);
mat<4, 4, T, Q> Result(1);
Result[0][0] = s.x;
Result[1][0] = s.y;
Result[2][0] = s.z;

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -475,20 +475,20 @@ namespace glm
/// the forth component specifies the 16 most-significant bits.
///
/// @see gtc_packing
/// @see vec<3, T, P> unpackRGBM(vec<4, T, P> const& p)
/// @see vec<3, T, Q> unpackRGBM(vec<4, T, Q> 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>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> packRGBM(vec<3, T, P> const& rgb);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> packRGBM(vec<3, T, Q> 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.
/// 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.
///
/// @see gtc_packing
/// @see vec<4, T, P> packRGBM(vec<3, float, P> const& v)
/// @see vec<4, T, Q> packRGBM(vec<3, float, Q> 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>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> unpackRGBM(vec<4, T, P> const& rgbm);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm);
/// Returns an unsigned integer vector obtained by converting the components of a floating-point vector
/// to the 16-bit floating-point representation found in the OpenGL Specification.
@ -496,48 +496,48 @@ namespace glm
/// the forth component specifies the 16 most-significant bits.
///
/// @see gtc_packing
/// @see vec<L, float, P> unpackHalf(vec<L, uint16, P> const& p)
/// @see vec<L, float, Q> unpackHalf(vec<L, uint16, Q> 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>
template<length_t L, qualifier P>
GLM_FUNC_DECL vec<L, uint16, P> packHalf(vec<L, float, P> const& v);
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, uint16, Q> packHalf(vec<L, float, Q> 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.
/// 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.
///
/// @see gtc_packing
/// @see vec<L, uint16, P> packHalf(vec<L, float, P> const& v)
/// @see vec<L, uint16, Q> packHalf(vec<L, float, Q> 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>
template<length_t L, qualifier P>
GLM_FUNC_DECL vec<L, float, P> unpackHalf(vec<L, uint16, P> const& p);
template<length_t L, qualifier Q>
GLM_FUNC_DECL vec<L, float, Q> unpackHalf(vec<L, uint16, Q> const& p);
/// Convert each component of the normalized floating-point vector into unsigned integer values.
///
/// @see gtc_packing
/// @see vec<L, floatType, P> unpackUnorm(vec<L, intType, P> const& p);
template<typename uintType, length_t L, typename floatType, qualifier P>
GLM_FUNC_DECL vec<L, uintType, P> packUnorm(vec<L, floatType, P> const& v);
/// @see vec<L, floatType, Q> unpackUnorm(vec<L, intType, Q> const& p);
template<typename uintType, length_t L, typename floatType, qualifier Q>
GLM_FUNC_DECL vec<L, uintType, Q> packUnorm(vec<L, floatType, Q> const& v);
/// Convert a packed integer to a normalized floating-point vector.
///
/// @see gtc_packing
/// @see vec<L, intType, P> packUnorm(vec<L, floatType, P> const& v)
template<typename floatType, length_t L, typename uintType, qualifier P>
GLM_FUNC_DECL vec<L, floatType, P> unpackUnorm(vec<L, uintType, P> const& v);
/// @see vec<L, intType, Q> packUnorm(vec<L, floatType, Q> const& v)
template<typename floatType, length_t L, typename uintType, qualifier Q>
GLM_FUNC_DECL vec<L, floatType, Q> unpackUnorm(vec<L, uintType, Q> const& v);
/// Convert each component of the normalized floating-point vector into signed integer values.
///
/// @see gtc_packing
/// @see vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const& p);
template<typename intType, length_t L, typename floatType, qualifier P>
GLM_FUNC_DECL vec<L, intType, P> packSnorm(vec<L, floatType, P> const& v);
/// @see vec<L, floatType, Q> unpackSnorm(vec<L, intType, Q> const& p);
template<typename intType, length_t L, typename floatType, qualifier Q>
GLM_FUNC_DECL vec<L, intType, Q> packSnorm(vec<L, floatType, Q> const& v);
/// Convert a packed integer to a normalized floating-point vector.
///
/// @see gtc_packing
/// @see vec<L, intType, P> packSnorm(vec<L, floatType, P> const& v)
template<typename floatType, length_t L, typename intType, qualifier P>
GLM_FUNC_DECL vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const& v);
/// @see vec<L, intType, Q> packSnorm(vec<L, floatType, Q> const& v)
template<typename floatType, length_t L, typename intType, qualifier Q>
GLM_FUNC_DECL vec<L, floatType, Q> unpackSnorm(vec<L, intType, Q> const& v);
/// Convert each component of the normalized floating-point vector into unsigned integer values.
///

View File

@ -271,14 +271,14 @@ namespace detail
uint32 pack;
};
template<length_t L, qualifier P>
template<length_t L, qualifier Q>
struct compute_half
{};
template<qualifier P>
struct compute_half<1, P>
template<qualifier Q>
struct compute_half<1, Q>
{
GLM_FUNC_QUALIFIER static vec<1, uint16, P> pack(vec<1, float, P> const& v)
GLM_FUNC_QUALIFIER static vec<1, uint16, Q> pack(vec<1, float, Q> const& v)
{
int16 const Unpack(detail::toFloat16(v.x));
u16vec1 Packed;
@ -286,68 +286,68 @@ namespace detail
return Packed;
}
GLM_FUNC_QUALIFIER static vec<1, float, P> unpack(vec<1, uint16, P> const& v)
GLM_FUNC_QUALIFIER static vec<1, float, Q> unpack(vec<1, uint16, Q> const& v)
{
i16vec1 Unpack;
memcpy(&Unpack, &v, sizeof(Unpack));
return vec<1, float, P>(detail::toFloat32(v.x));
return vec<1, float, Q>(detail::toFloat32(v.x));
}
};
template<qualifier P>
struct compute_half<2, P>
template<qualifier Q>
struct compute_half<2, Q>
{
GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const& v)
GLM_FUNC_QUALIFIER static vec<2, uint16, Q> pack(vec<2, float, Q> const& v)
{
vec<2, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y));
vec<2, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y));
u16vec2 Packed;
memcpy(&Packed, &Unpack, sizeof(Packed));
return Packed;
}
GLM_FUNC_QUALIFIER static vec<2, float, P> unpack(vec<2, uint16, P> const& v)
GLM_FUNC_QUALIFIER static vec<2, float, Q> unpack(vec<2, uint16, Q> const& v)
{
i16vec2 Unpack;
memcpy(&Unpack, &v, sizeof(Unpack));
return vec<2, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y));
return vec<2, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y));
}
};
template<qualifier P>
struct compute_half<3, P>
template<qualifier Q>
struct compute_half<3, Q>
{
GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const& v)
GLM_FUNC_QUALIFIER static vec<3, uint16, Q> pack(vec<3, float, Q> const& v)
{
vec<3, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z));
vec<3, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z));
u16vec3 Packed;
memcpy(&Packed, &Unpack, sizeof(Packed));
return Packed;
}
GLM_FUNC_QUALIFIER static vec<3, float, P> unpack(vec<3, uint16, P> const& v)
GLM_FUNC_QUALIFIER static vec<3, float, Q> unpack(vec<3, uint16, Q> const& v)
{
i16vec3 Unpack;
memcpy(&Unpack, &v, sizeof(Unpack));
return vec<3, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z));
return vec<3, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z));
}
};
template<qualifier P>
struct compute_half<4, P>
template<qualifier Q>
struct compute_half<4, Q>
{
GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const& v)
GLM_FUNC_QUALIFIER static vec<4, uint16, Q> pack(vec<4, float, Q> const& v)
{
vec<4, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w));
vec<4, int16, Q> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w));
u16vec4 Packed;
memcpy(&Packed, &Unpack, sizeof(Packed));
return Packed;
}
GLM_FUNC_QUALIFIER static vec<4, float, P> unpack(vec<4, uint16, P> const& v)
GLM_FUNC_QUALIFIER static vec<4, float, Q> unpack(vec<4, uint16, Q> const& v)
{
i16vec4 Unpack;
memcpy(&Unpack, &v, sizeof(Unpack));
return vec<4, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w));
return vec<4, float, Q>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w));
}
};
}//namespace detail
@ -641,67 +641,67 @@ namespace detail
}
// Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const& rgb)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> packRGBM(vec<3, T, Q> const& rgb)
{
vec<3, T, P> const Color(rgb * static_cast<T>(1.0 / 6.0));
vec<3, T, Q> const Color(rgb * static_cast<T>(1.0 / 6.0));
T Alpha = clamp(max(max(Color.x, Color.y), max(Color.z, static_cast<T>(1e-6))), static_cast<T>(0), static_cast<T>(1));
Alpha = ceil(Alpha * static_cast<T>(255.0)) / static_cast<T>(255.0);
return vec<4, T, P>(Color / Alpha, Alpha);
return vec<4, T, Q>(Color / Alpha, Alpha);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const& rgbm)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> unpackRGBM(vec<4, T, Q> const& rgbm)
{
return vec<3, T, P>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast<T>(6);
return vec<3, T, Q>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast<T>(6);
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER vec<L, uint16, P> packHalf(vec<L, float, P> const& v)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, uint16, Q> packHalf(vec<L, float, Q> const& v)
{
return detail::compute_half<L, P>::pack(v);
return detail::compute_half<L, Q>::pack(v);
}
template<length_t L, qualifier P>
GLM_FUNC_QUALIFIER vec<L, float, P> unpackHalf(vec<L, uint16, P> const& v)
template<length_t L, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, float, Q> unpackHalf(vec<L, uint16, Q> const& v)
{
return detail::compute_half<L, P>::unpack(v);
return detail::compute_half<L, Q>::unpack(v);
}
template<typename uintType, length_t L, typename floatType, qualifier P>
GLM_FUNC_QUALIFIER vec<L, uintType, P> packUnorm(vec<L, floatType, P> const& v)
template<typename uintType, length_t L, typename floatType, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, uintType, Q> packUnorm(vec<L, floatType, Q> const& v)
{
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");
return vec<L, uintType, P>(round(clamp(v, static_cast<floatType>(0), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<uintType>::max())));
return vec<L, uintType, Q>(round(clamp(v, static_cast<floatType>(0), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<uintType>::max())));
}
template<typename floatType, length_t L, typename uintType, qualifier P>
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackUnorm(vec<L, uintType, P> const& v)
template<typename floatType, length_t L, typename uintType, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, floatType, Q> unpackUnorm(vec<L, uintType, Q> const& v)
{
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");
return vec<L, float, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<uintType>::max()));
return vec<L, float, Q>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<uintType>::max()));
}
template<typename intType, length_t L, typename floatType, qualifier P>
GLM_FUNC_QUALIFIER vec<L, intType, P> packSnorm(vec<L, floatType, P> const& v)
template<typename intType, length_t L, typename floatType, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, intType, Q> packSnorm(vec<L, floatType, Q> const& v)
{
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");
return vec<L, intType, P>(round(clamp(v , static_cast<floatType>(-1), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<intType>::max())));
return vec<L, intType, Q>(round(clamp(v , static_cast<floatType>(-1), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<intType>::max())));
}
template<typename floatType, length_t L, typename intType, qualifier P>
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const& v)
template<typename floatType, length_t L, typename intType, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, floatType, Q> unpackSnorm(vec<L, intType, Q> const& v)
{
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");
return clamp(vec<L, 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(vec<L, floatType, Q>(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)

View File

@ -29,12 +29,12 @@ namespace glm
/// @addtogroup gtc_quaternion
/// @{
template<typename T, qualifier P = defaultp>
template<typename T, qualifier Q = defaultp>
struct tquat
{
// -- Implementation detail --
typedef tquat<T, P> type;
typedef tquat<T, Q> type;
typedef T value_type;
// -- Data --
@ -78,13 +78,13 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, P> const& q) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, Q> const& q) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, Q> const& q);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tquat(T s, vec<3, T, P> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR tquat(T s, vec<3, T, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR tquat(T w, T x, T y, T z);
// -- Conversion constructors --
@ -94,8 +94,8 @@ namespace glm
/// Explicit conversion operators
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
GLM_FUNC_DECL explicit operator mat<3, 3, T, P>();
GLM_FUNC_DECL explicit operator mat<4, 4, T, P>();
GLM_FUNC_DECL explicit operator mat<3, 3, T, Q>();
GLM_FUNC_DECL explicit operator mat<4, 4, T, Q>();
# endif
/// Create a quaternion from two normalized axis
@ -104,99 +104,99 @@ namespace glm
/// @param v A second normalized axis
/// @see gtc_quaternion
/// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
GLM_FUNC_DECL tquat(vec<3, T, P> const& u, vec<3, T, P> const& v);
GLM_FUNC_DECL tquat(vec<3, T, Q> const& u, vec<3, T, Q> const& v);
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, P> const& eulerAngles);
GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<3, 3, T, P> const& q);
GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<4, 4, T, P> const& q);
GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, Q> const& eulerAngles);
GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<3, 3, T, Q> const& q);
GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<4, 4, T, Q> const& q);
// -- Unary arithmetic operators --
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<T, P> const& q) GLM_DEFAULT;
GLM_FUNC_DECL tquat<T, Q> & operator=(tquat<T, Q> const& q) GLM_DEFAULT;
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<U, P> const& q);
GLM_FUNC_DECL tquat<T, Q> & operator=(tquat<U, Q> const& q);
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<U, P> const& q);
GLM_FUNC_DECL tquat<T, Q> & operator+=(tquat<U, Q> const& q);
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator-=(tquat<U, P> const& q);
GLM_FUNC_DECL tquat<T, Q> & operator-=(tquat<U, Q> const& q);
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<U, P> const& q);
GLM_FUNC_DECL tquat<T, Q> & operator*=(tquat<U, Q> const& q);
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator*=(U s);
GLM_FUNC_DECL tquat<T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator/=(U s);
GLM_FUNC_DECL tquat<T, Q> & operator/=(U s);
};
// -- Unary bit operators --
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator+(tquat<T, Q> const& q);
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> operator-(tquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator-(tquat<T, Q> const& q);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const& q, tquat<T, P> const& p);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator+(tquat<T, Q> const& q, tquat<T, Q> const& p);
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const& q, tquat<T, P> const& p);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator*(tquat<T, Q> const& q, tquat<T, Q> const& p);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator*(tquat<T, P> const& q, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator*(tquat<T, Q> const& q, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, tquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, tquat<T, Q> const& q);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator*(tquat<T, P> const& q, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator*(tquat<T, Q> const& q, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, tquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, tquat<T, Q> const& q);
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const& q, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator*(tquat<T, Q> const& q, T const& s);
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> operator*(T const& s, tquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator*(T const& s, tquat<T, Q> const& q);
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const& q, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> operator/(tquat<T, Q> const& q, T const& s);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(tquat<T, P> const& q1, tquat<T, P> const& q2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(tquat<T, Q> const& q1, tquat<T, Q> const& q2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(tquat<T, P> const& q1, tquat<T, P> const& q2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(tquat<T, Q> const& q1, tquat<T, Q> const& q2);
/// Returns the length of the quaternion.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL T length(tquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL T length(tquat<T, Q> const& q);
/// Returns the normalized quaternion.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> normalize(tquat<T, Q> const& q);
/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL T dot(tquat<T, P> const& x, tquat<T, P> const& y);
template<typename T, qualifier Q>
GLM_FUNC_DECL T dot(tquat<T, Q> const& x, tquat<T, Q> const& y);
/// Spherical linear interpolation of two quaternions.
/// The interpolation is oriented and the rotation is performed at constant speed.
@ -207,10 +207,10 @@ namespace glm
/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
/// @tparam T Floating-point scalar types.
///
/// @see - slerp(tquat<T, P> const& x, tquat<T, P> const& y, T const& a)
/// @see - slerp(tquat<T, Q> const& x, tquat<T, Q> const& y, T const& a)
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const& x, tquat<T, P> const& y, T a);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> mix(tquat<T, Q> const& x, tquat<T, Q> const& y, T a);
/// Linear interpolation of two quaternions.
/// The interpolation is oriented.
@ -221,8 +221,8 @@ namespace glm
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const& x, tquat<T, P> const& y, T a);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> lerp(tquat<T, Q> const& x, tquat<T, Q> const& y, T a);
/// Spherical linear interpolation of two quaternions.
/// The interpolation always take the short path and the rotation is performed at constant speed.
@ -233,24 +233,24 @@ namespace glm
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const& x, tquat<T, P> const& y, T a);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> slerp(tquat<T, Q> const& x, tquat<T, Q> const& y, T a);
/// Returns the q conjugate.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> conjugate(tquat<T, Q> const& q);
/// Returns the q inverse.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> inverse(tquat<T, Q> const& q);
/// Rotates a quaternion from a vector of 3 components axis and an angle.
///
@ -260,8 +260,8 @@ namespace glm
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const& q, T const& angle, vec<3, T, P> const& axis);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> rotate(tquat<T, Q> const& q, T const& angle, vec<3, T, Q> const& axis);
/// Returns euler angles, pitch as x, yaw as y, roll as z.
/// The result is expressed in radians.
@ -269,80 +269,80 @@ namespace glm
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> eulerAngles(tquat<T, Q> const& x);
/// Returns roll value of euler angles expressed in radians.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL T roll(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL T roll(tquat<T, Q> const& x);
/// Returns pitch value of euler angles expressed in radians.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL T pitch(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL T pitch(tquat<T, Q> const& x);
/// Returns yaw value of euler angles expressed in radians.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL T yaw(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL T yaw(tquat<T, Q> const& x);
/// Converts a quaternion to a 3 * 3 matrix.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 3, T, P> mat3_cast(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 3, T, Q> mat3_cast(tquat<T, Q> const& x);
/// Converts a quaternion to a 4 * 4 matrix.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL mat<4, 4, T, P> mat4_cast(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<4, 4, T, Q> mat4_cast(tquat<T, Q> const& x);
/// Converts a 3 * 3 matrix to a quaternion.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> quat_cast(mat<3, 3, T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> quat_cast(mat<3, 3, T, Q> const& x);
/// Converts a 4 * 4 matrix to a quaternion.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> quat_cast(mat<4, 4, T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> quat_cast(mat<4, 4, T, Q> const& x);
/// Returns the quaternion rotation angle.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL T angle(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL T angle(tquat<T, Q> const& x);
/// Returns the q rotation axis.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> axis(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> axis(tquat<T, Q> const& x);
/// Build a quaternion from an angle and a normalized axis.
///
@ -351,56 +351,56 @@ namespace glm
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tquat<T, P> angleAxis(T const& angle, vec<3, T, P> const& axis);
template<typename T, qualifier Q>
GLM_FUNC_DECL tquat<T, Q> angleAxis(T const& angle, vec<3, T, Q> const& axis);
/// Returns the component-wise comparison result of x < y.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, bool, P> lessThan(tquat<T, P> const& x, tquat<T, P> const& y);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> lessThan(tquat<T, Q> const& x, tquat<T, Q> const& y);
/// Returns the component-wise comparison of result x <= y.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, bool, P> lessThanEqual(tquat<T, P> const& x, tquat<T, P> const& y);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> lessThanEqual(tquat<T, Q> const& x, tquat<T, Q> const& y);
/// Returns the component-wise comparison of result x > y.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, bool, P> greaterThan(tquat<T, P> const& x, tquat<T, P> const& y);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> greaterThan(tquat<T, Q> const& x, tquat<T, Q> const& y);
/// Returns the component-wise comparison of result x >= y.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, bool, P> greaterThanEqual(tquat<T, P> const& x, tquat<T, P> const& y);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> greaterThanEqual(tquat<T, Q> const& x, tquat<T, Q> const& y);
/// Returns the component-wise comparison of result x == y.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, bool, P> equal(tquat<T, P> const& x, tquat<T, P> const& y);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> equal(tquat<T, Q> const& x, tquat<T, Q> const& y);
/// Returns the component-wise comparison of result x != y.
///
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, bool, P> notEqual(tquat<T, P> const& x, tquat<T, P> const& y);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> notEqual(tquat<T, Q> const& x, tquat<T, Q> const& y);
/// Returns true if x holds a NaN (not a number)
/// representation in the underlying implementation's set of
@ -413,8 +413,8 @@ namespace glm
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, bool, P> isnan(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> isnan(tquat<T, Q> const& x);
/// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's
@ -425,8 +425,8 @@ namespace glm
/// @tparam T Floating-point scalar types.
///
/// @see gtc_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, bool, P> isinf(tquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, bool, Q> isinf(tquat<T, Q> const& x);
/// @}
} //namespace glm

View File

@ -11,73 +11,73 @@
namespace glm{
namespace detail
{
template<typename T, qualifier P, bool Aligned>
struct compute_dot<tquat<T, P>, T, Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_dot<tquat<T, Q>, 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, Q> const& a, tquat<T, Q> const& b)
{
vec<4, T, P> tmp(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
vec<4, T, Q> tmp(a.x * b.x, a.y * b.y, a.z * b.z, a.w * b.w);
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
}
};
template<typename T, qualifier P, bool Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_quat_add
{
static tquat<T, P> call(tquat<T, P> const& q, tquat<T, P> const& p)
static tquat<T, Q> call(tquat<T, Q> const& q, tquat<T, Q> const& p)
{
return tquat<T, P>(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z);
return tquat<T, Q>(q.w + p.w, q.x + p.x, q.y + p.y, q.z + p.z);
}
};
template<typename T, qualifier P, bool Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_quat_sub
{
static tquat<T, P> call(tquat<T, P> const& q, tquat<T, P> const& p)
static tquat<T, Q> call(tquat<T, Q> const& q, tquat<T, Q> const& p)
{
return tquat<T, P>(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z);
return tquat<T, Q>(q.w - p.w, q.x - p.x, q.y - p.y, q.z - p.z);
}
};
template<typename T, qualifier P, bool Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_quat_mul_scalar
{
static tquat<T, P> call(tquat<T, P> const& q, T s)
static tquat<T, Q> call(tquat<T, Q> const& q, T s)
{
return tquat<T, P>(q.w * s, q.x * s, q.y * s, q.z * s);
return tquat<T, Q>(q.w * s, q.x * s, q.y * s, q.z * s);
}
};
template<typename T, qualifier P, bool Aligned>
template<typename T, qualifier Q, bool Aligned>
struct compute_quat_div_scalar
{
static tquat<T, P> call(tquat<T, P> const& q, T s)
static tquat<T, Q> call(tquat<T, Q> const& q, T s)
{
return tquat<T, P>(q.w / s, q.x / s, q.y / s, q.z / s);
return tquat<T, Q>(q.w / s, q.x / s, q.y / s, q.z / s);
}
};
template<typename T, qualifier P, bool Aligned>
template<typename T, qualifier Q, bool Aligned>
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, Q> call(tquat<T, Q> const& q, vec<4, T, Q> const& v)
{
return vec<4, T, P>(q * vec<3, T, P>(v), v.w);
return vec<4, T, Q>(q * vec<3, T, Q>(v), v.w);
}
};
}//namespace detail
// -- Component accesses --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T & tquat<T, P>::operator[](typename tquat<T, P>::length_type i)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T & tquat<T, Q>::operator[](typename tquat<T, Q>::length_type i)
{
assert(i >= 0 && i < this->length());
return (&x)[i];
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const& tquat<T, P>::operator[](typename tquat<T, P>::length_type i) const
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const& tquat<T, Q>::operator[](typename tquat<T, Q>::length_type i) const
{
assert(i >= 0 && i < this->length());
return (&x)[i];
@ -86,41 +86,41 @@ namespace detail
// -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::tquat()
{}
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::tquat(tquat<T, Q> const& q)
: x(q.x), y(q.y), z(q.z), w(q.w)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<T, Q> const& q)
template<typename T, qualifier Q>
template<qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::tquat(tquat<T, P> const& q)
: x(q.x), y(q.y), z(q.z), w(q.w)
{}
// -- Explicit basic constructors --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(T s, vec<3, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::tquat(T s, vec<3, T, Q> const& v)
: x(v.x), y(v.y), z(v.z), w(s)
{}
template <typename T, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(T _w, T _x, T _y, T _z)
template <typename T, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::tquat(T _w, T _x, T _y, T _z)
: x(_x), y(_y), z(_z), w(_w)
{}
// -- Conversion constructors --
template<typename T, qualifier P>
template<typename U, qualifier Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, P>::tquat(tquat<U, Q> const& q)
template<typename T, qualifier Q>
template<typename U, qualifier P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tquat<T, Q>::tquat(tquat<U, P> const& q)
: x(static_cast<T>(q.x))
, y(static_cast<T>(q.y))
, z(static_cast<T>(q.z))
@ -145,21 +145,21 @@ namespace detail
// this->z = c.x * c.y * s.z - s.x * s.y * c.z;
//}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(vec<3, T, P> const& u, vec<3, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q>::tquat(vec<3, T, Q> const& u, vec<3, T, Q> const& v)
{
vec<3, T, P> const LocalW(cross(u, v));
T Dot = detail::compute_dot<vec<3, T, P>, T, detail::is_aligned<P>::value>::call(u, v);
tquat<T, P> q(T(1) + Dot, LocalW.x, LocalW.y, LocalW.z);
vec<3, T, Q> const LocalW(cross(u, v));
T Dot = detail::compute_dot<vec<3, T, Q>, T, detail::is_aligned<Q>::value>::call(u, v);
tquat<T, Q> q(T(1) + Dot, LocalW.x, LocalW.y, LocalW.z);
*this = normalize(q);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(vec<3, T, P> const& eulerAngle)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q>::tquat(vec<3, T, Q> const& eulerAngle)
{
vec<3, T, P> c = glm::cos(eulerAngle * T(0.5));
vec<3, T, P> s = glm::sin(eulerAngle * T(0.5));
vec<3, T, Q> c = glm::cos(eulerAngle * T(0.5));
vec<3, T, Q> s = glm::sin(eulerAngle * T(0.5));
this->w = c.x * c.y * c.z + s.x * s.y * s.z;
this->x = s.x * c.y * c.z - c.x * s.y * s.z;
@ -167,40 +167,40 @@ namespace detail
this->z = c.x * c.y * s.z - s.x * s.y * c.z;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q>::tquat(mat<3, 3, T, Q> const& m)
{
*this = quat_cast(m);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q>::tquat(mat<4, 4, T, Q> const& m)
{
*this = quat_cast(m);
}
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P>::operator mat<3, 3, T, P>()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q>::operator mat<3, 3, T, Q>()
{
return mat3_cast(*this);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P>::operator mat<4, 4, T, P>()
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q>::operator mat<4, 4, T, Q>()
{
return mat4_cast(*this);
}
# endif//GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> conjugate(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> conjugate(tquat<T, Q> const& q)
{
return tquat<T, P>(q.w, -q.x, -q.y, -q.z);
return tquat<T, Q>(q.w, -q.x, -q.y, -q.z);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> inverse(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> inverse(tquat<T, Q> const& q)
{
return conjugate(q) / dot(q, q);
}
@ -208,8 +208,8 @@ namespace detail
// -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> & tquat<T, Q>::operator=(tquat<T, Q> const& q)
{
this->w = q.w;
this->x = q.x;
@ -219,9 +219,9 @@ namespace detail
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator=(tquat<U, P> const& q)
GLM_FUNC_QUALIFIER tquat<T, Q> & tquat<T, Q>::operator=(tquat<U, Q> const& q)
{
this->w = static_cast<T>(q.w);
this->x = static_cast<T>(q.x);
@ -230,26 +230,26 @@ namespace detail
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator+=(tquat<U, P> const& q)
GLM_FUNC_QUALIFIER tquat<T, Q> & tquat<T, Q>::operator+=(tquat<U, Q> 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, Q, detail::is_aligned<Q>::value>::call(*this, tquat<T, Q>(q)));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator-=(tquat<U, P> const& q)
GLM_FUNC_QUALIFIER tquat<T, Q> & tquat<T, Q>::operator-=(tquat<U, Q> 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, Q, detail::is_aligned<Q>::value>::call(*this, tquat<T, Q>(q)));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(tquat<U, P> const& r)
GLM_FUNC_QUALIFIER tquat<T, Q> & tquat<T, Q>::operator*=(tquat<U, Q> const& r)
{
tquat<T, P> const p(*this);
tquat<T, P> const q(r);
tquat<T, Q> const p(*this);
tquat<T, Q> const q(r);
this->w = p.w * q.w - p.x * q.x - p.y * q.y - p.z * q.z;
this->x = p.w * q.x + p.x * q.w + p.y * q.z - p.z * q.y;
@ -258,132 +258,132 @@ namespace detail
return *this;
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator*=(U s)
GLM_FUNC_QUALIFIER tquat<T, Q> & tquat<T, Q>::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, Q, detail::is_aligned<Q>::value>::call(*this, static_cast<U>(s)));
}
template<typename T, qualifier P>
template<typename T, qualifier Q>
template<typename U>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator/=(U s)
GLM_FUNC_QUALIFIER tquat<T, Q> & tquat<T, Q>::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, Q, detail::is_aligned<Q>::value>::call(*this, static_cast<U>(s)));
}
// -- Unary bit operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> operator+(tquat<T, Q> const& q)
{
return q;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> operator-(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> operator-(tquat<T, Q> const& q)
{
return tquat<T, P>(-q.w, -q.x, -q.y, -q.z);
return tquat<T, Q>(-q.w, -q.x, -q.y, -q.z);
}
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> operator+(tquat<T, P> const& q, tquat<T, P> const& p)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> operator+(tquat<T, Q> const& q, tquat<T, Q> const& p)
{
return tquat<T, P>(q) += p;
return tquat<T, Q>(q) += p;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const& q, tquat<T, P> const& p)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> operator*(tquat<T, Q> const& q, tquat<T, Q> const& p)
{
return tquat<T, P>(q) *= p;
return tquat<T, Q>(q) *= p;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(tquat<T, P> const& q, vec<3, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(tquat<T, Q> const& q, vec<3, T, Q> const& v)
{
vec<3, T, P> const QuatVector(q.x, q.y, q.z);
vec<3, T, P> const uv(glm::cross(QuatVector, v));
vec<3, T, P> const uuv(glm::cross(QuatVector, uv));
vec<3, T, Q> const QuatVector(q.x, q.y, q.z);
vec<3, T, Q> const uv(glm::cross(QuatVector, v));
vec<3, T, Q> const uuv(glm::cross(QuatVector, uv));
return v + ((uv * q.w) + uuv) * static_cast<T>(2);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> operator*(vec<3, T, P> const& v, tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> operator*(vec<3, T, Q> const& v, tquat<T, Q> const& q)
{
return glm::inverse(q) * v;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(tquat<T, P> const& q, vec<4, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(tquat<T, Q> const& q, vec<4, T, Q> 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, Q, detail::is_aligned<Q>::value>::call(q, v);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> operator*(vec<4, T, P> const& v, tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> operator*(vec<4, T, Q> const& v, tquat<T, Q> const& q)
{
return glm::inverse(q) * v;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> operator*(tquat<T, P> const& q, T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> operator*(tquat<T, Q> const& q, T const& s)
{
return tquat<T, P>(
return tquat<T, Q>(
q.w * s, q.x * s, q.y * s, q.z * s);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> operator*(T const& s, tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> operator*(T const& s, tquat<T, Q> const& q)
{
return q * s;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> operator/(tquat<T, P> const& q, T const& s)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> operator/(tquat<T, Q> const& q, T const& s)
{
return tquat<T, P>(
return tquat<T, Q>(
q.w / s, q.x / s, q.y / s, q.z / s);
}
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator==(tquat<T, P> const& q1, tquat<T, P> const& q2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator==(tquat<T, Q> const& q1, tquat<T, Q> const& q2)
{
return all(epsilonEqual(q1, q2, epsilon<T>()));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER bool operator!=(tquat<T, P> const& q1, tquat<T, P> const& q2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER bool operator!=(tquat<T, Q> const& q1, tquat<T, Q> const& q2)
{
return any(epsilonNotEqual(q1, q2, epsilon<T>()));
}
// -- Operations --
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T length(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T length(tquat<T, Q> const& q)
{
return glm::sqrt(dot(q, q));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> normalize(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> normalize(tquat<T, Q> const& q)
{
T len = length(q);
if(len <= T(0)) // Problem
return tquat<T, P>(static_cast<T>(1), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0));
return tquat<T, Q>(static_cast<T>(1), static_cast<T>(0), static_cast<T>(0), static_cast<T>(0));
T oneOverLen = T(1) / len;
return tquat<T, P>(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen);
return tquat<T, Q>(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> cross(tquat<T, P> const& q1, tquat<T, P> const& q2)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> cross(tquat<T, Q> const& q1, tquat<T, Q> const& q2)
{
return tquat<T, P>(
return tquat<T, Q>(
q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z,
q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y,
q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z,
@ -391,14 +391,14 @@ namespace detail
}
/*
// (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle))
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const& x, tquat<T, P> const& y, T const& a)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> mix(tquat<T, Q> const& x, tquat<T, Q> const& y, T const& a)
{
if(a <= T(0)) return x;
if(a >= T(1)) return y;
float fCos = dot(x, y);
tquat<T, P> y2(y); //BUG!!! tquat<T, P> y2;
tquat<T, Q> y2(y); //BUG!!! tquat<T, Q> y2;
if(fCos < T(0))
{
y2 = -y;
@ -421,18 +421,18 @@ namespace detail
k1 = sin((T(0) + a) * fAngle) * fOneOverSin;
}
return tquat<T, P>(
return tquat<T, Q>(
k0 * x.w + k1 * y2.w,
k0 * x.x + k1 * y2.x,
k0 * x.y + k1 * y2.y,
k0 * x.z + k1 * y2.z);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> mix2
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> mix2
(
tquat<T, P> const& x,
tquat<T, P> const& y,
tquat<T, Q> const& x,
tquat<T, Q> const& y,
T const& a
)
{
@ -466,8 +466,8 @@ namespace detail
}
*/
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> mix(tquat<T, P> const& x, tquat<T, P> const& y, T a)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> mix(tquat<T, Q> const& x, tquat<T, Q> const& y, T a)
{
T cosTheta = dot(x, y);
@ -475,7 +475,7 @@ namespace detail
if(cosTheta > T(1) - epsilon<T>())
{
// Linear interpolation
return tquat<T, P>(
return tquat<T, Q>(
mix(x.w, y.w, a),
mix(x.x, y.x, a),
mix(x.y, y.y, a),
@ -489,8 +489,8 @@ namespace detail
}
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> lerp(tquat<T, P> const& x, tquat<T, P> const& y, T a)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> lerp(tquat<T, Q> const& x, tquat<T, Q> const& y, T a)
{
// Lerp is only defined in [0, 1]
assert(a >= static_cast<T>(0));
@ -499,10 +499,10 @@ namespace detail
return x * (T(1) - a) + (y * a);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> slerp(tquat<T, P> const& x, tquat<T, P> const& y, T a)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> slerp(tquat<T, Q> const& x, tquat<T, Q> const& y, T a)
{
tquat<T, P> z = y;
tquat<T, Q> z = y;
T cosTheta = dot(x, y);
@ -518,7 +518,7 @@ namespace detail
if(cosTheta > T(1) - epsilon<T>())
{
// Linear interpolation
return tquat<T, P>(
return tquat<T, Q>(
mix(x.w, z.w, a),
mix(x.x, z.x, a),
mix(x.y, z.y, a),
@ -532,10 +532,10 @@ namespace detail
}
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> rotate(tquat<T, P> const& q, T const& angle, vec<3, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> rotate(tquat<T, Q> const& q, T const& angle, vec<3, T, Q> const& v)
{
vec<3, T, P> Tmp = v;
vec<3, T, Q> Tmp = v;
// Axis of rotation must be normalised
T len = glm::length(Tmp);
@ -550,24 +550,24 @@ namespace detail
T const AngleRad(angle);
T const Sin = sin(AngleRad * T(0.5));
return q * tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin);
//return gtc::quaternion::cross(q, tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin));
return q * tquat<T, Q>(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin);
//return gtc::quaternion::cross(q, tquat<T, Q>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> eulerAngles(tquat<T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> eulerAngles(tquat<T, Q> const& x)
{
return vec<3, T, P>(pitch(x), yaw(x), roll(x));
return vec<3, T, Q>(pitch(x), yaw(x), roll(x));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T roll(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T roll(tquat<T, Q> const& q)
{
return static_cast<T>(atan(static_cast<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, qualifier P>
GLM_FUNC_QUALIFIER T pitch(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T pitch(tquat<T, Q> 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));
const T y = static_cast<T>(2) * (q.y * q.z + q.w * q.x);
@ -579,16 +579,16 @@ namespace detail
return static_cast<T>(atan(y,x));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T yaw(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T yaw(tquat<T, Q> const& q)
{
return asin(clamp(static_cast<T>(-2) * (q.x * q.z - q.w * q.y), static_cast<T>(-1), static_cast<T>(1)));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat3_cast(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, Q> mat3_cast(tquat<T, Q> const& q)
{
mat<3, 3, T, P> Result(T(1));
mat<3, 3, T, Q> Result(T(1));
T qxx(q.x * q.x);
T qyy(q.y * q.y);
T qzz(q.z * q.z);
@ -613,14 +613,14 @@ namespace detail
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat4_cast(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, Q> mat4_cast(tquat<T, Q> const& q)
{
return mat<4, 4, T, P>(mat3_cast(q));
return mat<4, 4, T, Q>(mat3_cast(q));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> quat_cast(mat<3, 3, T, Q> const& m)
{
T fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2];
T fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2];
@ -648,7 +648,7 @@ namespace detail
T biggestVal = sqrt(fourBiggestSquaredMinus1 + static_cast<T>(1)) * static_cast<T>(0.5);
T mult = static_cast<T>(0.25) / biggestVal;
tquat<T, P> Result;
tquat<T, Q> Result;
switch(biggestIndex)
{
case 0:
@ -683,32 +683,32 @@ namespace detail
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> quat_cast(mat<4, 4, T, P> const& m4)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> quat_cast(mat<4, 4, T, Q> const& m4)
{
return quat_cast(mat<3, 3, T, P>(m4));
return quat_cast(mat<3, 3, T, Q>(m4));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T angle(tquat<T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T angle(tquat<T, Q> const& x)
{
return acos(x.w) * static_cast<T>(2);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> axis(tquat<T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> axis(tquat<T, Q> const& x)
{
T tmp1 = static_cast<T>(1) - x.w * x.w;
if(tmp1 <= static_cast<T>(0))
return vec<3, T, P>(0, 0, 1);
return vec<3, T, Q>(0, 0, 1);
T tmp2 = static_cast<T>(1) / sqrt(tmp1);
return vec<3, T, P>(x.x * tmp2, x.y * tmp2, x.z * tmp2);
return vec<3, T, Q>(x.x * tmp2, x.y * tmp2, x.z * tmp2);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER tquat<T, P> angleAxis(T const& angle, vec<3, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER tquat<T, Q> angleAxis(T const& angle, vec<3, T, Q> const& v)
{
tquat<T, P> Result;
tquat<T, Q> Result;
T const a(angle);
T const s = glm::sin(a * static_cast<T>(0.5));
@ -720,74 +720,74 @@ namespace detail
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThan(tquat<T, P> const& x, tquat<T, P> const& y)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThan(tquat<T, Q> const& x, tquat<T, Q> const& y)
{
vec<4, bool, P> Result;
vec<4, bool, Q> Result;
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] < y[i];
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> lessThanEqual(tquat<T, P> const& x, tquat<T, P> const& y)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> lessThanEqual(tquat<T, Q> const& x, tquat<T, Q> const& y)
{
vec<4, bool, P> Result;
vec<4, bool, Q> Result;
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] <= y[i];
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThan(tquat<T, P> const& x, tquat<T, P> const& y)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThan(tquat<T, Q> const& x, tquat<T, Q> const& y)
{
vec<4, bool, P> Result;
vec<4, bool, Q> Result;
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] > y[i];
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> greaterThanEqual(tquat<T, P> const& x, tquat<T, P> const& y)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> greaterThanEqual(tquat<T, Q> const& x, tquat<T, Q> const& y)
{
vec<4, bool, P> Result;
vec<4, bool, Q> Result;
for(length_t i = 0; i < x.length(); ++i)
Result[i] = x[i] >= y[i];
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> equal(tquat<T, P> const& x, tquat<T, P> const& y)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> equal(tquat<T, Q> const& x, tquat<T, Q> const& y)
{
vec<4, bool, P> Result;
vec<4, bool, Q> Result;
for(length_t i = 0; i < x.length(); ++i)
Result[i] = detail::compute_equal<T>::call(x[i], y[i]);
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> notEqual(tquat<T, P> const& x, tquat<T, P> const& y)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> notEqual(tquat<T, Q> const& x, tquat<T, Q> const& y)
{
vec<4, bool, P> Result;
vec<4, bool, Q> Result;
for(length_t i = 0; i < x.length(); ++i)
Result[i] = !detail::compute_equal<T>::call(x[i], y[i]);
return Result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> isnan(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(tquat<T, Q> const& q)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
return vec<4, bool, P>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w));
return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> isinf(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(tquat<T, Q> const& q)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
return vec<4, bool, P>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w));
return vec<4, bool, Q>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w));
}
}//namespace glm

View File

@ -7,10 +7,10 @@ namespace glm{
namespace detail
{
/*
template<qualifier P>
template<qualifier Q>
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, Q> const& q1, tquat<float, Q> const& q2)
{
// SSE2 STATS: 11 shuffle, 8 mul, 8 add
// SSE4 STATS: 3 shuffle, 4 mul, 4 dpps
@ -61,19 +61,19 @@ namespace detail
};
*/
template<qualifier P>
template<qualifier Q>
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, Q> const& x, tquat<float, Q> const& y)
{
return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data));
}
};
template<qualifier P>
template<qualifier Q>
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, Q> const& q, tquat<float, Q> const& p)
{
tquat<float, P> Result;
Result.data = _mm_add_ps(q.data, p.data);
@ -82,10 +82,10 @@ namespace detail
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier P>
template<qualifier Q>
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, Q> const& a, tquat<double, Q> const& b)
{
tquat<double, P> Result;
Result.data = _mm256_add_pd(a.data, b.data);
@ -94,10 +94,10 @@ namespace detail
};
# endif
template<qualifier P>
template<qualifier Q>
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, Q> const& q, tquat<float, Q> const& p)
{
vec<4, float, P> Result;
Result.data = _mm_sub_ps(q.data, p.data);
@ -106,10 +106,10 @@ namespace detail
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier P>
template<qualifier Q>
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, Q> const& a, tquat<double, Q> const& b)
{
tquat<double, P> Result;
Result.data = _mm256_sub_pd(a.data, b.data);
@ -118,10 +118,10 @@ namespace detail
};
# endif
template<qualifier P>
template<qualifier Q>
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, Q> const& q, float s)
{
vec<4, float, P> Result;
Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s));
@ -130,10 +130,10 @@ namespace detail
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier P>
template<qualifier Q>
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, Q> const& q, double s)
{
tquat<double, P> Result;
Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s));
@ -142,10 +142,10 @@ namespace detail
};
# endif
template<qualifier P>
template<qualifier Q>
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, Q> const& q, float s)
{
vec<4, float, P> Result;
Result.data = _mm_div_ps(q.data, _mm_set_ps1(s));
@ -154,10 +154,10 @@ namespace detail
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template<qualifier P>
template<qualifier Q>
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, Q> const& q, double s)
{
tquat<double, P> Result;
Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s));
@ -166,10 +166,10 @@ namespace detail
};
# endif
template<qualifier P>
template<qualifier Q>
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, Q> const& q, vec<4, float, Q> const& v)
{
__m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3));
__m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1));

View File

@ -42,8 +42,8 @@ namespace glm
/// @tparam T Value type. Currently supported: float or double.
///
/// @see gtc_random
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> linearRand(vec<L, T, P> const& Min, vec<L, T, P> const& Max);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> linearRand(vec<L, T, Q> const& Min, vec<L, T, Q> const& Max);
/// Generate random numbers in the interval [Min, Max], according a gaussian distribution
///

View File

@ -12,10 +12,10 @@
namespace glm{
namespace detail
{
template <length_t L, typename T, qualifier P>
template <length_t L, typename T, qualifier Q>
struct compute_rand
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call();
GLM_FUNC_QUALIFIER static vec<L, T, Q> call();
};
template <qualifier P>
@ -64,114 +64,114 @@ namespace detail
}
};
template <length_t L, qualifier P>
struct compute_rand<L, uint16, P>
template <length_t L, qualifier Q>
struct compute_rand<L, uint16, Q>
{
GLM_FUNC_QUALIFIER static vec<L, uint16, P> call()
GLM_FUNC_QUALIFIER static vec<L, uint16, Q> call()
{
return
(vec<L, uint16, P>(compute_rand<L, uint8, P>::call()) << static_cast<uint16>(8)) |
(vec<L, uint16, P>(compute_rand<L, uint8, P>::call()) << static_cast<uint16>(0));
(vec<L, uint16, Q>(compute_rand<L, uint8, Q>::call()) << static_cast<uint16>(8)) |
(vec<L, uint16, Q>(compute_rand<L, uint8, Q>::call()) << static_cast<uint16>(0));
}
};
template <length_t L, qualifier P>
struct compute_rand<L, uint32, P>
template <length_t L, qualifier Q>
struct compute_rand<L, uint32, Q>
{
GLM_FUNC_QUALIFIER static vec<L, uint32, P> call()
GLM_FUNC_QUALIFIER static vec<L, uint32, Q> call()
{
return
(vec<L, uint32, P>(compute_rand<L, uint16, P>::call()) << static_cast<uint32>(16)) |
(vec<L, uint32, P>(compute_rand<L, uint16, P>::call()) << static_cast<uint32>(0));
(vec<L, uint32, Q>(compute_rand<L, uint16, Q>::call()) << static_cast<uint32>(16)) |
(vec<L, uint32, Q>(compute_rand<L, uint16, Q>::call()) << static_cast<uint32>(0));
}
};
template <length_t L, qualifier P>
struct compute_rand<L, uint64, P>
template <length_t L, qualifier Q>
struct compute_rand<L, uint64, Q>
{
GLM_FUNC_QUALIFIER static vec<L, uint64, P> call()
GLM_FUNC_QUALIFIER static vec<L, uint64, Q> call()
{
return
(vec<L, uint64, P>(compute_rand<L, uint32, P>::call()) << static_cast<uint64>(32)) |
(vec<L, uint64, P>(compute_rand<L, uint32, P>::call()) << static_cast<uint64>(0));
(vec<L, uint64, Q>(compute_rand<L, uint32, Q>::call()) << static_cast<uint64>(32)) |
(vec<L, uint64, Q>(compute_rand<L, uint32, Q>::call()) << static_cast<uint64>(0));
}
};
template <length_t L, typename T, qualifier P>
template <length_t L, typename T, qualifier Q>
struct compute_linearRand
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& Min, vec<L, T, P> const& Max);
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& Min, vec<L, T, Q> const& Max);
};
template<length_t L, qualifier P>
struct compute_linearRand<L, int8, P>
template<length_t L, qualifier Q>
struct compute_linearRand<L, int8, Q>
{
GLM_FUNC_QUALIFIER static vec<L, int8, P> call(vec<L, int8, P> const& Min, vec<L, int8, P> const& Max)
GLM_FUNC_QUALIFIER static vec<L, int8, Q> call(vec<L, int8, Q> const& Min, vec<L, int8, Q> const& Max)
{
return (vec<L, int8, P>(compute_rand<L, uint8, P>::call() % vec<L, uint8, P>(Max + static_cast<int8>(1) - Min))) + Min;
return (vec<L, int8, Q>(compute_rand<L, uint8, Q>::call() % vec<L, uint8, Q>(Max + static_cast<int8>(1) - Min))) + Min;
}
};
template<length_t L, qualifier P>
struct compute_linearRand<L, uint8, P>
template<length_t L, qualifier Q>
struct compute_linearRand<L, uint8, Q>
{
GLM_FUNC_QUALIFIER static vec<L, uint8, P> call(vec<L, uint8, P> const& Min, vec<L, uint8, P> const& Max)
GLM_FUNC_QUALIFIER static vec<L, uint8, Q> call(vec<L, uint8, Q> const& Min, vec<L, uint8, Q> const& Max)
{
return (compute_rand<L, uint8, P>::call() % (Max + static_cast<uint8>(1) - Min)) + Min;
return (compute_rand<L, uint8, Q>::call() % (Max + static_cast<uint8>(1) - Min)) + Min;
}
};
template<length_t L, qualifier P>
struct compute_linearRand<L, int16, P>
template<length_t L, qualifier Q>
struct compute_linearRand<L, int16, Q>
{
GLM_FUNC_QUALIFIER static vec<L, int16, P> call(vec<L, int16, P> const& Min, vec<L, int16, P> const& Max)
GLM_FUNC_QUALIFIER static vec<L, int16, Q> call(vec<L, int16, Q> const& Min, vec<L, int16, Q> const& Max)
{
return (vec<L, int16, P>(compute_rand<L, uint16, P>::call() % vec<L, uint16, P>(Max + static_cast<int16>(1) - Min))) + Min;
return (vec<L, int16, Q>(compute_rand<L, uint16, Q>::call() % vec<L, uint16, Q>(Max + static_cast<int16>(1) - Min))) + Min;
}
};
template<length_t L, qualifier P>
struct compute_linearRand<L, uint16, P>
template<length_t L, qualifier Q>
struct compute_linearRand<L, uint16, Q>
{
GLM_FUNC_QUALIFIER static vec<L, uint16, P> call(vec<L, uint16, P> const& Min, vec<L, uint16, P> const& Max)
GLM_FUNC_QUALIFIER static vec<L, uint16, Q> call(vec<L, uint16, Q> const& Min, vec<L, uint16, Q> const& Max)
{
return (compute_rand<L, uint16, P>::call() % (Max + static_cast<uint16>(1) - Min)) + Min;
return (compute_rand<L, uint16, Q>::call() % (Max + static_cast<uint16>(1) - Min)) + Min;
}
};
template<length_t L, qualifier P>
struct compute_linearRand<L, int32, P>
template<length_t L, qualifier Q>
struct compute_linearRand<L, int32, Q>
{
GLM_FUNC_QUALIFIER static vec<L, int32, P> call(vec<L, int32, P> const& Min, vec<L, int32, P> const& Max)
GLM_FUNC_QUALIFIER static vec<L, int32, Q> call(vec<L, int32, Q> const& Min, vec<L, int32, Q> const& Max)
{
return (vec<L, int32, P>(compute_rand<L, uint32, P>::call() % vec<L, uint32, P>(Max + static_cast<int32>(1) - Min))) + Min;
return (vec<L, int32, Q>(compute_rand<L, uint32, Q>::call() % vec<L, uint32, Q>(Max + static_cast<int32>(1) - Min))) + Min;
}
};
template<length_t L, qualifier P>
struct compute_linearRand<L, uint32, P>
template<length_t L, qualifier Q>
struct compute_linearRand<L, uint32, Q>
{
GLM_FUNC_QUALIFIER static vec<L, uint32, P> call(vec<L, uint32, P> const& Min, vec<L, uint32, P> const& Max)
GLM_FUNC_QUALIFIER static vec<L, uint32, Q> call(vec<L, uint32, Q> const& Min, vec<L, uint32, Q> const& Max)
{
return (compute_rand<L, uint32, P>::call() % (Max + static_cast<uint32>(1) - Min)) + Min;
return (compute_rand<L, uint32, Q>::call() % (Max + static_cast<uint32>(1) - Min)) + Min;
}
};
template<length_t L, qualifier P>
struct compute_linearRand<L, int64, P>
template<length_t L, qualifier Q>
struct compute_linearRand<L, int64, Q>
{
GLM_FUNC_QUALIFIER static vec<L, int64, P> call(vec<L, int64, P> const& Min, vec<L, int64, P> const& Max)
GLM_FUNC_QUALIFIER static vec<L, int64, Q> call(vec<L, int64, Q> const& Min, vec<L, int64, Q> const& Max)
{
return (vec<L, int64, P>(compute_rand<L, uint64, P>::call() % vec<L, uint64, P>(Max + static_cast<int64>(1) - Min))) + Min;
return (vec<L, int64, Q>(compute_rand<L, uint64, Q>::call() % vec<L, uint64, Q>(Max + static_cast<int64>(1) - Min))) + Min;
}
};
template<length_t L, qualifier P>
struct compute_linearRand<L, uint64, P>
template<length_t L, qualifier Q>
struct compute_linearRand<L, uint64, Q>
{
GLM_FUNC_QUALIFIER static vec<L, uint64, P> call(vec<L, uint64, P> const& Min, vec<L, uint64, P> const& Max)
GLM_FUNC_QUALIFIER static vec<L, uint64, Q> call(vec<L, uint64, Q> const& Min, vec<L, uint64, Q> const& Max)
{
return (compute_rand<L, uint64, P>::call() % (Max + static_cast<uint64>(1) - Min)) + Min;
return (compute_rand<L, uint64, Q>::call() % (Max + static_cast<uint64>(1) - Min)) + Min;
}
};
@ -265,10 +265,10 @@ namespace detail
vec<1, genType, highp>(Max)).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> linearRand(vec<L, T, P> const& Min, vec<L, T, P> const& Max)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> linearRand(vec<L, T, Q> const& Min, vec<L, T, Q> const& Max)
{
return detail::compute_linearRand<L, T, P>::call(Min, Max);
return detail::compute_linearRand<L, T, Q>::call(Min, Max);
}
template<typename genType>
@ -287,10 +287,10 @@ namespace detail
return x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> gaussRand(vec<L, T, P> const& Mean, vec<L, T, P> const& Deviation)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> gaussRand(vec<L, T, Q> const& Mean, vec<L, T, Q> const& Deviation)
{
return detail::functor2<L, T, P>::call(gaussRand, Mean, Deviation);
return detail::functor2<L, T, Q>::call(gaussRand, Mean, Deviation);
}
template<typename T>

View File

@ -14,11 +14,11 @@ namespace glm
return genType(1) / glm::cos(angle);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> sec(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> sec(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sec' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(sec, x);
return detail::functor1<L, T, T, Q>::call(sec, x);
}
// csc
@ -29,11 +29,11 @@ namespace glm
return genType(1) / glm::sin(angle);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> csc(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> csc(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csc' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(csc, x);
return detail::functor1<L, T, T, Q>::call(csc, x);
}
// cot
@ -46,11 +46,11 @@ namespace glm
return glm::tan(pi_over_2 - angle);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> cot(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> cot(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cot' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(cot, x);
return detail::functor1<L, T, T, Q>::call(cot, x);
}
// asec
@ -61,11 +61,11 @@ namespace glm
return acos(genType(1) / x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> asec(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> asec(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asec' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(asec, x);
return detail::functor1<L, T, T, Q>::call(asec, x);
}
// acsc
@ -76,11 +76,11 @@ namespace glm
return asin(genType(1) / x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> acsc(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> acsc(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsc' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(acsc, x);
return detail::functor1<L, T, T, Q>::call(acsc, x);
}
// acot
@ -93,11 +93,11 @@ namespace glm
return pi_over_2 - atan(x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> acot(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> acot(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acot' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(acot, x);
return detail::functor1<L, T, T, Q>::call(acot, x);
}
// sech
@ -108,11 +108,11 @@ namespace glm
return genType(1) / glm::cosh(angle);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> sech(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> sech(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sech' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(sech, x);
return detail::functor1<L, T, T, Q>::call(sech, x);
}
// csch
@ -123,11 +123,11 @@ namespace glm
return genType(1) / glm::sinh(angle);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> csch(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> csch(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'csch' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(csch, x);
return detail::functor1<L, T, T, Q>::call(csch, x);
}
// coth
@ -138,11 +138,11 @@ namespace glm
return glm::cosh(angle) / glm::sinh(angle);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> coth(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> coth(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'coth' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(coth, x);
return detail::functor1<L, T, T, Q>::call(coth, x);
}
// asech
@ -153,11 +153,11 @@ namespace glm
return acosh(genType(1) / x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> asech(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> asech(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'asech' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(asech, x);
return detail::functor1<L, T, T, Q>::call(asech, x);
}
// acsch
@ -168,11 +168,11 @@ namespace glm
return acsch(genType(1) / x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> acsch(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> acsch(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acsch' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(acsch, x);
return detail::functor1<L, T, T, Q>::call(acsch, x);
}
// acoth
@ -183,10 +183,10 @@ namespace glm
return atanh(genType(1) / x);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> acoth(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> acoth(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'acoth' only accept floating-point inputs");
return detail::functor1<L, T, T, P>::call(acoth, x);
return detail::functor1<L, T, T, Q>::call(acoth, x);
}
}//namespace glm

View File

@ -39,8 +39,8 @@ namespace glm
/// Return true if the value is a power of two number.
///
/// @see gtc_round
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> isPowerOfTwo(vec<L, T, P> const& value);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isPowerOfTwo(vec<L, T, Q> const& value);
/// Return the power of two number which value is just higher the input value,
/// round up to a power of two.
@ -53,8 +53,8 @@ namespace glm
/// round up to a power of two.
///
/// @see gtc_round
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> ceilPowerOfTwo(vec<L, T, P> const& value);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> ceilPowerOfTwo(vec<L, T, Q> const& value);
/// Return the power of two number which value is just lower the input value,
/// round down to a power of two.
@ -67,8 +67,8 @@ namespace glm
/// round down to a power of two.
///
/// @see gtc_round
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> floorPowerOfTwo(vec<L, T, P> const& value);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> floorPowerOfTwo(vec<L, T, Q> const& value);
/// Return the power of two number which value is the closet to the input value.
///
@ -79,8 +79,8 @@ namespace glm
/// Return the power of two number which value is the closet to the input value.
///
/// @see gtc_round
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> roundPowerOfTwo(vec<L, T, P> const& value);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> roundPowerOfTwo(vec<L, T, Q> const& value);
/// Return true if the 'Value' is a multiple of 'Multiple'.
///
@ -91,14 +91,14 @@ namespace glm
/// Return true if the 'Value' is a multiple of 'Multiple'.
///
/// @see gtc_round
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> isMultiple(vec<L, T, P> const& Value, T Multiple);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isMultiple(vec<L, T, Q> const& Value, T Multiple);
/// Return true if the 'Value' is a multiple of 'Multiple'.
///
/// @see gtc_round
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, bool, P> isMultiple(vec<L, T, P> const& Value, vec<L, T, P> const& Multiple);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, bool, Q> isMultiple(vec<L, T, Q> const& Value, vec<L, T, Q> const& Multiple);
/// Higher multiple number of Source.
///
@ -115,8 +115,8 @@ namespace glm
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> ceilMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> ceilMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple);
/// Lower multiple number of Source.
///
@ -133,8 +133,8 @@ namespace glm
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> floorMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> floorMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple);
/// Lower multiple number of Source.
///
@ -151,8 +151,8 @@ namespace glm
/// @param Multiple Must be a null or positive value
///
/// @see gtc_round
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> roundMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> roundMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple);
/// @}
} //namespace glm

View File

@ -6,62 +6,62 @@
namespace glm{
namespace detail
{
template<length_t L, typename T, qualifier P, bool compute = false>
template<length_t L, typename T, qualifier Q, bool compute = false>
struct compute_ceilShift
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v, T)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v, T)
{
return v;
}
};
template<length_t L, typename T, qualifier P>
struct compute_ceilShift<L, T, P, true>
template<length_t L, typename T, qualifier Q>
struct compute_ceilShift<L, T, Q, true>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& v, T Shift)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v, T Shift)
{
return v | (v >> Shift);
}
};
template<length_t L, typename T, qualifier P, bool isSigned = true>
template<length_t L, typename T, qualifier Q, bool isSigned = true>
struct compute_ceilPowerOfTwo
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
vec<L, T, P> const Sign(sign(x));
vec<L, T, Q> const Sign(sign(x));
vec<L, T, P> v(abs(x));
vec<L, T, Q> v(abs(x));
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>(4));
v = compute_ceilShift<L, T, P, sizeof(T) >= 2>::call(v, 8);
v = compute_ceilShift<L, T, P, sizeof(T) >= 4>::call(v, 16);
v = compute_ceilShift<L, T, P, sizeof(T) >= 8>::call(v, 32);
v = compute_ceilShift<L, T, Q, sizeof(T) >= 2>::call(v, 8);
v = compute_ceilShift<L, T, Q, sizeof(T) >= 4>::call(v, 16);
v = compute_ceilShift<L, T, Q, sizeof(T) >= 8>::call(v, 32);
return (v + static_cast<T>(1)) * Sign;
}
};
template<length_t L, typename T, qualifier P>
struct compute_ceilPowerOfTwo<L, T, P, false>
template<length_t L, typename T, qualifier Q>
struct compute_ceilPowerOfTwo<L, T, Q, false>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& x)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
{
GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
vec<L, T, P> v(x);
vec<L, T, Q> v(x);
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>(4));
v = compute_ceilShift<L, T, P, sizeof(T) >= 2>::call(v, 8);
v = compute_ceilShift<L, T, P, sizeof(T) >= 4>::call(v, 16);
v = compute_ceilShift<L, T, P, sizeof(T) >= 8>::call(v, 32);
v = compute_ceilShift<L, T, Q, sizeof(T) >= 2>::call(v, 8);
v = compute_ceilShift<L, T, Q, sizeof(T) >= 4>::call(v, 16);
v = compute_ceilShift<L, T, Q, sizeof(T) >= 8>::call(v, 32);
return v + static_cast<T>(1);
}
};
@ -219,11 +219,11 @@ namespace detail
return !(Result & (Result - 1));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, bool, P> isPowerOfTwo(vec<L, T, P> const& Value)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> isPowerOfTwo(vec<L, T, Q> const& Value)
{
vec<L, T, P> const Result(abs(Value));
return equal(Result & (Result - 1), vec<L, T, P>(0));
vec<L, T, Q> const Result(abs(Value));
return equal(Result & (Result - 1), vec<L, T, Q>(0));
}
//////////////////
@ -235,10 +235,10 @@ namespace detail
return detail::compute_ceilPowerOfTwo<1, genType, defaultp, std::numeric_limits<genType>::is_signed>::call(vec<1, genType, defaultp>(value)).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> ceilPowerOfTwo(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> ceilPowerOfTwo(vec<L, T, Q> const& v)
{
return detail::compute_ceilPowerOfTwo<L, T, P, std::numeric_limits<T>::is_signed>::call(v);
return detail::compute_ceilPowerOfTwo<L, T, Q, std::numeric_limits<T>::is_signed>::call(v);
}
///////////////////
@ -250,10 +250,10 @@ namespace detail
return isPowerOfTwo(value) ? value : static_cast<genType>(1) << findMSB(value);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> floorPowerOfTwo(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> floorPowerOfTwo(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(floorPowerOfTwo, v);
return detail::functor1<L, T, T, Q>::call(floorPowerOfTwo, v);
}
///////////////////
@ -270,10 +270,10 @@ namespace detail
return (next - value) < (value - prev) ? next : prev;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> roundPowerOfTwo(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> roundPowerOfTwo(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(roundPowerOfTwo, v);
return detail::functor1<L, T, T, Q>::call(roundPowerOfTwo, v);
}
////////////////
@ -285,16 +285,16 @@ namespace detail
return isMultiple(vec<1, genType>(Value), vec<1, genType>(Multiple)).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, bool, P> isMultiple(vec<L, T, P> const& Value, T Multiple)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> isMultiple(vec<L, T, Q> const& Value, T Multiple)
{
return (Value % Multiple) == vec<L, T, P>(0);
return (Value % Multiple) == vec<L, T, Q>(0);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, bool, P> isMultiple(vec<L, T, P> const& Value, vec<L, T, P> const& Multiple)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, bool, Q> isMultiple(vec<L, T, Q> const& Value, vec<L, T, Q> const& Multiple)
{
return (Value % Multiple) == vec<L, T, P>(0);
return (Value % Multiple) == vec<L, T, Q>(0);
}
//////////////////////
@ -306,10 +306,10 @@ namespace detail
return detail::compute_ceilMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> ceilMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> ceilMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple)
{
return detail::functor2<L, T, P>::call(ceilMultiple, Source, Multiple);
return detail::functor2<L, T, Q>::call(ceilMultiple, Source, Multiple);
}
//////////////////////
@ -321,10 +321,10 @@ namespace detail
return detail::compute_floorMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> floorMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> floorMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple)
{
return detail::functor2<L, T, P>::call(floorMultiple, Source, Multiple);
return detail::functor2<L, T, Q>::call(floorMultiple, Source, Multiple);
}
//////////////////////
@ -336,9 +336,9 @@ namespace detail
return detail::compute_roundMultiple<std::numeric_limits<genType>::is_iec559, std::numeric_limits<genType>::is_signed>::call(Source, Multiple);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> roundMultiple(vec<L, T, P> const& Source, vec<L, T, P> const& Multiple)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> roundMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple)
{
return detail::functor2<L, T, P>::call(roundMultiple, Source, Multiple);
return detail::functor2<L, T, Q>::call(roundMultiple, Source, Multiple);
}
}//namespace glm

View File

@ -10,208 +10,208 @@ namespace glm
/// Return the constant address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, Q> const& v)
{
return &(v.x);
}
//! Return the address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, P>& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, Q>& v)
{
return &(v.x);
}
/// Return the constant address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, Q> const& v)
{
return &(v.x);
}
//! Return the address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, P>& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, Q>& v)
{
return &(v.x);
}
/// Return the constant address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, P> const& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, Q> const& v)
{
return &(v.x);
}
//! Return the address to the data of the vector input.
//! From GLM_GTC_type_ptr extension.
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, P>& v)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, Q>& v)
{
return &(v.x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, Q> const& m)
{
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, P>& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, Q>& m)
{
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, Q> const& m)
{
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, P>& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, Q>& m)
{
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, Q> const& m)
{
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
//! From GLM_GTC_type_ptr extension.
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, P>& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, Q>& m)
{
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, Q> const& m)
{
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, P>& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, Q>& m)
{
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, Q> const& m)
{
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, P>& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, Q>& m)
{
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, Q> const& m)
{
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, P>& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, Q>& m)
{
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, Q> const& m)
{
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, P>& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, Q>& m)
{
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, Q> const& m)
{
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, P>& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, Q>& m)
{
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, P> const& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, Q> const& m)
{
return &(m[0].x);
}
/// Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, P>& m)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, Q>& m)
{
return &(m[0].x);
}
/// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T const * value_ptr(tquat<T, P> const& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T const * value_ptr(tquat<T, Q> const& q)
{
return &(q[0]);
}
/// Return the address to the data of the quaternion input.
/// @see gtc_type_ptr
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T* value_ptr(tquat<T, P>& q)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T* value_ptr(tquat<T, Q>& q)
{
return &(q[0]);
}

View File

@ -217,10 +217,10 @@ namespace glm
# endif
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> next_float(vec<L, T, Q> const& x)
{
vec<L, T, P> Result;
vec<L, T, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = next_float(x[i]);
return Result;
@ -252,10 +252,10 @@ namespace glm
# endif
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const& x)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> prev_float(vec<L, T, Q> const& x)
{
vec<L, T, P> Result;
vec<L, T, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = prev_float(x[i]);
return Result;
@ -270,10 +270,10 @@ namespace glm
return temp;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> next_float(vec<L, T, P> const& x, vec<L, uint, P> const& ulps)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> next_float(vec<L, T, Q> const& x, vec<L, uint, Q> const& ulps)
{
vec<L, T, P> Result;
vec<L, T, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = next_float(x[i], ulps[i]);
return Result;
@ -288,10 +288,10 @@ namespace glm
return temp;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> prev_float(vec<L, T, P> const& x, vec<L, uint, P> const& ulps)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> prev_float(vec<L, T, Q> const& x, vec<L, uint, Q> const& ulps)
{
vec<L, T, P> Result;
vec<L, T, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = prev_float(x[i], ulps[i]);
return Result;
@ -328,10 +328,10 @@ namespace glm
return ulp;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, uint, P> float_distance(vec<L, T, P> const& x, vec<L, T, P> const& y)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, uint, Q> float_distance(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
{
vec<L, uint, P> Result;
vec<L, uint, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = float_distance(x[i], y[i]);
return Result;

View File

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

View File

@ -4,46 +4,46 @@
namespace glm{
// Min comparison between 2 variables
template<typename T, typename U, qualifier P>
template<typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER U associatedMin(T x, U a, T y, U b)
{
return x < y ? a : b;
}
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<2, U, P> associatedMin
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMin
(
vec<L, T, P> const& x, vec<L, U, P> const& a,
vec<L, T, P> const& y, vec<L, U, P> const& b
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
vec<L, T, Q> const& y, vec<L, U, Q> const& b
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] < y[i] ? a[i] : b[i];
return Result;
}
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMin
(
T x, const vec<L, U, P>& a,
T y, const vec<L, U, P>& b
T x, const vec<L, U, Q>& a,
T y, const vec<L, U, Q>& b
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x < y ? a[i] : b[i];
return Result;
}
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMin
(
vec<L, T, P> const& x, U a,
vec<L, T, P> const& y, U b
vec<L, T, Q> const& x, U a,
vec<L, T, Q> const& y, U b
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] < y[i] ? a : b;
return Result;
@ -62,15 +62,15 @@ GLM_FUNC_QUALIFIER U associatedMin
return Result;
}
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMin
(
vec<L, T, P> const& x, vec<L, U, P> const& a,
vec<L, T, P> const& y, vec<L, U, P> const& b,
vec<L, T, P> const& z, vec<L, U, P> const& c
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
vec<L, T, Q> const& y, vec<L, U, Q> const& b,
vec<L, T, Q> const& z, vec<L, U, Q> const& c
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
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]);
return Result;
@ -95,16 +95,16 @@ GLM_FUNC_QUALIFIER U associatedMin
}
// Min comparison between 4 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMin
(
vec<L, T, P> const& x, vec<L, U, P> const& a,
vec<L, T, P> const& y, vec<L, U, P> const& b,
vec<L, T, P> const& z, vec<L, U, P> const& c,
vec<L, T, P> const& w, vec<L, U, P> const& d
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
vec<L, T, Q> const& y, vec<L, U, Q> const& b,
vec<L, T, Q> const& z, vec<L, U, Q> const& c,
vec<L, T, Q> const& w, vec<L, U, Q> const& d
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
{
T Test1 = min(x[i], y[i]);
@ -117,19 +117,19 @@ GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
}
// Min comparison between 4 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMin
(
T x, vec<L, U, P> const& a,
T y, vec<L, U, P> const& b,
T z, vec<L, U, P> const& c,
T w, vec<L, U, P> const& d
T x, vec<L, U, Q> const& a,
T y, vec<L, U, Q> const& b,
T z, vec<L, U, Q> const& c,
T w, vec<L, U, Q> const& d
)
{
T Test1 = min(x, y);
T Test2 = min(z, w);
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
{
U Result1 = x < y ? a[i] : b[i];
@ -140,16 +140,16 @@ GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
}
// Min comparison between 4 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMin
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMin
(
vec<L, T, P> const& x, U a,
vec<L, T, P> const& y, U b,
vec<L, T, P> const& z, U c,
vec<L, T, P> const& w, U d
vec<L, T, Q> const& x, U a,
vec<L, T, Q> const& y, U b,
vec<L, T, Q> const& z, U c,
vec<L, T, Q> const& w, U d
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++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
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<2, U, P> associatedMax
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, U, Q> associatedMax
(
vec<L, T, P> const& x, vec<L, U, P> const& a,
vec<L, T, P> const& y, vec<L, U, P> const& b
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
vec<L, T, Q> const& y, vec<L, U, Q> const& b
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] > y[i] ? a[i] : b[i];
return Result;
}
// Max comparison between 2 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> associatedMax
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> associatedMax
(
T x, vec<L, U, P> const& a,
T y, vec<L, U, P> const& b
T x, vec<L, U, Q> const& a,
T y, vec<L, U, Q> const& b
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x > y ? a[i] : b[i];
return Result;
}
// Max comparison between 2 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMax
(
vec<L, T, P> const& x, U a,
vec<L, T, P> const& y, U b
vec<L, T, Q> const& x, U a,
vec<L, T, Q> const& y, U b
)
{
vec<L, T, P> Result;
vec<L, T, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
Result[i] = x[i] > y[i] ? a : b;
return Result;
@ -224,45 +224,45 @@ GLM_FUNC_QUALIFIER U associatedMax
}
// Max comparison between 3 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMax
(
vec<L, T, P> const& x, vec<L, U, P> const& a,
vec<L, T, P> const& y, vec<L, U, P> const& b,
vec<L, T, P> const& z, vec<L, U, P> const& c
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
vec<L, T, Q> const& y, vec<L, U, Q> const& b,
vec<L, T, Q> const& z, vec<L, U, Q> const& c
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
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]);
return Result;
}
// Max comparison between 3 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> associatedMax
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> associatedMax
(
T x, vec<L, U, P> const& a,
T y, vec<L, U, P> const& b,
T z, vec<L, U, P> const& c
T x, vec<L, U, Q> const& a,
T y, vec<L, U, Q> const& b,
T z, vec<L, U, Q> const& c
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
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]);
return Result;
}
// Max comparison between 3 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMax
(
vec<L, T, P> const& x, U a,
vec<L, T, P> const& y, U b,
vec<L, T, P> const& z, U c
vec<L, T, Q> const& x, U a,
vec<L, T, Q> const& y, U b,
vec<L, T, Q> const& z, U c
)
{
vec<L, T, P> Result;
vec<L, T, Q> Result;
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);
return Result;
@ -287,16 +287,16 @@ GLM_FUNC_QUALIFIER U associatedMax
}
// Max comparison between 4 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMax
(
vec<L, T, P> const& x, vec<L, U, P> const& a,
vec<L, T, P> const& y, vec<L, U, P> const& b,
vec<L, T, P> const& z, vec<L, U, P> const& c,
vec<L, T, P> const& w, vec<L, U, P> const& d
vec<L, T, Q> const& x, vec<L, U, Q> const& a,
vec<L, T, Q> const& y, vec<L, U, Q> const& b,
vec<L, T, Q> const& z, vec<L, U, Q> const& c,
vec<L, T, Q> const& w, vec<L, U, Q> const& d
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
{
T Test1 = max(x[i], y[i]);
@ -309,19 +309,19 @@ GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
}
// Max comparison between 4 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMax
(
T x, vec<L, U, P> const& a,
T y, vec<L, U, P> const& b,
T z, vec<L, U, P> const& c,
T w, vec<L, U, P> const& d
T x, vec<L, U, Q> const& a,
T y, vec<L, U, Q> const& b,
T z, vec<L, U, Q> const& c,
T w, vec<L, U, Q> const& d
)
{
T Test1 = max(x, y);
T Test2 = max(z, w);
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
{
U Result1 = x > y ? a[i] : b[i];
@ -332,16 +332,16 @@ GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
}
// Max comparison between 4 variables
template<length_t L, typename T, typename U, qualifier P>
GLM_FUNC_QUALIFIER vec<L, U, P> associatedMax
template<length_t L, typename T, typename U, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, U, Q> associatedMax
(
vec<L, T, P> const& x, U a,
vec<L, T, P> const& y, U b,
vec<L, T, P> const& z, U c,
vec<L, T, P> const& w, U d
vec<L, T, Q> const& x, U a,
vec<L, T, Q> const& y, U b,
vec<L, T, Q> const& z, U c,
vec<L, T, Q> const& w, U d
)
{
vec<L, U, P> Result;
vec<L, U, Q> Result;
for(length_t i = 0, n = Result.length(); i < n; ++i)
{
T Test1 = max(x[i], y[i]);

View File

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

View File

@ -19,10 +19,10 @@ namespace glm
return result;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> highestBitValue(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> highestBitValue(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(highestBitValue, v);
return detail::functor1<L, T, T, Q>::call(highestBitValue, v);
}
///////////////////
@ -34,10 +34,10 @@ namespace glm
return (Value & (~Value + 1));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> lowestBitValue(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> lowestBitValue(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(lowestBitValue, v);
return detail::functor1<L, T, T, Q>::call(lowestBitValue, v);
}
///////////////////
@ -49,10 +49,10 @@ namespace glm
return isPowerOfTwo(value) ? value : highestBitValue(value) << 1;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> powerOfTwoAbove(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> powerOfTwoAbove(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(powerOfTwoAbove, v);
return detail::functor1<L, T, T, Q>::call(powerOfTwoAbove, v);
}
///////////////////
@ -64,10 +64,10 @@ namespace glm
return isPowerOfTwo(value) ? value : highestBitValue(value);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> powerOfTwoBelow(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> powerOfTwoBelow(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(powerOfTwoBelow, v);
return detail::functor1<L, T, T, Q>::call(powerOfTwoBelow, v);
}
/////////////////////
@ -84,10 +84,10 @@ namespace glm
return (next - value) < (value - prev) ? next : prev;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> powerOfTwoNearest(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> powerOfTwoNearest(vec<L, T, Q> const& v)
{
return detail::functor1<L, T, T, P>::call(powerOfTwoNearest, v);
return detail::functor1<L, T, T, Q>::call(powerOfTwoNearest, v);
}
}//namespace glm

View File

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

View File

@ -3,17 +3,17 @@
namespace glm
{
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> closestPointOnLine
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> closestPointOnLine
(
vec<3, T, P> const& point,
vec<3, T, P> const& a,
vec<3, T, P> const& b
vec<3, T, Q> const& point,
vec<3, T, Q> const& a,
vec<3, T, Q> const& b
)
{
T LineLength = distance(a, b);
vec<3, T, P> Vector = point - a;
vec<3, T, P> LineDirection = (b - a) / LineLength;
vec<3, T, Q> Vector = point - a;
vec<3, T, Q> LineDirection = (b - a) / LineLength;
// Project Vector to LineDirection to get the distance of point from a
T Distance = dot(Vector, LineDirection);
@ -23,17 +23,17 @@ namespace glm
return a + LineDirection * Distance;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<2, T, P> closestPointOnLine
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, T, Q> closestPointOnLine
(
vec<2, T, P> const& point,
vec<2, T, P> const& a,
vec<2, T, P> const& b
vec<2, T, Q> const& point,
vec<2, T, Q> const& a,
vec<2, T, Q> const& b
)
{
T LineLength = distance(a, b);
vec<2, T, P> Vector = point - a;
vec<2, T, P> LineDirection = (b - a) / LineLength;
vec<2, T, Q> Vector = point - a;
vec<2, T, Q> LineDirection = (b - a) / LineLength;
// Project Vector to LineDirection to get the distance of point from a
T Distance = dot(Vector, LineDirection);

View File

@ -29,20 +29,20 @@ namespace glm
/// @{
/// Convert a linear sRGB color to D65 YUV.
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> convertLinearSRGBToD65XYZ(vec<3, T, P> const& ColorLinearSRGB);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB);
/// Convert a linear sRGB color to D50 YUV.
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> convertLinearSRGBToD50XYZ(vec<3, T, P> const& ColorLinearSRGB);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB);
/// Convert a D65 YUV color to linear sRGB.
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> convertD65XYZToLinearSRGB(vec<3, T, P> const& ColorD65XYZ);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ);
/// Convert a D65 YUV color to D50 YUV.
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> convertD65XYZToD50XYZ(vec<3, T, P> const& ColorD65XYZ);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ);
/// @}
} //namespace glm

View File

@ -3,42 +3,42 @@
namespace glm
{
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> convertLinearSRGBToD65XYZ(vec<3, T, P> const& ColorLinearSRGB)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD65XYZ(vec<3, T, Q> const& ColorLinearSRGB)
{
vec<3, T, P> const M(0.490f, 0.17697f, 0.2f);
vec<3, T, P> const N(0.31f, 0.8124f, 0.01063f);
vec<3, T, P> const O(0.490f, 0.01f, 0.99f);
vec<3, T, Q> const M(0.490f, 0.17697f, 0.2f);
vec<3, T, Q> const N(0.31f, 0.8124f, 0.01063f);
vec<3, T, Q> const O(0.490f, 0.01f, 0.99f);
return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast<T>(5.650675255693055f);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> convertLinearSRGBToD50XYZ(vec<3, T, P> const& ColorLinearSRGB)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> convertLinearSRGBToD50XYZ(vec<3, T, Q> const& ColorLinearSRGB)
{
vec<3, T, P> const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f);
vec<3, T, P> const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f);
vec<3, T, P> const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f);
vec<3, T, Q> const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f);
vec<3, T, Q> const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f);
vec<3, T, Q> const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f);
return M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> convertD65XYZToLinearSRGB(vec<3, T, P> const& ColorD65XYZ)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToLinearSRGB(vec<3, T, Q> const& ColorD65XYZ)
{
vec<3, T, P> const M(0.41847f, -0.091169f, 0.0009209f);
vec<3, T, P> const N(-0.15866f, 0.25243f, 0.015708f);
vec<3, T, P> const O(0.0009209f, -0.0025498f, 0.1786f);
vec<3, T, Q> const M(0.41847f, -0.091169f, 0.0009209f);
vec<3, T, Q> const N(-0.15866f, 0.25243f, 0.015708f);
vec<3, T, Q> const O(0.0009209f, -0.0025498f, 0.1786f);
return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> convertD65XYZToD50XYZ(vec<3, T, P> const& ColorD65XYZ)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> convertD65XYZToD50XYZ(vec<3, T, Q> const& ColorD65XYZ)
{
vec<3, T, P> const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f);
vec<3, T, P> const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f);
vec<3, T, P> const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f);
vec<3, T, Q> const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f);
vec<3, T, Q> const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f);
vec<3, T, Q> const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f);
return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
}

View File

@ -30,15 +30,15 @@ namespace glm
/// Converts a color from HSV color space to its color in RGB color space.
/// @see gtx_color_space
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> rgbColor(
vec<3, T, P> const& hsvValue);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> rgbColor(
vec<3, T, Q> const& hsvValue);
/// Converts a color from RGB color space to its color in HSV color space.
/// @see gtx_color_space
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> hsvColor(
vec<3, T, P> const& rgbValue);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> hsvColor(
vec<3, T, Q> const& rgbValue);
/// Build a saturation matrix.
/// @see gtx_color_space
@ -48,23 +48,23 @@ namespace glm
/// Modify the saturation of a color.
/// @see gtx_color_space
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> saturation(
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> saturation(
T const s,
vec<3, T, P> const& color);
vec<3, T, Q> const& color);
/// Modify the saturation of a color.
/// @see gtx_color_space
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> saturation(
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> saturation(
T const s,
vec<4, T, P> const& color);
vec<4, T, Q> const& color);
/// Compute color luminosity associating ratios (0.33, 0.59, 0.11) to RGB canals.
/// @see gtx_color_space
template<typename T, qualifier P>
template<typename T, qualifier Q>
GLM_FUNC_DECL T luminosity(
vec<3, T, P> const& color);
vec<3, T, Q> const& color);
/// @}
}//namespace glm

View File

@ -3,15 +3,15 @@
namespace glm
{
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> rgbColor(const vec<3, T, P>& hsvColor)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> rgbColor(const vec<3, T, Q>& hsvColor)
{
vec<3, T, P> hsv = hsvColor;
vec<3, T, P> rgbColor;
vec<3, T, Q> hsv = hsvColor;
vec<3, T, Q> rgbColor;
if(hsv.y == static_cast<T>(0))
// achromatic (grey)
rgbColor = vec<3, T, P>(hsv.z);
rgbColor = vec<3, T, Q>(hsv.z);
else
{
T sector = floor(hsv.x * (T(1) / T(60)));
@ -60,10 +60,10 @@ namespace glm
return rgbColor;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> hsvColor(const vec<3, T, P>& rgbColor)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> hsvColor(const vec<3, T, Q>& rgbColor)
{
vec<3, T, P> hsv = rgbColor;
vec<3, T, Q> hsv = rgbColor;
float Min = min(min(rgbColor.r, rgbColor.g), rgbColor.b);
float Max = max(max(rgbColor.r, rgbColor.g), rgbColor.b);
float Delta = Max - Min;
@ -121,22 +121,22 @@ namespace glm
return result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> saturation(const T s, const vec<3, T, P>& color)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> saturation(const T s, const vec<3, T, Q>& color)
{
return vec<3, T, P>(saturation(s) * vec<4, T, P>(color, T(0)));
return vec<3, T, Q>(saturation(s) * vec<4, T, Q>(color, T(0)));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, T, P> saturation(const T s, const vec<4, T, P>& color)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, T, Q> saturation(const T s, const vec<4, T, Q>& color)
{
return saturation(s) * color;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER T luminosity(const vec<3, T, P>& color)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER T luminosity(const vec<3, T, Q>& color)
{
const vec<3, T, P> tmp = vec<3, T, P>(0.33, 0.59, 0.11);
const vec<3, T, Q> tmp = vec<3, T, Q>(0.33, 0.59, 0.11);
return dot(color, tmp);
}
}//namespace glm

View File

@ -30,29 +30,29 @@ namespace glm
/// Convert a color from RGB color space to YCoCg color space.
/// @see gtx_color_space_YCoCg
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> rgb2YCoCg(
vec<3, T, P> const& rgbColor);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCg(
vec<3, T, Q> const& rgbColor);
/// Convert a color from YCoCg color space to RGB color space.
/// @see gtx_color_space_YCoCg
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> YCoCg2rgb(
vec<3, T, P> const& YCoCgColor);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> YCoCg2rgb(
vec<3, T, Q> const& YCoCgColor);
/// Convert a color from RGB color space to YCoCgR color space.
/// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
/// @see gtx_color_space_YCoCg
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> rgb2YCoCgR(
vec<3, T, P> const& rgbColor);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> rgb2YCoCgR(
vec<3, T, Q> const& rgbColor);
/// Convert a color from YCoCgR color space to RGB color space.
/// @see "YCoCg-R: A Color Space with RGB Reversibility and Low Dynamic Range"
/// @see gtx_color_space_YCoCg
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> YCoCgR2rgb(
vec<3, T, P> const& YCoCgColor);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> YCoCgR2rgb(
vec<3, T, Q> const& YCoCgColor);
/// @}
}//namespace glm

View File

@ -3,53 +3,53 @@
namespace glm
{
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCg
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCg
(
vec<3, T, P> const& rgbColor
vec<3, T, Q> const& rgbColor
)
{
vec<3, T, P> result;
vec<3, T, Q> result;
result.x/*Y */ = rgbColor.r / T(4) + rgbColor.g / T(2) + rgbColor.b / T(4);
result.y/*Co*/ = rgbColor.r / T(2) + rgbColor.g * T(0) - rgbColor.b / T(2);
result.z/*Cg*/ = - rgbColor.r / T(4) + rgbColor.g / T(2) - rgbColor.b / T(4);
return result;
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> YCoCg2rgb
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCg2rgb
(
vec<3, T, P> const& YCoCgColor
vec<3, T, Q> const& YCoCgColor
)
{
vec<3, T, P> result;
vec<3, T, Q> result;
result.r = YCoCgColor.x + YCoCgColor.y - YCoCgColor.z;
result.g = YCoCgColor.x + YCoCgColor.z;
result.b = YCoCgColor.x - YCoCgColor.y - YCoCgColor.z;
return result;
}
template<typename T, qualifier P, bool isInteger>
template<typename T, qualifier Q, bool isInteger>
class compute_YCoCgR {
public:
static GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCgR
static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR
(
vec<3, T, P> const& rgbColor
vec<3, T, Q> const& rgbColor
)
{
vec<3, T, P> result;
vec<3, T, Q> result;
result.x/*Y */ = rgbColor.g * static_cast<T>(0.5) + (rgbColor.r + rgbColor.b) * static_cast<T>(0.25);
result.y/*Co*/ = rgbColor.r - rgbColor.b;
result.z/*Cg*/ = rgbColor.g - (rgbColor.r + rgbColor.b) * static_cast<T>(0.5);
return result;
}
static GLM_FUNC_QUALIFIER vec<3, T, P> YCoCgR2rgb
static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb
(
vec<3, T, P> const& YCoCgRColor
vec<3, T, Q> const& YCoCgRColor
)
{
vec<3, T, P> result;
vec<3, T, Q> result;
T tmp = YCoCgRColor.x - (YCoCgRColor.z * static_cast<T>(0.5));
result.g = YCoCgRColor.z + tmp;
result.b = tmp - (YCoCgRColor.y * static_cast<T>(0.5));
@ -58,15 +58,15 @@ namespace glm
}
};
template<typename T, qualifier P>
class compute_YCoCgR<T, P, true> {
template<typename T, qualifier Q>
class compute_YCoCgR<T, Q, true> {
public:
static GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCgR
static GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR
(
vec<3, T, P> const& rgbColor
vec<3, T, Q> const& rgbColor
)
{
vec<3, T, P> result;
vec<3, T, Q> result;
result.y/*Co*/ = rgbColor.r - rgbColor.b;
T tmp = rgbColor.b + (result.y >> 1);
result.z/*Cg*/ = rgbColor.g - tmp;
@ -74,12 +74,12 @@ namespace glm
return result;
}
static GLM_FUNC_QUALIFIER vec<3, T, P> YCoCgR2rgb
static GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb
(
vec<3, T, P> const& YCoCgRColor
vec<3, T, Q> const& YCoCgRColor
)
{
vec<3, T, P> result;
vec<3, T, Q> result;
T tmp = YCoCgRColor.x - (YCoCgRColor.z >> 1);
result.g = YCoCgRColor.z + tmp;
result.b = tmp - (YCoCgRColor.y >> 1);
@ -88,21 +88,21 @@ namespace glm
}
};
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> rgb2YCoCgR
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> rgb2YCoCgR
(
vec<3, T, P> const& rgbColor
vec<3, T, Q> const& rgbColor
)
{
return compute_YCoCgR<T, P, std::numeric_limits<T>::is_integer>::rgb2YCoCgR(rgbColor);
return compute_YCoCgR<T, Q, std::numeric_limits<T>::is_integer>::rgb2YCoCgR(rgbColor);
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, T, P> YCoCgR2rgb
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, T, Q> YCoCgR2rgb
(
vec<3, T, P> const& YCoCgRColor
vec<3, T, Q> const& YCoCgRColor
)
{
return compute_YCoCgR<T, P, std::numeric_limits<T>::is_integer>::YCoCgR2rgb(YCoCgRColor);
return compute_YCoCgR<T, Q, std::numeric_limits<T>::is_integer>::YCoCgR2rgb(YCoCgRColor);
}
}//namespace glm

View File

@ -47,8 +47,8 @@ namespace glm
///
/// @see <a href="http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod">GLSL mod vs HLSL fmod</a>
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
template<length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, T, P> fmod(vec<L, T, P> const& v);
template<length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> fmod(vec<L, T, Q> const& v);
/// @}
}//namespace glm

View File

@ -8,19 +8,19 @@
namespace glm{
namespace detail
{
template<length_t L, typename T, qualifier P, bool isFloat = true>
template<length_t L, typename T, qualifier Q, bool isFloat = true>
struct compute_fmod
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& a, vec<L, T, P> const& b)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
{
return detail::functor2<L, T, P>::call(std::fmod, a, b);
return detail::functor2<L, T, Q>::call(std::fmod, a, b);
}
};
template<length_t L, typename T, qualifier P>
struct compute_fmod<L, T, P, false>
template<length_t L, typename T, qualifier Q>
struct compute_fmod<L, T, Q, false>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, T, P> const& a, vec<L, T, P> const& b)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
{
return a % b;
}
@ -39,54 +39,54 @@ namespace detail
# endif
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename vec<1, T, P>::bool_type isdenormal
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename vec<1, T, Q>::bool_type isdenormal
(
vec<1, T, P> const& x
vec<1, T, Q> const& x
)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs");
return typename vec<1, T, P>::bool_type(
return typename vec<1, T, Q>::bool_type(
isdenormal(x.x));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename vec<2, T, P>::bool_type isdenormal
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename vec<2, T, Q>::bool_type isdenormal
(
vec<2, T, P> const& x
vec<2, T, Q> const& x
)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs");
return typename vec<2, T, P>::bool_type(
return typename vec<2, T, Q>::bool_type(
isdenormal(x.x),
isdenormal(x.y));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename vec<3, T, P>::bool_type isdenormal
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename vec<3, T, Q>::bool_type isdenormal
(
vec<3, T, P> const& x
vec<3, T, Q> const& x
)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs");
return typename vec<3, T, P>::bool_type(
return typename vec<3, T, Q>::bool_type(
isdenormal(x.x),
isdenormal(x.y),
isdenormal(x.z));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER typename vec<4, T, P>::bool_type isdenormal
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER typename vec<4, T, Q>::bool_type isdenormal
(
vec<4, T, P> const& x
vec<4, T, Q> const& x
)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isdenormal' only accept floating-point inputs");
return typename vec<4, T, P>::bool_type(
return typename vec<4, T, Q>::bool_type(
isdenormal(x.x),
isdenormal(x.y),
isdenormal(x.z),
@ -100,15 +100,15 @@ namespace detail
return fmod(vec<1, genType>(x), y).x;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> fmod(vec<L, T, P> const& x, T y)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> fmod(vec<L, T, Q> const& x, T y)
{
return detail::compute_fmod<L, T, P, std::numeric_limits<T>::is_iec559>::call(x, vec<L, T, P>(y));
return detail::compute_fmod<L, T, Q, std::numeric_limits<T>::is_iec559>::call(x, vec<L, T, Q>(y));
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> fmod(vec<L, T, P> const& x, vec<L, T, P> const& y)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> fmod(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
{
return detail::compute_fmod<L, T, P, std::numeric_limits<T>::is_iec559>::call(x, y);
return detail::compute_fmod<L, T, Q, std::numeric_limits<T>::is_iec559>::call(x, y);
}
}//namespace glm

View File

@ -39,29 +39,29 @@ namespace glm
/// @{
template<typename T> GLM_FUNC_QUALIFIER T lerp(T x, T y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<2, T, P> lerp(const vec<2, T, P>& x, const vec<2, T, P>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<3, T, P> lerp(const vec<3, T, P>& x, const vec<3, T, P>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<4, T, P> lerp(const vec<4, T, P>& x, const vec<4, T, P>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<2, T, P> lerp(const vec<2, T, P>& x, const vec<2, T, P>& y, const vec<2, T, P>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<3, T, P> lerp(const vec<3, T, P>& x, const vec<3, T, P>& y, const vec<3, T, P>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<4, T, P> lerp(const vec<4, T, P>& x, const vec<4, T, P>& y, const vec<4, T, P>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, T a){return mix(x, y, a);} //!< \brief Returns x * (1.0 - a) + y * a, i.e., the linear blend of x and y using the floating-point value a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<2, T, Q> lerp(const vec<2, T, Q>& x, const vec<2, T, Q>& y, const vec<2, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> lerp(const vec<3, T, Q>& x, const vec<3, T, Q>& y, const vec<3, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> lerp(const vec<4, T, Q>& x, const vec<4, T, Q>& y, const vec<4, T, Q>& a){return mix(x, y, a);} //!< \brief Returns the component-wise result of x * (1.0 - a) + y * a, i.e., the linear blend of x and y using vector a. The value for a is not restricted to the range [0, 1]. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<2, T, P> saturate(const vec<2, T, P>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<3, T, P> saturate(const vec<3, T, P>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<4, T, P> saturate(const vec<4, T, P>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<2, T, Q> saturate(const vec<2, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> saturate(const vec<3, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> saturate(const vec<4, T, Q>& x){return clamp(x, T(0), T(1));} //!< \brief Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<2, T, P> atan2(const vec<2, T, P>& x, const vec<2, T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<3, T, P> atan2(const vec<3, T, P>& x, const vec<3, T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_QUALIFIER vec<4, T, P> atan2(const vec<4, T, P>& x, const vec<4, T, P>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<2, T, Q> atan2(const vec<2, T, Q>& x, const vec<2, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<3, T, Q> atan2(const vec<3, T, Q>& x, const vec<3, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_QUALIFIER vec<4, T, Q> atan2(const vec<4, T, Q>& x, const vec<4, T, Q>& y){return atan(x, y);} //!< \brief Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0. (From GLM_GTX_compatibility)
template<typename genType> GLM_FUNC_DECL bool isfinite(genType const& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_DECL vec<1, bool, P> isfinite(const vec<1, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_DECL vec<2, bool, P> isfinite(const vec<2, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_DECL vec<3, bool, P> isfinite(const vec<3, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
template<typename T, qualifier P> GLM_FUNC_DECL vec<4, bool, P> isfinite(const vec<4, T, P>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_DECL vec<1, bool, Q> isfinite(const vec<1, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_DECL vec<2, bool, Q> isfinite(const vec<2, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_DECL vec<3, bool, Q> isfinite(const vec<3, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
template<typename T, qualifier Q> GLM_FUNC_DECL vec<4, bool, Q> isfinite(const vec<4, T, Q>& x); //!< \brief Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)
typedef bool bool1; //!< \brief boolean type with 1 component. (From GLM_GTX_compatibility extension)
typedef vec<2, bool, highp> bool2; //!< \brief boolean type with 2 components. (From GLM_GTX_compatibility extension)

View File

@ -24,38 +24,38 @@ namespace glm
# endif
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<1, bool, P> isfinite(
vec<1, T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<1, bool, Q> isfinite(
vec<1, T, Q> const& x)
{
return vec<1, bool, P>(
return vec<1, bool, Q>(
isfinite(x.x));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<2, bool, P> isfinite(
vec<2, T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<2, bool, Q> isfinite(
vec<2, T, Q> const& x)
{
return vec<2, bool, P>(
return vec<2, bool, Q>(
isfinite(x.x),
isfinite(x.y));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<3, bool, P> isfinite(
vec<3, T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<3, bool, Q> isfinite(
vec<3, T, Q> const& x)
{
return vec<3, bool, P>(
return vec<3, bool, Q>(
isfinite(x.x),
isfinite(x.y),
isfinite(x.z));
}
template<typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<4, bool, P> isfinite(
vec<4, T, P> const& x)
template<typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<4, bool, Q> isfinite(
vec<4, T, Q> const& x)
{
return vec<4, bool, P>(
return vec<4, bool, Q>(
isfinite(x.x),
isfinite(x.y),
isfinite(x.z),

View File

@ -34,14 +34,14 @@ namespace glm
/// Convert an integer vector to a normalized float vector.
/// If the parameter value type is already a floating qualifier type, the value is passed through.
/// @see gtx_component_wise
template<typename floatType, length_t L, typename T, qualifier P>
GLM_FUNC_DECL vec<L, floatType, P> compNormalize(vec<L, T, P> const& v);
template<typename floatType, length_t L, typename T, qualifier Q>
GLM_FUNC_DECL vec<L, floatType, Q> compNormalize(vec<L, T, Q> const& v);
/// Convert a normalized float vector to an integer vector.
/// If the parameter value type is already a floating qualifier type, the value is passed through.
/// @see gtx_component_wise
template<length_t L, typename T, typename floatType, qualifier P>
GLM_FUNC_DECL vec<L, T, P> compScale(vec<L, floatType, P> const& v);
template<length_t L, typename T, typename floatType, qualifier Q>
GLM_FUNC_DECL vec<L, T, Q> compScale(vec<L, floatType, Q> const& v);
/// Add all vector components together.
/// @see gtx_component_wise

View File

@ -6,92 +6,92 @@
namespace glm{
namespace detail
{
template<length_t L, typename T, typename floatType, qualifier P, bool isInteger, bool signedType>
template<length_t L, typename T, typename floatType, qualifier Q, bool isInteger, bool signedType>
struct compute_compNormalize
{};
template<length_t L, typename T, typename floatType, qualifier P>
struct compute_compNormalize<L, T, floatType, P, true, true>
template<length_t L, typename T, typename floatType, qualifier Q>
struct compute_compNormalize<L, T, floatType, Q, true, true>
{
GLM_FUNC_QUALIFIER static vec<L, floatType, P> call(vec<L, T, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
{
floatType const Min = static_cast<floatType>(std::numeric_limits<T>::min());
floatType const Max = static_cast<floatType>(std::numeric_limits<T>::max());
return (vec<L, floatType, P>(v) - Min) / (Max - Min) * static_cast<floatType>(2) - static_cast<floatType>(1);
return (vec<L, floatType, Q>(v) - Min) / (Max - Min) * static_cast<floatType>(2) - static_cast<floatType>(1);
}
};
template<length_t L, typename T, typename floatType, qualifier P>
struct compute_compNormalize<L, T, floatType, P, true, false>
template<length_t L, typename T, typename floatType, qualifier Q>
struct compute_compNormalize<L, T, floatType, Q, true, false>
{
GLM_FUNC_QUALIFIER static vec<L, floatType, P> call(vec<L, T, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
{
return vec<L, floatType, P>(v) / static_cast<floatType>(std::numeric_limits<T>::max());
return vec<L, floatType, Q>(v) / static_cast<floatType>(std::numeric_limits<T>::max());
}
};
template<length_t L, typename T, typename floatType, qualifier P>
struct compute_compNormalize<L, T, floatType, P, false, true>
template<length_t L, typename T, typename floatType, qualifier Q>
struct compute_compNormalize<L, T, floatType, Q, false, true>
{
GLM_FUNC_QUALIFIER static vec<L, floatType, P> call(vec<L, T, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, floatType, Q> call(vec<L, T, Q> const& v)
{
return v;
}
};
template<length_t L, typename T, typename floatType, qualifier P, bool isInteger, bool signedType>
template<length_t L, typename T, typename floatType, qualifier Q, bool isInteger, bool signedType>
struct compute_compScale
{};
template<length_t L, typename T, typename floatType, qualifier P>
struct compute_compScale<L, T, floatType, P, true, true>
template<length_t L, typename T, typename floatType, qualifier Q>
struct compute_compScale<L, T, floatType, Q, true, true>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, floatType, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
{
floatType const Max = static_cast<floatType>(std::numeric_limits<T>::max()) + static_cast<floatType>(0.5);
vec<L, floatType, P> const Scaled(v * Max);
vec<L, T, P> const Result(Scaled - static_cast<floatType>(0.5));
vec<L, floatType, Q> const Scaled(v * Max);
vec<L, T, Q> const Result(Scaled - static_cast<floatType>(0.5));
return Result;
}
};
template<length_t L, typename T, typename floatType, qualifier P>
struct compute_compScale<L, T, floatType, P, true, false>
template<length_t L, typename T, typename floatType, qualifier Q>
struct compute_compScale<L, T, floatType, Q, true, false>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, floatType, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
{
return vec<L, T, P>(vec<L, floatType, P>(v) * static_cast<floatType>(std::numeric_limits<T>::max()));
return vec<L, T, Q>(vec<L, floatType, Q>(v) * static_cast<floatType>(std::numeric_limits<T>::max()));
}
};
template<length_t L, typename T, typename floatType, qualifier P>
struct compute_compScale<L, T, floatType, P, false, true>
template<length_t L, typename T, typename floatType, qualifier Q>
struct compute_compScale<L, T, floatType, Q, false, true>
{
GLM_FUNC_QUALIFIER static vec<L, T, P> call(vec<L, floatType, P> const& v)
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, floatType, Q> const& v)
{
return v;
}
};
}//namespace detail
template<typename floatType, length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER vec<L, floatType, P> compNormalize(vec<L, T, P> const& v)
template<typename floatType, length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, floatType, Q> compNormalize(vec<L, T, Q> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "'compNormalize' accepts only floating-point types for 'floatType' template parameter");
return detail::compute_compNormalize<L, T, floatType, P, std::numeric_limits<T>::is_integer, std::numeric_limits<T>::is_signed>::call(v);
return detail::compute_compNormalize<L, T, floatType, Q, std::numeric_limits<T>::is_integer, std::numeric_limits<T>::is_signed>::call(v);
}
template<typename T, length_t L, typename floatType, qualifier P>
GLM_FUNC_QUALIFIER vec<L, T, P> compScale(vec<L, floatType, P> const& v)
template<typename T, length_t L, typename floatType, qualifier Q>
GLM_FUNC_QUALIFIER vec<L, T, Q> compScale(vec<L, floatType, Q> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "'compScale' accepts only floating-point types for 'floatType' template parameter");
return detail::compute_compScale<L, T, floatType, P, std::numeric_limits<T>::is_integer, std::numeric_limits<T>::is_signed>::call(v);
return detail::compute_compScale<L, T, floatType, Q, std::numeric_limits<T>::is_integer, std::numeric_limits<T>::is_signed>::call(v);
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER T compAdd(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T compAdd(vec<L, T, Q> const& v)
{
T Result(0);
for(length_t i = 0, n = v.length(); i < n; ++i)
@ -99,8 +99,8 @@ namespace detail
return Result;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER T compMul(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T compMul(vec<L, T, Q> const& v)
{
T Result(1);
for(length_t i = 0, n = v.length(); i < n; ++i)
@ -108,8 +108,8 @@ namespace detail
return Result;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER T compMin(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T compMin(vec<L, T, Q> const& v)
{
T Result(v[0]);
for(length_t i = 1, n = v.length(); i < n; ++i)
@ -117,8 +117,8 @@ namespace detail
return Result;
}
template<length_t L, typename T, qualifier P>
GLM_FUNC_QUALIFIER T compMax(vec<L, T, P> const& v)
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T compMax(vec<L, T, Q> const& v)
{
T Result(v[0]);
for(length_t i = 1, n = v.length(); i < n; ++i)

View File

@ -33,17 +33,17 @@ namespace glm
/// @addtogroup gtx_dual_quaternion
/// @{
template<typename T, qualifier P = defaultp>
template<typename T, qualifier Q = defaultp>
struct tdualquat
{
// -- Implementation detail --
typedef T value_type;
typedef glm::tquat<T, P> part_type;
typedef glm::tquat<T, Q> part_type;
// -- Data --
glm::tquat<T, P> real, dual;
glm::tquat<T, Q> real, dual;
// -- Component accesses --
@ -57,128 +57,128 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat() GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, P> const& d) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, Q> const& d) GLM_DEFAULT;
template<qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tdualquat<T, Q> const& d);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, P> const& real);
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, P> const& orientation, vec<3, T, P> const& translation);
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, P> const& real, tquat<T, P> const& dual);
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, Q> const& real);
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, Q> const& orientation, vec<3, T, Q> const& translation);
GLM_FUNC_DECL GLM_CONSTEXPR tdualquat(tquat<T, Q> const& real, tquat<T, Q> const& dual);
// -- Conversion constructors --
template<typename U, qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tdualquat(tdualquat<U, Q> const& q);
GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<2, 4, T, P> const& holder_mat);
GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<3, 4, T, P> const& aug_mat);
GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<2, 4, T, Q> const& holder_mat);
GLM_FUNC_DECL GLM_EXPLICIT tdualquat(mat<3, 4, T, Q> const& aug_mat);
// -- Unary arithmetic operators --
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<T, P> const& m) GLM_DEFAULT;
GLM_FUNC_DECL tdualquat<T, Q> & operator=(tdualquat<T, Q> const& m) GLM_DEFAULT;
template<typename U>
GLM_FUNC_DECL tdualquat<T, P> & operator=(tdualquat<U, P> const& m);
GLM_FUNC_DECL tdualquat<T, Q> & operator=(tdualquat<U, Q> const& m);
template<typename U>
GLM_FUNC_DECL tdualquat<T, P> & operator*=(U s);
GLM_FUNC_DECL tdualquat<T, Q> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL tdualquat<T, P> & operator/=(U s);
GLM_FUNC_DECL tdualquat<T, Q> & operator/=(U s);
};
// -- Unary bit operators --
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> operator+(tdualquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> operator+(tdualquat<T, Q> const& q);
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> operator-(tdualquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> operator-(tdualquat<T, Q> const& q);
// -- Binary operators --
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> operator+(tdualquat<T, P> const& q, tdualquat<T, P> const& p);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> operator+(tdualquat<T, Q> const& q, tdualquat<T, Q> const& p);
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> operator*(tdualquat<T, P> const& q, tdualquat<T, P> const& p);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> operator*(tdualquat<T, Q> const& q, tdualquat<T, Q> const& p);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator*(tdualquat<T, P> const& q, vec<3, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator*(tdualquat<T, Q> const& q, vec<3, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const& v, tdualquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<3, T, Q> operator*(vec<3, T, Q> const& v, tdualquat<T, Q> const& q);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator*(tdualquat<T, P> const& q, vec<4, T, P> const& v);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator*(tdualquat<T, Q> const& q, vec<4, T, Q> const& v);
template<typename T, qualifier P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const& v, tdualquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL vec<4, T, Q> operator*(vec<4, T, Q> const& v, tdualquat<T, Q> const& q);
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> operator*(tdualquat<T, P> const& q, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> operator*(tdualquat<T, Q> const& q, T const& s);
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> operator*(T const& s, tdualquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> operator*(T const& s, tdualquat<T, Q> const& q);
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> operator/(tdualquat<T, P> const& q, T const& s);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> operator/(tdualquat<T, Q> const& q, T const& s);
// -- Boolean operators --
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator==(tdualquat<T, P> const& q1, tdualquat<T, P> const& q2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator==(tdualquat<T, Q> const& q1, tdualquat<T, Q> const& q2);
template<typename T, qualifier P>
GLM_FUNC_DECL bool operator!=(tdualquat<T, P> const& q1, tdualquat<T, P> const& q2);
template<typename T, qualifier Q>
GLM_FUNC_DECL bool operator!=(tdualquat<T, Q> const& q1, tdualquat<T, Q> const& q2);
/// Creates an identity dual quaternion.
///
/// @see gtx_dual_quaternion
template <typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> dual_quat_identity();
template <typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> dual_quat_identity();
/// Returns the normalized quaternion.
///
/// @see gtx_dual_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> normalize(tdualquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> normalize(tdualquat<T, Q> const& q);
/// Returns the linear interpolation of two dual quaternion.
///
/// @see gtc_dual_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> lerp(tdualquat<T, P> const& x, tdualquat<T, P> const& y, T const& a);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> lerp(tdualquat<T, Q> const& x, tdualquat<T, Q> const& y, T const& a);
/// Returns the q inverse.
///
/// @see gtx_dual_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> inverse(tdualquat<T, P> const& q);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> inverse(tdualquat<T, Q> const& q);
/// Converts a quaternion to a 2 * 4 matrix.
///
/// @see gtx_dual_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL mat<2, 4, T, P> mat2x4_cast(tdualquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<2, 4, T, Q> mat2x4_cast(tdualquat<T, Q> const& x);
/// Converts a quaternion to a 3 * 4 matrix.
///
/// @see gtx_dual_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL mat<3, 4, T, P> mat3x4_cast(tdualquat<T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL mat<3, 4, T, Q> mat3x4_cast(tdualquat<T, Q> const& x);
/// Converts a 2 * 4 matrix (matrix which holds real and dual parts) to a quaternion.
///
/// @see gtx_dual_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> dualquat_cast(mat<2, 4, T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> dualquat_cast(mat<2, 4, T, Q> const& x);
/// Converts a 3 * 4 matrix (augmented matrix rotation + translation) to a quaternion.
///
/// @see gtx_dual_quaternion
template<typename T, qualifier P>
GLM_FUNC_DECL tdualquat<T, P> dualquat_cast(mat<3, 4, T, P> const& x);
template<typename T, qualifier Q>
GLM_FUNC_DECL tdualquat<T, Q> dualquat_cast(mat<3, 4, T, Q> const& x);
/// Dual-quaternion of low single-qualifier floating-point numbers.

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