Renamed tvec into vec

This commit is contained in:
Christophe Riccio 2016-12-30 00:03:34 +01:00
parent d7fd5a61da
commit 4dd748f380
31 changed files with 1365 additions and 1365 deletions

View File

@ -28,19 +28,19 @@ namespace detail
template <typename T, precision P, int E0, int E1, bool Aligned>
struct _swizzle_base1<2, T, P, E0,E1,-1,-2, Aligned> : public _swizzle_base0<T, 2>
{
GLM_FUNC_QUALIFIER tvec<2, T, P> operator ()() const { return tvec<2, T, P>(this->elem(E0), this->elem(E1)); }
GLM_FUNC_QUALIFIER vec<2, T, P> operator ()() const { return vec<2, T, P>(this->elem(E0), this->elem(E1)); }
};
template <typename T, precision P, int E0, int E1, int E2, bool Aligned>
struct _swizzle_base1<3, T, P, E0,E1,E2,-1, Aligned> : public _swizzle_base0<T, 3>
{
GLM_FUNC_QUALIFIER tvec<3, T, P> operator ()() const { return tvec<3, T, P>(this->elem(E0), this->elem(E1), this->elem(E2)); }
GLM_FUNC_QUALIFIER vec<3, T, P> operator ()() const { return vec<3, T, P>(this->elem(E0), this->elem(E1), this->elem(E2)); }
};
template <typename T, precision P, int E0, int E1, int E2, int E3, bool Aligned>
struct _swizzle_base1<4, T, P, E0,E1,E2,E3, Aligned> : public _swizzle_base0<T, 4>
{
GLM_FUNC_QUALIFIER tvec<4, T, P> operator ()() const { return tvec<4, T, P>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
GLM_FUNC_QUALIFIER vec<4, T, P> operator ()() const { return vec<4, T, P>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); }
};
// Internal class for implementing swizzle operators
@ -65,7 +65,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (tvec<N, T, P> const& that)
GLM_FUNC_QUALIFIER _swizzle_base2& operator= (vec<N, T, P> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e = t; }
@ -74,7 +74,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER void operator -= (tvec<N, T, P> const& that)
GLM_FUNC_QUALIFIER void operator -= (vec<N, T, P> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e -= t; }
@ -82,7 +82,7 @@ namespace detail
_apply_op(that, op());
}
GLM_FUNC_QUALIFIER void operator += (tvec<N, T, P> const& that)
GLM_FUNC_QUALIFIER void operator += (vec<N, T, P> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e += t; }
@ -90,7 +90,7 @@ namespace detail
_apply_op(that, op());
}
GLM_FUNC_QUALIFIER void operator *= (tvec<N, T, P> const& that)
GLM_FUNC_QUALIFIER void operator *= (vec<N, T, P> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e *= t; }
@ -98,7 +98,7 @@ namespace detail
_apply_op(that, op());
}
GLM_FUNC_QUALIFIER void operator /= (tvec<N, T, P> const& that)
GLM_FUNC_QUALIFIER void operator /= (vec<N, T, P> const& that)
{
struct op {
GLM_FUNC_QUALIFIER void operator() (T& e, T& t) { e /= t; }
@ -119,7 +119,7 @@ namespace detail
protected:
template <typename U>
GLM_FUNC_QUALIFIER void _apply_op(tvec<N, T, P> const& that, U op)
GLM_FUNC_QUALIFIER void _apply_op(vec<N, T, P> const& that, U op)
{
// Make a copy of the data in this == &that.
// The copier should optimize out the copy in cases where the function is
@ -154,7 +154,7 @@ namespace detail
using base_type::operator=;
GLM_FUNC_QUALIFIER operator tvec<N, T, P> () const { return (*this)(); }
GLM_FUNC_QUALIFIER operator vec<N, T, P> () const { return (*this)(); }
};
//
@ -170,17 +170,17 @@ namespace detail
//
#define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \
_GLM_SWIZZLE_TEMPLATE2 \
GLM_FUNC_QUALIFIER tvec<N, T, P> operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
GLM_FUNC_QUALIFIER vec<N, T, P> operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \
{ \
return a() OPERAND b(); \
} \
_GLM_SWIZZLE_TEMPLATE1 \
GLM_FUNC_QUALIFIER tvec<N, T, P> operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const tvec<N, T, P>& b) \
GLM_FUNC_QUALIFIER vec<N, T, P> operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const vec<N, T, P>& b) \
{ \
return a() OPERAND b; \
} \
_GLM_SWIZZLE_TEMPLATE1 \
GLM_FUNC_QUALIFIER tvec<N, T, P> operator OPERAND ( const tvec<N, T, P>& a, const _GLM_SWIZZLE_TYPE1& b) \
GLM_FUNC_QUALIFIER vec<N, T, P> operator OPERAND ( const vec<N, T, P>& a, const _GLM_SWIZZLE_TYPE1& b) \
{ \
return a OPERAND b(); \
}
@ -190,12 +190,12 @@ namespace detail
//
#define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \
_GLM_SWIZZLE_TEMPLATE1 \
GLM_FUNC_QUALIFIER tvec<N, T, P> operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \
GLM_FUNC_QUALIFIER vec<N, T, P> operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \
{ \
return a() OPERAND b; \
} \
_GLM_SWIZZLE_TEMPLATE1 \
GLM_FUNC_QUALIFIER tvec<N, T, P> operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \
GLM_FUNC_QUALIFIER vec<N, T, P> operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \
{ \
return a OPERAND b(); \
}

View File

@ -326,7 +326,7 @@ namespace detail
std::numeric_limits<genFIType>::is_iec559 || (std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer),
"'sign' only accept signed inputs");
return detail::compute_sign<1, genFIType, defaultp, tvec, std::numeric_limits<genFIType>::is_iec559, highp>::call(tvec1<genFIType>(x)).x;
return detail::compute_sign<1, genFIType, defaultp, vec, std::numeric_limits<genFIType>::is_iec559, highp>::call(tvec1<genFIType>(x)).x;
}
template <int D, typename T, precision P, template <int, typename, precision> class vecType>

View File

@ -11,7 +11,7 @@ namespace glm{
namespace detail
{
template <precision P>
struct compute_abs_vector<4, float, P, tvec, true>
struct compute_abs_vector<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
@ -22,7 +22,7 @@ namespace detail
};
template <precision P>
struct compute_abs_vector<4, int, P, tvec, true>
struct compute_abs_vector<4, int, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & v)
{
@ -33,7 +33,7 @@ namespace detail
};
template <precision P>
struct compute_floor<4, float, P, tvec, true>
struct compute_floor<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
@ -44,7 +44,7 @@ namespace detail
};
template <precision P>
struct compute_ceil<4, float, P, tvec, true>
struct compute_ceil<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
@ -55,7 +55,7 @@ namespace detail
};
template <precision P>
struct compute_fract<4, float, P, tvec, true>
struct compute_fract<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
@ -66,7 +66,7 @@ namespace detail
};
template <precision P>
struct compute_round<4, float, P, tvec, true>
struct compute_round<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
@ -77,7 +77,7 @@ namespace detail
};
template <precision P>
struct compute_mod<4, float, P, tvec, true>
struct compute_mod<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y)
{
@ -88,7 +88,7 @@ namespace detail
};
template <precision P>
struct compute_min_vector<4, float, P, tvec, true>
struct compute_min_vector<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
{
@ -99,7 +99,7 @@ namespace detail
};
template <precision P>
struct compute_min_vector<4, int32, P, tvec, true>
struct compute_min_vector<4, int32, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
{
@ -110,7 +110,7 @@ namespace detail
};
template <precision P>
struct compute_min_vector<4, uint32, P, tvec, true>
struct compute_min_vector<4, uint32, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2)
{
@ -121,7 +121,7 @@ namespace detail
};
template <precision P>
struct compute_max_vector<4, float, P, tvec, true>
struct compute_max_vector<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
{
@ -132,7 +132,7 @@ namespace detail
};
template <precision P>
struct compute_max_vector<4, int32, P, tvec, true>
struct compute_max_vector<4, int32, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
{
@ -143,7 +143,7 @@ namespace detail
};
template <precision P>
struct compute_max_vector<4, uint32, P, tvec, true>
struct compute_max_vector<4, uint32, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2)
{
@ -154,7 +154,7 @@ namespace detail
};
template <precision P>
struct compute_clamp_vector<4, float, P, tvec, true>
struct compute_clamp_vector<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & minVal, tvec4<float, P> const & maxVal)
{
@ -165,7 +165,7 @@ namespace detail
};
template <precision P>
struct compute_clamp_vector<4, int32, P, tvec, true>
struct compute_clamp_vector<4, int32, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & x, tvec4<int32, P> const & minVal, tvec4<int32, P> const & maxVal)
{
@ -176,7 +176,7 @@ namespace detail
};
template <precision P>
struct compute_clamp_vector<4, uint32, P, tvec, true>
struct compute_clamp_vector<4, uint32, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & x, tvec4<uint32, P> const & minVal, tvec4<uint32, P> const & maxVal)
{
@ -187,7 +187,7 @@ namespace detail
};
template <precision P>
struct compute_mix_vector<4, float, bool, P, tvec, true>
struct compute_mix_vector<4, float, bool, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y, tvec4<bool, P> const & a)
{
@ -216,7 +216,7 @@ namespace detail
};
*/
template <precision P>
struct compute_smoothstep_vector<4, float, P, tvec, true>
struct compute_smoothstep_vector<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge0, tvec4<float, P> const& edge1, tvec4<float, P> const& x)
{

View File

@ -23,7 +23,7 @@ namespace detail
template <int D, typename T, precision P, template <int, class, precision> class vecType, bool isFloat, bool Aligned>
struct compute_log2
{
GLM_FUNC_QUALIFIER static tvec<D, T, P> call(tvec<D, T, P> const & vec)
GLM_FUNC_QUALIFIER static vec<D, T, P> call(vec<D, T, P> const & vec)
{
return detail::functor1<D, T, T, P>::call(log2, vec);
}
@ -32,7 +32,7 @@ namespace detail
template <int D, typename T, precision P, bool Aligned>
struct compute_sqrt
{
GLM_FUNC_QUALIFIER static tvec<D, T, P> call(tvec<D, T, P> const & x)
GLM_FUNC_QUALIFIER static vec<D, T, P> call(vec<D, T, P> const & x)
{
return detail::functor1<D, T, T, P>::call(std::sqrt, x);
}
@ -41,7 +41,7 @@ namespace detail
template <int D, typename T, precision P, bool Aligned>
struct compute_inversesqrt
{
GLM_FUNC_QUALIFIER static tvec<D, T, P> call(tvec<D, T, P> const & x)
GLM_FUNC_QUALIFIER static vec<D, T, P> call(vec<D, T, P> const & x)
{
return static_cast<T>(1) / sqrt(x);
}
@ -50,13 +50,13 @@ namespace detail
template <int D, bool Aligned>
struct compute_inversesqrt<D, float, lowp, Aligned>
{
GLM_FUNC_QUALIFIER static tvec<D, float, lowp> call(tvec<D, float, lowp> const & x)
GLM_FUNC_QUALIFIER static vec<D, float, lowp> call(vec<D, float, lowp> const & x)
{
tvec<D, float, lowp> tmp(x);
tvec<D, float, lowp> xhalf(tmp * 0.5f);
tvec<D, uint, lowp>* p = reinterpret_cast<tvec<D, uint, lowp>*>(const_cast<tvec<D, float, lowp>*>(&x));
tvec<D, uint, lowp> i = tvec<D, uint, lowp>(0x5f375a86) - (*p >> tvec<D, uint, lowp>(1));
tvec<D, float, lowp>* ptmp = reinterpret_cast<tvec<D, float, lowp>*>(&i);
vec<D, float, lowp> tmp(x);
vec<D, float, lowp> xhalf(tmp * 0.5f);
vec<D, uint, lowp>* p = reinterpret_cast<vec<D, uint, lowp>*>(const_cast<vec<D, float, lowp>*>(&x));
vec<D, uint, lowp> i = vec<D, uint, lowp>(0x5f375a86) - (*p >> vec<D, uint, lowp>(1));
vec<D, float, lowp>* ptmp = reinterpret_cast<vec<D, float, lowp>*>(&i);
tmp = *ptmp;
tmp = tmp * (1.5f - xhalf * tmp * tmp);
return tmp;

View File

@ -46,8 +46,8 @@ namespace glm
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <int D, typename T, precision P>
GLM_FUNC_DECL T dot(
tvec<D, T, P> const & x,
tvec<D, T, P> const & y);
vec<D, T, P> const & x,
vec<D, T, P> const & y);
/// Returns the cross product of x and y.
///

View File

@ -32,28 +32,28 @@ namespace detail
struct compute_dot{};
template <typename T, precision P, bool Aligned>
struct compute_dot<tvec<1, T, P>, T, Aligned>
struct compute_dot<vec<1, T, P>, T, Aligned>
{
GLM_FUNC_QUALIFIER static T call(tvec<1, T, P> const & a, tvec<1, T, P> const & b)
GLM_FUNC_QUALIFIER static T call(vec<1, T, P> const & a, vec<1, T, P> const & b)
{
return a.x * b.x;
}
};
template <typename T, precision P, bool Aligned>
struct compute_dot<tvec<2, T, P>, T, Aligned>
struct compute_dot<vec<2, T, P>, T, Aligned>
{
GLM_FUNC_QUALIFIER static T call(tvec<2, T, P> const & a, tvec<2, T, P> const & b)
GLM_FUNC_QUALIFIER static T call(vec<2, T, P> const & a, vec<2, T, P> const & b)
{
tvec<2, T, P> tmp(a * b);
vec<2, T, P> tmp(a * b);
return tmp.x + tmp.y;
}
};
template <typename T, precision P, bool Aligned>
struct compute_dot<tvec<3, T, P>, T, Aligned>
struct compute_dot<vec<3, T, P>, T, Aligned>
{
GLM_FUNC_QUALIFIER static T call(tvec<3, T, P> const & a, tvec<3, T, P> const & b)
GLM_FUNC_QUALIFIER static T call(vec<3, T, P> const & a, vec<3, T, P> const & b)
{
tvec3<T, P> tmp(a * b);
return tmp.x + tmp.y + tmp.z;
@ -61,11 +61,11 @@ namespace detail
};
template <typename T, precision P, bool Aligned>
struct compute_dot<tvec<4, T, P>, T, Aligned>
struct compute_dot<vec<4, T, P>, T, Aligned>
{
GLM_FUNC_QUALIFIER static T call(tvec<4, T, P> const & a, tvec<4, T, P> const & b)
GLM_FUNC_QUALIFIER static T call(vec<4, T, P> const & a, vec<4, T, P> const & b)
{
tvec<4, T, P> tmp(a * b);
vec<4, T, P> tmp(a * b);
return (tmp.x + tmp.y) + (tmp.z + tmp.w);
}
};
@ -168,10 +168,10 @@ namespace detail
}
template <int D, typename T, precision P>
GLM_FUNC_QUALIFIER T dot(tvec<D, T, P> const & x, tvec<D, T, P> const & y)
GLM_FUNC_QUALIFIER T dot(vec<D, T, P> const & x, vec<D, T, P> const & y)
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
return detail::compute_dot<tvec<D, T, P>, T, detail::is_aligned<P>::value>::call(x, y);
return detail::compute_dot<vec<D, T, P>, T, detail::is_aligned<P>::value>::call(x, y);
}
template <typename T, precision P>

View File

@ -9,16 +9,16 @@ namespace glm{
namespace detail
{
template <precision P>
struct compute_length<tvec, 4, float, P, true>
struct compute_length<vec, 4, float, P, true>
{
GLM_FUNC_QUALIFIER static float call(tvec<4, float, P> const & v)
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const & v)
{
return _mm_cvtss_f32(glm_vec4_length(v.data));
}
};
template <precision P>
struct compute_distance<tvec, 4, float, P, true>
struct compute_distance<vec, 4, float, P, true>
{
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & p0, tvec4<float, P> const & p1)
{
@ -27,9 +27,9 @@ namespace detail
};
template <precision P>
struct compute_dot<tvec<4, float, P>, float, true>
struct compute_dot<vec<4, float, P>, float, true>
{
GLM_FUNC_QUALIFIER static float call(tvec<4, float, P> const& x, tvec<4, float, P> const& y)
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const& x, vec<4, float, P> const& y)
{
return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data));
}
@ -51,7 +51,7 @@ namespace detail
};
template <precision P>
struct compute_normalize<4, float, P, tvec, true>
struct compute_normalize<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
{
@ -62,7 +62,7 @@ namespace detail
};
template <precision P>
struct compute_faceforward<4, float, P, tvec, true>
struct compute_faceforward<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& N, tvec4<float, P> const& I, tvec4<float, P> const& Nref)
{
@ -73,7 +73,7 @@ namespace detail
};
template <precision P>
struct compute_reflect<4, float, P, tvec, true>
struct compute_reflect<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& I, tvec4<float, P> const& N)
{
@ -84,7 +84,7 @@ namespace detail
};
template <precision P>
struct compute_refract<4, float, P, tvec, true>
struct compute_refract<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& I, tvec4<float, P> const& N, float eta)
{

View File

@ -9,7 +9,7 @@ namespace glm{
namespace detail
{
template <glm::precision P>
struct compute_bitfieldReverseStep<4, uint32, P, tvec, true, true>
struct compute_bitfieldReverseStep<4, uint32, P, vec, true, true>
{
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v, uint32 Mask, uint32 Shift)
{
@ -30,7 +30,7 @@ namespace detail
};
template <glm::precision P>
struct compute_bitfieldBitCountStep<4, uint32, P, tvec, true, true>
struct compute_bitfieldBitCountStep<4, uint32, P, vec, true, true>
{
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v, uint32 Mask, uint32 Shift)
{

View File

@ -35,55 +35,55 @@ namespace glm{
namespace detail
{
template <typename T, precision P>
struct outerProduct_trait<2, 2, T, P, tvec, tvec>
struct outerProduct_trait<2, 2, T, P, vec, vec>
{
typedef tmat2x2<T, P> type;
};
template <typename T, precision P>
struct outerProduct_trait<2, 3, T, P, tvec, tvec>
struct outerProduct_trait<2, 3, T, P, vec, vec>
{
typedef tmat3x2<T, P> type;
};
template <typename T, precision P>
struct outerProduct_trait<2, 4, T, P, tvec, tvec>
struct outerProduct_trait<2, 4, T, P, vec, vec>
{
typedef tmat4x2<T, P> type;
};
template <typename T, precision P>
struct outerProduct_trait<3, 2, T, P, tvec, tvec>
struct outerProduct_trait<3, 2, T, P, vec, vec>
{
typedef tmat2x3<T, P> type;
};
template <typename T, precision P>
struct outerProduct_trait<3, 3, T, P, tvec, tvec>
struct outerProduct_trait<3, 3, T, P, vec, vec>
{
typedef tmat3x3<T, P> type;
};
template <typename T, precision P>
struct outerProduct_trait<3, 4, T, P, tvec, tvec>
struct outerProduct_trait<3, 4, T, P, vec, vec>
{
typedef tmat4x3<T, P> type;
};
template <typename T, precision P>
struct outerProduct_trait<4, 2, T, P, tvec, tvec>
struct outerProduct_trait<4, 2, T, P, vec, vec>
{
typedef tmat2x4<T, P> type;
};
template <typename T, precision P>
struct outerProduct_trait<4, 3, T, P, tvec, tvec>
struct outerProduct_trait<4, 3, T, P, vec, vec>
{
typedef tmat3x4<T, P> type;
};
template <typename T, precision P>
struct outerProduct_trait<4, 4, T, P, tvec, tvec>
struct outerProduct_trait<4, 4, T, P, vec, vec>
{
typedef tmat4x4<T, P> type;
};

View File

@ -61,7 +61,7 @@ namespace detail
}//namespace detail
template<>
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp, tvec, tvec>(tvec4<float, aligned_lowp> const & c, tvec4<float, aligned_lowp> const & r)
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp, vec, vec>(tvec4<float, aligned_lowp> const & c, tvec4<float, aligned_lowp> const & r)
{
tmat4x4<float, aligned_lowp> m(uninitialize);
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
@ -69,7 +69,7 @@ namespace detail
}
template<>
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_mediump> outerProduct<4, 4, float, aligned_mediump, tvec, tvec>(tvec4<float, aligned_mediump> const & c, tvec4<float, aligned_mediump> const & r)
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_mediump> outerProduct<4, 4, float, aligned_mediump, vec, vec>(tvec4<float, aligned_mediump> const & c, tvec4<float, aligned_mediump> const & r)
{
tmat4x4<float, aligned_mediump> m(uninitialize);
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
@ -77,7 +77,7 @@ namespace detail
}
template<>
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_highp> outerProduct<4, 4, float, aligned_highp, tvec, tvec>(tvec4<float, aligned_highp> const & c, tvec4<float, aligned_highp> const & r)
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_highp> outerProduct<4, 4, float, aligned_highp, vec, vec>(tvec4<float, aligned_highp> const & c, tvec4<float, aligned_highp> const & r)
{
tmat4x4<float, aligned_highp> m(uninitialize);
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));

View File

@ -9,140 +9,140 @@
namespace glm
{
// tvec1 type explicit instantiation
template struct tvec<1, uint8, lowp>;
template struct tvec<1, uint16, lowp>;
template struct tvec<1, uint32, lowp>;
template struct tvec<1, uint64, lowp>;
template struct tvec<1, int8, lowp>;
template struct tvec<1, int16, lowp>;
template struct tvec<1, int32, lowp>;
template struct tvec<1, int64, lowp>;
template struct tvec<1, float32, lowp>;
template struct tvec<1, float64, lowp>;
template struct vec<1, uint8, lowp>;
template struct vec<1, uint16, lowp>;
template struct vec<1, uint32, lowp>;
template struct vec<1, uint64, lowp>;
template struct vec<1, int8, lowp>;
template struct vec<1, int16, lowp>;
template struct vec<1, int32, lowp>;
template struct vec<1, int64, lowp>;
template struct vec<1, float32, lowp>;
template struct vec<1, float64, lowp>;
template struct tvec<1, uint8, mediump>;
template struct tvec<1, uint16, mediump>;
template struct tvec<1, uint32, mediump>;
template struct tvec<1, uint64, mediump>;
template struct tvec<1, int8, mediump>;
template struct tvec<1, int16, mediump>;
template struct tvec<1, int32, mediump>;
template struct tvec<1, int64, mediump>;
template struct tvec<1, float32, mediump>;
template struct tvec<1, float64, mediump>;
template struct vec<1, uint8, mediump>;
template struct vec<1, uint16, mediump>;
template struct vec<1, uint32, mediump>;
template struct vec<1, uint64, mediump>;
template struct vec<1, int8, mediump>;
template struct vec<1, int16, mediump>;
template struct vec<1, int32, mediump>;
template struct vec<1, int64, mediump>;
template struct vec<1, float32, mediump>;
template struct vec<1, float64, mediump>;
template struct tvec<1, uint8, highp>;
template struct tvec<1, uint16, highp>;
template struct tvec<1, uint32, highp>;
template struct tvec<1, uint64, highp>;
template struct tvec<1, int8, highp>;
template struct tvec<1, int16, highp>;
template struct tvec<1, int32, highp>;
template struct tvec<1, int64, highp>;
template struct tvec<1, float32, highp>;
template struct tvec<1, float64, highp>;
template struct vec<1, uint8, highp>;
template struct vec<1, uint16, highp>;
template struct vec<1, uint32, highp>;
template struct vec<1, uint64, highp>;
template struct vec<1, int8, highp>;
template struct vec<1, int16, highp>;
template struct vec<1, int32, highp>;
template struct vec<1, int64, highp>;
template struct vec<1, float32, highp>;
template struct vec<1, float64, highp>;
// tvec2 type explicit instantiation
template struct tvec<2, uint8, lowp>;
template struct tvec<2, uint16, lowp>;
template struct tvec<2, uint32, lowp>;
template struct tvec<2, uint64, lowp>;
template struct tvec<2, int8, lowp>;
template struct tvec<2, int16, lowp>;
template struct tvec<2, int32, lowp>;
template struct tvec<2, int64, lowp>;
template struct tvec<2, float32, lowp>;
template struct tvec<2, float64, lowp>;
template struct vec<2, uint8, lowp>;
template struct vec<2, uint16, lowp>;
template struct vec<2, uint32, lowp>;
template struct vec<2, uint64, lowp>;
template struct vec<2, int8, lowp>;
template struct vec<2, int16, lowp>;
template struct vec<2, int32, lowp>;
template struct vec<2, int64, lowp>;
template struct vec<2, float32, lowp>;
template struct vec<2, float64, lowp>;
template struct tvec<2, uint8, mediump>;
template struct tvec<2, uint16, mediump>;
template struct tvec<2, uint32, mediump>;
template struct tvec<2, uint64, mediump>;
template struct tvec<2, int8, mediump>;
template struct tvec<2, int16, mediump>;
template struct tvec<2, int32, mediump>;
template struct tvec<2, int64, mediump>;
template struct tvec<2, float32, mediump>;
template struct tvec<2, float64, mediump>;
template struct vec<2, uint8, mediump>;
template struct vec<2, uint16, mediump>;
template struct vec<2, uint32, mediump>;
template struct vec<2, uint64, mediump>;
template struct vec<2, int8, mediump>;
template struct vec<2, int16, mediump>;
template struct vec<2, int32, mediump>;
template struct vec<2, int64, mediump>;
template struct vec<2, float32, mediump>;
template struct vec<2, float64, mediump>;
template struct tvec<2, uint8, highp>;
template struct tvec<2, uint16, highp>;
template struct tvec<2, uint32, highp>;
template struct tvec<2, uint64, highp>;
template struct tvec<2, int8, highp>;
template struct tvec<2, int16, highp>;
template struct tvec<2, int32, highp>;
template struct tvec<2, int64, highp>;
template struct tvec<2, float32, highp>;
template struct tvec<2, float64, highp>;
template struct vec<2, uint8, highp>;
template struct vec<2, uint16, highp>;
template struct vec<2, uint32, highp>;
template struct vec<2, uint64, highp>;
template struct vec<2, int8, highp>;
template struct vec<2, int16, highp>;
template struct vec<2, int32, highp>;
template struct vec<2, int64, highp>;
template struct vec<2, float32, highp>;
template struct vec<2, float64, highp>;
// tvec3 type explicit instantiation
template struct tvec<3, uint8, lowp>;
template struct tvec<3, uint16, lowp>;
template struct tvec<3, uint32, lowp>;
template struct tvec<3, uint64, lowp>;
template struct tvec<3, int8, lowp>;
template struct tvec<3, int16, lowp>;
template struct tvec<3, int32, lowp>;
template struct tvec<3, int64, lowp>;
template struct tvec<3, float32, lowp>;
template struct tvec<3, float64, lowp>;
template struct vec<3, uint8, lowp>;
template struct vec<3, uint16, lowp>;
template struct vec<3, uint32, lowp>;
template struct vec<3, uint64, lowp>;
template struct vec<3, int8, lowp>;
template struct vec<3, int16, lowp>;
template struct vec<3, int32, lowp>;
template struct vec<3, int64, lowp>;
template struct vec<3, float32, lowp>;
template struct vec<3, float64, lowp>;
template struct tvec<3, uint8, mediump>;
template struct tvec<3, uint16, mediump>;
template struct tvec<3, uint32, mediump>;
template struct tvec<3, uint64, mediump>;
template struct tvec<3, int8, mediump>;
template struct tvec<3, int16, mediump>;
template struct tvec<3, int32, mediump>;
template struct tvec<3, int64, mediump>;
template struct tvec<3, float32, mediump>;
template struct tvec<3, float64, mediump>;
template struct vec<3, uint8, mediump>;
template struct vec<3, uint16, mediump>;
template struct vec<3, uint32, mediump>;
template struct vec<3, uint64, mediump>;
template struct vec<3, int8, mediump>;
template struct vec<3, int16, mediump>;
template struct vec<3, int32, mediump>;
template struct vec<3, int64, mediump>;
template struct vec<3, float32, mediump>;
template struct vec<3, float64, mediump>;
template struct tvec<3, uint8, highp>;
template struct tvec<3, uint16, highp>;
template struct tvec<3, uint32, highp>;
template struct tvec<3, uint64, highp>;
template struct tvec<3, int8, highp>;
template struct tvec<3, int16, highp>;
template struct tvec<3, int32, highp>;
template struct tvec<3, int64, highp>;
template struct tvec<3, float32, highp>;
template struct tvec<3, float64, highp>;
template struct vec<3, uint8, highp>;
template struct vec<3, uint16, highp>;
template struct vec<3, uint32, highp>;
template struct vec<3, uint64, highp>;
template struct vec<3, int8, highp>;
template struct vec<3, int16, highp>;
template struct vec<3, int32, highp>;
template struct vec<3, int64, highp>;
template struct vec<3, float32, highp>;
template struct vec<3, float64, highp>;
// tvec4 type explicit instantiation
template struct tvec<4, uint8, lowp>;
template struct tvec<4, uint16, lowp>;
template struct tvec<4, uint32, lowp>;
template struct tvec<4, uint64, lowp>;
template struct tvec<4, int8, lowp>;
template struct tvec<4, int16, lowp>;
template struct tvec<4, int32, lowp>;
template struct tvec<4, int64, lowp>;
template struct tvec<4, float32, lowp>;
template struct tvec<4, float64, lowp>;
template struct vec<4, uint8, lowp>;
template struct vec<4, uint16, lowp>;
template struct vec<4, uint32, lowp>;
template struct vec<4, uint64, lowp>;
template struct vec<4, int8, lowp>;
template struct vec<4, int16, lowp>;
template struct vec<4, int32, lowp>;
template struct vec<4, int64, lowp>;
template struct vec<4, float32, lowp>;
template struct vec<4, float64, lowp>;
template struct tvec<4, uint8, mediump>;
template struct tvec<4, uint16, mediump>;
template struct tvec<4, uint32, mediump>;
template struct tvec<4, uint64, mediump>;
template struct tvec<4, int8, mediump>;
template struct tvec<4, int16, mediump>;
template struct tvec<4, int32, mediump>;
template struct tvec<4, int64, mediump>;
template struct tvec<4, float32, mediump>;
template struct tvec<4, float64, mediump>;
template struct vec<4, uint8, mediump>;
template struct vec<4, uint16, mediump>;
template struct vec<4, uint32, mediump>;
template struct vec<4, uint64, mediump>;
template struct vec<4, int8, mediump>;
template struct vec<4, int16, mediump>;
template struct vec<4, int32, mediump>;
template struct vec<4, int64, mediump>;
template struct vec<4, float32, mediump>;
template struct vec<4, float64, mediump>;
template struct tvec<4, uint8, highp>;
template struct tvec<4, uint16, highp>;
template struct tvec<4, uint32, highp>;
template struct tvec<4, uint64, highp>;
template struct tvec<4, int8, highp>;
template struct tvec<4, int16, highp>;
template struct tvec<4, int32, highp>;
template struct tvec<4, int64, highp>;
template struct tvec<4, float32, highp>;
template struct tvec<4, float64, highp>;
template struct vec<4, uint8, highp>;
template struct vec<4, uint16, highp>;
template struct vec<4, uint32, highp>;
template struct vec<4, uint64, highp>;
template struct vec<4, int8, highp>;
template struct vec<4, int16, highp>;
template struct vec<4, int32, highp>;
template struct vec<4, int64, highp>;
template struct vec<4, float32, highp>;
template struct vec<4, float64, highp>;
// tmat2x2 type explicit instantiation
template struct tmat2x2<float32, lowp>;

View File

@ -12,7 +12,7 @@ namespace detail
struct outerProduct_trait{};
}//namespace detail
template <int D, typename T, precision P> struct tvec;
template <int D, typename T, precision P> struct vec;
template <typename T, precision P> struct tmat2x2;
template <typename T, precision P> struct tmat2x3;
template <typename T, precision P> struct tmat2x4;

View File

@ -101,12 +101,12 @@ namespace detail
# endif
}//namespace detail
template <int D, typename T, precision P = defaultp> struct tvec;
template <int D, typename T, precision P = defaultp> struct vec;
template <typename T, precision P = defaultp> using tvec1 = tvec<1, T, P>;
template <typename T, precision P = defaultp> using tvec2 = tvec<2, T, P>;
template <typename T, precision P = defaultp> using tvec3 = tvec<3, T, P>;
template <typename T, precision P = defaultp> using tvec4 = tvec<4, T, P>;
template <typename T, precision P = defaultp> using tvec1 = vec<1, T, P>;
template <typename T, precision P = defaultp> using tvec2 = vec<2, T, P>;
template <typename T, precision P = defaultp> using tvec3 = vec<3, T, P>;
template <typename T, precision P = defaultp> using tvec4 = vec<4, T, P>;
typedef tvec1<float, highp> highp_vec1_t;
typedef tvec1<float, mediump> mediump_vec1_t;

View File

@ -17,13 +17,13 @@
namespace glm
{
template <typename T, precision P>
struct tvec<1, T, P>
struct vec<1, T, P>
{
// -- Implementation detail --
typedef T value_type;
typedef tvec type;
typedef tvec<1, bool, P> bool_type;
typedef vec type;
typedef vec<1, bool, P> bool_type;
// -- Data --
@ -82,31 +82,31 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tvec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec const & v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<1, T, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, T, Q> const & v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar);
// -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<2, U, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<3, U, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<4, U, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<1, U, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, Q> const & v);
// -- Swizzle constructors --
/*
@ -120,178 +120,178 @@ namespace glm
*/
// -- Unary arithmetic operators --
GLM_FUNC_DECL tvec & operator=(tvec const & v) GLM_DEFAULT;
GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tvec & operator=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator+=(U scalar);
GLM_FUNC_DECL vec & operator+=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator+=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator-=(U scalar);
GLM_FUNC_DECL vec & operator-=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator-=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator*=(U scalar);
GLM_FUNC_DECL vec & operator*=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator*=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator/=(U scalar);
GLM_FUNC_DECL vec & operator/=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator/=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const & v);
// -- Increment and decrement operators --
GLM_FUNC_DECL tvec & operator++();
GLM_FUNC_DECL tvec & operator--();
GLM_FUNC_DECL tvec operator++(int);
GLM_FUNC_DECL tvec operator--(int);
GLM_FUNC_DECL vec & operator++();
GLM_FUNC_DECL vec & operator--();
GLM_FUNC_DECL vec operator++(int);
GLM_FUNC_DECL vec operator--(int);
// -- Unary bit operators --
template <typename U>
GLM_FUNC_DECL tvec & operator%=(U scalar);
GLM_FUNC_DECL vec & operator%=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator%=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator&=(U scalar);
GLM_FUNC_DECL vec & operator&=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator&=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator|=(U scalar);
GLM_FUNC_DECL vec & operator|=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator|=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator^=(U scalar);
GLM_FUNC_DECL vec & operator^=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator^=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator<<=(U scalar);
GLM_FUNC_DECL vec & operator<<=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator<<=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator>>=(U scalar);
GLM_FUNC_DECL vec & operator>>=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator>>=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator+(tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator-(tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator+(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator+(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator+(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator-(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator-(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator- (tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator- (vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator*(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator*(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator*(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator/(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator/(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator/(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator%(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator%(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator%(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator&(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator&(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator&(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator|(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator|(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator|(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator^(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator^(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator^(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator<<(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator<<(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator<<(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator>>(tvec<1, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator>>(T scalar, tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator>>(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<1, T, P> operator~(tvec<1, T, P> const & v);
GLM_FUNC_DECL vec<1, T, P> operator~(vec<1, T, P> const & v);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL bool operator==(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec<1, bool, P> operator&&(tvec<1, bool, P> const & v1, tvec<1, bool, P> const & v2);
GLM_FUNC_DECL vec<1, bool, P> operator&&(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec<1, bool, P> operator||(tvec<1, bool, P> const & v1, tvec<1, bool, P> const & v2);
GLM_FUNC_DECL vec<1, bool, P> operator||(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -7,7 +7,7 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<1, T, P>::tvec()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0)
# endif
@ -16,25 +16,25 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<1, T, P>::tvec(tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, T, P> const & v)
: x(v.x)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<1, T, P>::tvec(tvec<1, T, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, T, Q> const & v)
: x(v.x)
{}
// -- Explicit basic constructors --
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec<1, T, P>::tvec(ctor)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<1, T, P>::tvec(T scalar)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(T scalar)
: x(scalar)
{}
@ -42,39 +42,39 @@ namespace glm
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<1, T, P>::tvec(tvec<1, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<1, U, Q> const & v)
: x(static_cast<T>(v.x))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<1, T, P>::tvec(tvec<2, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<2, U, Q> const & v)
: x(static_cast<T>(v.x))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<1, T, P>::tvec(tvec<3, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<3, U, Q> const & v)
: x(static_cast<T>(v.x))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<1, T, P>::tvec(tvec<4, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(vec<4, U, Q> const & v)
: x(static_cast<T>(v.x))
{}
// -- Component accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER T & tvec<1, T, P>::operator[](typename tvec<1, T, P>::length_type i)
GLM_FUNC_QUALIFIER T & vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i)
{
assert(i >= 0 && i < this->length());
return (&x)[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T const & tvec<1, T, P>::operator[](typename tvec<1, T, P>::length_type i) const
GLM_FUNC_QUALIFIER T const & vec<1, T, P>::operator[](typename vec<1, T, P>::length_type i) const
{
assert(i >= 0 && i < this->length());
return (&x)[i];
@ -84,7 +84,7 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator=(tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, T, P> const & v)
{
this->x = v.x;
return *this;
@ -93,7 +93,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, U, P> const & v)
{
this->x = static_cast<T>(v.x);
return *this;
@ -101,7 +101,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator+=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(U scalar)
{
this->x += static_cast<T>(scalar);
return *this;
@ -109,7 +109,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator+=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(vec<1, U, P> const & v)
{
this->x += static_cast<T>(v.x);
return *this;
@ -117,7 +117,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator-=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(U scalar)
{
this->x -= static_cast<T>(scalar);
return *this;
@ -125,7 +125,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator-=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(vec<1, U, P> const & v)
{
this->x -= static_cast<T>(v.x);
return *this;
@ -133,7 +133,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator*=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(U scalar)
{
this->x *= static_cast<T>(scalar);
return *this;
@ -141,7 +141,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator*=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(vec<1, U, P> const & v)
{
this->x *= static_cast<T>(v.x);
return *this;
@ -149,7 +149,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator/=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(U scalar)
{
this->x /= static_cast<T>(scalar);
return *this;
@ -157,7 +157,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator/=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(vec<1, U, P> const & v)
{
this->x /= static_cast<T>(v.x);
return *this;
@ -166,31 +166,31 @@ namespace glm
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator++()
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator++()
{
++this->x;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator--()
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator--()
{
--this->x;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> tvec<1, T, P>::operator++(int)
GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator++(int)
{
tvec<1, T, P> Result(*this);
vec<1, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> tvec<1, T, P>::operator--(int)
GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator--(int)
{
tvec<1, T, P> Result(*this);
vec<1, T, P> Result(*this);
--*this;
return Result;
}
@ -199,7 +199,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator%=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(U scalar)
{
this->x %= static_cast<T>(scalar);
return *this;
@ -207,7 +207,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator%=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(vec<1, U, P> const & v)
{
this->x %= static_cast<T>(v.x);
return *this;
@ -215,7 +215,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator&=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(U scalar)
{
this->x &= static_cast<T>(scalar);
return *this;
@ -223,7 +223,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator&=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(vec<1, U, P> const & v)
{
this->x &= static_cast<T>(v.x);
return *this;
@ -231,7 +231,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator|=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(U scalar)
{
this->x |= static_cast<T>(scalar);
return *this;
@ -239,7 +239,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator|=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(vec<1, U, P> const & v)
{
this->x |= U(v.x);
return *this;
@ -247,7 +247,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator^=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(U scalar)
{
this->x ^= static_cast<T>(scalar);
return *this;
@ -255,7 +255,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator^=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(vec<1, U, P> const & v)
{
this->x ^= static_cast<T>(v.x);
return *this;
@ -263,7 +263,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator<<=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(U scalar)
{
this->x <<= static_cast<T>(scalar);
return *this;
@ -271,7 +271,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator<<=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(vec<1, U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
return *this;
@ -279,7 +279,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator>>=(U scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(U scalar)
{
this->x >>= static_cast<T>(scalar);
return *this;
@ -287,7 +287,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<1, T, P> & tvec<1, T, P>::operator>>=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(vec<1, U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
return *this;
@ -296,263 +296,263 @@ namespace glm
// -- Unary constant operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator+(tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v)
{
return v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator-(tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
-v.x);
}
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator+(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator+(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar + v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator+(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x + v2.x);
}
//operator-
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator-(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator-(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar - v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator-(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x - v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator*(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator*(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar * v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator*(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x * v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator/(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator/(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar / v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator/(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x / v2.x);
}
// -- Binary bit operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator%(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x % scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator%(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar % v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator%(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x % v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator&(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x & scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator&(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar & v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator&(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x & v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator|(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x | scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator|(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar | v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator|(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x | v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator^(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x ^ scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator^(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar ^ v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator^(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x ^ v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator<<(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x << scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator<<(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar << v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator<<(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x << v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator>>(tvec<1, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v.x >> scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator>>(T scalar, tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
scalar >> v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator>>(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<1, T, P>(
return vec<1, T, P>(
v1.x >> v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<1, T, P> operator~(tvec<1, T, P> const & v)
GLM_FUNC_QUALIFIER vec<1, T, P> operator~(vec<1, T, P> const & v)
{
return tvec<1, T, P>(
return vec<1, T, P>(
~v.x);
}
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER bool operator==(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return (v1.x == v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tvec<1, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return (v1.x != v2.x);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec<1, bool, P> operator&&(tvec<1, bool, P> const & v1, tvec<1, bool, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, bool, P> operator&&(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2)
{
return tvec<1, bool, P>(v1.x && v2.x);
return vec<1, bool, P>(v1.x && v2.x);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec<1, bool, P> operator||(tvec<1, bool, P> const & v1, tvec<1, bool, P> const & v2)
GLM_FUNC_QUALIFIER vec<1, bool, P> operator||(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2)
{
return tvec<1, bool, P>(v1.x || v2.x);
return vec<1, bool, P>(v1.x || v2.x);
}
}//namespace glm

View File

@ -16,13 +16,13 @@
namespace glm
{
template <typename T, precision P>
struct tvec<2, T, P>
struct vec<2, T, P>
{
// -- Implementation detail --
typedef T value_type;
typedef tvec type;
typedef tvec<2, bool, P> bool_type;
typedef vec type;
typedef vec<2, bool, P> bool_type;
// -- Data --
@ -83,42 +83,42 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tvec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec const& v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const& v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<2, T, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, T, Q> const& v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR tvec(T s1, T s2);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR vec(T s1, T s2);
// -- Conversion constructors --
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(A x, B y);
GLM_FUNC_DECL GLM_CONSTEXPR vec(A x, B y);
template <typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<1, A, P> const & v1, tvec<1, B, P> const & v2);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const & v1, vec<1, B, P> const & v2);
// -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<3, U, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<4, U, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<2, U, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<2, U, Q> const & v);
// -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
template <int E0, int E1>
GLM_FUNC_DECL tvec(detail::_swizzle<2, T, P, E0, E1,-1,-2> const& that)
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1,-1,-2> const& that)
{
*this = that();
}
@ -126,258 +126,258 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL tvec& operator=(tvec const & v) GLM_DEFAULT;
GLM_FUNC_DECL vec& operator=(vec const & v) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tvec& operator=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec& operator=(vec<2, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec& operator+=(U scalar);
GLM_FUNC_DECL vec& operator+=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec& operator+=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec& operator+=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec& operator+=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec& operator+=(vec<2, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec& operator-=(U scalar);
GLM_FUNC_DECL vec& operator-=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec& operator-=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec& operator-=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec& operator-=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec& operator-=(vec<2, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec& operator*=(U scalar);
GLM_FUNC_DECL vec& operator*=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec& operator*=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec& operator*=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec& operator*=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec& operator*=(vec<2, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec& operator/=(U scalar);
GLM_FUNC_DECL vec& operator/=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec& operator/=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec& operator/=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec& operator/=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec& operator/=(vec<2, U, P> const & v);
// -- Increment and decrement operators --
GLM_FUNC_DECL tvec & operator++();
GLM_FUNC_DECL tvec & operator--();
GLM_FUNC_DECL tvec operator++(int);
GLM_FUNC_DECL tvec operator--(int);
GLM_FUNC_DECL vec & operator++();
GLM_FUNC_DECL vec & operator--();
GLM_FUNC_DECL vec operator++(int);
GLM_FUNC_DECL vec operator--(int);
// -- Unary bit operators --
template <typename U>
GLM_FUNC_DECL tvec & operator%=(U scalar);
GLM_FUNC_DECL vec & operator%=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator%=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator%=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec & operator%=(vec<2, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator&=(U scalar);
GLM_FUNC_DECL vec & operator&=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator&=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator&=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec & operator&=(vec<2, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator|=(U scalar);
GLM_FUNC_DECL vec & operator|=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator|=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator|=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec & operator|=(vec<2, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator^=(U scalar);
GLM_FUNC_DECL vec & operator^=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator^=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator^=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec & operator^=(vec<2, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator<<=(U scalar);
GLM_FUNC_DECL vec & operator<<=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator<<=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator<<=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec & operator<<=(vec<2, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator>>=(U scalar);
GLM_FUNC_DECL vec & operator>>=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator>>=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator>>=(tvec<2, U, P> const & v);
GLM_FUNC_DECL vec & operator>>=(vec<2, U, P> const & v);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator+(tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator-(tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator+(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator+(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator+(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator+(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator+(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator+(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator+(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator-(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator-(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator-(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator-(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator-(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator-(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator-(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator*(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator*(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator*(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator*(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator*(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator*(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator*(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator/(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator/(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator/(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator/(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator/(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator/(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator/(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator%(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator%(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator%(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator%(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator%(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator%(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator%(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator&(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator&(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator&(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator&(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator&(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator&(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator&(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator|(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator|(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator|(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator|(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator|(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator|(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator|(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator^(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator^(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator^(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator^(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator^(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator^(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator^(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator<<(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator<<(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator<<(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator<<(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator<<(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator<<(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator>>(tvec<2, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator>>(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator>>(T scalar, tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator>>(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator>>(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator>>(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<2, T, P> operator~(tvec<2, T, P> const & v);
GLM_FUNC_DECL vec<2, T, P> operator~(vec<2, T, P> const & v);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL bool operator==(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2);
GLM_FUNC_DECL bool operator!=(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec<2, bool, P> operator&&(tvec<2, bool, P> const & v1, tvec<2, bool, P> const & v2);
GLM_FUNC_DECL vec<2, bool, P> operator&&(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec<2, bool, P> operator||(tvec<2, bool, P> const & v1, tvec<2, bool, P> const & v2);
GLM_FUNC_DECL vec<2, bool, P> operator||(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@ -7,7 +7,7 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0), y(0)
# endif
@ -16,30 +16,30 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec(tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, P> const & v)
: x(v.x), y(v.y)
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec(tvec<2, T, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, T, Q> const & v)
: x(v.x), y(v.y)
{}
// -- Explicit basic constructors --
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec<2, T, P>::tvec(ctor)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<2, T, P>::vec(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec(T scalar)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T scalar)
: x(scalar), y(scalar)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec(T s1, T s2)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(T s1, T s2)
: x(s1), y(s2)
{}
@ -47,14 +47,14 @@ namespace glm
template <typename T, precision P>
template <typename A, typename B>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec(A a, B b)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(A a, B b)
: x(static_cast<T>(a))
, y(static_cast<T>(b))
{}
template <typename T, precision P>
template <typename A, typename B>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec(tvec<1, A, P> const & a, tvec<1, B, P> const & b)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<1, A, P> const & a, vec<1, B, P> const & b)
: x(static_cast<T>(a.x))
, y(static_cast<T>(b.x))
{}
@ -63,21 +63,21 @@ namespace glm
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec(tvec<2, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<2, U, Q> const & v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec(tvec<3, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<3, U, Q> const & v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
{}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec<2, T, P>::tvec(tvec<4, U, Q> const & v)
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<2, T, P>::vec(vec<4, U, Q> const & v)
: x(static_cast<T>(v.x))
, y(static_cast<T>(v.y))
{}
@ -85,14 +85,14 @@ namespace glm
// -- Component accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER T & tvec<2, T, P>::operator[](typename tvec<2, T, P>::length_type i)
GLM_FUNC_QUALIFIER T & vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i)
{
assert(i >= 0 && i < this->length());
return (&x)[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER T const & tvec<2, T, P>::operator[](typename tvec<2, T, P>::length_type i) const
GLM_FUNC_QUALIFIER T const & vec<2, T, P>::operator[](typename vec<2, T, P>::length_type i) const
{
assert(i >= 0 && i < this->length());
return (&x)[i];
@ -102,7 +102,7 @@ namespace glm
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator=(tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, T, P> const & v)
{
this->x = v.x;
this->y = v.y;
@ -112,7 +112,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator=(vec<2, U, P> const & v)
{
this->x = static_cast<T>(v.x);
this->y = static_cast<T>(v.y);
@ -121,7 +121,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator+=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(U scalar)
{
this->x += static_cast<T>(scalar);
this->y += static_cast<T>(scalar);
@ -130,7 +130,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator+=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(vec<1, U, P> const & v)
{
this->x += static_cast<T>(v.x);
this->y += static_cast<T>(v.x);
@ -139,7 +139,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator+=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator+=(vec<2, U, P> const & v)
{
this->x += static_cast<T>(v.x);
this->y += static_cast<T>(v.y);
@ -148,7 +148,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator-=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(U scalar)
{
this->x -= static_cast<T>(scalar);
this->y -= static_cast<T>(scalar);
@ -157,7 +157,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator-=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(vec<1, U, P> const & v)
{
this->x -= static_cast<T>(v.x);
this->y -= static_cast<T>(v.x);
@ -166,7 +166,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator-=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator-=(vec<2, U, P> const & v)
{
this->x -= static_cast<T>(v.x);
this->y -= static_cast<T>(v.y);
@ -175,7 +175,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator*=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(U scalar)
{
this->x *= static_cast<T>(scalar);
this->y *= static_cast<T>(scalar);
@ -184,7 +184,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator*=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(vec<1, U, P> const & v)
{
this->x *= static_cast<T>(v.x);
this->y *= static_cast<T>(v.x);
@ -193,7 +193,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator*=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator*=(vec<2, U, P> const & v)
{
this->x *= static_cast<T>(v.x);
this->y *= static_cast<T>(v.y);
@ -202,7 +202,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator/=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(U scalar)
{
this->x /= static_cast<T>(scalar);
this->y /= static_cast<T>(scalar);
@ -211,7 +211,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator/=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(vec<1, U, P> const & v)
{
this->x /= static_cast<T>(v.x);
this->y /= static_cast<T>(v.x);
@ -220,7 +220,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator/=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator/=(vec<2, U, P> const & v)
{
this->x /= static_cast<T>(v.x);
this->y /= static_cast<T>(v.y);
@ -230,7 +230,7 @@ namespace glm
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator++()
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator++()
{
++this->x;
++this->y;
@ -238,7 +238,7 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator--()
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator--()
{
--this->x;
--this->y;
@ -246,17 +246,17 @@ namespace glm
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> tvec<2, T, P>::operator++(int)
GLM_FUNC_QUALIFIER vec<2, T, P> vec<2, T, P>::operator++(int)
{
tvec<2, T, P> Result(*this);
vec<2, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> tvec<2, T, P>::operator--(int)
GLM_FUNC_QUALIFIER vec<2, T, P> vec<2, T, P>::operator--(int)
{
tvec<2, T, P> Result(*this);
vec<2, T, P> Result(*this);
--*this;
return Result;
}
@ -265,7 +265,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator%=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(U scalar)
{
this->x %= static_cast<T>(scalar);
this->y %= static_cast<T>(scalar);
@ -274,7 +274,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator%=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(vec<1, U, P> const & v)
{
this->x %= static_cast<T>(v.x);
this->y %= static_cast<T>(v.x);
@ -283,7 +283,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator%=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator%=(vec<2, U, P> const & v)
{
this->x %= static_cast<T>(v.x);
this->y %= static_cast<T>(v.y);
@ -292,7 +292,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator&=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(U scalar)
{
this->x &= static_cast<T>(scalar);
this->y &= static_cast<T>(scalar);
@ -301,7 +301,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator&=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(vec<1, U, P> const & v)
{
this->x &= static_cast<T>(v.x);
this->y &= static_cast<T>(v.x);
@ -310,7 +310,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator&=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator&=(vec<2, U, P> const & v)
{
this->x &= static_cast<T>(v.x);
this->y &= static_cast<T>(v.y);
@ -319,7 +319,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator|=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(U scalar)
{
this->x |= static_cast<T>(scalar);
this->y |= static_cast<T>(scalar);
@ -328,7 +328,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator|=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(vec<1, U, P> const & v)
{
this->x |= static_cast<T>(v.x);
this->y |= static_cast<T>(v.x);
@ -337,7 +337,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator|=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator|=(vec<2, U, P> const & v)
{
this->x |= static_cast<T>(v.x);
this->y |= static_cast<T>(v.y);
@ -346,7 +346,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator^=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(U scalar)
{
this->x ^= static_cast<T>(scalar);
this->y ^= static_cast<T>(scalar);
@ -355,7 +355,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator^=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(vec<1, U, P> const & v)
{
this->x ^= static_cast<T>(v.x);
this->y ^= static_cast<T>(v.x);
@ -364,7 +364,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator^=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator^=(vec<2, U, P> const & v)
{
this->x ^= static_cast<T>(v.x);
this->y ^= static_cast<T>(v.y);
@ -373,7 +373,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator<<=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(U scalar)
{
this->x <<= static_cast<T>(scalar);
this->y <<= static_cast<T>(scalar);
@ -382,7 +382,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator<<=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(vec<1, U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.x);
@ -391,7 +391,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator<<=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator<<=(vec<2, U, P> const & v)
{
this->x <<= static_cast<T>(v.x);
this->y <<= static_cast<T>(v.y);
@ -400,7 +400,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator>>=(U scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(U scalar)
{
this->x >>= static_cast<T>(scalar);
this->y >>= static_cast<T>(scalar);
@ -409,7 +409,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator>>=(tvec<1, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(vec<1, U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.x);
@ -418,7 +418,7 @@ namespace glm
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec<2, T, P> & tvec<2, T, P>::operator>>=(tvec<2, U, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> & vec<2, T, P>::operator>>=(vec<2, U, P> const & v)
{
this->x >>= static_cast<T>(v.x);
this->y >>= static_cast<T>(v.y);
@ -428,15 +428,15 @@ namespace glm
// -- Unary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator+(tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v)
{
return v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator-(tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
-v.x,
-v.y);
}
@ -444,161 +444,161 @@ namespace glm
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator+(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x + scalar,
v.y + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator+(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x + v2.x,
v1.y + v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator+(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar + v.x,
scalar + v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator+(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x + v2.x,
v1.x + v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator+(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x + v2.x,
v1.y + v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator-(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x - scalar,
v.y - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator-(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x - v2.x,
v1.y - v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator-(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar - v.x,
scalar - v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator-(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x - v2.x,
v1.x - v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator-(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x - v2.x,
v1.y - v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator*(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x * scalar,
v.y * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator*(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x * v2.x,
v1.y * v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator*(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar * v.x,
scalar * v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator*(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x * v2.x,
v1.x * v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator*(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x * v2.x,
v1.y * v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator/(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x / scalar,
v.y / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator/(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x / v2.x,
v1.y / v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator/(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar / v.x,
scalar / v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator/(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x / v2.x,
v1.x / v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator/(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x / v2.x,
v1.y / v2.y);
}
@ -606,249 +606,249 @@ namespace glm
// -- Binary bit operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator%(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x % scalar,
v.y % scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator%(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x % v2.x,
v1.y % v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator%(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar % v.x,
scalar % v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator%(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x % v2.x,
v1.x % v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator%(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x % v2.x,
v1.y % v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator&(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x & scalar,
v.y & scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator&(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x & v2.x,
v1.y & v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator&(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar & v.x,
scalar & v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator&(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x & v2.x,
v1.x & v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator&(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x & v2.x,
v1.y & v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator|(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x | scalar,
v.y | scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator|(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x | v2.x,
v1.y | v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator|(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar | v.x,
scalar | v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator|(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x | v2.x,
v1.x | v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator|(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x | v2.x,
v1.y | v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator^(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x ^ scalar,
v.y ^ scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator^(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x ^ v2.x,
v1.y ^ v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator^(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar ^ v.x,
scalar ^ v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator^(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x ^ v2.x,
v1.x ^ v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator^(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x ^ v2.x,
v1.y ^ v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator<<(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x << scalar,
v.y << scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator<<(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x << v2.x,
v1.y << v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator<<(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar << v.x,
scalar << v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator<<(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x << v2.x,
v1.x << v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator<<(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x << v2.x,
v1.y << v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator>>(tvec<2, T, P> const & v, T scalar)
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v, T scalar)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v.x >> scalar,
v.y >> scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator>>(tvec<2, T, P> const & v1, tvec<1, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x >> v2.x,
v1.y >> v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator>>(T scalar, tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(T scalar, vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
scalar >> v.x,
scalar >> v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator>>(tvec<1, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<1, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x >> v2.x,
v1.x >> v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator>>(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return tvec<2, T, P>(
return vec<2, T, P>(
v1.x >> v2.x,
v1.y >> v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<2, T, P> operator~(tvec<2, T, P> const & v)
GLM_FUNC_QUALIFIER vec<2, T, P> operator~(vec<2, T, P> const & v)
{
return tvec<2, T, P>(
return vec<2, T, P>(
~v.x,
~v.y);
}
@ -856,26 +856,26 @@ namespace glm
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER bool operator==(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return (v1.x == v2.x) && (v1.y == v2.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tvec<2, T, P> const & v1, tvec<2, T, P> const & v2)
GLM_FUNC_QUALIFIER bool operator!=(vec<2, T, P> const & v1, vec<2, T, P> const & v2)
{
return (v1.x != v2.x) || (v1.y != v2.y);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec<2, bool, P> operator&&(tvec<2, bool, P> const & v1, tvec<2, bool, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, bool, P> operator&&(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2)
{
return tvec<2, bool, P>(v1.x && v2.x, v1.y && v2.y);
return vec<2, bool, P>(v1.x && v2.x, v1.y && v2.y);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec<2, bool, P> operator||(tvec<2, bool, P> const & v1, tvec<2, bool, P> const & v2)
GLM_FUNC_QUALIFIER vec<2, bool, P> operator||(vec<2, bool, P> const & v1, vec<2, bool, P> const & v2)
{
return tvec<2, bool, P>(v1.x || v2.x, v1.y || v2.y);
return vec<2, bool, P>(v1.x || v2.x, v1.y || v2.y);
}
}//namespace glm

View File

@ -16,13 +16,13 @@
namespace glm
{
template <typename T, precision P>
struct tvec<3, T, P>
struct vec<3, T, P>
{
// -- Implementation detail --
typedef T value_type;
typedef tvec type;
typedef tvec<3, bool, P> bool_type;
typedef vec type;
typedef vec<3, bool, P> bool_type;
// -- Data --
@ -83,322 +83,322 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tvec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec const & v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<3, T, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, T, Q> const & v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR tvec(T a, T b, T c);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit vec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit vec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR vec(T a, T b, T c);
// -- Conversion scalar constructors --
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(A a, B b, C c);
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, B b, C c);
template <typename A, typename B, typename C>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<1, A, P> const & a, tvec<1, B, P> const & b, tvec<1, C, P> const & c);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, P> const & a, vec<1, B, P> const & b, vec<1, C, P> const & c);
// -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<2, A, Q> const & a, B b);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, B b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<2, A, Q> const & a, tvec<1, B, Q> const & b);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(A a, tvec<2, B, Q> const & b);
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<2, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<1, A, Q> const & a, tvec<2, B, Q> const & b);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<4, U, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const & v);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<3, U, Q> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<3, U, Q> const & v);
// -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & that)
GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & that)
{
*this = that();
}
template <int E0, int E1>
GLM_FUNC_DECL tvec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & scalar)
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & scalar)
{
*this = tvec(v(), scalar);
*this = vec(v(), scalar);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec(T const & scalar, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
GLM_FUNC_DECL vec(T const & scalar, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
{
*this = tvec(scalar, v());
*this = vec(scalar, v());
}
# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
// -- Unary arithmetic operators --
GLM_FUNC_DECL tvec & operator=(tvec const & v) GLM_DEFAULT;
GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tvec & operator=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator=(vec<3, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator+=(U scalar);
GLM_FUNC_DECL vec & operator+=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator+=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator+=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator+=(vec<3, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator-=(U scalar);
GLM_FUNC_DECL vec & operator-=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator-=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator-=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator-=(vec<3, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator*=(U scalar);
GLM_FUNC_DECL vec & operator*=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator*=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator*=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator*=(vec<3, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator/=(U scalar);
GLM_FUNC_DECL vec & operator/=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator/=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator/=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator/=(vec<3, U, P> const & v);
// -- Increment and decrement operators --
GLM_FUNC_DECL tvec & operator++();
GLM_FUNC_DECL tvec & operator--();
GLM_FUNC_DECL tvec operator++(int);
GLM_FUNC_DECL tvec operator--(int);
GLM_FUNC_DECL vec & operator++();
GLM_FUNC_DECL vec & operator--();
GLM_FUNC_DECL vec operator++(int);
GLM_FUNC_DECL vec operator--(int);
// -- Unary bit operators --
template <typename U>
GLM_FUNC_DECL tvec & operator%=(U scalar);
GLM_FUNC_DECL vec & operator%=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator%=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator%=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator%=(vec<3, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator&=(U scalar);
GLM_FUNC_DECL vec & operator&=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator&=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator&=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator&=(vec<3, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator|=(U scalar);
GLM_FUNC_DECL vec & operator|=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator|=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator|=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator|=(vec<3, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator^=(U scalar);
GLM_FUNC_DECL vec & operator^=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator^=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator^=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator^=(vec<3, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator<<=(U scalar);
GLM_FUNC_DECL vec & operator<<=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator<<=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator<<=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator<<=(vec<3, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator>>=(U scalar);
GLM_FUNC_DECL vec & operator>>=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec & operator>>=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec & operator>>=(tvec<3, U, P> const & v);
GLM_FUNC_DECL vec & operator>>=(vec<3, U, P> const & v);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator+(tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator-(tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator+(tvec<3, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator+(tvec<3, T, P> const & v, tvec<1, T, P> const & scalar);
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator+(T scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator+(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator+(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator+(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator+(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator-(tvec<3, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator-(tvec<3, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator-(T scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator-(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator-(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator-(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator-(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator*(tvec<3, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator*(tvec<3, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator*(T scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator*(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator*(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator*(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator*(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator/(tvec<3, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator/(tvec<3, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator/(T scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator/(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator/(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator/(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator/(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator%(tvec<3, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator%(tvec<3, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator%(T const & scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator%(T const & scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator%(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator%(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator%(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator&(tvec<3, T, P> const & v1, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator&(tvec<3, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator&(T scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator&(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator&(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator&(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator&(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator|(tvec<3, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator|(tvec<3, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator|(T scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator|(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator|(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator|(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator|(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator^(tvec<3, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator^(tvec<3, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator^(T scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator^(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator^(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator^(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator^(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator<<(tvec<3, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator<<(tvec<3, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator<<(T scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator<<(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator<<(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator<<(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator>>(tvec<3, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator>>(tvec<3, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator>>(T scalar, tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator>>(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator>>(tvec<1, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator>>(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<3, T, P> operator~(tvec<3, T, P> const & v);
GLM_FUNC_DECL vec<3, T, P> operator~(vec<3, T, P> const & v);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL bool operator==(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec<3, T, P> const & v1, tvec<3, T, P> const & v2);
GLM_FUNC_DECL bool operator!=(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec<3, bool, P> operator&&(tvec<3, bool, P> const & v1, tvec<3, bool, P> const & v2);
GLM_FUNC_DECL vec<3, bool, P> operator&&(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec<3, bool, P> operator||(tvec<3, bool, P> const & v1, tvec<3, bool, P> const & v2);
GLM_FUNC_DECL vec<3, bool, P> operator||(vec<3, bool, P> const & v1, vec<3, bool, P> const & v2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

File diff suppressed because it is too large Load Diff

View File

@ -16,13 +16,13 @@
namespace glm
{
template <typename T, precision P>
struct tvec<4, T, P>
struct vec<4, T, P>
{
// -- Implementation detail --
typedef T value_type;
typedef tvec<4, T, P> type;
typedef tvec<4, bool, P> bool_type;
typedef vec<4, T, P> type;
typedef vec<4, bool, P> bool_type;
// -- Data --
@ -86,364 +86,364 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec(tvec<4, T, P> const& v) GLM_DEFAULT;
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, P> const& v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec(tvec<4, T, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(vec<4, T, Q> const& v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit tvec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit tvec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec(T a, T b, T c, T d);
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit vec(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit vec(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(T a, T b, T c, T d);
// -- Conversion scalar constructors --
/// Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, typename D>
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec(A a, B b, C c, D d);
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD vec(A a, B b, C c, D d);
template <typename A, typename B, typename C, typename D>
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec(tvec<1, A, P> const& a, tvec<1, B, P> const& b, tvec<1, C, P> const& c, tvec<1, D, P> const& d);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR vec(vec<1, A, P> const& a, vec<1, B, P> const& b, vec<1, C, P> const& c, vec<1, D, P> const& d);
// -- Conversion vector constructors --
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<2, A, Q> const & a, B b, C c);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, B b, C c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<2, A, Q> const & a, tvec<1, B, Q> const & b, tvec<1, C, Q> const & c);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b, vec<1, C, Q> const & c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(A a, tvec<2, B, Q> const & b, C c);
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<2, B, Q> const & b, C c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<1, A, Q> const & a, tvec<2, B, Q> const & b, tvec<1, C, Q> const & c);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b, vec<1, C, Q> const & c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(A a, B b, tvec<2, C, Q> const & c);
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, B b, vec<2, C, Q> const & c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<1, A, Q> const & a, tvec<1, B, Q> const & b, tvec<2, C, Q> const & c);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<1, B, Q> const & b, vec<2, C, Q> const & c);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<3, A, Q> const & a, B b);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const & a, B b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<3, A, Q> const & a, tvec<1, B, Q> const & b);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const & a, vec<1, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(A a, tvec<3, B, Q> const & b);
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<3, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<1, A, Q> const & a, tvec<3, B, Q> const & b);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<3, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec(tvec<2, A, Q> const & a, tvec<2, B, Q> const & b);
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<2, B, Q> const & b);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tvec(tvec<4, U, Q> const& v);
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<4, U, Q> const& v);
// -- Swizzle constructors --
# if GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
template <int E0, int E1, int E2, int E3>
GLM_FUNC_DECL tvec(detail::_swizzle<4, T, P, E0, E1, E2, E3> const & that)
GLM_FUNC_DECL vec(detail::_swizzle<4, T, P, E0, E1, E2, E3> const & that)
{
*this = that();
}
template <int E0, int E1, int F0, int F1>
GLM_FUNC_DECL tvec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, F0, F1, -1, -2> const & u)
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, F0, F1, -1, -2> const & u)
{
*this = tvec<4, T, P>(v(), u());
*this = vec<4, T, P>(v(), u());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec(T const & x, T const & y, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
GLM_FUNC_DECL vec(T const & x, T const & y, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
{
*this = tvec<4, T, P>(x, y, v());
*this = vec<4, T, P>(x, y, v());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec(T const & x, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & w)
GLM_FUNC_DECL vec(T const & x, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & w)
{
*this = tvec<4, T, P>(x, v(), w);
*this = vec<4, T, P>(x, v(), w);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & z, T const & w)
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & z, T const & w)
{
*this = tvec<4, T, P>(v(), z, w);
*this = vec<4, T, P>(v(), z, w);
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v, T const & w)
GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v, T const & w)
{
*this = tvec<4, T, P>(v(), w);
*this = vec<4, T, P>(v(), w);
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec(T const & x, detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v)
GLM_FUNC_DECL vec(T const & x, detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v)
{
*this = tvec<4, T, P>(x, v());
*this = vec<4, T, P>(x, v());
}
# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
// -- Unary arithmetic operators --
GLM_FUNC_DECL tvec<4, T, P> & operator=(tvec<4, T, P> const & v) GLM_DEFAULT;
GLM_FUNC_DECL vec<4, T, P> & operator=(vec<4, T, P> const & v) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator=(vec<4, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator+=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator+=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator+=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator+=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<4, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator-=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator-=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator-=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator-=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<4, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator*=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator*=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator*=(tvec<1, U, P> const& v);
GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<1, U, P> const& v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator*=(tvec<4, U, P> const& v);
GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<4, U, P> const& v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator/=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator/=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator/=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator/=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<4, U, P> const & v);
// -- Increment and decrement operators --
GLM_FUNC_DECL tvec<4, T, P> & operator++();
GLM_FUNC_DECL tvec<4, T, P> & operator--();
GLM_FUNC_DECL tvec<4, T, P> operator++(int);
GLM_FUNC_DECL tvec<4, T, P> operator--(int);
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);
// -- Unary bit operators --
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator%=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator%=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator%=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator%=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<4, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator&=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator&=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator&=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator&=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<4, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator|=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator|=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator|=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator|=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<4, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator^=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator^=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator^=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator^=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<4, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator<<=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator<<=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator<<=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator<<=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<4, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator>>=(U scalar);
GLM_FUNC_DECL vec<4, T, P> & operator>>=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator>>=(tvec<1, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<1, U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec<4, T, P> & operator>>=(tvec<4, U, P> const & v);
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<4, U, P> const & v);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator+(tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator-(tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator+(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator+(tvec<4, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator+(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator+(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator+(tvec<1, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator+(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator+(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator-(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator-(tvec<4, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator-(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator-(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator-(tvec<1, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator-(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator-(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator*(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator*(tvec<4, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator*(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator*(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator*(tvec<1, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator*(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator*(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator/(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator/(tvec<4, T, P> const & v1, tvec<1, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator/(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator/(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator/(tvec<1, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator/(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator/(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator%(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator%(tvec<4, T, P> const & v, tvec<1, T, P> const & scalar);
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator%(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator%(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator%(tvec<1, T, P> const & scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator%(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator%(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator&(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator&(tvec<4, T, P> const & v, tvec<1, T, P> const & scalar);
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator&(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator&(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator&(tvec<1, T, P> const & scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator&(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator&(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator|(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator|(tvec<4, T, P> const & v, tvec<1, T, P> const & scalar);
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator|(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator|(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator|(tvec<1, T, P> const & scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator|(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator|(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator^(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator^(tvec<4, T, P> const & v, tvec<1, T, P> const & scalar);
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator^(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator^(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator^(tvec<1, T, P> const & scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator^(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator^(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator<<(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator<<(tvec<4, T, P> const & v, tvec<1, T, P> const & scalar);
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator<<(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator<<(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator<<(tvec<1, T, P> const & scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator<<(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator>>(tvec<4, T, P> const & v, T scalar);
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator>>(tvec<4, T, P> const & v, tvec<1, T, P> const & scalar);
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator>>(T scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator>>(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator>>(tvec<1, T, P> const & scalar, tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator>>(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec<4, T, P> operator~(tvec<4, T, P> const & v);
GLM_FUNC_DECL vec<4, T, P> operator~(vec<4, T, P> const & v);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL bool operator==(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tvec<4, T, P> const & v1, tvec<4, T, P> const & v2);
GLM_FUNC_DECL bool operator!=(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec<4, bool, P> operator&&(tvec<4, bool, P> const & v1, tvec<4, bool, P> const & v2);
GLM_FUNC_DECL vec<4, bool, P> operator&&(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec<4, bool, P> operator||(tvec<4, bool, P> const & v1, tvec<4, bool, P> const & v2);
GLM_FUNC_DECL vec<4, bool, P> operator||(vec<4, bool, P> const & v1, vec<4, bool, P> const & v2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

File diff suppressed because it is too large Load Diff

View File

@ -341,21 +341,21 @@ namespace detail
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps())
# endif
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps())
# endif
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec()
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps())
# endif
@ -363,117 +363,117 @@ namespace detail
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec(float s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::vec(float s) :
data(_mm_set1_ps(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec(float s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::vec(float s) :
data(_mm_set1_ps(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec(float s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::vec(float s) :
data(_mm_set1_ps(s))
{}
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_lowp>::tvec(double s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_lowp>::vec(double s) :
data(_mm256_set1_pd(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_mediump>::tvec(double s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_mediump>::vec(double s) :
data(_mm256_set1_pd(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_highp>::tvec(double s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_highp>::vec(double s) :
data(_mm256_set1_pd(s))
{}
# endif
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::tvec(int32 s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::vec(int32 s) :
data(_mm_set1_epi32(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::tvec(int32 s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::vec(int32 s) :
data(_mm_set1_epi32(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::tvec(int32 s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::vec(int32 s) :
data(_mm_set1_epi32(s))
{}
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_lowp>::tvec(int64 s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_lowp>::vec(int64 s) :
data(_mm256_set1_epi64x(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_mediump>::tvec(int64 s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_mediump>::vec(int64 s) :
data(_mm256_set1_epi64x(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_highp>::tvec(int64 s) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_highp>::vec(int64 s) :
data(_mm256_set1_epi64x(s))
{}
# endif
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec(float a, float b, float c, float d) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::vec(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec(float a, float b, float c, float d) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::vec(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec(float a, float b, float c, float d) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::vec(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::tvec(int32 a, int32 b, int32 c, int32 d) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_set_epi32(d, c, b, a))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::tvec(int32 a, int32 b, int32 c, int32 d) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_set_epi32(d, c, b, a))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::tvec(int32 a, int32 b, int32 c, int32 d) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_set_epi32(d, c, b, a))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec(int32 a, int32 b, int32 c, int32 d) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec(int32 a, int32 b, int32 c, int32 d) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec(int32 a, int32 b, int32 c, int32 d) :
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
{}
}//namespace glm

View File

@ -19,11 +19,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_rgbToSrgb<4, T, P, tvec>
struct compute_rgbToSrgb<4, T, P, vec>
{
GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const& ColorRGB, T GammaCorrection)
{
return tvec4<T, P>(compute_rgbToSrgb<3, T, P, tvec>::call(tvec3<T, P>(ColorRGB), GammaCorrection), ColorRGB.a);
return tvec4<T, P>(compute_rgbToSrgb<3, T, P, vec>::call(tvec3<T, P>(ColorRGB), GammaCorrection), ColorRGB.a);
}
};
@ -40,11 +40,11 @@ namespace detail
};
template <typename T, precision P>
struct compute_srgbToRgb<4, T, P, tvec>
struct compute_srgbToRgb<4, T, P, vec>
{
GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const& ColorSRGB, T Gamma)
{
return tvec4<T, P>(compute_srgbToRgb<3, T, P, tvec>::call(tvec3<T, P>(ColorSRGB), Gamma), ColorSRGB.a);
return tvec4<T, P>(compute_srgbToRgb<3, T, P, vec>::call(tvec3<T, P>(ColorSRGB), Gamma), ColorSRGB.a);
}
};
}//namespace detail

View File

@ -17,7 +17,7 @@ namespace detail
# if GLM_HAS_BITSCAN_WINDOWS
template <precision P, bool Aligned>
struct compute_log2<4, int, P, tvec, false, Aligned>
struct compute_log2<4, int, P, vec, false, Aligned>
{
GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & vec)
{

View File

@ -275,9 +275,9 @@ namespace detail
{};
template <precision P>
struct compute_half<1, P, tvec>
struct compute_half<1, P, vec>
{
GLM_FUNC_QUALIFIER static tvec<1, uint16, P> pack(tvec<1, float, P> const & v)
GLM_FUNC_QUALIFIER static vec<1, uint16, P> pack(vec<1, float, P> const & v)
{
int16 const Unpack(detail::toFloat16(v.x));
u16vec1 Packed(uninitialize);
@ -285,68 +285,68 @@ namespace detail
return Packed;
}
GLM_FUNC_QUALIFIER static tvec<1, float, P> unpack(tvec<1, uint16, P> const & v)
GLM_FUNC_QUALIFIER static vec<1, float, P> unpack(vec<1, uint16, P> const & v)
{
i16vec1 Unpack(uninitialize);
memcpy(&Unpack, &v, sizeof(Unpack));
return tvec<1, float, P>(detail::toFloat32(v.x));
return vec<1, float, P>(detail::toFloat32(v.x));
}
};
template <precision P>
struct compute_half<2, P, tvec>
struct compute_half<2, P, vec>
{
GLM_FUNC_QUALIFIER static tvec<2, uint16, P> pack(tvec<2, float, P> const & v)
GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const & v)
{
tvec<2, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y));
vec<2, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y));
u16vec2 Packed(uninitialize);
memcpy(&Packed, &Unpack, sizeof(Packed));
return Packed;
}
GLM_FUNC_QUALIFIER static tvec<2, float, P> unpack(tvec<2, uint16, P> const & v)
GLM_FUNC_QUALIFIER static vec<2, float, P> unpack(vec<2, uint16, P> const & v)
{
i16vec2 Unpack(uninitialize);
memcpy(&Unpack, &v, sizeof(Unpack));
return tvec<2, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y));
return vec<2, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y));
}
};
template <precision P>
struct compute_half<3, P, tvec>
struct compute_half<3, P, vec>
{
GLM_FUNC_QUALIFIER static tvec<3, uint16, P> pack(tvec<3, float, P> const & v)
GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const & v)
{
tvec<3, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z));
vec<3, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z));
u16vec3 Packed(uninitialize);
memcpy(&Packed, &Unpack, sizeof(Packed));
return Packed;
}
GLM_FUNC_QUALIFIER static tvec<3, float, P> unpack(tvec<3, uint16, P> const & v)
GLM_FUNC_QUALIFIER static vec<3, float, P> unpack(vec<3, uint16, P> const & v)
{
i16vec3 Unpack(uninitialize);
memcpy(&Unpack, &v, sizeof(Unpack));
return tvec<3, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z));
return vec<3, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z));
}
};
template <precision P>
struct compute_half<4, P, tvec>
struct compute_half<4, P, vec>
{
GLM_FUNC_QUALIFIER static tvec<4, uint16, P> pack(tvec<4, float, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const & v)
{
tvec<4, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w));
vec<4, int16, P> const Unpack(detail::toFloat16(v.x), detail::toFloat16(v.y), detail::toFloat16(v.z), detail::toFloat16(v.w));
u16vec4 Packed(uninitialize);
memcpy(&Packed, &Unpack, sizeof(Packed));
return Packed;
}
GLM_FUNC_QUALIFIER static tvec<4, float, P> unpack(tvec<4, uint16, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, float, P> unpack(vec<4, uint16, P> const & v)
{
i16vec4 Unpack(uninitialize);
memcpy(&Unpack, &v, sizeof(Unpack));
return tvec<4, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w));
return vec<4, float, P>(detail::toFloat32(v.x), detail::toFloat32(v.y), detail::toFloat32(v.z), detail::toFloat32(v.w));
}
};
}//namespace detail
@ -641,18 +641,18 @@ namespace detail
// Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<4, T, P> packRGBM(tvec<3, T, P> const & rgb)
GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const & rgb)
{
tvec<3, T, P> const Color(rgb * static_cast<T>(1.0 / 6.0));
vec<3, T, P> const Color(rgb * static_cast<T>(1.0 / 6.0));
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 tvec<4, T, P>(Color / Alpha, Alpha);
return vec<4, T, P>(Color / Alpha, Alpha);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec<3, T, P> unpackRGBM(tvec<4, T, P> const & rgbm)
GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm)
{
return tvec<3, T, P>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast<T>(6);
return vec<3, T, P>(rgbm.x, rgbm.y, rgbm.z) * rgbm.w * static_cast<T>(6);
}
template <int D, precision P, template <int, typename, precision> class vecType>

View File

@ -154,7 +154,7 @@ namespace detail
GLM_FUNC_QUALIFIER tquat<T, P>::tquat(tvec3<T, P> const & u, tvec3<T, P> const & v)
{
tvec3<T, P> const LocalW(cross(u, v));
T Dot = detail::compute_dot<tvec<3, T, P>, T, detail::is_aligned<P>::value>::call(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);
*this = normalize(q);

View File

@ -17,7 +17,7 @@ namespace detail
};
template <precision P>
struct compute_rand<1, uint8, P, tvec>
struct compute_rand<1, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec1<uint8, P> call()
{
@ -27,7 +27,7 @@ namespace detail
};
template <precision P>
struct compute_rand<2, uint8, P, tvec>
struct compute_rand<2, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec2<uint8, P> call()
{
@ -38,7 +38,7 @@ namespace detail
};
template <precision P>
struct compute_rand<3, uint8, P, tvec>
struct compute_rand<3, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec3<uint8, P> call()
{
@ -50,7 +50,7 @@ namespace detail
};
template <precision P>
struct compute_rand<4, uint8, P, tvec>
struct compute_rand<4, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec4<uint8, P> call()
{
@ -258,7 +258,7 @@ namespace detail
template <typename genType>
GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max)
{
return detail::compute_linearRand<1, genType, highp, tvec>::call(
return detail::compute_linearRand<1, genType, highp, vec>::call(
tvec1<genType, highp>(Min),
tvec1<genType, highp>(Max)).x;
}

View File

@ -232,7 +232,7 @@ namespace detail
template <typename genType>
GLM_FUNC_QUALIFIER genType ceilPowerOfTwo(genType value)
{
return detail::compute_ceilPowerOfTwo<1, genType, defaultp, tvec, std::numeric_limits<genType>::is_signed>::call(tvec1<genType, defaultp>(value)).x;
return detail::compute_ceilPowerOfTwo<1, genType, defaultp, vec, std::numeric_limits<genType>::is_signed>::call(tvec1<genType, defaultp>(value)).x;
}
template <int D, typename T, precision P, template <int, typename, precision> class vecType>

View File

@ -53,7 +53,7 @@ namespace glm
};
template <int D, typename T, precision P>
struct type<tvec<D, T, P>>
struct type<vec<D, T, P>>
{
static bool const is_vec = true;
static bool const is_mat = false;

View File

@ -10,7 +10,7 @@ namespace detail
struct compute_areCollinear{};
template <typename T, precision P>
struct compute_areCollinear<2, T, P, tvec>
struct compute_areCollinear<2, T, P, vec>
{
GLM_FUNC_QUALIFIER static bool call(tvec2<T, P> const & v0, tvec2<T, P> const & v1, T const & epsilon)
{
@ -19,7 +19,7 @@ namespace detail
};
template <typename T, precision P>
struct compute_areCollinear<3, T, P, tvec>
struct compute_areCollinear<3, T, P, vec>
{
GLM_FUNC_QUALIFIER static bool call(tvec3<T, P> const & v0, tvec3<T, P> const & v1, T const & epsilon)
{
@ -28,7 +28,7 @@ namespace detail
};
template <typename T, precision P>
struct compute_areCollinear<4, T, P, tvec>
struct compute_areCollinear<4, T, P, vec>
{
GLM_FUNC_QUALIFIER static bool call(tvec4<T, P> const & v0, tvec4<T, P> const & v1, T const & epsilon)
{
@ -40,7 +40,7 @@ namespace detail
struct compute_isCompNull{};
template <typename T, precision P>
struct compute_isCompNull<2, T, P, tvec>
struct compute_isCompNull<2, T, P, vec>
{
GLM_FUNC_QUALIFIER static tvec2<bool, P> call(tvec2<T, P> const & v, T const & epsilon)
{
@ -51,7 +51,7 @@ namespace detail
};
template <typename T, precision P>
struct compute_isCompNull<3, T, P, tvec>
struct compute_isCompNull<3, T, P, vec>
{
GLM_FUNC_QUALIFIER static tvec3<bool, P> call(tvec3<T, P> const & v, T const & epsilon)
{
@ -63,7 +63,7 @@ namespace detail
};
template <typename T, precision P>
struct compute_isCompNull<4, T, P, tvec>
struct compute_isCompNull<4, T, P, vec>
{
GLM_FUNC_QUALIFIER static tvec4<bool, P> call(tvec4<T, P> const & v, T const & epsilon)
{

View File

@ -170,7 +170,7 @@ namespace bitfieldReverse
template <typename T>
GLM_FUNC_QUALIFIER T bitfieldReverseLoop(T v)
{
return bitfieldReverseLoop(glm::tvec<1, T>(v)).x;
return bitfieldReverseLoop(glm::vec<1, T>(v)).x;
}
GLM_FUNC_QUALIFIER glm::uint32_t bitfieldReverseUint32(glm::uint32_t x)
@ -230,7 +230,7 @@ namespace bitfieldReverse
template <typename genType>
GLM_FUNC_QUALIFIER genType bitfieldReverseOps(genType x)
{
return bitfieldReverseOps(glm::tvec<1, genType, glm::defaultp>(x)).x;
return bitfieldReverseOps(glm::vec<1, genType, glm::defaultp>(x)).x;
}
template <typename genType>
@ -1440,7 +1440,7 @@ namespace bitCount
template <typename genType>
GLM_FUNC_QUALIFIER int bitCount_bitfield(genType x)
{
return bitCount_bitfield(glm::tvec<1, genType, glm::defaultp>(x)).x;
return bitCount_bitfield(glm::vec<1, genType, glm::defaultp>(x)).x;
}
int perf(std::size_t Size)