Merge pull request #596 from g-truc/dim

Parameterize on dimensions #584 for vectors and matrices types #596
This commit is contained in:
Christophe
2017-01-03 22:38:34 +01:00
committed by GitHub
257 changed files with 12551 additions and 12683 deletions

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -11,120 +11,120 @@
namespace glm{
namespace detail
{
template <typename R, typename T, precision P, template <typename, precision> class vecType>
template<length_t L, typename R, typename T, precision P>
struct functor1{};
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec1>
template<typename R, typename T, precision P>
struct functor1<1, R, T, P>
{
GLM_FUNC_QUALIFIER static tvec1<R, P> call(R (*Func) (T x), tvec1<T, P> const & v)
GLM_FUNC_QUALIFIER static vec<1, R, P> call(R (*Func) (T x), vec<1, T, P> const & v)
{
return tvec1<R, P>(Func(v.x));
return vec<1, R, P>(Func(v.x));
}
};
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec2>
template<typename R, typename T, precision P>
struct functor1<2, R, T, P>
{
GLM_FUNC_QUALIFIER static tvec2<R, P> call(R (*Func) (T x), tvec2<T, P> const & v)
GLM_FUNC_QUALIFIER static vec<2, R, P> call(R (*Func) (T x), vec<2, T, P> const & v)
{
return tvec2<R, P>(Func(v.x), Func(v.y));
return vec<2, R, P>(Func(v.x), Func(v.y));
}
};
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec3>
template<typename R, typename T, precision P>
struct functor1<3, R, T, P>
{
GLM_FUNC_QUALIFIER static tvec3<R, P> call(R (*Func) (T x), tvec3<T, P> const & v)
GLM_FUNC_QUALIFIER static vec<3, R, P> call(R (*Func) (T x), vec<3, T, P> const & v)
{
return tvec3<R, P>(Func(v.x), Func(v.y), Func(v.z));
return vec<3, R, P>(Func(v.x), Func(v.y), Func(v.z));
}
};
template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec4>
template<typename R, typename T, precision P>
struct functor1<4, R, T, P>
{
GLM_FUNC_QUALIFIER static tvec4<R, P> call(R (*Func) (T x), tvec4<T, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, R, P> call(R (*Func) (T x), vec<4, T, P> const & v)
{
return tvec4<R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
return vec<4, R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
}
};
template <typename T, precision P, template <typename, precision> class vecType>
template<length_t L, typename T, precision P>
struct functor2{};
template <typename T, precision P>
struct functor2<T, P, tvec1>
template<typename T, precision P>
struct functor2<1, T, P>
{
GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, tvec1<T, P> const & b)
GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, vec<1, T, P> const & b)
{
return tvec1<T, P>(Func(a.x, b.x));
return vec<1, T, P>(Func(a.x, b.x));
}
};
template <typename T, precision P>
struct functor2<T, P, tvec2>
template<typename T, precision P>
struct functor2<2, T, P>
{
GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, tvec2<T, P> const & b)
GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, vec<2, T, P> const & b)
{
return tvec2<T, P>(Func(a.x, b.x), Func(a.y, b.y));
return vec<2, T, P>(Func(a.x, b.x), Func(a.y, b.y));
}
};
template <typename T, precision P>
struct functor2<T, P, tvec3>
template<typename T, precision P>
struct functor2<3, T, P>
{
GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, tvec3<T, P> const & b)
GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, vec<3, T, P> const & b)
{
return tvec3<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
return vec<3, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
}
};
template <typename T, precision P>
struct functor2<T, P, tvec4>
template<typename T, precision P>
struct functor2<4, T, P>
{
GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, tvec4<T, P> const & b)
GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, vec<4, T, P> const & b)
{
return tvec4<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
return vec<4, T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
}
};
template <typename T, precision P, template <typename, precision> class vecType>
template<length_t L, typename T, precision P>
struct functor2_vec_sca{};
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec1>
template<typename T, precision P>
struct functor2_vec_sca<1, T, P>
{
GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, T b)
GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, T b)
{
return tvec1<T, P>(Func(a.x, b));
return vec<1, T, P>(Func(a.x, b));
}
};
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec2>
template<typename T, precision P>
struct functor2_vec_sca<2, T, P>
{
GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, T b)
GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, T b)
{
return tvec2<T, P>(Func(a.x, b), Func(a.y, b));
return vec<2, T, P>(Func(a.x, b), Func(a.y, b));
}
};
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec3>
template<typename T, precision P>
struct functor2_vec_sca<3, T, P>
{
GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, T b)
GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, T b)
{
return tvec3<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
return vec<3, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
}
};
template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec4>
template<typename T, precision P>
struct functor2_vec_sca<4, T, P>
{
GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, T b)
GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, T b)
{
return tvec4<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
return vec<4, T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
}
};
}//namespace detail

View File

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

View File

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

View File

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

View File

@@ -10,191 +10,191 @@
namespace glm{
namespace detail
{
template <precision P>
struct compute_abs_vector<float, P, tvec4, true>
template<precision P>
struct compute_abs_vector<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_abs(v.data);
return result;
}
};
template <precision P>
struct compute_abs_vector<int, P, tvec4, true>
template<precision P>
struct compute_abs_vector<4, int, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, int, P> call(vec<4, int, P> const & v)
{
tvec4<int, P> result(uninitialize);
vec<4, int, P> result(uninitialize);
result.data = glm_ivec4_abs(v.data);
return result;
}
};
template <precision P>
struct compute_floor<float, P, tvec4, true>
template<precision P>
struct compute_floor<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_floor(v.data);
return result;
}
};
template <precision P>
struct compute_ceil<float, P, tvec4, true>
template<precision P>
struct compute_ceil<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_ceil(v.data);
return result;
}
};
template <precision P>
struct compute_fract<float, P, tvec4, true>
template<precision P>
struct compute_fract<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_fract(v.data);
return result;
}
};
template <precision P>
struct compute_round<float, P, tvec4, true>
template<precision P>
struct compute_round<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_round(v.data);
return result;
}
};
template <precision P>
struct compute_mod<float, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & y)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_mod(x.data, y.data);
return result;
}
};
template <precision P>
struct compute_min_vector<float, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = _mm_min_ps(v1.data, v2.data);
return result;
}
};
template <precision P>
struct compute_min_vector<int32, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
{
tvec4<int32, P> result(uninitialize);
vec<4, int32, P> result(uninitialize);
result.data = _mm_min_epi32(v1.data, v2.data);
return result;
}
};
template <precision P>
struct compute_min_vector<uint32, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, uint32, P> const & v1, vec<4, uint32, P> const & v2)
{
tvec4<uint32, P> result(uninitialize);
vec<4, uint32, P> result(uninitialize);
result.data = _mm_min_epu32(v1.data, v2.data);
return result;
}
};
template <precision P>
struct compute_max_vector<float, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = _mm_max_ps(v1.data, v2.data);
return result;
}
};
template <precision P>
struct compute_max_vector<int32, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
{
tvec4<int32, P> result(uninitialize);
vec<4, int32, P> result(uninitialize);
result.data = _mm_max_epi32(v1.data, v2.data);
return result;
}
};
template <precision P>
struct compute_max_vector<uint32, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & v1, vec<4, uint32, P> const & v2)
{
tvec4<uint32, P> result(uninitialize);
vec<4, uint32, P> result(uninitialize);
result.data = _mm_max_epu32(v1.data, v2.data);
return result;
}
};
template <precision P>
struct compute_clamp_vector<float, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & minVal, vec<4, float, P> const & maxVal)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data);
return result;
}
};
template <precision P>
struct compute_clamp_vector<int32, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, int32, P> call(vec<4, int32, P> const & x, vec<4, int32, P> const & minVal, vec<4, int32, P> const & maxVal)
{
tvec4<int32, P> result(uninitialize);
vec<4, int32, P> result(uninitialize);
result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data);
return result;
}
};
template <precision P>
struct compute_clamp_vector<uint32, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, uint32, P> call(vec<4, uint32, P> const & x, vec<4, uint32, P> const & minVal, vec<4, uint32, P> const & maxVal)
{
tvec4<uint32, P> result(uninitialize);
vec<4, uint32, P> result(uninitialize);
result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data);
return result;
}
};
template <precision P>
struct compute_mix_vector<float, bool, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & x, vec<4, float, P> const & y, vec<4, bool, P> const & a)
{
__m128i const Load = _mm_set_epi32(-(int)a.w, -(int)a.z, -(int)a.y, -(int)a.x);
__m128 const Mask = _mm_castsi128_ps(Load);
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
# if 0 && GLM_ARCH & GLM_ARCH_AVX
Result.data = _mm_blendv_ps(x.data, y.data, Mask);
# else
@@ -204,23 +204,23 @@ namespace detail
}
};
/* FIXME
template <precision P>
template<precision P>
struct compute_step_vector<float, P, tvec4>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge, tvec4<float, P> const& x)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& edge, vec<4, float, P> const& x)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_step(edge.data, x.data);
return result;
}
};
*/
template <precision P>
struct compute_smoothstep_vector<float, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& edge0, vec<4, float, P> const& edge1, vec<4, float, P> const& x)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data);
return result;
}

View File

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

View File

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

View File

@@ -8,23 +8,23 @@
namespace glm{
namespace detail
{
template <precision P>
struct compute_sqrt<tvec4, float, P, true>
template<precision P>
struct compute_sqrt<4, float, P, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = _mm_sqrt_ps(v.data);
return result;
}
};
template <>
struct compute_sqrt<tvec4, float, aligned_lowp, true>
template<>
struct compute_sqrt<4, float, aligned_lowp, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, aligned_lowp> call(tvec4<float, aligned_lowp> const & v)
GLM_FUNC_QUALIFIER static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const & v)
{
tvec4<float, aligned_lowp> result(uninitialize);
vec<4, float, aligned_lowp> result(uninitialize);
result.data = glm_vec4_sqrt_lowp(v.data);
return result;
}

View File

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

View File

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

View File

@@ -8,87 +8,87 @@
namespace glm{
namespace detail
{
template <precision P>
struct compute_length<tvec4, float, P, true>
template<precision P>
struct compute_length<vec, 4, float, P, true>
{
GLM_FUNC_QUALIFIER static float call(tvec4<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<tvec4, float, P, true>
template<precision P>
struct compute_distance<vec, 4, float, P, true>
{
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & p0, tvec4<float, P> const & p1)
GLM_FUNC_QUALIFIER static float call(vec<4, float, P> const & p0, vec<4, float, P> const & p1)
{
return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data));
}
};
template <precision P>
struct compute_dot<tvec4, float, P, true>
template<precision P>
struct compute_dot<vec<4, float, P>, float, true>
{
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const& x, tvec4<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));
}
};
template <precision P>
template<precision P>
struct compute_cross<float, P, true>
{
GLM_FUNC_QUALIFIER static tvec3<float, P> call(tvec3<float, P> const & a, tvec3<float, P> const & b)
GLM_FUNC_QUALIFIER static vec<3, float, P> call(vec<3, float, P> const & a, vec<3, float, P> const & b)
{
__m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x);
__m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x);
__m128 const xpd0 = glm_vec4_cross(set0, set1);
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = xpd0;
return tvec3<float, P>(result);
return vec<3, float, P>(result);
}
};
template <precision P>
struct compute_normalize<float, P, tvec4, true>
template<precision P>
struct compute_normalize<4, float, P, vec, true>
{
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const & v)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_normalize(v.data);
return result;
}
};
template <precision P>
struct compute_faceforward<float, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& N, vec<4, float, P> const& I, vec<4, float, P> const& Nref)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_faceforward(N.data, I.data, Nref.data);
return result;
}
};
template <precision P>
struct compute_reflect<float, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& I, vec<4, float, P> const& N)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_reflect(I.data, N.data);
return result;
}
};
template <precision P>
struct compute_refract<float, P, tvec4, true>
template<precision P>
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)
GLM_FUNC_QUALIFIER static vec<4, float, P> call(vec<4, float, P> const& I, vec<4, float, P> const& N, float eta)
{
tvec4<float, P> result(uninitialize);
vec<4, float, P> result(uninitialize);
result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(eta));
return result;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -10,14 +10,14 @@
namespace glm{
namespace detail
{
template <precision P>
struct compute_matrixCompMult<tmat4x4, float, P, true>
template<precision P>
struct compute_matrixCompMult<mat, 4, 4, float, P, true>
{
GLM_STATIC_ASSERT(detail::is_aligned<P>::value, "Specialization requires aligned");
GLM_FUNC_QUALIFIER static tmat4x4<float, P> call(tmat4x4<float, P> const & x, tmat4x4<float, P> const & y)
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const & x, mat<4, 4, float, P> const & y)
{
tmat4x4<float, P> result(uninitialize);
mat<4, 4, float, P> result(uninitialize);
glm_mat4_matrixCompMult(
*(glm_vec4 const (*)[4])&x[0].data,
*(glm_vec4 const (*)[4])&y[0].data,
@@ -26,12 +26,12 @@ namespace detail
}
};
template <precision P>
struct compute_transpose<tmat4x4, float, P, true>
template<precision P>
struct compute_transpose<mat, 4, 4, float, P, true>
{
GLM_FUNC_QUALIFIER static tmat4x4<float, P> call(tmat4x4<float, P> const & m)
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const & m)
{
tmat4x4<float, P> result(uninitialize);
mat<4, 4, float, P> result(uninitialize);
glm_mat4_transpose(
*(glm_vec4 const (*)[4])&m[0].data,
*(glm_vec4(*)[4])&result[0].data);
@@ -39,21 +39,21 @@ namespace detail
}
};
template <precision P>
struct compute_determinant<tmat4x4, float, P, true>
template<precision P>
struct compute_determinant<mat, 4, 4, float, P, true>
{
GLM_FUNC_QUALIFIER static float call(tmat4x4<float, P> const& m)
GLM_FUNC_QUALIFIER static float call(mat<4, 4, float, P> const& m)
{
return _mm_cvtss_f32(glm_mat4_determinant(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data)));
}
};
template <precision P>
struct compute_inverse<tmat4x4, float, P, true>
template<precision P>
struct compute_inverse<mat, 4, 4, float, P, true>
{
GLM_FUNC_QUALIFIER static tmat4x4<float, P> call(tmat4x4<float, P> const& m)
GLM_FUNC_QUALIFIER static mat<4, 4, float, P> call(mat<4, 4, float, P> const& m)
{
tmat4x4<float, P> Result(uninitialize);
mat<4, 4, float, P> Result(uninitialize);
glm_mat4_inverse(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data), *reinterpret_cast<__m128(*)[4]>(&Result[0].data));
return Result;
}
@@ -61,25 +61,25 @@ namespace detail
}//namespace detail
template<>
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_lowp> outerProduct<float, aligned_lowp, tvec4, tvec4>(tvec4<float, aligned_lowp> const & c, tvec4<float, aligned_lowp> const & r)
GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_lowp> outerProduct<4, 4, float, aligned_lowp, vec, vec>(vec<4, float, aligned_lowp> const & c, vec<4, float, aligned_lowp> const & r)
{
tmat4x4<float, aligned_lowp> m(uninitialize);
mat<4, 4, float, aligned_lowp> m(uninitialize);
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
return m;
}
template<>
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_mediump> outerProduct<float, aligned_mediump, tvec4, tvec4>(tvec4<float, aligned_mediump> const & c, tvec4<float, aligned_mediump> const & r)
GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_mediump> outerProduct<4, 4, float, aligned_mediump, vec, vec>(vec<4, float, aligned_mediump> const & c, vec<4, float, aligned_mediump> const & r)
{
tmat4x4<float, aligned_mediump> m(uninitialize);
mat<4, 4, float, aligned_mediump> m(uninitialize);
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
return m;
}
template<>
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_highp> outerProduct<float, aligned_highp, tvec4, tvec4>(tvec4<float, aligned_highp> const & c, tvec4<float, aligned_highp> const & r)
GLM_FUNC_QUALIFIER mat<4, 4, float, aligned_highp> outerProduct<4, 4, float, aligned_highp, vec, vec>(vec<4, float, aligned_highp> const & c, vec<4, float, aligned_highp> const & r)
{
tmat4x4<float, aligned_highp> m(uninitialize);
mat<4, 4, float, aligned_highp> m(uninitialize);
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
return m;
}

View File

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

View File

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

View File

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

View File

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

View File

@@ -9,230 +9,230 @@
namespace glm
{
// tvec1 type explicit instantiation
template struct tvec1<uint8, lowp>;
template struct tvec1<uint16, lowp>;
template struct tvec1<uint32, lowp>;
template struct tvec1<uint64, lowp>;
template struct tvec1<int8, lowp>;
template struct tvec1<int16, lowp>;
template struct tvec1<int32, lowp>;
template struct tvec1<int64, lowp>;
template struct tvec1<float32, lowp>;
template struct tvec1<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 tvec1<uint8, mediump>;
template struct tvec1<uint16, mediump>;
template struct tvec1<uint32, mediump>;
template struct tvec1<uint64, mediump>;
template struct tvec1<int8, mediump>;
template struct tvec1<int16, mediump>;
template struct tvec1<int32, mediump>;
template struct tvec1<int64, mediump>;
template struct tvec1<float32, mediump>;
template struct tvec1<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 tvec1<uint8, highp>;
template struct tvec1<uint16, highp>;
template struct tvec1<uint32, highp>;
template struct tvec1<uint64, highp>;
template struct tvec1<int8, highp>;
template struct tvec1<int16, highp>;
template struct tvec1<int32, highp>;
template struct tvec1<int64, highp>;
template struct tvec1<float32, highp>;
template struct tvec1<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 tvec2<uint8, lowp>;
template struct tvec2<uint16, lowp>;
template struct tvec2<uint32, lowp>;
template struct tvec2<uint64, lowp>;
template struct tvec2<int8, lowp>;
template struct tvec2<int16, lowp>;
template struct tvec2<int32, lowp>;
template struct tvec2<int64, lowp>;
template struct tvec2<float32, lowp>;
template struct tvec2<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 tvec2<uint8, mediump>;
template struct tvec2<uint16, mediump>;
template struct tvec2<uint32, mediump>;
template struct tvec2<uint64, mediump>;
template struct tvec2<int8, mediump>;
template struct tvec2<int16, mediump>;
template struct tvec2<int32, mediump>;
template struct tvec2<int64, mediump>;
template struct tvec2<float32, mediump>;
template struct tvec2<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 tvec2<uint8, highp>;
template struct tvec2<uint16, highp>;
template struct tvec2<uint32, highp>;
template struct tvec2<uint64, highp>;
template struct tvec2<int8, highp>;
template struct tvec2<int16, highp>;
template struct tvec2<int32, highp>;
template struct tvec2<int64, highp>;
template struct tvec2<float32, highp>;
template struct tvec2<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 tvec3<uint8, lowp>;
template struct tvec3<uint16, lowp>;
template struct tvec3<uint32, lowp>;
template struct tvec3<uint64, lowp>;
template struct tvec3<int8, lowp>;
template struct tvec3<int16, lowp>;
template struct tvec3<int32, lowp>;
template struct tvec3<int64, lowp>;
template struct tvec3<float32, lowp>;
template struct tvec3<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 tvec3<uint8, mediump>;
template struct tvec3<uint16, mediump>;
template struct tvec3<uint32, mediump>;
template struct tvec3<uint64, mediump>;
template struct tvec3<int8, mediump>;
template struct tvec3<int16, mediump>;
template struct tvec3<int32, mediump>;
template struct tvec3<int64, mediump>;
template struct tvec3<float32, mediump>;
template struct tvec3<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 tvec3<uint8, highp>;
template struct tvec3<uint16, highp>;
template struct tvec3<uint32, highp>;
template struct tvec3<uint64, highp>;
template struct tvec3<int8, highp>;
template struct tvec3<int16, highp>;
template struct tvec3<int32, highp>;
template struct tvec3<int64, highp>;
template struct tvec3<float32, highp>;
template struct tvec3<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 tvec4<uint8, lowp>;
template struct tvec4<uint16, lowp>;
template struct tvec4<uint32, lowp>;
template struct tvec4<uint64, lowp>;
template struct tvec4<int8, lowp>;
template struct tvec4<int16, lowp>;
template struct tvec4<int32, lowp>;
template struct tvec4<int64, lowp>;
template struct tvec4<float32, lowp>;
template struct tvec4<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 tvec4<uint8, mediump>;
template struct tvec4<uint16, mediump>;
template struct tvec4<uint32, mediump>;
template struct tvec4<uint64, mediump>;
template struct tvec4<int8, mediump>;
template struct tvec4<int16, mediump>;
template struct tvec4<int32, mediump>;
template struct tvec4<int64, mediump>;
template struct tvec4<float32, mediump>;
template struct tvec4<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 tvec4<uint8, highp>;
template struct tvec4<uint16, highp>;
template struct tvec4<uint32, highp>;
template struct tvec4<uint64, highp>;
template struct tvec4<int8, highp>;
template struct tvec4<int16, highp>;
template struct tvec4<int32, highp>;
template struct tvec4<int64, highp>;
template struct tvec4<float32, highp>;
template struct tvec4<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>;
template struct tmat2x2<float64, lowp>;
template struct mat<2, 2, float32, lowp>;
template struct mat<2, 2, float64, lowp>;
template struct tmat2x2<float32, mediump>;
template struct tmat2x2<float64, mediump>;
template struct mat<2, 2, float32, mediump>;
template struct mat<2, 2, float64, mediump>;
template struct tmat2x2<float32, highp>;
template struct tmat2x2<float64, highp>;
template struct mat<2, 2, float32, highp>;
template struct mat<2, 2, float64, highp>;
// tmat2x3 type explicit instantiation
template struct tmat2x3<float32, lowp>;
template struct tmat2x3<float64, lowp>;
template struct mat<2, 3, float32, lowp>;
template struct mat<2, 3, float64, lowp>;
template struct tmat2x3<float32, mediump>;
template struct tmat2x3<float64, mediump>;
template struct mat<2, 3, float32, mediump>;
template struct mat<2, 3, float64, mediump>;
template struct tmat2x3<float32, highp>;
template struct tmat2x3<float64, highp>;
template struct mat<2, 3, float32, highp>;
template struct mat<2, 3, float64, highp>;
// tmat2x4 type explicit instantiation
template struct tmat2x4<float32, lowp>;
template struct tmat2x4<float64, lowp>;
template struct mat<2, 4, float32, lowp>;
template struct mat<2, 4, float64, lowp>;
template struct tmat2x4<float32, mediump>;
template struct tmat2x4<float64, mediump>;
template struct mat<2, 4, float32, mediump>;
template struct mat<2, 4, float64, mediump>;
template struct tmat2x4<float32, highp>;
template struct tmat2x4<float64, highp>;
template struct mat<2, 4, float32, highp>;
template struct mat<2, 4, float64, highp>;
// tmat3x2 type explicit instantiation
template struct tmat3x2<float32, lowp>;
template struct tmat3x2<float64, lowp>;
template struct mat<3, 2, float32, lowp>;
template struct mat<3, 2, float64, lowp>;
template struct tmat3x2<float32, mediump>;
template struct tmat3x2<float64, mediump>;
template struct mat<3, 2, float32, mediump>;
template struct mat<3, 2, float64, mediump>;
template struct tmat3x2<float32, highp>;
template struct tmat3x2<float64, highp>;
template struct mat<3, 2, float32, highp>;
template struct mat<3, 2, float64, highp>;
// tmat3x3 type explicit instantiation
template struct tmat3x3<float32, lowp>;
template struct tmat3x3<float64, lowp>;
template struct mat<3, 3, float32, lowp>;
template struct mat<3, 3, float64, lowp>;
template struct tmat3x3<float32, mediump>;
template struct tmat3x3<float64, mediump>;
template struct mat<3, 3, float32, mediump>;
template struct mat<3, 3, float64, mediump>;
template struct tmat3x3<float32, highp>;
template struct tmat3x3<float64, highp>;
template struct mat<3, 3, float32, highp>;
template struct mat<3, 3, float64, highp>;
// tmat3x4 type explicit instantiation
template struct tmat3x4<float32, lowp>;
template struct tmat3x4<float64, lowp>;
template struct mat<3, 4, float32, lowp>;
template struct mat<3, 4, float64, lowp>;
template struct tmat3x4<float32, mediump>;
template struct tmat3x4<float64, mediump>;
template struct mat<3, 4, float32, mediump>;
template struct mat<3, 4, float64, mediump>;
template struct tmat3x4<float32, highp>;
template struct tmat3x4<float64, highp>;
template struct mat<3, 4, float32, highp>;
template struct mat<3, 4, float64, highp>;
// tmat4x2 type explicit instantiation
template struct tmat4x2<float32, lowp>;
template struct tmat4x2<float64, lowp>;
template struct mat<4, 2, float32, lowp>;
template struct mat<4, 2, float64, lowp>;
template struct tmat4x2<float32, mediump>;
template struct tmat4x2<float64, mediump>;
template struct mat<4, 2, float32, mediump>;
template struct mat<4, 2, float64, mediump>;
template struct tmat4x2<float32, highp>;
template struct tmat4x2<float64, highp>;
template struct mat<4, 2, float32, highp>;
template struct mat<4, 2, float64, highp>;
// tmat4x3 type explicit instantiation
template struct tmat4x3<float32, lowp>;
template struct tmat4x3<float64, lowp>;
template struct mat<4, 3, float32, lowp>;
template struct mat<4, 3, float64, lowp>;
template struct tmat4x3<float32, mediump>;
template struct tmat4x3<float64, mediump>;
template struct mat<4, 3, float32, mediump>;
template struct mat<4, 3, float64, mediump>;
template struct tmat4x3<float32, highp>;
template struct tmat4x3<float64, highp>;
template struct mat<4, 3, float32, highp>;
template struct mat<4, 3, float64, highp>;
// tmat4x4 type explicit instantiation
template struct tmat4x4<float32, lowp>;
template struct tmat4x4<float64, lowp>;
template struct mat<4, 4, float32, lowp>;
template struct mat<4, 4, float64, lowp>;
template struct tmat4x4<float32, mediump>;
template struct tmat4x4<float64, mediump>;
template struct mat<4, 4, float32, mediump>;
template struct mat<4, 4, float64, mediump>;
template struct tmat4x4<float32, highp>;
template struct tmat4x4<float64, highp>;
template struct mat<4, 4, float32, highp>;
template struct mat<4, 4, float64, highp>;
// tquat type explicit instantiation
template struct tquat<float32, lowp>;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -8,24 +8,11 @@
namespace glm{
namespace detail
{
template <typename T, precision P, template <class, precision> class colType, template <class, precision> class rowType>
template<int Columns, int Rows, typename T, precision P, template<int, class, precision> class colType, template<int, class, precision> class rowType>
struct outerProduct_trait{};
}//namespace detail
template <typename T, precision P> struct tvec2;
template <typename T, precision P> struct tvec3;
template <typename T, precision P> struct tvec4;
template <typename T, precision P> struct tmat2x2;
template <typename T, precision P> struct tmat2x3;
template <typename T, precision P> struct tmat2x4;
template <typename T, precision P> struct tmat3x2;
template <typename T, precision P> struct tmat3x3;
template <typename T, precision P> struct tmat3x4;
template <typename T, precision P> struct tmat4x2;
template <typename T, precision P> struct tmat4x3;
template <typename T, precision P> struct tmat4x4;
template <typename T, precision P, template <typename, precision> class matType>
template<typename T, precision P, template<typename, precision> class matType>
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m);
/// @addtogroup core_precision
@@ -36,42 +23,42 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, lowp> lowp_mat2;
typedef mat<2, 2, float, lowp> lowp_mat2;
/// 2 columns of 2 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, mediump> mediump_mat2;
typedef mat<2, 2, float, mediump> mediump_mat2;
/// 2 columns of 2 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, highp> highp_mat2;
typedef mat<2, 2, float, highp> highp_mat2;
/// 2 columns of 2 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, lowp> lowp_mat2x2;
typedef mat<2, 2, float, lowp> lowp_mat2x2;
/// 2 columns of 2 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, mediump> mediump_mat2x2;
typedef mat<2, 2, float, mediump> mediump_mat2x2;
/// 2 columns of 2 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<float, highp> highp_mat2x2;
typedef mat<2, 2, float, highp> highp_mat2x2;
/// @}
@@ -83,21 +70,21 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<float, lowp> lowp_mat2x3;
typedef mat<2, 3, float, lowp> lowp_mat2x3;
/// 2 columns of 3 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<float, mediump> mediump_mat2x3;
typedef mat<2, 3, float, mediump> mediump_mat2x3;
/// 2 columns of 3 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<float, highp> highp_mat2x3;
typedef mat<2, 3, float, highp> highp_mat2x3;
/// @}
@@ -109,21 +96,21 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<float, lowp> lowp_mat2x4;
typedef mat<2, 4, float, lowp> lowp_mat2x4;
/// 2 columns of 4 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<float, mediump> mediump_mat2x4;
typedef mat<2, 4, float, mediump> mediump_mat2x4;
/// 2 columns of 4 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<float, highp> highp_mat2x4;
typedef mat<2, 4, float, highp> highp_mat2x4;
/// @}
@@ -135,21 +122,21 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<float, lowp> lowp_mat3x2;
typedef mat<3, 2, float, lowp> lowp_mat3x2;
/// 3 columns of 2 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<float, mediump> mediump_mat3x2;
typedef mat<3, 2, float, mediump> mediump_mat3x2;
/// 3 columns of 2 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<float, highp> highp_mat3x2;
typedef mat<3, 2, float, highp> highp_mat3x2;
/// @}
@@ -161,42 +148,42 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, lowp> lowp_mat3;
typedef mat<3, 3, float, lowp> lowp_mat3;
/// 3 columns of 3 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, mediump> mediump_mat3;
typedef mat<3, 3, float, mediump> mediump_mat3;
/// 3 columns of 3 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, highp> highp_mat3;
typedef mat<3, 3, float, highp> highp_mat3;
/// 3 columns of 3 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, lowp> lowp_mat3x3;
typedef mat<3, 3, float, lowp> lowp_mat3x3;
/// 3 columns of 3 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, mediump> mediump_mat3x3;
typedef mat<3, 3, float, mediump> mediump_mat3x3;
/// 3 columns of 3 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, highp> highp_mat3x3;
typedef mat<3, 3, float, highp> highp_mat3x3;
/// @}
@@ -208,21 +195,21 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<float, lowp> lowp_mat3x4;
typedef mat<3, 4, float, lowp> lowp_mat3x4;
/// 3 columns of 4 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<float, mediump> mediump_mat3x4;
typedef mat<3, 4, float, mediump> mediump_mat3x4;
/// 3 columns of 4 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<float, highp> highp_mat3x4;
typedef mat<3, 4, float, highp> highp_mat3x4;
/// @}
@@ -234,21 +221,21 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<float, lowp> lowp_mat4x2;
typedef mat<4, 2, float, lowp> lowp_mat4x2;
/// 4 columns of 2 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<float, mediump> mediump_mat4x2;
typedef mat<4, 2, float, mediump> mediump_mat4x2;
/// 4 columns of 2 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<float, highp> highp_mat4x2;
typedef mat<4, 2, float, highp> highp_mat4x2;
/// @}
@@ -260,21 +247,21 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<float, lowp> lowp_mat4x3;
typedef mat<4, 3, float, lowp> lowp_mat4x3;
/// 4 columns of 3 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<float, mediump> mediump_mat4x3;
typedef mat<4, 3, float, mediump> mediump_mat4x3;
/// 4 columns of 3 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<float, highp> highp_mat4x3;
typedef mat<4, 3, float, highp> highp_mat4x3;
/// @}
@@ -287,42 +274,42 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, lowp> lowp_mat4;
typedef mat<4, 4, float, lowp> lowp_mat4;
/// 4 columns of 4 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, mediump> mediump_mat4;
typedef mat<4, 4, float, mediump> mediump_mat4;
/// 4 columns of 4 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, highp> highp_mat4;
typedef mat<4, 4, float, highp> highp_mat4;
/// 4 columns of 4 components matrix of low precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, lowp> lowp_mat4x4;
typedef mat<4, 4, float, lowp> lowp_mat4x4;
/// 4 columns of 4 components matrix of medium precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, mediump> mediump_mat4x4;
typedef mat<4, 4, float, mediump> mediump_mat4x4;
/// 4 columns of 4 components matrix of high precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<float, highp> highp_mat4x4;
typedef mat<4, 4, float, highp> highp_mat4x4;
/// @}
@@ -425,37 +412,37 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, lowp> lowp_dmat2;
typedef mat<2, 2, double, lowp> lowp_dmat2;
/// 2 columns of 2 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, mediump> mediump_dmat2;
typedef mat<2, 2, double, mediump> mediump_dmat2;
/// 2 columns of 2 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, highp> highp_dmat2;
typedef mat<2, 2, double, highp> highp_dmat2;
/// 2 columns of 2 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, lowp> lowp_dmat2x2;
typedef mat<2, 2, double, lowp> lowp_dmat2x2;
/// 2 columns of 2 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, mediump> mediump_dmat2x2;
typedef mat<2, 2, double, mediump> mediump_dmat2x2;
/// 2 columns of 2 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x2<double, highp> highp_dmat2x2;
typedef mat<2, 2, double, highp> highp_dmat2x2;
/// @}
@@ -466,19 +453,19 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<double, lowp> lowp_dmat2x3;
typedef mat<2, 3, double, lowp> lowp_dmat2x3;
/// 2 columns of 3 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<double, mediump> mediump_dmat2x3;
typedef mat<2, 3, double, mediump> mediump_dmat2x3;
/// 2 columns of 3 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x3<double, highp> highp_dmat2x3;
typedef mat<2, 3, double, highp> highp_dmat2x3;
/// @}
@@ -489,19 +476,19 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<double, lowp> lowp_dmat2x4;
typedef mat<2, 4, double, lowp> lowp_dmat2x4;
/// 2 columns of 4 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<double, mediump> mediump_dmat2x4;
typedef mat<2, 4, double, mediump> mediump_dmat2x4;
/// 2 columns of 4 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat2x4<double, highp> highp_dmat2x4;
typedef mat<2, 4, double, highp> highp_dmat2x4;
/// @}
@@ -512,19 +499,19 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<double, lowp> lowp_dmat3x2;
typedef mat<3, 2, double, lowp> lowp_dmat3x2;
/// 3 columns of 2 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<double, mediump> mediump_dmat3x2;
typedef mat<3, 2, double, mediump> mediump_dmat3x2;
/// 3 columns of 2 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x2<double, highp> highp_dmat3x2;
typedef mat<3, 2, double, highp> highp_dmat3x2;
/// @}
@@ -535,37 +522,37 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<float, lowp> lowp_dmat3;
typedef mat<3, 3, float, lowp> lowp_dmat3;
/// 3 columns of 3 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, mediump> mediump_dmat3;
typedef mat<3, 3, double, mediump> mediump_dmat3;
/// 3 columns of 3 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, highp> highp_dmat3;
typedef mat<3, 3, double, highp> highp_dmat3;
/// 3 columns of 3 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, lowp> lowp_dmat3x3;
typedef mat<3, 3, double, lowp> lowp_dmat3x3;
/// 3 columns of 3 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, mediump> mediump_dmat3x3;
typedef mat<3, 3, double, mediump> mediump_dmat3x3;
/// 3 columns of 3 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x3<double, highp> highp_dmat3x3;
typedef mat<3, 3, double, highp> highp_dmat3x3;
/// @}
@@ -576,19 +563,19 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<double, lowp> lowp_dmat3x4;
typedef mat<3, 4, double, lowp> lowp_dmat3x4;
/// 3 columns of 4 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<double, mediump> mediump_dmat3x4;
typedef mat<3, 4, double, mediump> mediump_dmat3x4;
/// 3 columns of 4 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat3x4<double, highp> highp_dmat3x4;
typedef mat<3, 4, double, highp> highp_dmat3x4;
/// @}
@@ -599,19 +586,19 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<double, lowp> lowp_dmat4x2;
typedef mat<4, 2, double, lowp> lowp_dmat4x2;
/// 4 columns of 2 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<double, mediump> mediump_dmat4x2;
typedef mat<4, 2, double, mediump> mediump_dmat4x2;
/// 4 columns of 2 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x2<double, highp> highp_dmat4x2;
typedef mat<4, 2, double, highp> highp_dmat4x2;
/// @}
@@ -622,19 +609,19 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<double, lowp> lowp_dmat4x3;
typedef mat<4, 3, double, lowp> lowp_dmat4x3;
/// 4 columns of 3 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<double, mediump> mediump_dmat4x3;
typedef mat<4, 3, double, mediump> mediump_dmat4x3;
/// 4 columns of 3 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x3<double, highp> highp_dmat4x3;
typedef mat<4, 3, double, highp> highp_dmat4x3;
/// @}
@@ -645,37 +632,37 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, lowp> lowp_dmat4;
typedef mat<4, 4, double, lowp> lowp_dmat4;
/// 4 columns of 4 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, mediump> mediump_dmat4;
typedef mat<4, 4, double, mediump> mediump_dmat4;
/// 4 columns of 4 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, highp> highp_dmat4;
typedef mat<4, 4, double, highp> highp_dmat4;
/// 4 columns of 4 components matrix of low precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, lowp> lowp_dmat4x4;
typedef mat<4, 4, double, lowp> lowp_dmat4x4;
/// 4 columns of 4 components matrix of medium precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, mediump> mediump_dmat4x4;
typedef mat<4, 4, double, mediump> mediump_dmat4x4;
/// 4 columns of 4 components matrix of high precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.6 Matrices</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tmat4x4<double, highp> highp_dmat4x4;
typedef mat<4, 4, double, highp> highp_dmat4x4;
/// @}

View File

@@ -11,13 +11,13 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat2x2
template<typename T, precision P>
struct mat<2, 2, T, P>
{
typedef tvec2<T, P> col_type;
typedef tvec2<T, P> row_type;
typedef tmat2x2<T, P> type;
typedef tmat2x2<T, P> transpose_type;
typedef vec<2, T, P> col_type;
typedef vec<2, T, P> row_type;
typedef mat<2, 2, T, P> type;
typedef mat<2, 2, T, P> transpose_type;
typedef T value_type;
private:
@@ -26,45 +26,45 @@ namespace glm
public:
// -- Constructors --
GLM_FUNC_DECL tmat2x2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat2x2(tmat2x2<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<2, 2, T, P> const & m) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL mat(mat<2, 2, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat2x2(ctor);
GLM_FUNC_DECL explicit tmat2x2(T scalar);
GLM_FUNC_DECL tmat2x2(
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
GLM_FUNC_DECL explicit mat(T scalar);
GLM_FUNC_DECL mat(
T const & x1, T const & y1,
T const & x2, T const & y2);
GLM_FUNC_DECL tmat2x2(
GLM_FUNC_DECL mat(
col_type const & v1,
col_type const & v2);
// -- Conversions --
template <typename U, typename V, typename M, typename N>
GLM_FUNC_DECL tmat2x2(
template<typename U, typename V, typename M, typename N>
GLM_FUNC_DECL mat(
U const & x1, V const & y1,
M const & x2, N const & y2);
template <typename U, typename V>
GLM_FUNC_DECL tmat2x2(
tvec2<U, P> const & v1,
tvec2<V, P> const & v2);
template<typename U, typename V>
GLM_FUNC_DECL mat(
vec<2, U, P> const & v1,
vec<2, V, P> const & v2);
// -- Matrix conversions --
template <typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x2<U, Q> const & m);
template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x2(tmat4x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
@@ -76,106 +76,106 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<T, P> const & v) GLM_DEFAULT;
GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, T, P> const & v) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator+=(tmat2x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator-=(tmat2x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator*=(tmat2x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x2<T, P> & operator/=(tmat2x2<U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator=(mat<2, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator+=(mat<2, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator-=(mat<2, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator*=(mat<2, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 2, T, P> & operator/=(mat<2, 2, U, P> const & m);
// -- Increment and decrement operators --
GLM_FUNC_DECL tmat2x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x2<T, P> operator++(int);
GLM_FUNC_DECL tmat2x2<T, P> operator--(int);
GLM_FUNC_DECL mat<2, 2, T, P> & operator++ ();
GLM_FUNC_DECL mat<2, 2, T, P> & operator-- ();
GLM_FUNC_DECL mat<2, 2, T, P> operator++(int);
GLM_FUNC_DECL mat<2, 2, T, P> operator--(int);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+(T scalar, tmat2x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator-(T scalar, tmat2x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator*(T scalar, tmat2x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator*(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator*(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator*(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator*(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator/(T scalar, tmat2x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2);
} //namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@@ -8,8 +8,8 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0);
@@ -19,35 +19,35 @@ namespace glm
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, P> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<T, Q> const & m)
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, T, Q> const& m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat2x2<T, P>::tmat2x2(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<2, 2, T, P>::mat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0);
this->value[1] = col_type(0, scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat
(
T const & x0, T const & y0,
T const & x1, T const & y1
@@ -57,8 +57,8 @@ namespace glm
this->value[1] = col_type(x1, y1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(col_type const & v0, col_type const & v1)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(col_type const& v0, col_type const& v1)
{
this->value[0] = v0;
this->value[1] = v1;
@@ -66,9 +66,9 @@ namespace glm
// -- Conversion constructors --
template <typename T, precision P>
template <typename X1, typename Y1, typename X2, typename Y2>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2
template<typename T, precision P>
template<typename X1, typename Y1, typename X2, typename Y2>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat
(
X1 const & x1, Y1 const & y1,
X2 const & x2, Y2 const & y2
@@ -78,9 +78,9 @@ namespace glm
this->value[1] = col_type(static_cast<T>(x2), value_type(y2));
}
template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tvec2<V1, P> const & v1, tvec2<V2, P> const & v2)
template<typename T, precision P>
template<typename V1, typename V2>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(vec<2, V1, P> const& v1, vec<2, V2, P> const& v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
@@ -88,65 +88,65 @@ namespace glm
// -- mat2x2 matrix conversions --
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x2<U, Q> const & m)
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 2, U, Q> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 3, T, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 4, T, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 3, T, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 2, T, P> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<2, 4, T, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 2, T, P> const& m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<3, 4, T, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>::tmat2x2(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>::mat(mat<4, 3, T, P> const& m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -154,15 +154,15 @@ namespace glm
// -- Accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type& mat<2, 2, T, P>::operator[](typename mat<2, 2, T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type const & tmat2x2<T, P>::operator[](typename tmat2x2<T, P>::length_type i) const
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type const& mat<2, 2, T, P>::operator[](typename mat<2, 2, T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@@ -171,8 +171,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -180,237 +180,237 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator=(tmat2x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator=(mat<2, 2, U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(U scalar)
{
this->value[0] += scalar;
this->value[1] += scalar;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator+=(tmat2x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator+=(mat<2, 2, U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(U scalar)
{
this->value[0] -= scalar;
this->value[1] -= scalar;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator-=(tmat2x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator-=(mat<2, 2, U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(U scalar)
{
this->value[0] *= scalar;
this->value[1] *= scalar;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator*=(tmat2x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator*=(mat<2, 2, U, P> const & m)
{
return (*this = *this * m);
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(U scalar)
{
this->value[0] /= scalar;
this->value[1] /= scalar;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator/=(tmat2x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator/=(mat<2, 2, U, P> const & m)
{
return *this *= inverse(m);
}
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P>& tmat2x2<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P>& mat<2, 2, T, P>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator++(int)
{
tmat2x2<T, P> Result(*this);
mat<2, 2, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> tmat2x2<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> mat<2, 2, T, P>::operator--(int)
{
tmat2x2<T, P> Result(*this);
mat<2, 2, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
-m[0],
-m[1]);
}
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m, T scalar)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
m[0] + scalar,
m[1] + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(T scalar, tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(T scalar, mat<2, 2, T, P> const & m)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
m[0] + scalar,
m[1] + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator+(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m, T scalar)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
m[0] - scalar,
m[1] - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(T scalar, tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(T scalar, mat<2, 2, T, P> const & m)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
scalar - m[0],
scalar - m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator-(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m, T scalar)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
m[0] * scalar,
m[1] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(T scalar, tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(T scalar, mat<2, 2, T, P> const & m)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
m[0] * scalar,
m[1] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator*
(
tmat2x2<T, P> const & m,
typename tmat2x2<T, P>::row_type const & v
mat<2, 2, T, P> const& m,
typename mat<2, 2, T, P>::row_type const & v
)
{
return tvec2<T, P>(
return vec<2, T, P>(
m[0][0] * v.x + m[1][0] * v.y,
m[0][1] * v.x + m[1][1] * v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator*
(
typename tmat2x2<T, P>::col_type const & v,
tmat2x2<T, P> const & m
typename mat<2, 2, T, P>::col_type const & v,
mat<2, 2, T, P> const& m
)
{
return tvec2<T, P>(
return vec<2, T, P>(
v.x * m[0][0] + v.y * m[0][1],
v.x * m[1][0] + v.y * m[1][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
m1[0][1] * m2[1][0] + m1[1][1] * m2[1][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
@@ -419,10 +419,10 @@ namespace glm
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<2, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1],
@@ -433,51 +433,51 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m, T scalar)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
m[0] / scalar,
m[1] / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(T scalar, tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(T scalar, mat<2, 2, T, P> const & m)
{
return tmat2x2<T, P>(
return mat<2, 2, T, P>(
scalar / m[0],
scalar / m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::col_type operator/(mat<2, 2, T, P> const & m, typename mat<2, 2, T, P>::row_type const & v)
{
return inverse(m) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 2, T, P>::row_type operator/(typename mat<2, 2, T, P>::col_type const & v, mat<2, 2, T, P> const & m)
{
return v * inverse(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator/(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{
tmat2x2<T, P> m1_copy(m1);
mat<2, 2, T, P> m1_copy(m1);
return m1_copy /= m2;
}
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 2, T, P> const & m1, mat<2, 2, T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}

View File

@@ -12,13 +12,13 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat2x3
template<typename T, precision P>
struct mat<2, 3, T, P>
{
typedef tvec3<T, P> col_type;
typedef tvec2<T, P> row_type;
typedef tmat2x3<T, P> type;
typedef tmat3x2<T, P> transpose_type;
typedef vec<3, T, P> col_type;
typedef vec<2, T, P> row_type;
typedef mat<2, 3, T, P> type;
typedef mat<3, 2, T, P> transpose_type;
typedef T value_type;
private:
@@ -27,45 +27,45 @@ namespace glm
public:
// -- Constructors --
GLM_FUNC_DECL tmat2x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat2x3(tmat2x3<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat2x3(tmat2x3<T, Q> const & m);
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<2, 3, T, P> const & m) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL mat(mat<2, 3, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat2x3(ctor);
GLM_FUNC_DECL explicit tmat2x3(T scalar);
GLM_FUNC_DECL tmat2x3(
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
GLM_FUNC_DECL explicit mat(T scalar);
GLM_FUNC_DECL mat(
T x0, T y0, T z0,
T x1, T y1, T z1);
GLM_FUNC_DECL tmat2x3(
GLM_FUNC_DECL mat(
col_type const & v0,
col_type const & v1);
// -- Conversions --
template <typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2>
GLM_FUNC_DECL tmat2x3(
template<typename X1, typename Y1, typename Z1, typename X2, typename Y2, typename Z2>
GLM_FUNC_DECL mat(
X1 x1, Y1 y1, Z1 z1,
X2 x2, Y2 y2, Z2 z2);
template <typename U, typename V>
GLM_FUNC_DECL tmat2x3(
tvec3<U, P> const & v1,
tvec3<V, P> const & v2);
template<typename U, typename V>
GLM_FUNC_DECL mat(
vec<3, U, P> const & v1,
vec<3, V, P> const & v2);
// -- Matrix conversions --
template <typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x3<U, Q> const & m);
template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x3(tmat4x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
@@ -77,87 +77,87 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, T, P> const & m) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator=(tmat2x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator+=(tmat2x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator-=(tmat2x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x3<T, P> & operator/=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator=(mat<2, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator+=(mat<2, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator-=(mat<2, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 3, T, P> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL tmat2x3<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x3<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x3<T, P> operator++(int);
GLM_FUNC_DECL tmat2x3<T, P> operator--(int);
GLM_FUNC_DECL mat<2, 3, T, P> & operator++ ();
GLM_FUNC_DECL mat<2, 3, T, P> & operator-- ();
GLM_FUNC_DECL mat<2, 3, T, P> operator++(int);
GLM_FUNC_DECL mat<2, 3, T, P> operator--(int);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(T scalar, tmat2x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x3<T, P>::col_type operator*(tmat2x3<T, P> const & m, typename tmat2x3<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 3, T, P>::col_type operator*(mat<2, 3, T, P> const & m, typename mat<2, 3, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x3<T, P>::row_type operator*(typename tmat2x3<T, P>::col_type const & v, tmat2x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 3, T, P>::row_type operator*(typename mat<2, 3, T, P>::col_type const & v, mat<2, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator/(mat<2, 3, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator/(T scalar, tmat2x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const & m);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@@ -6,8 +6,8 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0);
@@ -17,35 +17,35 @@ namespace glm
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<T, Q> const & m)
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat2x3<T, P>::tmat2x3(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<2, 3, T, P>::mat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0, 0);
this->value[1] = col_type(0, scalar, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat
(
T x0, T y0, T z0,
T x1, T y1, T z1
@@ -55,8 +55,8 @@ namespace glm
this->value[1] = col_type(x1, y1, z1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(col_type const & v0, col_type const & v1)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(col_type const & v0, col_type const & v1)
{
this->value[0] = v0;
this->value[1] = v1;
@@ -64,11 +64,11 @@ namespace glm
// -- Conversion constructors --
template <typename T, precision P>
template <
template<typename T, precision P>
template<
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat
(
X1 x1, Y1 y1, Z1 z1,
X2 x2, Y2 y2, Z2 z2
@@ -78,9 +78,9 @@ namespace glm
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2));
}
template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tvec3<V1, P> const & v1, tvec3<V2, P> const & v2)
template<typename T, precision P>
template<typename V1, typename V2>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(vec<3, V1, P> const & v1, vec<3, V2, P> const & v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
@@ -88,65 +88,65 @@ namespace glm
// -- Matrix conversions --
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x3<U, Q> const & m)
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 3, U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 3, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<2, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<3, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>::tmat2x3(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>::mat(mat<4, 3, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -154,15 +154,15 @@ namespace glm
// -- Accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type & mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type const & tmat2x3<T, P>::operator[](typename tmat2x3<T, P>::length_type i) const
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type const & mat<2, 3, T, P>::operator[](typename mat<2, 3, T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@@ -171,8 +171,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -180,63 +180,63 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator=(tmat2x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator=(mat<2, 3, U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator+=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator+=(tmat2x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator+=(mat<2, 3, U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator-=(tmat2x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator-=(mat<2, 3, U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P>& tmat2x3<T, P>::operator*=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P>& mat<2, 3, T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator/=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@@ -245,131 +245,131 @@ namespace glm
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> & tmat2x3<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> & mat<2, 3, T, P>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator++(int)
{
tmat2x3<T, P> Result(*this);
mat<2, 3, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> tmat2x3<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> mat<2, 3, T, P>::operator--(int)
{
tmat2x3<T, P> Result(*this);
mat<2, 3, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
-m[0],
-m[1]);
}
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m, T scalar)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m[0] + scalar,
m[1] + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator+(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator+(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m, T scalar)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m[0] - scalar,
m[1] - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator-(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator-(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m, T scalar)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m[0] * scalar,
m[1] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(T scalar, tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(T scalar, mat<2, 3, T, P> const & m)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m[0] * scalar,
m[1] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::col_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::col_type operator*
(
tmat2x3<T, P> const & m,
typename tmat2x3<T, P>::row_type const & v)
mat<2, 3, T, P> const& m,
typename mat<2, 3, T, P>::row_type const & v)
{
return typename tmat2x3<T, P>::col_type(
return typename mat<2, 3, T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y,
m[0][1] * v.x + m[1][1] * v.y,
m[0][2] * v.x + m[1][2] * v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x3<T, P>::row_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 3, T, P>::row_type operator*
(
typename tmat2x3<T, P>::col_type const & v,
tmat2x3<T, P> const & m)
typename mat<2, 3, T, P>::col_type const & v,
mat<2, 3, T, P> const& m)
{
return typename tmat2x3<T, P>::row_type(
return typename mat<2, 3, T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat2x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<2, 2, T, P> const & m2)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
@@ -378,8 +378,8 @@ namespace glm
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat3x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<3, 2, T, P> const & m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
@@ -395,7 +395,7 @@ namespace glm
T SrcB20 = m2[2][0];
T SrcB21 = m2[2][1];
tmat3x3<T, P> Result(uninitialize);
mat<3, 3, T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01;
@@ -408,10 +408,10 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat2x3<T, P> const & m1, tmat4x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<2, 3, T, P> const & m1, mat<4, 2, T, P> const & m2)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
@@ -426,32 +426,32 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(tmat2x3<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(mat<2, 3, T, P> const & m, T scalar)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m[0] / scalar,
m[1] / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator/(T scalar, tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator/(T scalar, mat<2, 3, T, P> const & m)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
scalar / m[0],
scalar / m[1]);
}
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat2x3<T, P> const & m1, tmat2x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}

View File

@@ -12,13 +12,13 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat2x4
template<typename T, precision P>
struct mat<2, 4, T, P>
{
typedef tvec4<T, P> col_type;
typedef tvec2<T, P> row_type;
typedef tmat2x4<T, P> type;
typedef tmat4x2<T, P> transpose_type;
typedef vec<4, T, P> col_type;
typedef vec<2, T, P> row_type;
typedef mat<2, 4, T, P> type;
typedef mat<4, 2, T, P> transpose_type;
typedef T value_type;
private:
@@ -27,47 +27,47 @@ namespace glm
public:
// -- Constructors --
GLM_FUNC_DECL tmat2x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<2, 4, T, P> const & m) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL mat(mat<2, 4, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat2x4(ctor);
GLM_FUNC_DECL explicit tmat2x4(T scalar);
GLM_FUNC_DECL tmat2x4(
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
GLM_FUNC_DECL explicit mat(T scalar);
GLM_FUNC_DECL mat(
T x0, T y0, T z0, T w0,
T x1, T y1, T z1, T w1);
GLM_FUNC_DECL tmat2x4(
GLM_FUNC_DECL mat(
col_type const & v0,
col_type const & v1);
// -- Conversions --
template <
template<
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2>
GLM_FUNC_DECL tmat2x4(
GLM_FUNC_DECL mat(
X1 x1, Y1 y1, Z1 z1, W1 w1,
X2 x2, Y2 y2, Z2 z2, W2 w2);
template <typename U, typename V>
GLM_FUNC_DECL tmat2x4(
tvec4<U, P> const & v1,
tvec4<V, P> const & v2);
template<typename U, typename V>
GLM_FUNC_DECL mat(
vec<4, U, P> const & v1,
vec<4, V, P> const & v2);
// -- Matrix conversions --
template <typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x4<U, Q> const & m);
template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat4x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
@@ -79,87 +79,87 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, T, P> const & m) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator+=(tmat2x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator-=(tmat2x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat2x4<T, P> & operator/=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator=(mat<2, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator+=(mat<2, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator-=(mat<2, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<2, 4, T, P> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL tmat2x4<T, P> & operator++ ();
GLM_FUNC_DECL tmat2x4<T, P> & operator-- ();
GLM_FUNC_DECL tmat2x4<T, P> operator++(int);
GLM_FUNC_DECL tmat2x4<T, P> operator--(int);
GLM_FUNC_DECL mat<2, 4, T, P> & operator++ ();
GLM_FUNC_DECL mat<2, 4, T, P> & operator-- ();
GLM_FUNC_DECL mat<2, 4, T, P> operator++(int);
GLM_FUNC_DECL mat<2, 4, T, P> operator--(int);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(T scalar, tmat2x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const & m, typename mat<2, 4, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const & v, mat<2, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<2, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator/(mat<2, 4, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator/(T scalar, tmat2x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const & m);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@@ -6,8 +6,8 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0, 0);
@@ -17,36 +17,36 @@ namespace glm
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<T, Q> const & m)
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat2x4<T, P>::tmat2x4(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<2, 4, T, P>::mat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(T scalar)
{
value_type const Zero(0);
this->value[0] = col_type(scalar, Zero, Zero, Zero);
this->value[1] = col_type(Zero, scalar, Zero, Zero);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat
(
T x0, T y0, T z0, T w0,
T x1, T y1, T z1, T w1
@@ -56,8 +56,8 @@ namespace glm
this->value[1] = col_type(x1, y1, z1, w1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(col_type const & v0, col_type const & v1)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(col_type const & v0, col_type const & v1)
{
this->value[0] = v0;
this->value[1] = v1;
@@ -65,11 +65,11 @@ namespace glm
// -- Conversion constructors --
template <typename T, precision P>
template <
template<typename T, precision P>
template<
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat
(
X1 x1, Y1 y1, Z1 z1, W1 w1,
X2 x2, Y2 y2, Z2 z2, W2 w2
@@ -79,9 +79,9 @@ namespace glm
this->value[1] = col_type(static_cast<T>(x2), value_type(y2), value_type(z2), value_type(w2));
}
template <typename T, precision P>
template <typename V1, typename V2>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tvec4<V1, P> const & v1, tvec4<V2, P> const & v2)
template<typename T, precision P>
template<typename V1, typename V2>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(vec<4, V1, P> const & v1, vec<4, V2, P> const & v2)
{
this->value[0] = col_type(v1);
this->value[1] = col_type(v2);
@@ -89,65 +89,65 @@ namespace glm
// -- Matrix conversions --
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x4<U, Q> const & m)
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 4, U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 3, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<2, 3, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<3, 4, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>::tmat2x4(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>::mat(mat<4, 3, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@@ -155,15 +155,15 @@ namespace glm
// -- Accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type & mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type const & tmat2x4<T, P>::operator[](typename tmat2x4<T, P>::length_type i) const
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type const & mat<2, 4, T, P>::operator[](typename mat<2, 4, T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@@ -172,8 +172,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -181,63 +181,63 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator=(tmat2x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator=(mat<2, 4, U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator+=(tmat2x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator+=(mat<2, 4, U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator-=(tmat2x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator-=(mat<2, 4, U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator*=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat2x4<T, P> & tmat2x4<T, P>::operator/=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> & mat<2, 4, T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@@ -246,124 +246,124 @@ namespace glm
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator++()
{
++this->value[0];
++this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P>& tmat2x4<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P>& mat<2, 4, T, P>::operator--()
{
--this->value[0];
--this->value[1];
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator++(int)
{
tmat2x4<T, P> Result(*this);
mat<2, 4, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> tmat2x4<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> mat<2, 4, T, P>::operator--(int)
{
tmat2x4<T, P> Result(*this);
mat<2, 4, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
-m[0],
-m[1]);
}
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m, T scalar)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m[0] + scalar,
m[1] + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator+(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m1[0] + m2[0],
m1[1] + m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m, T scalar)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m[0] - scalar,
m[1] - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator-(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m1[0] - m2[0],
m1[1] - m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m, T scalar)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m[0] * scalar,
m[1] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(T scalar, tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(T scalar, mat<2, 4, T, P> const & m)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m[0] * scalar,
m[1] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::col_type operator*(mat<2, 4, T, P> const & m, typename mat<2, 4, T, P>::row_type const & v)
{
return typename tmat2x4<T, P>::col_type(
return typename mat<2, 4, T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y,
m[0][1] * v.x + m[1][1] * v.y,
m[0][2] * v.x + m[1][2] * v.y,
m[0][3] * v.x + m[1][3] * v.y);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<2, 4, T, P>::row_type operator*(typename mat<2, 4, T, P>::col_type const & v, mat<2, 4, T, P> const & m)
{
return typename tmat2x4<T, P>::row_type(
return typename mat<2, 4, T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<4, 2, T, P> const & m2)
{
T SrcA00 = m1[0][0];
T SrcA01 = m1[0][1];
@@ -383,7 +383,7 @@ namespace glm
T SrcB30 = m2[3][0];
T SrcB31 = m2[3][1];
tmat4x4<T, P> Result(uninitialize);
mat<4, 4, T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01;
@@ -403,10 +403,10 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<2, 2, T, P> const & m2)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
@@ -417,10 +417,10 @@ namespace glm
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<2, 4, T, P> const & m1, mat<3, 2, T, P> const & m2)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1],
@@ -435,32 +435,32 @@ namespace glm
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(mat<2, 4, T, P> const & m, T scalar)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m[0] / scalar,
m[1] / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator/(T scalar, tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator/(T scalar, mat<2, 4, T, P> const & m)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
scalar / m[0],
scalar / m[1]);
}
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<2, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]);
}

View File

@@ -12,13 +12,13 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat3x2
template<typename T, precision P>
struct mat<3, 2, T, P>
{
typedef tvec2<T, P> col_type;
typedef tvec3<T, P> row_type;
typedef tmat3x2<T, P> type;
typedef tmat2x3<T, P> transpose_type;
typedef vec<2, T, P> col_type;
typedef vec<3, T, P> row_type;
typedef mat<3, 2, T, P> type;
typedef mat<2, 3, T, P> transpose_type;
typedef T value_type;
private:
@@ -27,18 +27,18 @@ namespace glm
public:
// -- Constructors --
GLM_FUNC_DECL tmat3x2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<3, 2, T, P> const & m) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL mat(mat<3, 2, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat3x2(ctor);
GLM_FUNC_DECL explicit tmat3x2(T scalar);
GLM_FUNC_DECL tmat3x2(
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
GLM_FUNC_DECL explicit mat(T scalar);
GLM_FUNC_DECL mat(
T x0, T y0,
T x1, T y1,
T x2, T y2);
GLM_FUNC_DECL tmat3x2(
GLM_FUNC_DECL mat(
col_type const & v0,
col_type const & v1,
col_type const & v2);
@@ -49,30 +49,30 @@ namespace glm
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3>
GLM_FUNC_DECL tmat3x2(
GLM_FUNC_DECL mat(
X1 x1, Y1 y1,
X2 x2, Y2 y2,
X3 x3, Y3 y3);
template <typename V1, typename V2, typename V3>
GLM_FUNC_DECL tmat3x2(
tvec2<V1, P> const & v1,
tvec2<V2, P> const & v2,
tvec2<V3, P> const & v3);
template<typename V1, typename V2, typename V3>
GLM_FUNC_DECL mat(
vec<2, V1, P> const & v1,
vec<2, V2, P> const & v2,
vec<2, V3, P> const & v3);
// -- Matrix conversions --
template <typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x2<U, Q> const & m);
template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x2(tmat4x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
@@ -84,87 +84,87 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, T, P> const & m) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator=(tmat3x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator+=(tmat3x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator-=(tmat3x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x2<T, P> & operator/=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator=(mat<3, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator+=(mat<3, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator-=(mat<3, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 2, T, P> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL tmat3x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat3x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat3x2<T, P> operator++(int);
GLM_FUNC_DECL tmat3x2<T, P> operator--(int);
GLM_FUNC_DECL mat<3, 2, T, P> & operator++ ();
GLM_FUNC_DECL mat<3, 2, T, P> & operator-- ();
GLM_FUNC_DECL mat<3, 2, T, P> operator++(int);
GLM_FUNC_DECL mat<3, 2, T, P> operator--(int);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(T scalar, tmat3x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const & m, typename mat<3, 2, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const & v, mat<3, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator/(mat<3, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator/(T scalar, tmat3x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const & m);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2);
}//namespace glm

View File

@@ -6,8 +6,8 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0);
@@ -18,8 +18,8 @@ namespace glm
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@@ -27,29 +27,29 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<T, Q> const & m)
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat3x2<T, P>::tmat3x2(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<3, 2, T, P>::mat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0);
this->value[1] = col_type(0, scalar);
this->value[2] = col_type(0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
(
T x0, T y0,
T x1, T y1,
@@ -61,8 +61,8 @@ namespace glm
this->value[2] = col_type(x2, y2);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
(
col_type const & v0,
col_type const & v1,
@@ -76,12 +76,12 @@ namespace glm
// -- Conversion constructors --
template <typename T, precision P>
template <
template<typename T, precision P>
template<
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
(
X1 x1, Y1 y1,
X2 x2, Y2 y2,
@@ -93,13 +93,13 @@ namespace glm
this->value[2] = col_type(static_cast<T>(x3), value_type(y3));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2
template<typename T, precision P>
template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat
(
tvec2<V1, P> const & v1,
tvec2<V2, P> const & v2,
tvec2<V3, P> const & v3
vec<2, V1, P> const & v1,
vec<2, V2, P> const & v2,
vec<2, V3, P> const & v3
)
{
this->value[0] = col_type(v1);
@@ -109,73 +109,73 @@ namespace glm
// -- Matrix conversions --
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x2<U, Q> const & m)
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 2, U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 2, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 3, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 3, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(T(0));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<2, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(T(0));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<3, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 2, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = m[2];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>::tmat3x2(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>::mat(mat<4, 3, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -184,15 +184,15 @@ namespace glm
// -- Accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type & mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type const & tmat3x2<T, P>::operator[](typename tmat3x2<T, P>::length_type i) const
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type const & mat<3, 2, T, P>::operator[](typename mat<3, 2, T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@@ -201,8 +201,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -211,9 +211,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator=(tmat3x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator=(mat<3, 2, U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -221,9 +221,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@@ -231,9 +231,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator+=(tmat3x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator+=(mat<3, 2, U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@@ -241,9 +241,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@@ -251,9 +251,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator-=(tmat3x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator-=(mat<3, 2, U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@@ -261,9 +261,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator*=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@@ -271,9 +271,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x2<T, P> & tmat3x2<T, P>::operator/=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> & mat<3, 2, T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@@ -283,8 +283,8 @@ namespace glm
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator++()
{
++this->value[0];
++this->value[1];
@@ -292,8 +292,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P>& tmat3x2<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P>& mat<3, 2, T, P>::operator--()
{
--this->value[0];
--this->value[1];
@@ -301,34 +301,34 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator++(int)
{
tmat3x2<T, P> Result(*this);
mat<3, 2, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> tmat3x2<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> mat<3, 2, T, P>::operator--(int)
{
tmat3x2<T, P> Result(*this);
mat<3, 2, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
-m[0],
-m[1],
-m[2]);
@@ -336,79 +336,79 @@ namespace glm
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m, T scalar)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator+(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator+(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m, T scalar)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator-(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator-(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m, T scalar)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(T scalar, tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(T scalar, mat<3, 2, T, P> const & m)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::col_type operator*(tmat3x2<T, P> const & m, typename tmat3x2<T, P>::row_type const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::col_type operator*(mat<3, 2, T, P> const & m, typename mat<3, 2, T, P>::row_type const & v)
{
return typename tmat3x2<T, P>::col_type(
return typename mat<3, 2, T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x2<T, P>::row_type operator*(typename tmat3x2<T, P>::col_type const & v, tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 2, T, P>::row_type operator*(typename mat<3, 2, T, P>::col_type const & v, mat<3, 2, T, P> const & m)
{
return typename tmat3x2<T, P>::row_type(
return typename mat<3, 2, T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1],
v.x * m[1][0] + v.y * m[1][1],
v.x * m[2][0] + v.y * m[2][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat2x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<2, 3, T, P> const & m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
@@ -424,7 +424,7 @@ namespace glm
const T SrcB11 = m2[1][1];
const T SrcB12 = m2[1][2];
tmat2x2<T, P> Result(uninitialize);
mat<2, 2, T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12;
@@ -432,10 +432,10 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat3x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<3, 3, T, P> const & m2)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
@@ -444,10 +444,10 @@ namespace glm
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat3x2<T, P> const & m1, tmat4x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<3, 2, T, P> const & m1, mat<4, 3, T, P> const & m2)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2],
@@ -458,19 +458,19 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(tmat3x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(mat<3, 2, T, P> const & m, T scalar)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator/(T scalar, tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator/(T scalar, mat<3, 2, T, P> const & m)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
@@ -478,14 +478,14 @@ namespace glm
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat3x2<T, P> const & m1, tmat3x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 2, T, P> const & m1, mat<3, 2, T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}

View File

@@ -11,13 +11,13 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat3x3
template<typename T, precision P>
struct mat<3, 3, T, P>
{
typedef tvec3<T, P> col_type;
typedef tvec3<T, P> row_type;
typedef tmat3x3<T, P> type;
typedef tmat3x3<T, P> transpose_type;
typedef vec<3, T, P> col_type;
typedef vec<3, T, P> row_type;
typedef mat<3, 3, T, P> type;
typedef mat<3, 3, T, P> transpose_type;
typedef T value_type;
private:
@@ -26,18 +26,18 @@ namespace glm
public:
// -- Constructors --
GLM_FUNC_DECL tmat3x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<3, 3, T, P> const & m) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL mat(mat<3, 3, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat3x3(ctor);
GLM_FUNC_DECL explicit tmat3x3(T scalar);
GLM_FUNC_DECL tmat3x3(
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
GLM_FUNC_DECL explicit mat(T scalar);
GLM_FUNC_DECL mat(
T x0, T y0, T z0,
T x1, T y1, T z1,
T x2, T y2, T z2);
GLM_FUNC_DECL tmat3x3(
GLM_FUNC_DECL mat(
col_type const & v0,
col_type const & v1,
col_type const & v2);
@@ -48,30 +48,30 @@ namespace glm
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3>
GLM_FUNC_DECL tmat3x3(
GLM_FUNC_DECL mat(
X1 x1, Y1 y1, Z1 z1,
X2 x2, Y2 y2, Z2 z2,
X3 x3, Y3 y3, Z3 z3);
template <typename V1, typename V2, typename V3>
GLM_FUNC_DECL tmat3x3(
tvec3<V1, P> const & v1,
tvec3<V2, P> const & v2,
tvec3<V3, P> const & v3);
template<typename V1, typename V2, typename V3>
GLM_FUNC_DECL mat(
vec<3, V1, P> const & v1,
vec<3, V2, P> const & v2,
vec<3, V3, P> const & v3);
// -- Matrix conversions --
template <typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x3<U, Q> const & m);
template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat4x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
@@ -83,106 +83,106 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, T, P> const & m) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator+=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator-=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator*=(tmat3x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x3<T, P> & operator/=(tmat3x3<U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator=(mat<3, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator+=(mat<3, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator-=(mat<3, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator*=(mat<3, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 3, T, P> & operator/=(mat<3, 3, U, P> const & m);
// -- Increment and decrement operators --
GLM_FUNC_DECL tmat3x3<T, P> & operator++();
GLM_FUNC_DECL tmat3x3<T, P> & operator--();
GLM_FUNC_DECL tmat3x3<T, P> operator++(int);
GLM_FUNC_DECL tmat3x3<T, P> operator--(int);
GLM_FUNC_DECL mat<3, 3, T, P> & operator++();
GLM_FUNC_DECL mat<3, 3, T, P> & operator--();
GLM_FUNC_DECL mat<3, 3, T, P> operator++(int);
GLM_FUNC_DECL mat<3, 3, T, P> operator--(int);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+(T scalar, tmat3x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator-(T scalar, tmat3x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(T scalar, tmat3x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator/(T scalar, tmat3x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@@ -8,8 +8,8 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0);
@@ -20,8 +20,8 @@ namespace glm
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@@ -29,29 +29,29 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<T, Q> const & m)
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat3x3<T, P>::tmat3x3(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<3, 3, T, P>::mat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0, 0);
this->value[1] = col_type(0, scalar, 0);
this->value[2] = col_type(0, 0, scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
(
T x0, T y0, T z0,
T x1, T y1, T z1,
@@ -63,8 +63,8 @@ namespace glm
this->value[2] = col_type(x2, y2, z2);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
(
col_type const & v0,
col_type const & v1,
@@ -78,12 +78,12 @@ namespace glm
// -- Conversion constructors --
template <typename T, precision P>
template <
template<typename T, precision P>
template<
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
(
X1 x1, Y1 y1, Z1 z1,
X2 x2, Y2 y2, Z2 z2,
@@ -95,13 +95,13 @@ namespace glm
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3
template<typename T, precision P>
template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat
(
tvec3<V1, P> const & v1,
tvec3<V2, P> const & v2,
tvec3<V3, P> const & v3
vec<3, V1, P> const& v1,
vec<3, V2, P> const& v2,
vec<3, V3, P> const& v3
)
{
this->value[0] = col_type(v1);
@@ -111,73 +111,73 @@ namespace glm
// -- Matrix conversions --
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x3<U, Q> const & m)
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 3, U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 3, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
this->value[2] = col_type(0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<2, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<3, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P>::tmat3x3(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P>::mat(mat<4, 3, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -186,15 +186,15 @@ namespace glm
// -- Accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type & mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type const & tmat3x3<T, P>::operator[](typename tmat3x3<T, P>::length_type i) const
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type const & mat<3, 3, T, P>::operator[](typename mat<3, 3, T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@@ -203,8 +203,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -213,9 +213,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator=(tmat3x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator=(mat<3, 3, U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -223,9 +223,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@@ -233,9 +233,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator+=(tmat3x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator+=(mat<3, 3, U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@@ -243,9 +243,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@@ -253,9 +253,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator-=(tmat3x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator-=(mat<3, 3, U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@@ -263,9 +263,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@@ -273,16 +273,16 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator*=(tmat3x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator*=(mat<3, 3, U, P> const & m)
{
return (*this = *this * m);
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@@ -290,17 +290,17 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator/=(tmat3x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator/=(mat<3, 3, U, P> const & m)
{
return *this *= inverse(m);
}
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator++()
{
++this->value[0];
++this->value[1];
@@ -308,8 +308,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> & tmat3x3<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> & mat<3, 3, T, P>::operator--()
{
--this->value[0];
--this->value[1];
@@ -317,34 +317,34 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator++(int)
{
tmat3x3<T, P> Result(*this);
mat<3, 3, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> tmat3x3<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> mat<3, 3, T, P>::operator--(int)
{
tmat3x3<T, P> Result(*this);
mat<3, 3, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
-m[0],
-m[1],
-m[2]);
@@ -352,98 +352,98 @@ namespace glm
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m, T scalar)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(T scalar, tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(T scalar, mat<3, 3, T, P> const & m)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator+(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m, T scalar)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(T scalar, tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(T scalar, mat<3, 3, T, P> const & m)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
scalar - m[0],
scalar - m[1],
scalar - m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator-(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m, T scalar)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(T scalar, tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(T scalar, mat<3, 3, T, P> const & m)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator*(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v)
{
return typename tmat3x3<T, P>::col_type(
return typename mat<3, 3, T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z,
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator*(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m)
{
return typename tmat3x3<T, P>::row_type(
return typename mat<3, 3, T, P>::row_type(
m[0][0] * v.x + m[0][1] * v.y + m[0][2] * v.z,
m[1][0] * v.x + m[1][1] * v.y + m[1][2] * v.z,
m[2][0] * v.x + m[2][1] * v.y + m[2][2] * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
@@ -465,7 +465,7 @@ namespace glm
T const SrcB21 = m2[2][1];
T const SrcB22 = m2[2][2];
tmat3x3<T, P> Result(uninitialize);
mat<3, 3, T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02;
@@ -478,10 +478,10 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<2, 3, T, P> const & m2)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
@@ -490,10 +490,10 @@ namespace glm
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<3, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
@@ -508,53 +508,53 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m, T scalar)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(T scalar, tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(T scalar, mat<3, 3, T, P> const & m)
{
return tmat3x3<T, P>(
return mat<3, 3, T, P>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::col_type operator/(mat<3, 3, T, P> const & m, typename mat<3, 3, T, P>::row_type const & v)
{
return inverse(m) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 3, T, P>::row_type operator/(typename mat<3, 3, T, P>::col_type const & v, mat<3, 3, T, P> const & m)
{
return v * inverse(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator/(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{
tmat3x3<T, P> m1_copy(m1);
mat<3, 3, T, P> m1_copy(m1);
return m1_copy /= m2;
}
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 3, T, P> const & m1, mat<3, 3, T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}

View File

@@ -12,13 +12,13 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat3x4
template<typename T, precision P>
struct mat<3, 4, T, P>
{
typedef tvec4<T, P> col_type;
typedef tvec3<T, P> row_type;
typedef tmat3x4<T, P> type;
typedef tmat4x3<T, P> transpose_type;
typedef vec<4, T, P> col_type;
typedef vec<3, T, P> row_type;
typedef mat<3, 4, T, P> type;
typedef mat<4, 3, T, P> transpose_type;
typedef T value_type;
private:
@@ -27,18 +27,18 @@ namespace glm
public:
// -- Constructors --
GLM_FUNC_DECL tmat3x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat3x4(tmat3x4<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat3x4(tmat3x4<T, Q> const & m);
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<3, 4, T, P> const & m) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL mat(mat<3, 4, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat3x4(ctor);
GLM_FUNC_DECL explicit tmat3x4(T scalar);
GLM_FUNC_DECL tmat3x4(
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
GLM_FUNC_DECL explicit mat(T scalar);
GLM_FUNC_DECL mat(
T x0, T y0, T z0, T w0,
T x1, T y1, T z1, T w1,
T x2, T y2, T z2, T w2);
GLM_FUNC_DECL tmat3x4(
GLM_FUNC_DECL mat(
col_type const & v0,
col_type const & v1,
col_type const & v2);
@@ -49,30 +49,30 @@ namespace glm
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3>
GLM_FUNC_DECL tmat3x4(
GLM_FUNC_DECL mat(
X1 x1, Y1 y1, Z1 z1, W1 w1,
X2 x2, Y2 y2, Z2 z2, W2 w2,
X3 x3, Y3 y3, Z3 z3, W3 w3);
template <typename V1, typename V2, typename V3>
GLM_FUNC_DECL tmat3x4(
tvec4<V1, P> const & v1,
tvec4<V2, P> const & v2,
tvec4<V3, P> const & v3);
template<typename V1, typename V2, typename V3>
GLM_FUNC_DECL mat(
vec<4, V1, P> const & v1,
vec<4, V2, P> const & v2,
vec<4, V3, P> const & v3);
// -- Matrix conversions --
template <typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x4<U, Q> const & m);
template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat3x4(tmat4x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Accesses --
@@ -84,87 +84,87 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, T, P> const & m) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator=(tmat3x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator+=(tmat3x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator-=(tmat3x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat3x4<T, P> & operator/=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator=(mat<3, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator+=(mat<3, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator-=(mat<3, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<3, 4, T, P> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL tmat3x4<T, P> & operator++();
GLM_FUNC_DECL tmat3x4<T, P> & operator--();
GLM_FUNC_DECL tmat3x4<T, P> operator++(int);
GLM_FUNC_DECL tmat3x4<T, P> operator--(int);
GLM_FUNC_DECL mat<3, 4, T, P> & operator++();
GLM_FUNC_DECL mat<3, 4, T, P> & operator--();
GLM_FUNC_DECL mat<3, 4, T, P> operator++(int);
GLM_FUNC_DECL mat<3, 4, T, P> operator--(int);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator+(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator-(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(T scalar, tmat3x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x4<T, P>::col_type operator*(tmat3x4<T, P> const & m, typename tmat3x4<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 4, T, P>::col_type operator*(mat<3, 4, T, P> const & m, typename mat<3, 4, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat3x4<T, P>::row_type operator*(typename tmat3x4<T, P>::col_type const & v, tmat3x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<3, 4, T, P>::row_type operator*(typename mat<3, 4, T, P>::col_type const & v, mat<3, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat4x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<4, 3, T, P> const& m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat2x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<2, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat3x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<3, 3, T, P> const& m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator/(mat<3, 4, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator/(T scalar, tmat3x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const & m);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@@ -6,8 +6,8 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0, 0);
@@ -18,8 +18,8 @@ namespace glm
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@@ -27,29 +27,29 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<T, Q> const & m)
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
this->value[2] = m.value[2];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat3x4<T, P>::tmat3x4(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<3, 4, T, P>::mat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0, 0, 0);
this->value[1] = col_type(0, scalar, 0, 0);
this->value[2] = col_type(0, 0, scalar, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
(
T x0, T y0, T z0, T w0,
T x1, T y1, T z1, T w1,
@@ -61,8 +61,8 @@ namespace glm
this->value[2] = col_type(x2, y2, z2, w2);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
(
col_type const & v0,
col_type const & v1,
@@ -76,12 +76,12 @@ namespace glm
// -- Conversion constructors --
template <typename T, precision P>
template <
template<typename T, precision P>
template<
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
(
X1 x1, Y1 y1, Z1 z1, W1 w1,
X2 x2, Y2 y2, Z2 z2, W2 w2,
@@ -93,13 +93,13 @@ namespace glm
this->value[2] = col_type(static_cast<T>(x3), value_type(y3), value_type(z3), value_type(w3));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4
template<typename T, precision P>
template<typename V1, typename V2, typename V3>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat
(
tvec4<V1, P> const & v1,
tvec4<V2, P> const & v2,
tvec4<V3, P> const & v3
vec<4, V1, P> const & v1,
vec<4, V2, P> const & v2,
vec<4, V3, P> const & v3
)
{
this->value[0] = col_type(v1);
@@ -109,73 +109,73 @@ namespace glm
// -- Matrix conversions --
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x4<U, Q> const & m)
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 4, U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(0, 0, 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 3, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(m[2], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(m[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 3, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
this->value[2] = col_type(0, 0, 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<3, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<2, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
this->value[2] = col_type(0, 0, 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
this->value[2] = col_type(m[2], 1, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>::tmat3x4(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>::mat(mat<4, 3, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@@ -184,15 +184,15 @@ namespace glm
// -- Accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type & mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type const & tmat3x4<T, P>::operator[](typename tmat3x4<T, P>::length_type i) const
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type const & mat<3, 4, T, P>::operator[](typename mat<3, 4, T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@@ -201,8 +201,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -211,9 +211,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator=(tmat3x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator=(mat<3, 4, U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -221,9 +221,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@@ -231,9 +231,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator+=(tmat3x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator+=(mat<3, 4, U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@@ -241,9 +241,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@@ -251,9 +251,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator-=(tmat3x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator-=(mat<3, 4, U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@@ -261,9 +261,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator*=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@@ -271,9 +271,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat3x4<T, P> & tmat3x4<T, P>::operator/=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> & mat<3, 4, T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@@ -283,8 +283,8 @@ namespace glm
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator++()
{
++this->value[0];
++this->value[1];
@@ -292,8 +292,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P>& tmat3x4<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P>& mat<3, 4, T, P>::operator--()
{
--this->value[0];
--this->value[1];
@@ -301,34 +301,34 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator++(int)
{
tmat3x4<T, P> Result(*this);
mat<3, 4, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> tmat3x4<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> mat<3, 4, T, P>::operator--(int)
{
tmat3x4<T, P> Result(*this);
mat<3, 4, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
-m[0],
-m[1],
-m[2]);
@@ -336,89 +336,89 @@ namespace glm
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m, T scalar)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator+(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator+(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m, T scalar)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator-(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator-(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m, T scalar)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(T scalar, tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(T scalar, mat<3, 4, T, P> const & m)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::col_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::col_type operator*
(
tmat3x4<T, P> const & m,
typename tmat3x4<T, P>::row_type const & v
mat<3, 4, T, P> const& m,
typename mat<3, 4, T, P>::row_type const & v
)
{
return typename tmat3x4<T, P>::col_type(
return typename mat<3, 4, T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z,
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z,
m[0][3] * v.x + m[1][3] * v.y + m[2][3] * v.z);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat3x4<T, P>::row_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<3, 4, T, P>::row_type operator*
(
typename tmat3x4<T, P>::col_type const & v,
tmat3x4<T, P> const & m
typename mat<3, 4, T, P>::col_type const & v,
mat<3, 4, T, P> const& m
)
{
return typename tmat3x4<T, P>::row_type(
return typename mat<3, 4, T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2] + v.w * m[0][3],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2] + v.w * m[1][3],
v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2] + v.w * m[2][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat4x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<4, 3, T, P> const & m2)
{
const T SrcA00 = m1[0][0];
const T SrcA01 = m1[0][1];
@@ -446,7 +446,7 @@ namespace glm
const T SrcB31 = m2[3][1];
const T SrcB32 = m2[3][2];
tmat4x4<T, P> Result(uninitialize);
mat<4, 4, T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02;
@@ -466,10 +466,10 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat2x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<2, 3, T, P> const & m2)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
@@ -480,10 +480,10 @@ namespace glm
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat3x4<T, P> const & m1, tmat3x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<3, 4, T, P> const & m1, mat<3, 3, T, P> const & m2)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2],
@@ -498,19 +498,19 @@ namespace glm
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(tmat3x4<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(mat<3, 4, T, P> const & m, T scalar)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator/(T scalar, tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator/(T scalar, mat<3, 4, T, P> const & m)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
scalar / m[0],
scalar / m[1],
scalar / m[2]);
@@ -518,14 +518,14 @@ namespace glm
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat3x4<T, P> const & m1, tmat3x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<3, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]);
}

View File

@@ -12,13 +12,13 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat4x2
template<typename T, precision P>
struct mat<4, 2, T, P>
{
typedef tvec2<T, P> col_type;
typedef tvec4<T, P> row_type;
typedef tmat4x2<T, P> type;
typedef tmat2x4<T, P> transpose_type;
typedef vec<2, T, P> col_type;
typedef vec<4, T, P> row_type;
typedef mat<4, 2, T, P> type;
typedef mat<2, 4, T, P> transpose_type;
typedef T value_type;
private:
@@ -27,19 +27,19 @@ namespace glm
public:
// -- Constructors --
GLM_FUNC_DECL tmat4x2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<4, 2, T, P> const & m) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL mat(mat<4, 2, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat4x2(ctor);
GLM_FUNC_DECL explicit tmat4x2(T scalar);
GLM_FUNC_DECL tmat4x2(
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
GLM_FUNC_DECL explicit mat(T scalar);
GLM_FUNC_DECL mat(
T x0, T y0,
T x1, T y1,
T x2, T y2,
T x3, T y3);
GLM_FUNC_DECL tmat4x2(
GLM_FUNC_DECL mat(
col_type const & v0,
col_type const & v1,
col_type const & v2,
@@ -47,37 +47,37 @@ namespace glm
// -- Conversions --
template <
template<
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3,
typename X4, typename Y4>
GLM_FUNC_DECL tmat4x2(
GLM_FUNC_DECL mat(
X1 x1, Y1 y1,
X2 x2, Y2 y2,
X3 x3, Y3 y3,
X4 x4, Y4 y4);
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL tmat4x2(
tvec2<V1, P> const & v1,
tvec2<V2, P> const & v2,
tvec2<V3, P> const & v3,
tvec2<V4, P> const & v4);
template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL mat(
vec<2, V1, P> const & v1,
vec<2, V2, P> const & v2,
vec<2, V3, P> const & v3,
vec<2, V4, P> const & v4);
// -- Matrix conversions --
template <typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x2<U, Q> const & m);
template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
// -- Accesses --
@@ -89,87 +89,87 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, T, P> const & m) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator+=(tmat4x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator-=(tmat4x2<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x2<T, P> & operator/=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator=(mat<4, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator+=(mat<4, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator-=(mat<4, 2, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 2, T, P> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL tmat4x2<T, P> & operator++ ();
GLM_FUNC_DECL tmat4x2<T, P> & operator-- ();
GLM_FUNC_DECL tmat4x2<T, P> operator++(int);
GLM_FUNC_DECL tmat4x2<T, P> operator--(int);
GLM_FUNC_DECL mat<4, 2, T, P> & operator++ ();
GLM_FUNC_DECL mat<4, 2, T, P> & operator-- ();
GLM_FUNC_DECL mat<4, 2, T, P> operator++(int);
GLM_FUNC_DECL mat<4, 2, T, P> operator--(int);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const& m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(T scalar, tmat4x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const & m, typename mat<4, 2, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const & v, mat<4, 2, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat2x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator/(mat<4, 2, T, P> const & m, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x2<T, P> operator/(T scalar, tmat4x2<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const & m);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@@ -6,8 +6,8 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0);
@@ -19,8 +19,8 @@ namespace glm
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@@ -29,9 +29,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<T, Q> const & m)
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@@ -39,12 +39,12 @@ namespace glm
this->value[3] = m.value[3];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat4x2<T, P>::tmat4x2(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<4, 2, T, P>::mat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(T scalar)
{
this->value[0] = col_type(scalar, 0);
this->value[1] = col_type(0, scalar);
@@ -52,8 +52,8 @@ namespace glm
this->value[3] = col_type(0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
(
T x0, T y0,
T x1, T y1,
@@ -67,8 +67,8 @@ namespace glm
this->value[3] = col_type(x3, y3);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
(
col_type const & v0,
col_type const & v1,
@@ -84,13 +84,13 @@ namespace glm
// -- Conversion constructors --
template <typename T, precision P>
template <
template<typename T, precision P>
template<
typename X1, typename Y1,
typename X2, typename Y2,
typename X3, typename Y3,
typename X4, typename Y4>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
(
X1 x1, Y1 y1,
X2 x2, Y2 y2,
@@ -104,14 +104,14 @@ namespace glm
this->value[3] = col_type(static_cast<T>(x4), value_type(y4));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2
template<typename T, precision P>
template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat
(
tvec2<V1, P> const & v1,
tvec2<V2, P> const & v2,
tvec2<V3, P> const & v3,
tvec2<V4, P> const & v4
vec<2, V1, P> const & v1,
vec<2, V2, P> const & v2,
vec<2, V3, P> const & v3,
vec<2, V4, P> const & v4
)
{
this->value[0] = col_type(v1);
@@ -122,9 +122,9 @@ namespace glm
// -- Conversion --
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x2<U, Q> const & m)
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 2, U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -132,8 +132,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 2, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -141,8 +141,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 3, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -150,8 +150,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -159,8 +159,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 3, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -168,8 +168,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 2, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -177,8 +177,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<2, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -186,8 +186,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<4, 3, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -195,8 +195,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>::tmat4x2(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>::mat(mat<3, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -206,15 +206,15 @@ namespace glm
// -- Accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type & mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type const & tmat4x2<T, P>::operator[](typename tmat4x2<T, P>::length_type i) const
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type const & mat<4, 2, T, P>::operator[](typename mat<4, 2, T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@@ -223,8 +223,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -234,9 +234,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P>& tmat4x2<T, P>::operator=(tmat4x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P>& mat<4, 2, T, P>::operator=(mat<4, 2, U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -245,9 +245,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@@ -256,9 +256,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator+=(tmat4x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator+=(mat<4, 2, U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@@ -267,9 +267,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@@ -278,9 +278,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator-=(tmat4x2<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator-=(mat<4, 2, U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@@ -289,9 +289,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator*=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@@ -300,9 +300,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator/=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@@ -313,8 +313,8 @@ namespace glm
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator++()
{
++this->value[0];
++this->value[1];
@@ -323,8 +323,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> & tmat4x2<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> & mat<4, 2, T, P>::operator--()
{
--this->value[0];
--this->value[1];
@@ -333,34 +333,34 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator++(int)
{
tmat4x2<T, P> Result(*this);
mat<4, 2, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> tmat4x2<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> mat<4, 2, T, P>::operator--(int)
{
tmat4x2<T, P> Result(*this);
mat<4, 2, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
-m[0],
-m[1],
-m[2],
@@ -369,86 +369,86 @@ namespace glm
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m, T scalar)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m[0] + scalar,
m[1] + scalar,
m[2] + scalar,
m[3] + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator+(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m, T scalar)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m[0] - scalar,
m[1] - scalar,
m[2] - scalar,
m[3] - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator-(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m, T scalar)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(T scalar, tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(T scalar, mat<4, 2, T, P> const & m)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m[0] * scalar,
m[1] * scalar,
m[2] * scalar,
m[3] * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::col_type operator*(mat<4, 2, T, P> const & m, typename mat<4, 2, T, P>::row_type const & v)
{
return typename tmat4x2<T, P>::col_type(
return typename mat<4, 2, T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 2, T, P>::row_type operator*(typename mat<4, 2, T, P>::col_type const & v, mat<4, 2, T, P> const & m)
{
return typename tmat4x2<T, P>::row_type(
return typename mat<4, 2, T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1],
v.x * m[1][0] + v.y * m[1][1],
v.x * m[2][0] + v.y * m[2][1],
v.x * m[3][0] + v.y * m[3][1]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat2x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<2, 4, T, P> const & m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
@@ -468,7 +468,7 @@ namespace glm
T const SrcB12 = m2[1][2];
T const SrcB13 = m2[1][3];
tmat2x2<T, P> Result(uninitialize);
mat<2, 2, T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
Result[1][0] = SrcA00 * SrcB10 + SrcA10 * SrcB11 + SrcA20 * SrcB12 + SrcA30 * SrcB13;
@@ -476,10 +476,10 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<3, 4, T, P> const & m2)
{
return tmat3x2<T, P>(
return mat<3, 2, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
@@ -488,10 +488,10 @@ namespace glm
m1[0][1] * m2[2][0] + m1[1][1] * m2[2][1] + m1[2][1] * m2[2][2] + m1[3][1] * m2[2][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator*(mat<4, 2, T, P> const & m1, mat<4, 4, T, P> const & m2)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][0] * m2[1][0] + m1[1][0] * m2[1][1] + m1[2][0] * m2[1][2] + m1[3][0] * m2[1][3],
@@ -502,20 +502,20 @@ namespace glm
m1[0][1] * m2[3][0] + m1[1][1] * m2[3][1] + m1[2][1] * m2[3][2] + m1[3][1] * m2[3][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(mat<4, 2, T, P> const & m, T scalar)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
m[0] / scalar,
m[1] / scalar,
m[2] / scalar,
m[3] / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x2<T, P> operator/(T scalar, tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 2, T, P> operator/(T scalar, mat<4, 2, T, P> const & m)
{
return tmat4x2<T, P>(
return mat<4, 2, T, P>(
scalar / m[0],
scalar / m[1],
scalar / m[2],
@@ -524,14 +524,14 @@ namespace glm
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 2, T, P> const & m1, mat<4, 2, T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}

View File

@@ -12,13 +12,13 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat4x3
template<typename T, precision P>
struct mat<4, 3, T, P>
{
typedef tvec3<T, P> col_type;
typedef tvec4<T, P> row_type;
typedef tmat4x3<T, P> type;
typedef tmat3x4<T, P> transpose_type;
typedef vec<3, T, P> col_type;
typedef vec<4, T, P> row_type;
typedef mat<4, 3, T, P> type;
typedef mat<3, 4, T, P> transpose_type;
typedef T value_type;
private:
@@ -27,19 +27,19 @@ namespace glm
public:
// -- Constructors --
GLM_FUNC_DECL tmat4x3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat4x3(tmat4x3<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat4x3(tmat4x3<T, Q> const & m);
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<4, 3, T, P> const & m) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL mat(mat<4, 3, T, Q> const & m);
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tmat4x3(ctor);
GLM_FUNC_DECL explicit tmat4x3(T const & x);
GLM_FUNC_DECL tmat4x3(
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit mat(ctor);
GLM_FUNC_DECL explicit mat(T const & x);
GLM_FUNC_DECL mat(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1,
T const & x2, T const & y2, T const & z2,
T const & x3, T const & y3, T const & z3);
GLM_FUNC_DECL tmat4x3(
GLM_FUNC_DECL mat(
col_type const & v0,
col_type const & v1,
col_type const & v2,
@@ -47,37 +47,37 @@ namespace glm
// -- Conversions --
template <
template<
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3,
typename X4, typename Y4, typename Z4>
GLM_FUNC_DECL tmat4x3(
GLM_FUNC_DECL mat(
X1 const & x1, Y1 const & y1, Z1 const & z1,
X2 const & x2, Y2 const & y2, Z2 const & z2,
X3 const & x3, Y3 const & y3, Z3 const & z3,
X4 const & x4, Y4 const & y4, Z4 const & z4);
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL tmat4x3(
tvec3<V1, P> const & v1,
tvec3<V2, P> const & v2,
tvec3<V3, P> const & v3,
tvec3<V4, P> const & v4);
template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL mat(
vec<3, V1, P> const & v1,
vec<3, V2, P> const & v2,
vec<3, V3, P> const & v3,
vec<3, V4, P> const & v4);
// -- Matrix conversions --
template <typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x3<U, Q> const & m);
template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x3(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
// -- Accesses --
@@ -89,87 +89,87 @@ namespace glm
// -- Unary arithmetic operators --
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, T, P> const & m) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator=(tmat4x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator+=(tmat4x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator-=(tmat4x3<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x3<T, P> & operator/=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator=(mat<4, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator+=(mat<4, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator-=(mat<4, 3, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 3, T, P> & operator/=(U s);
// -- Increment and decrement operators --
GLM_FUNC_DECL tmat4x3<T, P> & operator++();
GLM_FUNC_DECL tmat4x3<T, P> & operator--();
GLM_FUNC_DECL tmat4x3<T, P> operator++(int);
GLM_FUNC_DECL tmat4x3<T, P> operator--(int);
GLM_FUNC_DECL mat<4, 3, T, P>& operator++();
GLM_FUNC_DECL mat<4, 3, T, P>& operator--();
GLM_FUNC_DECL mat<4, 3, T, P> operator++(int);
GLM_FUNC_DECL mat<4, 3, T, P> operator--(int);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator+(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m, T const & s);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator-(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat4x3<T, P> const & m, T const & s);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(T const & s, tmat4x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(T const & s, mat<4, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x3<T, P>::col_type operator*(tmat4x3<T, P> const & m, typename tmat4x3<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 3, T, P>::col_type operator*(mat<4, 3, T, P> const & m, typename mat<4, 3, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x3<T, P>::row_type operator*(typename tmat4x3<T, P>::col_type const & v, tmat4x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 3, T, P>::row_type operator*(typename mat<4, 3, T, P>::col_type const & v, mat<4, 3, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat3x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<3, 4, T, P> const& m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat4x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator/(tmat4x3<T, P> const & m, T const & s);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator/(mat<4, 3, T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x3<T, P> operator/(T const & s, tmat4x3<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 3, T, P> operator/(T const & s, mat<4, 3, T, P> const & m);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@@ -6,8 +6,8 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0);
@@ -19,8 +19,8 @@ namespace glm
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, P> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@@ -29,9 +29,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<T, Q> const & m)
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, T, Q> const & m)
{
this->value[0] = m.value[0];
this->value[1] = m.value[1];
@@ -39,12 +39,12 @@ namespace glm
this->value[3] = m.value[3];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tmat4x3<T, P>::tmat4x3(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR mat<4, 3, T, P>::mat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(T const & s)
{
this->value[0] = col_type(s, 0, 0);
this->value[1] = col_type(0, s, 0);
@@ -52,8 +52,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
(
T const & x0, T const & y0, T const & z0,
T const & x1, T const & y1, T const & z1,
@@ -67,8 +67,8 @@ namespace glm
this->value[3] = col_type(x3, y3, z3);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
(
col_type const & v0,
col_type const & v1,
@@ -84,13 +84,13 @@ namespace glm
// -- Conversion constructors --
template <typename T, precision P>
template <
template<typename T, precision P>
template<
typename X1, typename Y1, typename Z1,
typename X2, typename Y2, typename Z2,
typename X3, typename Y3, typename Z3,
typename X4, typename Y4, typename Z4>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
(
X1 const & x1, Y1 const & y1, Z1 const & z1,
X2 const & x2, Y2 const & y2, Z2 const & z2,
@@ -104,14 +104,14 @@ namespace glm
this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3
template<typename T, precision P>
template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat
(
tvec3<V1, P> const & v1,
tvec3<V2, P> const & v2,
tvec3<V3, P> const & v3,
tvec3<V4, P> const & v4
vec<3, V1, P> const & v1,
vec<3, V2, P> const & v2,
vec<3, V3, P> const & v3,
vec<3, V4, P> const & v4
)
{
this->value[0] = col_type(v1);
@@ -122,9 +122,9 @@ namespace glm
// -- Matrix conversions --
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x3<U, Q> const & m)
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 3, U, Q> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -132,8 +132,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@@ -141,8 +141,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 3, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -150,8 +150,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -159,8 +159,8 @@ namespace glm
this->value[3] = col_type(m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 3, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -168,8 +168,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@@ -177,8 +177,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<2, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -186,8 +186,8 @@ namespace glm
this->value[3] = col_type(0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<4, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@@ -195,8 +195,8 @@ namespace glm
this->value[3] = col_type(m[3], 0);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>::tmat4x3(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>::mat(mat<3, 4, T, P> const & m)
{
this->value[0] = col_type(m[0]);
this->value[1] = col_type(m[1]);
@@ -206,15 +206,15 @@ namespace glm
// -- Accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type & mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type const & tmat4x3<T, P>::operator[](typename tmat4x3<T, P>::length_type i) const
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type const & mat<4, 3, T, P>::operator[](typename mat<4, 3, T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@@ -223,8 +223,8 @@ namespace glm
// -- Unary updatable operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -234,9 +234,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P>& tmat4x3<T, P>::operator=(tmat4x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P>& mat<4, 3, T, P>::operator=(mat<4, 3, U, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -245,9 +245,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@@ -256,9 +256,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator+=(tmat4x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator+=(mat<4, 3, U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@@ -267,9 +267,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@@ -278,9 +278,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator-=(tmat4x3<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator-=(mat<4, 3, U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@@ -289,9 +289,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator*=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@@ -300,9 +300,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator/=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@@ -313,8 +313,8 @@ namespace glm
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator++()
{
++this->value[0];
++this->value[1];
@@ -323,8 +323,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> & tmat4x3<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> & mat<4, 3, T, P>::operator--()
{
--this->value[0];
--this->value[1];
@@ -333,34 +333,34 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator++(int)
{
tmat4x3<T, P> Result(*this);
mat<4, 3, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> tmat4x3<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> mat<4, 3, T, P>::operator--(int)
{
tmat4x3<T, P> Result(*this);
mat<4, 3, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
-m[0],
-m[1],
-m[2],
@@ -369,95 +369,95 @@ namespace glm
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m, T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator+(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator+(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m, T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m[0] - s,
m[1] - s,
m[2] - s,
m[3] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator-(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator-(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat4x3<T, P> const & m, T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(T const & s, tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(T const & s, mat<4, 3, T, P> const & m)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::col_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::col_type operator*
(
tmat4x3<T, P> const & m,
typename tmat4x3<T, P>::row_type const & v)
mat<4, 3, T, P> const& m,
typename mat<4, 3, T, P>::row_type const & v)
{
return typename tmat4x3<T, P>::col_type(
return typename mat<4, 3, T, P>::col_type(
m[0][0] * v.x + m[1][0] * v.y + m[2][0] * v.z + m[3][0] * v.w,
m[0][1] * v.x + m[1][1] * v.y + m[2][1] * v.z + m[3][1] * v.w,
m[0][2] * v.x + m[1][2] * v.y + m[2][2] * v.z + m[3][2] * v.w);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x3<T, P>::row_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 3, T, P>::row_type operator*
(
typename tmat4x3<T, P>::col_type const & v,
tmat4x3<T, P> const & m)
typename mat<4, 3, T, P>::col_type const & v,
mat<4, 3, T, P> const& m)
{
return typename tmat4x3<T, P>::row_type(
return typename mat<4, 3, T, P>::row_type(
v.x * m[0][0] + v.y * m[0][1] + v.z * m[0][2],
v.x * m[1][0] + v.y * m[1][1] + v.z * m[1][2],
v.x * m[2][0] + v.y * m[2][1] + v.z * m[2][2],
v.x * m[3][0] + v.y * m[3][1] + v.z * m[3][2]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<2, 4, T, P> const & m2)
{
return tmat2x3<T, P>(
return mat<2, 3, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
@@ -466,8 +466,8 @@ namespace glm
m1[0][2] * m2[1][0] + m1[1][2] * m2[1][1] + m1[2][2] * m2[1][2] + m1[3][2] * m2[1][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat3x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<3, 4, T, P> const & m2)
{
T const SrcA00 = m1[0][0];
T const SrcA01 = m1[0][1];
@@ -495,7 +495,7 @@ namespace glm
T const SrcB22 = m2[2][2];
T const SrcB23 = m2[2][3];
tmat3x3<T, P> Result(uninitialize);
mat<3, 3, T, P> Result(uninitialize);
Result[0][0] = SrcA00 * SrcB00 + SrcA10 * SrcB01 + SrcA20 * SrcB02 + SrcA30 * SrcB03;
Result[0][1] = SrcA01 * SrcB00 + SrcA11 * SrcB01 + SrcA21 * SrcB02 + SrcA31 * SrcB03;
Result[0][2] = SrcA02 * SrcB00 + SrcA12 * SrcB01 + SrcA22 * SrcB02 + SrcA32 * SrcB03;
@@ -508,10 +508,10 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat4x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator*(mat<4, 3, T, P> const & m1, mat<4, 4, T, P> const & m2)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
@@ -526,20 +526,20 @@ namespace glm
m1[0][2] * m2[3][0] + m1[1][2] * m2[3][1] + m1[2][2] * m2[3][2] + m1[3][2] * m2[3][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/(tmat4x3<T, P> const & m, T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(mat<4, 3, T, P> const & m, T const & s)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
m[0] / s,
m[1] / s,
m[2] / s,
m[3] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x3<T, P> operator/(T const & s, tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 3, T, P> operator/(T const & s, mat<4, 3, T, P> const & m)
{
return tmat4x3<T, P>(
return mat<4, 3, T, P>(
s / m[0],
s / m[1],
s / m[2],
@@ -548,14 +548,14 @@ namespace glm
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat4x3<T, P> const & m1, tmat4x3<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 3, T, P> const & m1, mat<4, 3, T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}

View File

@@ -11,73 +11,19 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tmat4x4
template<typename T, precision P>
struct mat<4, 4, T, P>
{
typedef tvec4<T, P> col_type;
typedef tvec4<T, P> row_type;
typedef tmat4x4<T, P> type;
typedef tmat4x4<T, P> transpose_type;
typedef vec<4, T, P> col_type;
typedef vec<4, T, P> row_type;
typedef mat<4, 4, T, P> type;
typedef mat<4, 4, T, P> transpose_type;
typedef T value_type;
private:
col_type value[4];
public:
// -- Constructors --
GLM_FUNC_DECL tmat4x4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL tmat4x4(tmat4x4<T, P> const & m) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL tmat4x4(tmat4x4<T, Q> const & m);
GLM_FUNC_DECL explicit tmat4x4(ctor);
GLM_FUNC_DECL explicit tmat4x4(T const & x);
GLM_FUNC_DECL tmat4x4(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1,
T const & x2, T const & y2, T const & z2, T const & w2,
T const & x3, T const & y3, T const & z3, T const & w3);
GLM_FUNC_DECL tmat4x4(
col_type const & v0,
col_type const & v1,
col_type const & v2,
col_type const & v3);
// -- Conversions --
template <
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3,
typename X4, typename Y4, typename Z4, typename W4>
GLM_FUNC_DECL tmat4x4(
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3,
X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4);
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL tmat4x4(
tvec4<V1, P> const & v1,
tvec4<V2, P> const & v2,
tvec4<V3, P> const & v3,
tvec4<V4, P> const & v4);
// -- Matrix conversions --
template <typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x4<U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat2x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat3x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat2x3<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat3x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat2x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x2<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat3x4<T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT tmat4x4(tmat4x3<T, P> const & x);
// -- Accesses --
typedef length_t length_type;
@@ -86,108 +32,162 @@ namespace glm
GLM_FUNC_DECL col_type & operator[](length_type i);
GLM_FUNC_DECL col_type const & operator[](length_type i) const;
// -- Constructors --
GLM_FUNC_DECL mat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL mat(mat<4, 4, T, P> const& m) GLM_DEFAULT;
template<precision Q>
GLM_FUNC_DECL mat(mat<4, 4, T, Q> const& m);
GLM_FUNC_DECL explicit mat(ctor);
GLM_FUNC_DECL explicit mat(T const & x);
GLM_FUNC_DECL mat(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1,
T const & x2, T const & y2, T const & z2, T const & w2,
T const & x3, T const & y3, T const & z3, T const & w3);
GLM_FUNC_DECL mat(
col_type const & v0,
col_type const & v1,
col_type const & v2,
col_type const & v3);
// -- Conversions --
template<
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3,
typename X4, typename Y4, typename Z4, typename W4>
GLM_FUNC_DECL mat(
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
X3 const & x3, Y3 const & y3, Z3 const & z3, W3 const & w3,
X4 const & x4, Y4 const & y4, Z4 const & z4, W4 const & w4);
template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_DECL mat(
vec<4, V1, P> const & v1,
vec<4, V2, P> const & v2,
vec<4, V3, P> const & v3,
vec<4, V4, P> const & v4);
// -- Matrix conversions --
template<typename U, precision Q>
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, U, Q> const & m);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, P> const & x);
GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, P> const & x);
// -- Unary arithmetic operators --
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<T, P> const & m) GLM_DEFAULT;
GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, T, P> const & m) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator+=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator+=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator-=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator-=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator*=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator*=(tmat4x4<U, P> const & m);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator/=(U s);
template <typename U>
GLM_FUNC_DECL tmat4x4<T, P> & operator/=(tmat4x4<U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator=(mat<4, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator+=(mat<4, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator-=(mat<4, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator*=(mat<4, 4, U, P> const & m);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(U s);
template<typename U>
GLM_FUNC_DECL mat<4, 4, T, P> & operator/=(mat<4, 4, U, P> const & m);
// -- Increment and decrement operators --
GLM_FUNC_DECL tmat4x4<T, P> & operator++();
GLM_FUNC_DECL tmat4x4<T, P> & operator--();
GLM_FUNC_DECL tmat4x4<T, P> operator++(int);
GLM_FUNC_DECL tmat4x4<T, P> operator--(int);
GLM_FUNC_DECL mat<4, 4, T, P> & operator++();
GLM_FUNC_DECL mat<4, 4, T, P> & operator--();
GLM_FUNC_DECL mat<4, 4, T, P> operator++(int);
GLM_FUNC_DECL mat<4, 4, T, P> operator--(int);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+(T const & s, tmat4x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(T const & s, mat<4, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator+(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m, T const & s);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator-(T const & s, tmat4x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(T const & s, mat<4, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator-(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const& m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat4x4<T, P> const & m, T const & s);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(T const & s, tmat4x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(T const & s, mat<4, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator*(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator*(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator*(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator*(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat2x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<2, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<2, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat3x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<3, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator/(tmat4x4<T, P> const & m, T const & s);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m, T const & s);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator/(T const & s, tmat4x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator/(T const & s, mat<4, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v);
template <typename T, precision P>
GLM_FUNC_DECL typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m);
template<typename T, precision P>
GLM_FUNC_DECL typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m);
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> operator/(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const& m2);
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_DECL bool operator==(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
template <typename T, precision P>
GLM_FUNC_DECL bool operator!=(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2);
}//namespace glm
#ifndef GLM_EXTERNAL_TEMPLATE

View File

@@ -8,8 +8,8 @@ namespace glm
// -- Constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat()
{
# ifndef GLM_FORCE_NO_CTOR_INIT
this->value[0] = col_type(1, 0, 0, 0);
@@ -21,8 +21,8 @@ namespace glm
# endif
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -31,9 +31,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <precision Q>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x4<T, Q> const & m)
template<typename T, precision P>
template<precision Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 4, T, Q> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -41,12 +41,12 @@ namespace glm
this->value[3] = m[3];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(T const & s)
{
this->value[0] = col_type(s, 0, 0, 0);
this->value[1] = col_type(0, s, 0, 0);
@@ -54,8 +54,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
(
T const & x0, T const & y0, T const & z0, T const & w0,
T const & x1, T const & y1, T const & z1, T const & w1,
@@ -69,8 +69,8 @@ namespace glm
this->value[3] = col_type(x3, y3, z3, w3);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
(
col_type const & v0,
col_type const & v1,
@@ -84,11 +84,11 @@ namespace glm
this->value[3] = v3;
}
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
template<typename T, precision P>
template<typename U, precision Q>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
(
tmat4x4<U, Q> const & m
mat<4, 4, U, Q> const & m
)
{
this->value[0] = col_type(m[0]);
@@ -99,13 +99,13 @@ namespace glm
// -- Conversions --
template <typename T, precision P>
template <
template<typename T, precision P>
template<
typename X1, typename Y1, typename Z1, typename W1,
typename X2, typename Y2, typename Z2, typename W2,
typename X3, typename Y3, typename Z3, typename W3,
typename X4, typename Y4, typename Z4, typename W4>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
(
X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2,
@@ -139,14 +139,14 @@ namespace glm
this->value[3] = col_type(static_cast<T>(x4), value_type(y4), value_type(z4), value_type(w4));
}
template <typename T, precision P>
template <typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4
template<typename T, precision P>
template<typename V1, typename V2, typename V3, typename V4>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat
(
tvec4<V1, P> const & v1,
tvec4<V2, P> const & v2,
tvec4<V3, P> const & v3,
tvec4<V4, P> const & v4
vec<4, V1, P> const & v1,
vec<4, V2, P> const & v2,
vec<4, V3, P> const & v3,
vec<4, V4, P> const & v4
)
{
GLM_STATIC_ASSERT(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer || GLM_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
@@ -162,8 +162,8 @@ namespace glm
// -- Matrix conversions --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
@@ -171,8 +171,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 3, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@@ -180,8 +180,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 3, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@@ -189,8 +189,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
@@ -198,8 +198,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat2x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<2, 4, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -207,8 +207,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x2<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 2, T, P> const & m)
{
this->value[0] = col_type(m[0], 0, 0);
this->value[1] = col_type(m[1], 0, 0);
@@ -216,8 +216,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat3x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<3, 4, T, P> const & m)
{
this->value[0] = m[0];
this->value[1] = m[1];
@@ -225,8 +225,8 @@ namespace glm
this->value[3] = col_type(0, 0, 0, 1);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>::tmat4x4(tmat4x3<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>::mat(mat<4, 3, T, P> const & m)
{
this->value[0] = col_type(m[0], 0);
this->value[1] = col_type(m[1], 0);
@@ -236,15 +236,15 @@ namespace glm
// -- Accesses --
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type & mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i)
{
assert(i < this->length());
return this->value[i];
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type const & tmat4x4<T, P>::operator[](typename tmat4x4<T, P>::length_type i) const
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type const & mat<4, 4, T, P>::operator[](typename mat<4, 4, T, P>::length_type i) const
{
assert(i < this->length());
return this->value[i];
@@ -253,8 +253,8 @@ namespace glm
// -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, T, P> const & m)
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
@@ -266,9 +266,9 @@ namespace glm
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator=(tmat4x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator=(mat<4, 4, U, P> const & m)
{
//memcpy could be faster
//memcpy(&this->value, &m.value, 16 * sizeof(valType));
@@ -279,9 +279,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(U s)
{
this->value[0] += s;
this->value[1] += s;
@@ -290,9 +290,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P>& tmat4x4<T, P>::operator+=(tmat4x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P>& mat<4, 4, T, P>::operator+=(mat<4, 4, U, P> const & m)
{
this->value[0] += m[0];
this->value[1] += m[1];
@@ -301,9 +301,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(U s)
{
this->value[0] -= s;
this->value[1] -= s;
@@ -312,9 +312,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator-=(tmat4x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator-=(mat<4, 4, U, P> const & m)
{
this->value[0] -= m[0];
this->value[1] -= m[1];
@@ -323,9 +323,9 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(U s)
{
this->value[0] *= s;
this->value[1] *= s;
@@ -334,16 +334,16 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator*=(tmat4x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator*=(mat<4, 4, U, P> const & m)
{
return (*this = *this * m);
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/=(U s)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(U s)
{
this->value[0] /= s;
this->value[1] /= s;
@@ -352,17 +352,17 @@ namespace glm
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator/=(tmat4x4<U, P> const & m)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator/=(mat<4, 4, U, P> const & m)
{
return *this *= inverse(m);
}
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator++()
{
++this->value[0];
++this->value[1];
@@ -371,8 +371,8 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> & tmat4x4<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> & mat<4, 4, T, P>::operator--()
{
--this->value[0];
--this->value[1];
@@ -381,34 +381,34 @@ namespace glm
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator++(int)
{
tmat4x4<T, P> Result(*this);
mat<4, 4, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> tmat4x4<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> mat<4, 4, T, P>::operator--(int)
{
tmat4x4<T, P> Result(*this);
mat<4, 4, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary constant operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m)
{
return m;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
-m[0],
-m[1],
-m[2],
@@ -417,91 +417,91 @@ namespace glm
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m, T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(T const & s, tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(T const & s, mat<4, 4, T, P> const & m)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
m[0] + s,
m[1] + s,
m[2] + s,
m[3] + s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator+(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator+(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
m1[0] + m2[0],
m1[1] + m2[1],
m1[2] + m2[2],
m1[3] + m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m, T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
m[0] - s,
m[1] - s,
m[2] - s,
m[3] - s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(T const & s, tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(T const & s, mat<4, 4, T, P> const & m)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
s - m[0],
s - m[1],
s - m[2],
s - m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator-(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator-(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
m1[0] - m2[0],
m1[1] - m2[1],
m1[2] - m2[2],
m1[3] - m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat4x4<T, P> const & m, T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(T const & s, tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(T const & s, mat<4, 4, T, P> const & m)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
m[0] * s,
m[1] * s,
m[2] * s,
m[3] * s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator*
(
tmat4x4<T, P> const & m,
typename tmat4x4<T, P>::row_type const & v
mat<4, 4, T, P> const& m,
typename mat<4, 4, T, P>::row_type const & v
)
{
/*
@@ -520,24 +520,24 @@ namespace glm
__m128 a2 = _mm_add_ps(a0, a1);
return typename tmat4x4<T, P>::col_type(a2);
return typename mat<4, 4, T, P>::col_type(a2);
*/
typename tmat4x4<T, P>::col_type const Mov0(v[0]);
typename tmat4x4<T, P>::col_type const Mov1(v[1]);
typename tmat4x4<T, P>::col_type const Mul0 = m[0] * Mov0;
typename tmat4x4<T, P>::col_type const Mul1 = m[1] * Mov1;
typename tmat4x4<T, P>::col_type const Add0 = Mul0 + Mul1;
typename tmat4x4<T, P>::col_type const Mov2(v[2]);
typename tmat4x4<T, P>::col_type const Mov3(v[3]);
typename tmat4x4<T, P>::col_type const Mul2 = m[2] * Mov2;
typename tmat4x4<T, P>::col_type const Mul3 = m[3] * Mov3;
typename tmat4x4<T, P>::col_type const Add1 = Mul2 + Mul3;
typename tmat4x4<T, P>::col_type const Add2 = Add0 + Add1;
typename mat<4, 4, T, P>::col_type const Mov0(v[0]);
typename mat<4, 4, T, P>::col_type const Mov1(v[1]);
typename mat<4, 4, T, P>::col_type const Mul0 = m[0] * Mov0;
typename mat<4, 4, T, P>::col_type const Mul1 = m[1] * Mov1;
typename mat<4, 4, T, P>::col_type const Add0 = Mul0 + Mul1;
typename mat<4, 4, T, P>::col_type const Mov2(v[2]);
typename mat<4, 4, T, P>::col_type const Mov3(v[3]);
typename mat<4, 4, T, P>::col_type const Mul2 = m[2] * Mov2;
typename mat<4, 4, T, P>::col_type const Mul3 = m[3] * Mov3;
typename mat<4, 4, T, P>::col_type const Add1 = Mul2 + Mul3;
typename mat<4, 4, T, P>::col_type const Add2 = Add0 + Add1;
return Add2;
/*
return typename tmat4x4<T, P>::col_type(
return typename mat<4, 4, T, P>::col_type(
m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3],
m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3],
m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3],
@@ -545,24 +545,24 @@ namespace glm
*/
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::row_type operator*
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator*
(
typename tmat4x4<T, P>::col_type const & v,
tmat4x4<T, P> const & m
typename mat<4, 4, T, P>::col_type const & v,
mat<4, 4, T, P> const& m
)
{
return typename tmat4x4<T, P>::row_type(
return typename mat<4, 4, T, P>::row_type(
m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2] + m[0][3] * v[3],
m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2] + m[1][3] * v[3],
m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2] + m[2][3] * v[3],
m[3][0] * v[0] + m[3][1] * v[1] + m[3][2] * v[2] + m[3][3] * v[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat2x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat2x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<2, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<2, 4, T, P> const & m2)
{
return tmat2x4<T, P>(
return mat<2, 4, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
@@ -573,10 +573,10 @@ namespace glm
m1[0][3] * m2[1][0] + m1[1][3] * m2[1][1] + m1[2][3] * m2[1][2] + m1[3][3] * m2[1][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat3x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat3x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<3, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<3, 4, T, P> const & m2)
{
return tmat3x4<T, P>(
return mat<3, 4, T, P>(
m1[0][0] * m2[0][0] + m1[1][0] * m2[0][1] + m1[2][0] * m2[0][2] + m1[3][0] * m2[0][3],
m1[0][1] * m2[0][0] + m1[1][1] * m2[0][1] + m1[2][1] * m2[0][2] + m1[3][1] * m2[0][3],
m1[0][2] * m2[0][0] + m1[1][2] * m2[0][1] + m1[2][2] * m2[0][2] + m1[3][2] * m2[0][3],
@@ -591,20 +591,20 @@ namespace glm
m1[0][3] * m2[2][0] + m1[1][3] * m2[2][1] + m1[2][3] * m2[2][2] + m1[3][3] * m2[2][3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator*(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator*(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{
typename tmat4x4<T, P>::col_type const SrcA0 = m1[0];
typename tmat4x4<T, P>::col_type const SrcA1 = m1[1];
typename tmat4x4<T, P>::col_type const SrcA2 = m1[2];
typename tmat4x4<T, P>::col_type const SrcA3 = m1[3];
typename mat<4, 4, T, P>::col_type const SrcA0 = m1[0];
typename mat<4, 4, T, P>::col_type const SrcA1 = m1[1];
typename mat<4, 4, T, P>::col_type const SrcA2 = m1[2];
typename mat<4, 4, T, P>::col_type const SrcA3 = m1[3];
typename tmat4x4<T, P>::col_type const SrcB0 = m2[0];
typename tmat4x4<T, P>::col_type const SrcB1 = m2[1];
typename tmat4x4<T, P>::col_type const SrcB2 = m2[2];
typename tmat4x4<T, P>::col_type const SrcB3 = m2[3];
typename mat<4, 4, T, P>::col_type const SrcB0 = m2[0];
typename mat<4, 4, T, P>::col_type const SrcB1 = m2[1];
typename mat<4, 4, T, P>::col_type const SrcB2 = m2[2];
typename mat<4, 4, T, P>::col_type const SrcB3 = m2[3];
tmat4x4<T, P> Result(uninitialize);
mat<4, 4, T, P> Result(uninitialize);
Result[0] = SrcA0 * SrcB0[0] + SrcA1 * SrcB0[1] + SrcA2 * SrcB0[2] + SrcA3 * SrcB0[3];
Result[1] = SrcA0 * SrcB1[0] + SrcA1 * SrcB1[1] + SrcA2 * SrcB1[2] + SrcA3 * SrcB1[3];
Result[2] = SrcA0 * SrcB2[0] + SrcA1 * SrcB2[1] + SrcA2 * SrcB2[2] + SrcA3 * SrcB2[3];
@@ -612,55 +612,55 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(tmat4x4<T, P> const & m, T const & s)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m, T const & s)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
m[0] / s,
m[1] / s,
m[2] / s,
m[3] / s);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(T const & s, tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(T const & s, mat<4, 4, T, P> const& m)
{
return tmat4x4<T, P>(
return mat<4, 4, T, P>(
s / m[0],
s / m[1],
s / m[2],
s / m[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::col_type operator/(tmat4x4<T, P> const & m, typename tmat4x4<T, P>::row_type const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::col_type operator/(mat<4, 4, T, P> const & m, typename mat<4, 4, T, P>::row_type const & v)
{
return inverse(m) * v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tmat4x4<T, P>::row_type operator/(typename tmat4x4<T, P>::col_type const & v, tmat4x4<T, P> const & m)
template<typename T, precision P>
GLM_FUNC_QUALIFIER typename mat<4, 4, T, P>::row_type operator/(typename mat<4, 4, T, P>::col_type const & v, mat<4, 4, T, P> const & m)
{
return v * inverse(m);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> operator/(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> operator/(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{
tmat4x4<T, P> m1_copy(m1);
mat<4, 4, T, P> m1_copy(m1);
return m1_copy /= m2;
}
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{
return (m1[0] == m2[0]) && (m1[1] == m2[1]) && (m1[2] == m2[2]) && (m1[3] == m2[3]);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(tmat4x4<T, P> const & m1, tmat4x4<T, P> const & m2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=(mat<4, 4, T, P> const & m1, mat<4, 4, T, P> const & m2)
{
return (m1[0] != m2[0]) || (m1[1] != m2[1]) || (m1[2] != m2[2]) || (m1[3] != m2[3]);
}

View File

@@ -9,7 +9,7 @@
namespace glm{
namespace detail
{
template <typename T, std::size_t size, bool aligned>
template<typename T, std::size_t size, bool aligned>
struct storage
{
typedef struct type {
@@ -18,7 +18,7 @@ namespace detail
};
#define GLM_ALIGNED_STORAGE_TYPE_STRUCT(x) \
template <typename T> \
template<typename T> \
struct storage<T, x, true> { \
GLM_ALIGNED_STRUCT(x) type { \
uint8 data[x]; \
@@ -34,19 +34,19 @@ namespace detail
GLM_ALIGNED_STORAGE_TYPE_STRUCT(64)
# if GLM_ARCH & GLM_ARCH_SSE2_BIT
template <>
template<>
struct storage<float, 16, true>
{
typedef glm_vec4 type;
};
template <>
template<>
struct storage<int, 16, true>
{
typedef glm_ivec4 type;
};
template <>
template<>
struct storage<unsigned int, 16, true>
{
typedef glm_uvec4 type;
@@ -58,19 +58,19 @@ namespace detail
unsigned __int8 data[16];
} glm_128;
template <>
template<>
struct storage<float, 16, true>
{
typedef glm_128 type;
};
template <>
template<>
struct storage<int, 16, true>
{
typedef glm_128 type;
};
template <>
template<>
struct storage<unsigned int, 16, true>
{
typedef glm_128 type;
@@ -79,7 +79,7 @@ namespace detail
# endif
# if (GLM_ARCH & GLM_ARCH_AVX_BIT)
template <>
template<>
struct storage<double, 32, true>
{
typedef glm_dvec4 type;
@@ -87,13 +87,13 @@ namespace detail
# endif
# if (GLM_ARCH & GLM_ARCH_AVX2_BIT)
template <>
template<>
struct storage<int64, 32, true>
{
typedef glm_i64vec4 type;
};
template <>
template<>
struct storage<uint64, 32, true>
{
typedef glm_u64vec4 type;
@@ -101,26 +101,21 @@ namespace detail
# endif
}//namespace detail
template <typename T, precision P> struct tvec1;
template <typename T, precision P> struct tvec2;
template <typename T, precision P> struct tvec3;
template <typename T, precision P> struct tvec4;
typedef tvec1<float, highp> highp_vec1_t;
typedef tvec1<float, mediump> mediump_vec1_t;
typedef tvec1<float, lowp> lowp_vec1_t;
typedef tvec1<double, highp> highp_dvec1_t;
typedef tvec1<double, mediump> mediump_dvec1_t;
typedef tvec1<double, lowp> lowp_dvec1_t;
typedef tvec1<int, highp> highp_ivec1_t;
typedef tvec1<int, mediump> mediump_ivec1_t;
typedef tvec1<int, lowp> lowp_ivec1_t;
typedef tvec1<uint, highp> highp_uvec1_t;
typedef tvec1<uint, mediump> mediump_uvec1_t;
typedef tvec1<uint, lowp> lowp_uvec1_t;
typedef tvec1<bool, highp> highp_bvec1_t;
typedef tvec1<bool, mediump> mediump_bvec1_t;
typedef tvec1<bool, lowp> lowp_bvec1_t;
typedef vec<1, float, highp> highp_vec1_t;
typedef vec<1, float, mediump> mediump_vec1_t;
typedef vec<1, float, lowp> lowp_vec1_t;
typedef vec<1, double, highp> highp_dvec1_t;
typedef vec<1, double, mediump> mediump_dvec1_t;
typedef vec<1, double, lowp> lowp_dvec1_t;
typedef vec<1, int, highp> highp_ivec1_t;
typedef vec<1, int, mediump> mediump_ivec1_t;
typedef vec<1, int, lowp> lowp_ivec1_t;
typedef vec<1, uint, highp> highp_uvec1_t;
typedef vec<1, uint, mediump> mediump_uvec1_t;
typedef vec<1, uint, lowp> lowp_uvec1_t;
typedef vec<1, bool, highp> highp_bvec1_t;
typedef vec<1, bool, mediump> mediump_bvec1_t;
typedef vec<1, bool, lowp> lowp_bvec1_t;
/// @addtogroup core_precision
/// @{
@@ -130,105 +125,105 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<float, highp> highp_vec2;
typedef vec<2, float, highp> highp_vec2;
/// 2 components vector of medium single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<float, mediump> mediump_vec2;
typedef vec<2, float, mediump> mediump_vec2;
/// 2 components vector of low single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<float, lowp> lowp_vec2;
typedef vec<2, float, lowp> lowp_vec2;
/// 2 components vector of high double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<double, highp> highp_dvec2;
typedef vec<2, double, highp> highp_dvec2;
/// 2 components vector of medium double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<double, mediump> mediump_dvec2;
typedef vec<2, double, mediump> mediump_dvec2;
/// 2 components vector of low double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<double, lowp> lowp_dvec2;
typedef vec<2, double, lowp> lowp_dvec2;
/// 2 components vector of high precision signed integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<int, highp> highp_ivec2;
typedef vec<2, int, highp> highp_ivec2;
/// 2 components vector of medium precision signed integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<int, mediump> mediump_ivec2;
typedef vec<2, int, mediump> mediump_ivec2;
/// 2 components vector of low precision signed integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<int, lowp> lowp_ivec2;
typedef vec<2, int, lowp> lowp_ivec2;
/// 2 components vector of high precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<uint, highp> highp_uvec2;
typedef vec<2, uint, highp> highp_uvec2;
/// 2 components vector of medium precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<uint, mediump> mediump_uvec2;
typedef vec<2, uint, mediump> mediump_uvec2;
/// 2 components vector of low precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<uint, lowp> lowp_uvec2;
typedef vec<2, uint, lowp> lowp_uvec2;
/// 2 components vector of high precision bool numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<bool, highp> highp_bvec2;
typedef vec<2, bool, highp> highp_bvec2;
/// 2 components vector of medium precision bool numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<bool, mediump> mediump_bvec2;
typedef vec<2, bool, mediump> mediump_bvec2;
/// 2 components vector of low precision bool numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec2<bool, lowp> lowp_bvec2;
typedef vec<2, bool, lowp> lowp_bvec2;
/// @}
@@ -240,102 +235,102 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<float, highp> highp_vec3;
typedef vec<3, float, highp> highp_vec3;
/// 3 components vector of medium single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<float, mediump> mediump_vec3;
typedef vec<3, float, mediump> mediump_vec3;
/// 3 components vector of low single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<float, lowp> lowp_vec3;
typedef vec<3, float, lowp> lowp_vec3;
/// 3 components vector of high double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<double, highp> highp_dvec3;
typedef vec<3, double, highp> highp_dvec3;
/// 3 components vector of medium double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<double, mediump> mediump_dvec3;
typedef vec<3, double, mediump> mediump_dvec3;
/// 3 components vector of low double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<double, lowp> lowp_dvec3;
typedef vec<3, double, lowp> lowp_dvec3;
/// 3 components vector of high precision signed integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<int, highp> highp_ivec3;
typedef vec<3, int, highp> highp_ivec3;
/// 3 components vector of medium precision signed integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<int, mediump> mediump_ivec3;
typedef vec<3, int, mediump> mediump_ivec3;
/// 3 components vector of low precision signed integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<int, lowp> lowp_ivec3;
typedef vec<3, int, lowp> lowp_ivec3;
/// 3 components vector of high precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<uint, highp> highp_uvec3;
typedef vec<3, uint, highp> highp_uvec3;
/// 3 components vector of medium precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<uint, mediump> mediump_uvec3;
typedef vec<3, uint, mediump> mediump_uvec3;
/// 3 components vector of low precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<uint, lowp> lowp_uvec3;
typedef vec<3, uint, lowp> lowp_uvec3;
/// 3 components vector of high precision bool numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<bool, highp> highp_bvec3;
typedef vec<3, bool, highp> highp_bvec3;
/// 3 components vector of medium precision bool numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<bool, mediump> mediump_bvec3;
typedef vec<3, bool, mediump> mediump_bvec3;
/// 3 components vector of low precision bool numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec3<bool, lowp> lowp_bvec3;
typedef vec<3, bool, lowp> lowp_bvec3;
/// @}
@@ -346,91 +341,91 @@ namespace detail
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<float, highp> highp_vec4;
typedef vec<4, float, highp> highp_vec4;
/// 4 components vector of medium single-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<float, mediump> mediump_vec4;
typedef vec<4, float, mediump> mediump_vec4;
/// 4 components vector of low single-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<float, lowp> lowp_vec4;
typedef vec<4, float, lowp> lowp_vec4;
/// 4 components vector of high double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<double, highp> highp_dvec4;
typedef vec<4, double, highp> highp_dvec4;
/// 4 components vector of medium double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<double, mediump> mediump_dvec4;
typedef vec<4, double, mediump> mediump_dvec4;
/// 4 components vector of low double-precision floating-point numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<double, lowp> lowp_dvec4;
typedef vec<4, double, lowp> lowp_dvec4;
/// 4 components vector of high precision signed integer numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<int, highp> highp_ivec4;
typedef vec<4, int, highp> highp_ivec4;
/// 4 components vector of medium precision signed integer numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<int, mediump> mediump_ivec4;
typedef vec<4, int, mediump> mediump_ivec4;
/// 4 components vector of low precision signed integer numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<int, lowp> lowp_ivec4;
typedef vec<4, int, lowp> lowp_ivec4;
/// 4 components vector of high precision unsigned integer numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<uint, highp> highp_uvec4;
typedef vec<4, uint, highp> highp_uvec4;
/// 4 components vector of medium precision unsigned integer numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<uint, mediump> mediump_uvec4;
typedef vec<4, uint, mediump> mediump_uvec4;
/// 4 components vector of low precision unsigned integer numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<uint, lowp> lowp_uvec4;
typedef vec<4, uint, lowp> lowp_uvec4;
/// 4 components vector of high precision bool numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<bool, highp> highp_bvec4;
typedef vec<4, bool, highp> highp_bvec4;
/// 4 components vector of medium precision bool numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<bool, mediump> mediump_bvec4;
typedef vec<4, bool, mediump> mediump_bvec4;
/// 4 components vector of low precision bool numbers.
///
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.1.5 Vectors</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 4.7.2 Precision Qualifier</a>
typedef tvec4<bool, lowp> lowp_bvec4;
typedef vec<4, bool, lowp> lowp_bvec4;
/// @}

View File

@@ -16,14 +16,14 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tvec1
template<typename T, precision P>
struct vec<1, T, P>
{
// -- Implementation detail --
typedef T value_type;
typedef tvec1<T, P> type;
typedef tvec1<bool, P> bool_type;
typedef vec type;
typedef vec<1, bool, P> bool_type;
// -- Data --
@@ -82,37 +82,37 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tvec1() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec1(tvec1<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec1(tvec1<T, Q> const & v);
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 vec(vec<1, T, Q> const & v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec1(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec1(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 tvec1(tvec2<U, Q> const & v);
template<typename U, precision Q>
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 tvec1(tvec3<U, Q> const & v);
template<typename U, precision Q>
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 tvec1(tvec4<U, Q> const & v);
template<typename U, precision Q>
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 tvec1(tvec1<U, Q> const & v);
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT vec(vec<1, U, Q> const & v);
// -- Swizzle constructors --
/*
# if(GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED))
template <int E0>
GLM_FUNC_DECL tvec1(detail::_swizzle<1, T, P, tvec1, E0, -1,-2,-3> const & that)
template<int E0>
GLM_FUNC_DECL tvec(detail::_swizzle<1, T, P, tvec1, E0, -1,-2,-3> const & that)
{
*this = that();
}
@@ -120,178 +120,178 @@ namespace glm
*/
// -- Unary arithmetic operators --
GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<T, P> const & v) GLM_DEFAULT;
GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator+=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator+=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator-=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator-=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator*=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator*=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator/=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator/=(tvec1<U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator+=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator-=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator*=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator/=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const & v);
// -- Increment and decrement operators --
GLM_FUNC_DECL tvec1<T, P> & operator++();
GLM_FUNC_DECL tvec1<T, P> & operator--();
GLM_FUNC_DECL tvec1<T, P> operator++(int);
GLM_FUNC_DECL tvec1<T, P> 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 tvec1<T, P> & operator%=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator%=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator&=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator&=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator|=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator|=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator^=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator^=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator<<=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator<<=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator>>=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec1<T, P> & operator>>=(tvec1<U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator%=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator+(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator+(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator-(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator-(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator- (tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator- (vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator*(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator*(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator/(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator/(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator%(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator%(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator&(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator&(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator|(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator|(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator^(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator^(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator<<(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator>>(T scalar, tvec1<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator>>(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec1<T, P> operator~(tvec1<T, P> const & v);
template<typename T, precision P>
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==(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
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!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(vec<1, T, P> const & v1, vec<1, T, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec1<bool, P> operator&&(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2);
template<precision P>
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 tvec1<bool, P> operator||(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2);
template<precision P>
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

@@ -6,8 +6,8 @@ namespace glm
// -- Implicit basic constructors --
# if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT)
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1()
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: x(0)
# endif
@@ -15,66 +15,66 @@ namespace glm
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec1<T, P> const & v)
template<typename T, precision P>
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 tvec1<T, P>::tvec1(tvec1<T, Q> const & v)
template<typename T, precision P>
template<precision Q>
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 tvec1<T, P>::tvec1(ctor)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR vec<1, T, P>::vec(ctor)
{}
template <typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<1, T, P>::vec(T scalar)
: x(scalar)
{}
// -- Conversion vector constructors --
template <typename T, precision P>
template <typename U, precision Q>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR tvec1<T, P>::tvec1(tvec1<U, Q> const & v)
template<typename T, precision P>
template<typename U, precision Q>
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 tvec1<T, P>::tvec1(tvec2<U, Q> const & v)
template<typename T, precision P>
template<typename U, precision Q>
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 tvec1<T, P>::tvec1(tvec3<U, Q> const & v)
template<typename T, precision P>
template<typename U, precision Q>
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 tvec1<T, P>::tvec1(tvec4<U, Q> const & v)
template<typename T, precision P>
template<typename U, precision Q>
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 & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i)
template<typename T, precision P>
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 & tvec1<T, P>::operator[](typename tvec1<T, P>::length_type i) const
template<typename T, precision P>
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];
@@ -83,81 +83,81 @@ namespace glm
// -- Unary arithmetic operators --
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator=(vec<1, T, P> const & v)
{
this->x = v.x;
return *this;
}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator+=(U scalar)
{
this->x += static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator+=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator-=(U scalar)
{
this->x -= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator-=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator*=(U scalar)
{
this->x *= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator*=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator/=(U scalar)
{
this->x /= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator/=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
@@ -165,129 +165,129 @@ namespace glm
// -- Increment and decrement operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator++()
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator++()
{
++this->x;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator--()
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator--()
{
--this->x;
return *this;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> tvec1<T, P>::operator++(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator++(int)
{
tvec1<T, P> Result(*this);
vec<1, T, P> Result(*this);
++*this;
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> tvec1<T, P>::operator--(int)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> vec<1, T, P>::operator--(int)
{
tvec1<T, P> Result(*this);
vec<1, T, P> Result(*this);
--*this;
return Result;
}
// -- Unary bit operators --
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator%=(U scalar)
{
this->x %= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator%=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator&=(U scalar)
{
this->x &= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator&=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator|=(U scalar)
{
this->x |= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator|=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator^=(U scalar)
{
this->x ^= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator^=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator<<=(U scalar)
{
this->x <<= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator<<=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=(U scalar)
template<typename T, precision P>
template<typename U>
GLM_FUNC_QUALIFIER vec<1, T, P> & vec<1, T, P>::operator>>=(U scalar)
{
this->x >>= static_cast<T>(scalar);
return *this;
}
template <typename T, precision P>
template <typename U>
GLM_FUNC_QUALIFIER tvec1<T, P> & tvec1<T, P>::operator>>=(tvec1<U, P> const & v)
template<typename T, precision P>
template<typename U>
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;
@@ -295,264 +295,264 @@ namespace glm
// -- Unary constant operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v)
{
return v;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
-v.x);
}
// -- Binary arithmetic operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x + scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar + v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator+(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator+(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x + v2.x);
}
//operator-
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x - scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar - v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator-(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator-(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x - v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x * scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar * v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator*(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator*(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x * v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x / scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar / v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator/(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator/(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x / v2.x);
}
// -- Binary bit operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x % scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar % v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator%(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator%(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x % v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x & scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar & v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator&(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator&(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x & v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x | scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar | v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator|(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator|(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x | v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x ^ scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar ^ v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator^(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator^(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x ^ v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x << scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar << v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator<<(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator<<(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x << v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(tvec1<T, P> const & v, T scalar)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v, T scalar)
{
return tvec1<T, P>(
return vec<1, T, P>(
v.x >> scalar);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(T scalar, tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(T scalar, vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
scalar >> v.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator>>(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator>>(vec<1, T, P> const & v1, vec<1, T, P> const & v2)
{
return tvec1<T, P>(
return vec<1, T, P>(
v1.x >> v2.x);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> operator~(tvec1<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<1, T, P> operator~(vec<1, T, P> const & v)
{
return tvec1<T, P>(
return vec<1, T, P>(
~v.x);
}
// -- Boolean operators --
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
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!=(tvec1<T, P> const & v1, tvec1<T, P> const & v2)
template<typename T, precision P>
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 tvec1<bool, P> operator&&(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2)
template<precision P>
GLM_FUNC_QUALIFIER vec<1, bool, P> operator&&(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2)
{
return tvec1<bool, P>(v1.x && v2.x);
return vec<1, bool, P>(v1.x && v2.x);
}
template <precision P>
GLM_FUNC_QUALIFIER tvec1<bool, P> operator||(tvec1<bool, P> const & v1, tvec1<bool, P> const & v2)
template<precision P>
GLM_FUNC_QUALIFIER vec<1, bool, P> operator||(vec<1, bool, P> const & v1, vec<1, bool, P> const & v2)
{
return tvec1<bool, P>(v1.x || v2.x);
return vec<1, bool, P>(v1.x || v2.x);
}
}//namespace glm

View File

@@ -15,14 +15,14 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tvec2
template<typename T, precision P>
struct vec<2, T, P>
{
// -- Implementation detail --
typedef T value_type;
typedef tvec2<T, P> type;
typedef tvec2<bool, P> bool_type;
typedef vec type;
typedef vec<2, bool, P> bool_type;
// -- Data --
@@ -44,15 +44,15 @@ namespace glm
struct{ T s, t; };
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
_GLM_SWIZZLE2_2_MEMBERS(T, P, glm::tvec2, x, y)
_GLM_SWIZZLE2_2_MEMBERS(T, P, glm::tvec2, r, g)
_GLM_SWIZZLE2_2_MEMBERS(T, P, glm::tvec2, s, t)
_GLM_SWIZZLE2_3_MEMBERS(T, P, glm::tvec3, x, y)
_GLM_SWIZZLE2_3_MEMBERS(T, P, glm::tvec3, r, g)
_GLM_SWIZZLE2_3_MEMBERS(T, P, glm::tvec3, s, t)
_GLM_SWIZZLE2_4_MEMBERS(T, P, glm::tvec4, x, y)
_GLM_SWIZZLE2_4_MEMBERS(T, P, glm::tvec4, r, g)
_GLM_SWIZZLE2_4_MEMBERS(T, P, glm::tvec4, s, t)
_GLM_SWIZZLE2_2_MEMBERS(T, P, x, y)
_GLM_SWIZZLE2_2_MEMBERS(T, P, r, g)
_GLM_SWIZZLE2_2_MEMBERS(T, P, s, t)
_GLM_SWIZZLE2_3_MEMBERS(T, P, x, y)
_GLM_SWIZZLE2_3_MEMBERS(T, P, r, g)
_GLM_SWIZZLE2_3_MEMBERS(T, P, s, t)
_GLM_SWIZZLE2_4_MEMBERS(T, P, x, y)
_GLM_SWIZZLE2_4_MEMBERS(T, P, r, g)
_GLM_SWIZZLE2_4_MEMBERS(T, P, s, t)
# endif//GLM_SWIZZLE
};
@@ -68,7 +68,7 @@ namespace glm
union {T y, g, t;};
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P, tvec2, tvec2, tvec3, tvec4)
GLM_SWIZZLE_GEN_VEC_FROM_VEC2(T, P)
# endif//GLM_SWIZZLE
# endif
@@ -83,42 +83,42 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tvec2() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec2<T, P> const& v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec2<T, Q> const& v);
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 vec(vec<2, T, Q> const& v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec2(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec2(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR tvec2(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)
template <typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR tvec2(A x, B y);
template <typename A, typename B>
GLM_FUNC_DECL GLM_CONSTEXPR tvec2(tvec1<A, P> const & v1, tvec1<B, P> const & v2);
/// 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 vec(A x, B y);
template<typename A, typename B>
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 tvec2(tvec3<U, Q> const & v);
template<typename U, precision Q>
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 tvec2(tvec4<U, Q> const & v);
template<typename U, precision Q>
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 tvec2(tvec2<U, Q> const & v);
template<typename U, precision Q>
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 tvec2(detail::_swizzle<2, T, P, glm::tvec2, E0, E1,-1,-2> const& that)
template<int E0, int E1>
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 tvec2<T, P>& operator=(tvec2<T, P> const & v) GLM_DEFAULT;
GLM_FUNC_DECL vec& operator=(vec const & v) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator+=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator+=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator-=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator-=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator*=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator*=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator/=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P>& operator/=(tvec2<U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec& operator=(vec<2, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec& operator+=(U scalar);
template<typename U>
GLM_FUNC_DECL vec& operator+=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec& operator+=(vec<2, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec& operator-=(U scalar);
template<typename U>
GLM_FUNC_DECL vec& operator-=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec& operator-=(vec<2, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec& operator*=(U scalar);
template<typename U>
GLM_FUNC_DECL vec& operator*=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec& operator*=(vec<2, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec& operator/=(U scalar);
template<typename U>
GLM_FUNC_DECL vec& operator/=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec& operator/=(vec<2, U, P> const & v);
// -- Increment and decrement operators --
GLM_FUNC_DECL tvec2<T, P> & operator++();
GLM_FUNC_DECL tvec2<T, P> & operator--();
GLM_FUNC_DECL tvec2<T, P> operator++(int);
GLM_FUNC_DECL tvec2<T, P> 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 tvec2<T, P> & operator%=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator%=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator&=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator&=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator|=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator|=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator^=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator^=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator<<=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator<<=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator<<=(tvec2<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator>>=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator>>=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec2<T, P> & operator>>=(tvec2<U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator%=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<2, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<2, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<2, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<2, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<2, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<2, U, P> const & v);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator+(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator+(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator+(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator+(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator-(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator-(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator-(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator-(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator*(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator*(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator*(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator*(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator/(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator/(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator/(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator/(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator%(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator%(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator%(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator%(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator&(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator&(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator&(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator&(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator|(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator|(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator|(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator|(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator^(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator^(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator^(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator^(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator<<(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator<<(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator<<(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator>>(T scalar, tvec2<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(T scalar, vec<2, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec1<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<1, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator>>(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<2, T, P> operator>>(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec2<T, P> operator~(tvec2<T, P> const & v);
template<typename T, precision P>
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==(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
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!=(tvec2<T, P> const & v1, tvec2<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(vec<2, T, P> const & v1, vec<2, T, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec2<bool, P> operator&&(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2);
template<precision P>
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 tvec2<bool, P> operator||(tvec2<bool, P> const & v1, tvec2<bool, P> const & v2);
template<precision P>
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

File diff suppressed because it is too large Load Diff

View File

@@ -15,14 +15,14 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tvec3
template<typename T, precision P>
struct vec<3, T, P>
{
// -- Implementation detail --
typedef T value_type;
typedef tvec3<T, P> type;
typedef tvec3<bool, P> bool_type;
typedef vec type;
typedef vec<3, bool, P> bool_type;
// -- Data --
@@ -44,15 +44,15 @@ namespace glm
struct{ T s, t, p; };
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
_GLM_SWIZZLE3_2_MEMBERS(T, P, glm::tvec2, x, y, z)
_GLM_SWIZZLE3_2_MEMBERS(T, P, glm::tvec2, r, g, b)
_GLM_SWIZZLE3_2_MEMBERS(T, P, glm::tvec2, s, t, p)
_GLM_SWIZZLE3_3_MEMBERS(T, P, glm::tvec3, x, y, z)
_GLM_SWIZZLE3_3_MEMBERS(T, P, glm::tvec3, r, g, b)
_GLM_SWIZZLE3_3_MEMBERS(T, P, glm::tvec3, s, t, p)
_GLM_SWIZZLE3_4_MEMBERS(T, P, glm::tvec4, x, y, z)
_GLM_SWIZZLE3_4_MEMBERS(T, P, glm::tvec4, r, g, b)
_GLM_SWIZZLE3_4_MEMBERS(T, P, glm::tvec4, s, t, p)
_GLM_SWIZZLE3_2_MEMBERS(T, P, x, y, z)
_GLM_SWIZZLE3_2_MEMBERS(T, P, r, g, b)
_GLM_SWIZZLE3_2_MEMBERS(T, P, s, t, p)
_GLM_SWIZZLE3_3_MEMBERS(T, P, x, y, z)
_GLM_SWIZZLE3_3_MEMBERS(T, P, r, g, b)
_GLM_SWIZZLE3_3_MEMBERS(T, P, s, t, p)
_GLM_SWIZZLE3_4_MEMBERS(T, P, x, y, z)
_GLM_SWIZZLE3_4_MEMBERS(T, P, r, g, b)
_GLM_SWIZZLE3_4_MEMBERS(T, P, s, t, p)
# endif//GLM_SWIZZLE
};
@@ -68,7 +68,7 @@ namespace glm
union { T z, b, p; };
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P, tvec3, tvec2, tvec3, tvec4)
GLM_SWIZZLE_GEN_VEC_FROM_VEC3(T, P)
# endif//GLM_SWIZZLE
# endif//GLM_LANG
@@ -83,322 +83,322 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR tvec3() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec3<T, P> const & v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec3<T, Q> const & v);
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 vec(vec<3, T, Q> const & v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tvec3(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR explicit tvec3(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR tvec3(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 tvec3(A a, B b, C c);
template <typename A, typename B, typename C>
GLM_FUNC_DECL GLM_CONSTEXPR tvec3(tvec1<A, P> const & a, tvec1<B, P> const & b, tvec1<C, P> const & c);
template<typename A, typename B, typename 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 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 tvec3(tvec2<A, Q> const & a, B b);
template<typename A, typename B, precision Q>
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 tvec3(tvec2<A, Q> const & a, tvec1<B, Q> const & b);
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b);
/// 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 tvec3(A a, tvec2<B, Q> const & b);
template<typename A, typename B, precision Q>
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 tvec3(tvec1<A, Q> const & a, tvec2<B, Q> const & b);
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b);
/// 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 tvec3(tvec4<U, Q> const & v);
template<typename U, precision Q>
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 tvec3(tvec3<U, Q> const & v);
template<typename U, precision Q>
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 tvec3(detail::_swizzle<3, T, P, glm::tvec3, E0, E1, E2, -1> const & that)
template<int E0, int E1, int E2>
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 tvec3(detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v, T const & scalar)
template<int E0, int E1>
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & scalar)
{
*this = tvec3<T, P>(v(), scalar);
*this = vec(v(), scalar);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec3(T const & scalar, detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v)
template<int E0, int E1>
GLM_FUNC_DECL vec(T const & scalar, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
{
*this = tvec3<T, P>(scalar, v());
*this = vec(scalar, v());
}
# endif// GLM_HAS_UNRESTRICTED_UNIONS && (GLM_SWIZZLE == GLM_SWIZZLE_ENABLED)
// -- Unary arithmetic operators --
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<T, P> const & v) GLM_DEFAULT;
GLM_FUNC_DECL vec & operator=(vec const & v) GLM_DEFAULT;
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator+=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator+=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator-=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator-=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator*=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator*=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator/=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator/=(tvec3<U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator=(vec<3, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator+=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator+=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator+=(vec<3, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator-=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator-=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator-=(vec<3, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator*=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator*=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator*=(vec<3, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator/=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator/=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator/=(vec<3, U, P> const & v);
// -- Increment and decrement operators --
GLM_FUNC_DECL tvec3<T, P> & operator++();
GLM_FUNC_DECL tvec3<T, P> & operator--();
GLM_FUNC_DECL tvec3<T, P> operator++(int);
GLM_FUNC_DECL tvec3<T, P> 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 tvec3<T, P> & operator%=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator%=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator&=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator&=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator|=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator|=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator^=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator^=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator<<=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator<<=(tvec3<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator>>=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec3<T, P> & operator>>=(tvec3<U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator%=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator%=(vec<3, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator&=(vec<3, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator|=(vec<3, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator^=(vec<3, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator<<=(vec<3, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec & operator>>=(vec<3, U, P> const & v);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v, tvec1<T, P> const & scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(T scalar, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator+(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator+(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(T scalar, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator-(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator-(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(T scalar, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(T scalar, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator/(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator/(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(T const & scalar, tvec3<T, P> const & v);
template<typename T, precision P>
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 tvec3<T, P> operator%(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator%(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator%(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v1, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(T scalar, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator&(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator&(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(T scalar, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator|(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator|(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(T scalar, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator^(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator^(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(T scalar, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator<<(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator<<(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(T scalar, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(T scalar, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec1<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<1, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator>>(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator>>(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator~(tvec3<T, P> const & v);
template<typename T, precision P>
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==(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
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!=(tvec3<T, P> const & v1, tvec3<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(vec<3, T, P> const & v1, vec<3, T, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec3<bool, P> operator&&(tvec3<bool, P> const & v1, tvec3<bool, P> const & v2);
template<precision P>
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 tvec3<bool, P> operator||(tvec3<bool, P> const & v1, tvec3<bool, P> const & v2);
template<precision P>
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

@@ -15,14 +15,14 @@
namespace glm
{
template <typename T, precision P = defaultp>
struct tvec4
template<typename T, precision P>
struct vec<4, T, P>
{
// -- Implementation detail --
typedef T value_type;
typedef tvec4<T, P> type;
typedef tvec4<bool, P> bool_type;
typedef vec<4, T, P> type;
typedef vec<4, bool, P> bool_type;
// -- Data --
@@ -36,7 +36,7 @@ namespace glm
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
# pragma clang diagnostic ignored "-Wnested-anon-types"
# endif
union
{
struct { T x, y, z, w;};
@@ -46,15 +46,15 @@ namespace glm
typename detail::storage<T, sizeof(T) * 4, detail::is_aligned<P>::value>::type data;
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
_GLM_SWIZZLE4_2_MEMBERS(T, P, glm::tvec2, x, y, z, w)
_GLM_SWIZZLE4_2_MEMBERS(T, P, glm::tvec2, r, g, b, a)
_GLM_SWIZZLE4_2_MEMBERS(T, P, glm::tvec2, s, t, p, q)
_GLM_SWIZZLE4_3_MEMBERS(T, P, glm::tvec3, x, y, z, w)
_GLM_SWIZZLE4_3_MEMBERS(T, P, glm::tvec3, r, g, b, a)
_GLM_SWIZZLE4_3_MEMBERS(T, P, glm::tvec3, s, t, p, q)
_GLM_SWIZZLE4_4_MEMBERS(T, P, glm::tvec4, x, y, z, w)
_GLM_SWIZZLE4_4_MEMBERS(T, P, glm::tvec4, r, g, b, a)
_GLM_SWIZZLE4_4_MEMBERS(T, P, glm::tvec4, s, t, p, q)
_GLM_SWIZZLE4_2_MEMBERS(T, P, x, y, z, w)
_GLM_SWIZZLE4_2_MEMBERS(T, P, r, g, b, a)
_GLM_SWIZZLE4_2_MEMBERS(T, P, s, t, p, q)
_GLM_SWIZZLE4_3_MEMBERS(T, P, x, y, z, w)
_GLM_SWIZZLE4_3_MEMBERS(T, P, r, g, b, a)
_GLM_SWIZZLE4_3_MEMBERS(T, P, s, t, p, q)
_GLM_SWIZZLE4_4_MEMBERS(T, P, x, y, z, w)
_GLM_SWIZZLE4_4_MEMBERS(T, P, r, g, b, a)
_GLM_SWIZZLE4_4_MEMBERS(T, P, s, t, p, q)
# endif//GLM_SWIZZLE
};
@@ -71,7 +71,7 @@ namespace glm
union { T w, a, q; };
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P, tvec4, tvec2, tvec3, tvec4)
GLM_SWIZZLE_GEN_VEC_FROM_VEC4(T, P)
# endif//GLM_SWIZZLE
# endif
@@ -86,364 +86,364 @@ namespace glm
// -- Implicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4(tvec4<T, P> const& v) GLM_DEFAULT;
template <precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4(tvec4<T, Q> const& v);
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 vec(vec<4, T, Q> const& v);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit tvec4(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD explicit tvec4(T scalar);
GLM_FUNC_DECL GLM_CONSTEXPR_SIMD tvec4(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 tvec4(A a, B b, C c, D d);
template <typename A, typename B, typename C, typename D>
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR tvec4(tvec1<A, P> const& a, tvec1<B, P> const& b, tvec1<C, P> const& c, tvec1<D, P> const& d);
/// Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template<typename A, typename B, typename C, typename D>
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 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 tvec4(tvec2<A, Q> const & a, B b, C c);
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, B b, C c);
/// 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 tvec4(tvec2<A, Q> const & a, tvec1<B, Q> const & b, tvec1<C, Q> const & c);
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<1, B, Q> const & b, vec<1, C, Q> const & c);
/// 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 tvec4(A a, tvec2<B, Q> const & b, C c);
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, vec<2, B, Q> const & b, C c);
/// 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 tvec4(tvec1<A, Q> const & a, tvec2<B, Q> const & b, tvec1<C, Q> const & c);
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<2, B, Q> const & b, vec<1, C, Q> const & c);
/// 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 tvec4(A a, B b, tvec2<C, Q> const & c);
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(A a, B b, vec<2, C, Q> const & c);
/// 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 tvec4(tvec1<A, Q> const & a, tvec1<B, Q> const & b, tvec2<C, Q> const & c);
template<typename A, typename B, typename C, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<1, B, Q> const & b, vec<2, C, Q> const & c);
/// 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 tvec4(tvec3<A, Q> const & a, B b);
template<typename A, typename B, precision Q>
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 tvec4(tvec3<A, Q> const & a, tvec1<B, Q> const & b);
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<3, A, Q> const & a, vec<1, B, Q> const & b);
/// 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 tvec4(A a, tvec3<B, Q> const & b);
template<typename A, typename B, precision Q>
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 tvec4(tvec1<A, Q> const & a, tvec3<B, Q> const & b);
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<1, A, Q> const & a, vec<3, B, Q> const & b);
/// 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 tvec4(tvec2<A, Q> const & a, tvec2<B, Q> const & b);
template<typename A, typename B, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec(vec<2, A, Q> const & a, vec<2, B, Q> const & b);
/// 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 tvec4(tvec4<U, Q> const& v);
template<typename U, precision Q>
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 tvec4(detail::_swizzle<4, T, P, glm::tvec4, E0, E1, E2, E3> const & that)
template<int E0, int E1, int E2, int E3>
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 tvec4(detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, glm::tvec2, F0, F1, -1, -2> const & u)
template<int E0, int E1, int F0, int F1>
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, detail::_swizzle<2, T, P, F0, F1, -1, -2> const & u)
{
*this = tvec4<T, P>(v(), u());
*this = vec<4, T, P>(v(), u());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(T const & x, T const & y, detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v)
template<int E0, int E1>
GLM_FUNC_DECL vec(T const & x, T const & y, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v)
{
*this = tvec4<T, P>(x, y, v());
*this = vec<4, T, P>(x, y, v());
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v, T const & w)
template<int E0, int E1>
GLM_FUNC_DECL vec(T const & x, detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & w)
{
*this = tvec4<T, P>(x, v(), w);
*this = vec<4, T, P>(x, v(), w);
}
template <int E0, int E1>
GLM_FUNC_DECL tvec4(detail::_swizzle<2, T, P, glm::tvec2, E0, E1, -1, -2> const & v, T const & z, T const & w)
template<int E0, int E1>
GLM_FUNC_DECL vec(detail::_swizzle<2, T, P, E0, E1, -1, -2> const & v, T const & z, T const & w)
{
*this = tvec4<T, P>(v(), z, w);
*this = vec<4, T, P>(v(), z, w);
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec4(detail::_swizzle<3, T, P, glm::tvec3, E0, E1, E2, -1> const & v, T const & w)
template<int E0, int E1, int E2>
GLM_FUNC_DECL vec(detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v, T const & w)
{
*this = tvec4<T, P>(v(), w);
*this = vec<4, T, P>(v(), w);
}
template <int E0, int E1, int E2>
GLM_FUNC_DECL tvec4(T const & x, detail::_swizzle<3, T, P, glm::tvec3, E0, E1, E2, -1> const & v)
template<int E0, int E1, int E2>
GLM_FUNC_DECL vec(T const & x, detail::_swizzle<3, T, P, E0, E1, E2, -1> const & v)
{
*this = tvec4<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 tvec4<T, P> & operator=(tvec4<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 tvec4<T, P> & operator=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator+=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator+=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator-=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator-=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator*=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec1<U, P> const& v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator*=(tvec4<U, P> const& v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator/=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator/=(tvec4<U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator+=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator+=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator-=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator-=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator*=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<1, U, P> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator*=(vec<4, U, P> const& v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator/=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator/=(vec<4, U, P> const & v);
// -- Increment and decrement operators --
GLM_FUNC_DECL tvec4<T, P> & operator++();
GLM_FUNC_DECL tvec4<T, P> & operator--();
GLM_FUNC_DECL tvec4<T, P> operator++(int);
GLM_FUNC_DECL tvec4<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 tvec4<T, P> & operator%=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator%=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator&=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator&=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator|=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator|=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator^=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator^=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator<<=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator<<=(tvec4<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator>>=(U scalar);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec1<U, P> const & v);
template <typename U>
GLM_FUNC_DECL tvec4<T, P> & operator>>=(tvec4<U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator%=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator%=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator&=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator&=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator|=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator|=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator^=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator^=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator<<=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator<<=(vec<4, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator>>=(U scalar);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<1, U, P> const & v);
template<typename U>
GLM_FUNC_DECL vec<4, T, P> & operator>>=(vec<4, U, P> const & v);
};
// -- Unary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v);
// -- Binary operators --
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec1<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator+(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator+(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec1<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator-(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator-(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec1<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec1<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<1, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec1<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<1, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator/(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator/(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator%(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator%(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator&(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator&(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator|(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator|(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator^(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator^(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator<<(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator<<(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, T scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, T scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v, tvec1<T, P> const & scalar);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v, vec<1, T, P> const & scalar);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(T scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(T scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec1<T, P> const & scalar, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<1, T, P> const & scalar, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator>>(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator>>(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator~(tvec4<T, P> const & v);
template<typename T, precision P>
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==(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
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!=(tvec4<T, P> const & v1, tvec4<T, P> const & v2);
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(vec<4, T, P> const & v1, vec<4, T, P> const & v2);
template <precision P>
GLM_FUNC_DECL tvec4<bool, P> operator&&(tvec4<bool, P> const & v1, tvec4<bool, P> const & v2);
template<precision P>
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 tvec4<bool, P> operator||(tvec4<bool, P> const & v1, tvec4<bool, P> const & v2);
template<precision P>
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

@@ -7,14 +7,14 @@ namespace glm{
namespace detail
{
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
template <precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, float, P, glm::tvec4, E0,E1,E2,E3, true> : public _swizzle_base0<float, 4>
template<precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, float, P, E0,E1,E2,E3, true> : public _swizzle_base0<float, 4>
{
GLM_FUNC_QUALIFIER tvec4<float, P> operator ()() const
GLM_FUNC_QUALIFIER vec<4, float, P> operator ()() const
{
__m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer);
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
# if GLM_ARCH & GLM_ARCH_AVX_BIT
Result.data = _mm_permute_ps(data, _MM_SHUFFLE(E3, E2, E1, E0));
# else
@@ -24,315 +24,315 @@ namespace detail
}
};
template <precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, int32, P, glm::tvec4, E0,E1,E2,E3, true> : public _swizzle_base0<int32, 4>
template<precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, int32, P, E0,E1,E2,E3, true> : public _swizzle_base0<int32, 4>
{
GLM_FUNC_QUALIFIER tvec4<int32, P> operator ()() const
GLM_FUNC_QUALIFIER vec<4, int32, P> operator ()() const
{
__m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer);
tvec4<int32, P> Result(uninitialize);
vec<4, int32, P> Result(uninitialize);
Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0));
return Result;
}
};
template <precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, uint32, P, glm::tvec4, E0,E1,E2,E3, true> : public _swizzle_base0<uint32, 4>
template<precision P, int E0, int E1, int E2, int E3>
struct _swizzle_base1<4, uint32, P, E0,E1,E2,E3, true> : public _swizzle_base0<uint32, 4>
{
GLM_FUNC_QUALIFIER tvec4<uint32, P> operator ()() const
GLM_FUNC_QUALIFIER vec<4, uint32, P> operator ()() const
{
__m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer);
tvec4<uint32, P> Result(uninitialize);
vec<4, uint32, P> Result(uninitialize);
Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0));
return Result;
}
};
# endif// GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
template <precision P>
template<precision P>
struct compute_vec4_add<float, P, true>
{
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_add_ps(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P>
template<precision P>
struct compute_vec4_add<double, P, true>
{
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
{
tvec4<double, P> Result(uninitialize);
vec<4, double, P> Result(uninitialize);
Result.data = _mm256_add_pd(a.data, b.data);
return Result;
}
};
# endif
template <precision P>
template<precision P>
struct compute_vec4_sub<float, P, true>
{
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_sub_ps(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P>
template<precision P>
struct compute_vec4_sub<double, P, true>
{
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
{
tvec4<double, P> Result(uninitialize);
vec<4, double, P> Result(uninitialize);
Result.data = _mm256_sub_pd(a.data, b.data);
return Result;
}
};
# endif
template <precision P>
template<precision P>
struct compute_vec4_mul<float, P, true>
{
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_mul_ps(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P>
template<precision P>
struct compute_vec4_mul<double, P, true>
{
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
{
tvec4<double, P> Result(uninitialize);
vec<4, double, P> Result(uninitialize);
Result.data = _mm256_mul_pd(a.data, b.data);
return Result;
}
};
# endif
template <precision P>
template<precision P>
struct compute_vec4_div<float, P, true>
{
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
static vec<4, float, P> call(vec<4, float, P> const & a, vec<4, float, P> const & b)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_div_ps(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P>
template<precision P>
struct compute_vec4_div<double, P, true>
{
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
static vec<4, double, P> call(vec<4, double, P> const & a, vec<4, double, P> const & b)
{
tvec4<double, P> Result(uninitialize);
vec<4, double, P> Result(uninitialize);
Result.data = _mm256_div_pd(a.data, b.data);
return Result;
}
};
# endif
template <>
template<>
struct compute_vec4_div<float, aligned_lowp, true>
{
static tvec4<float, aligned_lowp> call(tvec4<float, aligned_lowp> const & a, tvec4<float, aligned_lowp> const & b)
static vec<4, float, aligned_lowp> call(vec<4, float, aligned_lowp> const & a, vec<4, float, aligned_lowp> const & b)
{
tvec4<float, aligned_lowp> Result(uninitialize);
vec<4, float, aligned_lowp> Result(uninitialize);
Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data));
return Result;
}
};
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_and<T, P, true, 32, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm_and_si128(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_and<T, P, true, 64, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm256_and_si256(a.data, b.data);
return Result;
}
};
# endif
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_or<T, P, true, 32, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm_or_si128(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_or<T, P, true, 64, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm256_or_si256(a.data, b.data);
return Result;
}
};
# endif
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_xor<T, P, true, 32, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm_xor_si128(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_xor<T, P, true, 64, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm256_xor_si256(a.data, b.data);
return Result;
}
};
# endif
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_shift_left<T, P, true, 32, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm_sll_epi32(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_shift_left<T, P, true, 64, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm256_sll_epi64(a.data, b.data);
return Result;
}
};
# endif
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_shift_right<T, P, true, 32, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm_srl_epi32(a.data, b.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_shift_right<T, P, true, 64, true>
{
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
static vec<4, T, P> call(vec<4, T, P> const& a, vec<4, T, P> const& b)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm256_srl_epi64(a.data, b.data);
return Result;
}
};
# endif
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_bitwise_not<T, P, true, 32, true>
{
static tvec4<T, P> call(tvec4<T, P> const & v)
static vec<4, T, P> call(vec<4, T, P> const & v)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1));
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
template <typename T, precision P>
template<typename T, precision P>
struct compute_vec4_bitwise_not<T, P, true, 64, true>
{
static tvec4<T, P> call(tvec4<T, P> const & v)
static vec<4, T, P> call(vec<4, T, P> const & v)
{
tvec4<T, P> Result(uninitialize);
vec<4, T, P> Result(uninitialize);
Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1));
return Result;
}
};
# endif
template <precision P>
template<precision P>
struct compute_vec4_equal<float, P, false, 32, true>
{
static bool call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
static bool call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
{
return _mm_movemask_ps(_mm_cmpeq_ps(v1.data, v2.data)) != 0;
}
};
template <precision P>
template<precision P>
struct compute_vec4_equal<int32, P, true, 32, true>
{
static bool call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
static bool call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
{
return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0;
}
};
template <precision P>
template<precision P>
struct compute_vec4_nequal<float, P, false, 32, true>
{
static bool call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
static bool call(vec<4, float, P> const & v1, vec<4, float, P> const & v2)
{
return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0;
}
};
template <precision P>
template<precision P>
struct compute_vec4_nequal<int32, P, true, 32, true>
{
static bool call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
static bool call(vec<4, int32, P> const & v1, vec<4, int32, P> const & v2)
{
return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0;
}
@@ -340,140 +340,140 @@ namespace detail
}//namespace detail
# if !GLM_HAS_DEFAULTED_FUNCTIONS
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4()
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, 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>::tvec4()
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, 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>::tvec4()
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec()
# ifndef GLM_FORCE_NO_CTOR_INIT
: data(_mm_setzero_ps())
# endif
{}
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4(float s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(float s) :
data(_mm_set1_ps(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4(float s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(float s) :
data(_mm_set1_ps(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4(float s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, 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>::tvec4(double s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_lowp>::vec(double s) :
data(_mm256_set1_pd(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_mediump>::tvec4(double s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_mediump>::vec(double s) :
data(_mm256_set1_pd(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_highp>::tvec4(double s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, double, aligned_highp>::vec(double s) :
data(_mm256_set1_pd(s))
{}
# endif
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::tvec4(int32 s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_lowp>::vec(int32 s) :
data(_mm_set1_epi32(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::tvec4(int32 s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_mediump>::vec(int32 s) :
data(_mm_set1_epi32(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::tvec4(int32 s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, 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>::tvec4(int64 s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_lowp>::vec(int64 s) :
data(_mm256_set1_epi64x(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_mediump>::tvec4(int64 s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_mediump>::vec(int64 s) :
data(_mm256_set1_epi64x(s))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_highp>::tvec4(int64 s) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int64, aligned_highp>::vec(int64 s) :
data(_mm256_set1_epi64x(s))
{}
# endif
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4(float a, float b, float c, float d) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4(float a, float b, float c, float d) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a))
{}
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4(float a, float b, float c, float d) :
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(float a, float b, float c, float d) :
data(_mm_set_ps(d, c, b, a))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
template<>
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_lowp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_set_epi32(d, c, b, a))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::tvec4(int32 a, int32 b, int32 c, int32 d) :
template<>
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_mediump>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_set_epi32(d, c, b, a))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
template<>
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, int32, aligned_highp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_set_epi32(d, c, b, a))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
template<>
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_lowp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4(int32 a, int32 b, int32 c, int32 d) :
template<>
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_mediump>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
{}
template <>
template <>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
template<>
template<>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD vec<4, float, aligned_highp>::vec(int32 a, int32 b, int32 c, int32 d) :
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
{}
}//namespace glm

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -33,300 +33,300 @@ namespace glm
/// High-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, highp> highp_imat2;
typedef mat<2, 2, int, highp> highp_imat2;
/// High-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, highp> highp_imat3;
typedef mat<3, 3, int, highp> highp_imat3;
/// High-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, highp> highp_imat4;
typedef mat<4, 4, int, highp> highp_imat4;
/// High-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, highp> highp_imat2x2;
typedef mat<2, 2, int, highp> highp_imat2x2;
/// High-precision signed integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<int, highp> highp_imat2x3;
typedef mat<2, 3, int, highp> highp_imat2x3;
/// High-precision signed integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<int, highp> highp_imat2x4;
typedef mat<2, 4, int, highp> highp_imat2x4;
/// High-precision signed integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<int, highp> highp_imat3x2;
typedef mat<3, 2, int, highp> highp_imat3x2;
/// High-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, highp> highp_imat3x3;
typedef mat<3, 3, int, highp> highp_imat3x3;
/// High-precision signed integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<int, highp> highp_imat3x4;
typedef mat<3, 4, int, highp> highp_imat3x4;
/// High-precision signed integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<int, highp> highp_imat4x2;
typedef mat<4, 2, int, highp> highp_imat4x2;
/// High-precision signed integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<int, highp> highp_imat4x3;
typedef mat<4, 3, int, highp> highp_imat4x3;
/// High-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, highp> highp_imat4x4;
typedef mat<4, 4, int, highp> highp_imat4x4;
/// Medium-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, mediump> mediump_imat2;
typedef mat<2, 2, int, mediump> mediump_imat2;
/// Medium-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, mediump> mediump_imat3;
typedef mat<3, 3, int, mediump> mediump_imat3;
/// Medium-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, mediump> mediump_imat4;
typedef mat<4, 4, int, mediump> mediump_imat4;
/// Medium-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, mediump> mediump_imat2x2;
typedef mat<2, 2, int, mediump> mediump_imat2x2;
/// Medium-precision signed integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<int, mediump> mediump_imat2x3;
typedef mat<2, 3, int, mediump> mediump_imat2x3;
/// Medium-precision signed integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<int, mediump> mediump_imat2x4;
typedef mat<2, 4, int, mediump> mediump_imat2x4;
/// Medium-precision signed integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<int, mediump> mediump_imat3x2;
typedef mat<3, 2, int, mediump> mediump_imat3x2;
/// Medium-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, mediump> mediump_imat3x3;
typedef mat<3, 3, int, mediump> mediump_imat3x3;
/// Medium-precision signed integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<int, mediump> mediump_imat3x4;
typedef mat<3, 4, int, mediump> mediump_imat3x4;
/// Medium-precision signed integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<int, mediump> mediump_imat4x2;
typedef mat<4, 2, int, mediump> mediump_imat4x2;
/// Medium-precision signed integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<int, mediump> mediump_imat4x3;
typedef mat<4, 3, int, mediump> mediump_imat4x3;
/// Medium-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, mediump> mediump_imat4x4;
typedef mat<4, 4, int, mediump> mediump_imat4x4;
/// Low-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, lowp> lowp_imat2;
typedef mat<2, 2, int, lowp> lowp_imat2;
/// Low-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, lowp> lowp_imat3;
typedef mat<3, 3, int, lowp> lowp_imat3;
/// Low-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, lowp> lowp_imat4;
typedef mat<4, 4, int, lowp> lowp_imat4;
/// Low-precision signed integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<int, lowp> lowp_imat2x2;
typedef mat<2, 2, int, lowp> lowp_imat2x2;
/// Low-precision signed integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<int, lowp> lowp_imat2x3;
typedef mat<2, 3, int, lowp> lowp_imat2x3;
/// Low-precision signed integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<int, lowp> lowp_imat2x4;
typedef mat<2, 4, int, lowp> lowp_imat2x4;
/// Low-precision signed integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<int, lowp> lowp_imat3x2;
typedef mat<3, 2, int, lowp> lowp_imat3x2;
/// Low-precision signed integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<int, lowp> lowp_imat3x3;
typedef mat<3, 3, int, lowp> lowp_imat3x3;
/// Low-precision signed integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<int, lowp> lowp_imat3x4;
typedef mat<3, 4, int, lowp> lowp_imat3x4;
/// Low-precision signed integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<int, lowp> lowp_imat4x2;
typedef mat<4, 2, int, lowp> lowp_imat4x2;
/// Low-precision signed integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<int, lowp> lowp_imat4x3;
typedef mat<4, 3, int, lowp> lowp_imat4x3;
/// Low-precision signed integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<int, lowp> lowp_imat4x4;
typedef mat<4, 4, int, lowp> lowp_imat4x4;
/// High-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, highp> highp_umat2;
typedef mat<2, 2, uint, highp> highp_umat2;
/// High-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, highp> highp_umat3;
typedef mat<3, 3, uint, highp> highp_umat3;
/// High-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, highp> highp_umat4;
typedef mat<4, 4, uint, highp> highp_umat4;
/// High-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, highp> highp_umat2x2;
typedef mat<2, 2, uint, highp> highp_umat2x2;
/// High-precision unsigned integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<uint, highp> highp_umat2x3;
typedef mat<2, 3, uint, highp> highp_umat2x3;
/// High-precision unsigned integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<uint, highp> highp_umat2x4;
typedef mat<2, 4, uint, highp> highp_umat2x4;
/// High-precision unsigned integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<uint, highp> highp_umat3x2;
typedef mat<3, 2, uint, highp> highp_umat3x2;
/// High-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, highp> highp_umat3x3;
typedef mat<3, 3, uint, highp> highp_umat3x3;
/// High-precision unsigned integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<uint, highp> highp_umat3x4;
typedef mat<3, 4, uint, highp> highp_umat3x4;
/// High-precision unsigned integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<uint, highp> highp_umat4x2;
typedef mat<4, 2, uint, highp> highp_umat4x2;
/// High-precision unsigned integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<uint, highp> highp_umat4x3;
typedef mat<4, 3, uint, highp> highp_umat4x3;
/// High-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, highp> highp_umat4x4;
typedef mat<4, 4, uint, highp> highp_umat4x4;
/// Medium-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, mediump> mediump_umat2;
typedef mat<2, 2, uint, mediump> mediump_umat2;
/// Medium-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, mediump> mediump_umat3;
typedef mat<3, 3, uint, mediump> mediump_umat3;
/// Medium-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, mediump> mediump_umat4;
typedef mat<4, 4, uint, mediump> mediump_umat4;
/// Medium-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, mediump> mediump_umat2x2;
typedef mat<2, 2, uint, mediump> mediump_umat2x2;
/// Medium-precision unsigned integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<uint, mediump> mediump_umat2x3;
typedef mat<2, 3, uint, mediump> mediump_umat2x3;
/// Medium-precision unsigned integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<uint, mediump> mediump_umat2x4;
typedef mat<2, 4, uint, mediump> mediump_umat2x4;
/// Medium-precision unsigned integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<uint, mediump> mediump_umat3x2;
typedef mat<3, 2, uint, mediump> mediump_umat3x2;
/// Medium-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, mediump> mediump_umat3x3;
typedef mat<3, 3, uint, mediump> mediump_umat3x3;
/// Medium-precision unsigned integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<uint, mediump> mediump_umat3x4;
typedef mat<3, 4, uint, mediump> mediump_umat3x4;
/// Medium-precision unsigned integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<uint, mediump> mediump_umat4x2;
typedef mat<4, 2, uint, mediump> mediump_umat4x2;
/// Medium-precision unsigned integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<uint, mediump> mediump_umat4x3;
typedef mat<4, 3, uint, mediump> mediump_umat4x3;
/// Medium-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, mediump> mediump_umat4x4;
typedef mat<4, 4, uint, mediump> mediump_umat4x4;
/// Low-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, lowp> lowp_umat2;
typedef mat<2, 2, uint, lowp> lowp_umat2;
/// Low-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, lowp> lowp_umat3;
typedef mat<3, 3, uint, lowp> lowp_umat3;
/// Low-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, lowp> lowp_umat4;
typedef mat<4, 4, uint, lowp> lowp_umat4;
/// Low-precision unsigned integer 2x2 matrix.
/// @see gtc_matrix_integer
typedef tmat2x2<uint, lowp> lowp_umat2x2;
typedef mat<2, 2, uint, lowp> lowp_umat2x2;
/// Low-precision unsigned integer 2x3 matrix.
/// @see gtc_matrix_integer
typedef tmat2x3<uint, lowp> lowp_umat2x3;
typedef mat<2, 3, uint, lowp> lowp_umat2x3;
/// Low-precision unsigned integer 2x4 matrix.
/// @see gtc_matrix_integer
typedef tmat2x4<uint, lowp> lowp_umat2x4;
typedef mat<2, 4, uint, lowp> lowp_umat2x4;
/// Low-precision unsigned integer 3x2 matrix.
/// @see gtc_matrix_integer
typedef tmat3x2<uint, lowp> lowp_umat3x2;
typedef mat<3, 2, uint, lowp> lowp_umat3x2;
/// Low-precision unsigned integer 3x3 matrix.
/// @see gtc_matrix_integer
typedef tmat3x3<uint, lowp> lowp_umat3x3;
typedef mat<3, 3, uint, lowp> lowp_umat3x3;
/// Low-precision unsigned integer 3x4 matrix.
/// @see gtc_matrix_integer
typedef tmat3x4<uint, lowp> lowp_umat3x4;
typedef mat<3, 4, uint, lowp> lowp_umat3x4;
/// Low-precision unsigned integer 4x2 matrix.
/// @see gtc_matrix_integer
typedef tmat4x2<uint, lowp> lowp_umat4x2;
typedef mat<4, 2, uint, lowp> lowp_umat4x2;
/// Low-precision unsigned integer 4x3 matrix.
/// @see gtc_matrix_integer
typedef tmat4x3<uint, lowp> lowp_umat4x3;
typedef mat<4, 3, uint, lowp> lowp_umat4x3;
/// Low-precision unsigned integer 4x4 matrix.
/// @see gtc_matrix_integer
typedef tmat4x4<uint, lowp> lowp_umat4x4;
typedef mat<4, 4, uint, lowp> lowp_umat4x4;
#if(defined(GLM_PRECISION_HIGHP_INT))
typedef highp_imat2 imat2;

View File

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

View File

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

View File

@@ -52,12 +52,12 @@ namespace glm
/// // m[3][0] == 1.0f, m[3][1] == 1.0f, m[3][2] == 1.0f, m[3][3] == 1.0f
/// @endcode
/// @see gtc_matrix_transform
/// @see - translate(tmat4x4<T, P> const & m, T x, T y, T z)
/// @see - translate(tvec3<T, P> const & v)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> translate(
tmat4x4<T, P> const & m,
tvec3<T, P> const & v);
/// @see - translate(mat<4, 4, T, P> const & m, T x, T y, T z)
/// @see - translate(vec<3, T, P> const & v)
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> translate(
mat<4, 4, T, P> const& m,
vec<3, T, P> const & v);
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
///
@@ -66,13 +66,13 @@ namespace glm
/// @param axis Rotation axis, recommended to be normalized.
/// @tparam T Value type used to build the matrix. Supported: half, float or double.
/// @see gtc_matrix_transform
/// @see - rotate(tmat4x4<T, P> const & m, T angle, T x, T y, T z)
/// @see - rotate(T angle, tvec3<T, P> const & v)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> rotate(
tmat4x4<T, P> const & m,
/// @see - rotate(mat<4, 4, T, P> const & m, T angle, T x, T y, T z)
/// @see - rotate(T angle, vec<3, T, P> const & v)
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> rotate(
mat<4, 4, T, P> const& m,
T angle,
tvec3<T, P> const & axis);
vec<3, T, P> const & axis);
/// Builds a scale 4 * 4 matrix created from 3 scalars.
///
@@ -80,12 +80,12 @@ namespace glm
/// @param v Ratio of scaling for each axis.
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommended), float or double.
/// @see gtc_matrix_transform
/// @see - scale(tmat4x4<T, P> const & m, T x, T y, T z)
/// @see - scale(tvec3<T, P> const & v)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> scale(
tmat4x4<T, P> const & m,
tvec3<T, P> const & v);
/// @see - scale(mat<4, 4, T, P> const & m, T x, T y, T z)
/// @see - scale(vec<3, T, P> const & v)
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> scale(
mat<4, 4, T, P> const& m,
vec<3, T, P> const & v);
/// Creates a matrix for an orthographic parallel viewing volume, using the default handedness.
///
@@ -98,8 +98,8 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> ortho(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
T left,
T right,
T bottom,
@@ -118,8 +118,8 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> orthoLH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoLH(
T left,
T right,
T bottom,
@@ -138,8 +138,8 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top)
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> orthoRH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> orthoRH(
T left,
T right,
T bottom,
@@ -156,8 +156,8 @@ namespace glm
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
/// @see - glm::ortho(T const & left, T const & right, T const & bottom, T const & top, T const & zNear, T const & zFar)
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> ortho(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> ortho(
T left,
T right,
T bottom,
@@ -173,8 +173,8 @@ namespace glm
/// @param far
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> frustum(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustum(
T left,
T right,
T bottom,
@@ -192,8 +192,8 @@ namespace glm
/// @param far
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> frustumLH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumLH(
T left,
T right,
T bottom,
@@ -211,8 +211,8 @@ namespace glm
/// @param far
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> frustumRH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> frustumRH(
T left,
T right,
T bottom,
@@ -228,8 +228,8 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspective(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspective(
T fovy,
T aspect,
T near,
@@ -243,8 +243,8 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveRH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveRH(
T fovy,
T aspect,
T near,
@@ -258,8 +258,8 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveLH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveLH(
T fovy,
T aspect,
T near,
@@ -274,8 +274,8 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveFov(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFov(
T fov,
T width,
T height,
@@ -291,8 +291,8 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveFovRH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovRH(
T fov,
T width,
T height,
@@ -308,8 +308,8 @@ namespace glm
/// @param far Specifies the distance from the viewer to the far clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> perspectiveFovLH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> perspectiveFovLH(
T fov,
T width,
T height,
@@ -323,8 +323,8 @@ namespace glm
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> infinitePerspective(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspective(
T fovy, T aspect, T near);
/// Creates a matrix for a left handed, symmetric perspective-view frustum with far plane at infinite.
@@ -334,8 +334,8 @@ namespace glm
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> infinitePerspectiveLH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveLH(
T fovy, T aspect, T near);
/// Creates a matrix for a right handed, symmetric perspective-view frustum with far plane at infinite.
@@ -345,8 +345,8 @@ namespace glm
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> infinitePerspectiveRH(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> infinitePerspectiveRH(
T fovy, T aspect, T near);
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
@@ -356,8 +356,8 @@ namespace glm
/// @param near Specifies the distance from the viewer to the near clipping plane (always positive).
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective(
T fovy, T aspect, T near);
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite for graphics hardware that doesn't support depth clamping.
@@ -368,8 +368,8 @@ namespace glm
/// @param ep
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> tweakedInfinitePerspective(
template<typename T>
GLM_FUNC_DECL mat<4, 4, T, defaultp> tweakedInfinitePerspective(
T fovy, T aspect, T near, T ep);
/// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
@@ -382,12 +382,12 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
template <typename T, typename U, precision P>
GLM_FUNC_DECL tvec3<T, P> project(
tvec3<T, P> const & obj,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
tvec4<U, P> const & viewport);
template<typename T, typename U, precision P>
GLM_FUNC_DECL vec<3, T, P> project(
vec<3, T, P> const & obj,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const & viewport);
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
///
@@ -399,12 +399,12 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
template <typename T, typename U, precision P>
GLM_FUNC_DECL tvec3<T, P> unProject(
tvec3<T, P> const & win,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
tvec4<U, P> const & viewport);
template<typename T, typename U, precision P>
GLM_FUNC_DECL vec<3, T, P> unProject(
vec<3, T, P> const & win,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const & viewport);
/// Define a picking region
///
@@ -414,11 +414,11 @@ namespace glm
/// @tparam T Native type used for the computation. Currently supported: half (not recommanded), float or double.
/// @tparam U Currently supported: Floating-point types and integer types.
/// @see gtc_matrix_transform
template <typename T, precision P, typename U>
GLM_FUNC_DECL tmat4x4<T, P> pickMatrix(
tvec2<T, P> const & center,
tvec2<T, P> const & delta,
tvec4<U, P> const & viewport);
template<typename T, precision P, typename U>
GLM_FUNC_DECL mat<4, 4, T, P> pickMatrix(
vec<2, T, P> const & center,
vec<2, T, P> const & delta,
vec<4, U, P> const & viewport);
/// Build a look at view matrix based on the default handedness.
///
@@ -427,11 +427,11 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> lookAt(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> lookAt(
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up);
/// Build a right handed look at view matrix.
///
@@ -440,11 +440,11 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> lookAtRH(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> lookAtRH(
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up);
/// Build a left handed look at view matrix.
///
@@ -453,11 +453,11 @@ namespace glm
/// @param up Normalized up vector, how the camera is oriented. Typically (0, 0, 1)
/// @see gtc_matrix_transform
/// @see - frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal) frustum(T const & left, T const & right, T const & bottom, T const & top, T const & nearVal, T const & farVal)
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> lookAtLH(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> lookAtLH(
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up);
/// @}
}//namespace glm

View File

@@ -7,25 +7,25 @@
namespace glm
{
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> translate(tmat4x4<T, P> const & m, tvec3<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> translate(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
{
tmat4x4<T, P> Result(m);
mat<4, 4, T, P> Result(m);
Result[3] = m[0] * v[0] + m[1] * v[1] + m[2] * v[2] + m[3];
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate(tmat4x4<T, P> const & m, T angle, tvec3<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v)
{
T const a = angle;
T const c = cos(a);
T const s = sin(a);
tvec3<T, P> axis(normalize(v));
tvec3<T, P> temp((T(1) - c) * axis);
vec<3, T, P> axis(normalize(v));
vec<3, T, P> temp((T(1) - c) * axis);
tmat4x4<T, P> Rotate(uninitialize);
mat<4, 4, T, P> Rotate(uninitialize);
Rotate[0][0] = c + temp[0] * axis[0];
Rotate[0][1] = temp[0] * axis[1] + s * axis[2];
Rotate[0][2] = temp[0] * axis[2] - s * axis[1];
@@ -38,7 +38,7 @@ namespace glm
Rotate[2][1] = temp[2] * axis[1] - s * axis[0];
Rotate[2][2] = c + temp[2] * axis[2];
tmat4x4<T, P> Result(uninitialize);
mat<4, 4, T, P> Result(uninitialize);
Result[0] = m[0] * Rotate[0][0] + m[1] * Rotate[0][1] + m[2] * Rotate[0][2];
Result[1] = m[0] * Rotate[1][0] + m[1] * Rotate[1][1] + m[2] * Rotate[1][2];
Result[2] = m[0] * Rotate[2][0] + m[1] * Rotate[2][1] + m[2] * Rotate[2][2];
@@ -46,15 +46,15 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> rotate_slow(tmat4x4<T, P> const & m, T angle, tvec3<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> rotate_slow(mat<4, 4, T, P> const & m, T angle, vec<3, T, P> const & v)
{
T const a = angle;
T const c = cos(a);
T const s = sin(a);
tmat4x4<T, P> Result;
mat<4, 4, T, P> Result;
tvec3<T, P> axis = normalize(v);
vec<3, T, P> axis = normalize(v);
Result[0][0] = c + (static_cast<T>(1) - c) * axis.x * axis.x;
Result[0][1] = (static_cast<T>(1) - c) * axis.x * axis.y + s * axis.z;
@@ -71,14 +71,14 @@ namespace glm
Result[2][2] = c + (static_cast<T>(1) - c) * axis.z * axis.z;
Result[2][3] = static_cast<T>(0);
Result[3] = tvec4<T, P>(0, 0, 0, 1);
Result[3] = vec<4, T, P>(0, 0, 0, 1);
return m * Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> scale(tmat4x4<T, P> const & m, tvec3<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
{
tmat4x4<T, P> Result(uninitialize);
mat<4, 4, T, P> Result(uninitialize);
Result[0] = m[0] * v[0];
Result[1] = m[1] * v[1];
Result[2] = m[2] * v[2];
@@ -86,18 +86,18 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> scale_slow(tmat4x4<T, P> const & m, tvec3<T, P> const & v)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> scale_slow(mat<4, 4, T, P> const & m, vec<3, T, P> const & v)
{
tmat4x4<T, P> Result(T(1));
mat<4, 4, T, P> Result(T(1));
Result[0][0] = v.x;
Result[1][1] = v.y;
Result[2][2] = v.z;
return m * Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> ortho
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho
(
T left, T right,
T bottom, T top,
@@ -111,15 +111,15 @@ namespace glm
# endif
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> orthoLH
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoLH
(
T left, T right,
T bottom, T top,
T zNear, T zFar
)
{
tmat4x4<T, defaultp> Result(1);
mat<4, 4, T, defaultp> Result(1);
Result[0][0] = static_cast<T>(2) / (right - left);
Result[1][1] = static_cast<T>(2) / (top - bottom);
Result[3][0] = - (right + left) / (right - left);
@@ -136,15 +136,15 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> orthoRH
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> orthoRH
(
T left, T right,
T bottom, T top,
T zNear, T zFar
)
{
tmat4x4<T, defaultp> Result(1);
mat<4, 4, T, defaultp> Result(1);
Result[0][0] = static_cast<T>(2) / (right - left);
Result[1][1] = static_cast<T>(2) / (top - bottom);
Result[3][0] = - (right + left) / (right - left);
@@ -161,14 +161,14 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> ortho
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> ortho
(
T left, T right,
T bottom, T top
)
{
tmat4x4<T, defaultp> Result(static_cast<T>(1));
mat<4, 4, T, defaultp> Result(static_cast<T>(1));
Result[0][0] = static_cast<T>(2) / (right - left);
Result[1][1] = static_cast<T>(2) / (top - bottom);
Result[2][2] = - static_cast<T>(1);
@@ -177,8 +177,8 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustum
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustum
(
T left, T right,
T bottom, T top,
@@ -192,15 +192,15 @@ namespace glm
# endif
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustumLH
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumLH
(
T left, T right,
T bottom, T top,
T nearVal, T farVal
)
{
tmat4x4<T, defaultp> Result(0);
mat<4, 4, T, defaultp> Result(0);
Result[0][0] = (static_cast<T>(2) * nearVal) / (right - left);
Result[1][1] = (static_cast<T>(2) * nearVal) / (top - bottom);
Result[2][0] = (right + left) / (right - left);
@@ -218,15 +218,15 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> frustumRH
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> frustumRH
(
T left, T right,
T bottom, T top,
T nearVal, T farVal
)
{
tmat4x4<T, defaultp> Result(0);
mat<4, 4, T, defaultp> Result(0);
Result[0][0] = (static_cast<T>(2) * nearVal) / (right - left);
Result[1][1] = (static_cast<T>(2) * nearVal) / (top - bottom);
Result[2][0] = (right + left) / (right - left);
@@ -244,8 +244,8 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspective(T fovy, T aspect, T zNear, T zFar)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return perspectiveLH(fovy, aspect, zNear, zFar);
@@ -254,14 +254,14 @@ namespace glm
# endif
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveRH(T fovy, T aspect, T zNear, T zFar)
{
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
T const tanHalfFovy = tan(fovy / static_cast<T>(2));
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = static_cast<T>(1) / (aspect * tanHalfFovy);
Result[1][1] = static_cast<T>(1) / (tanHalfFovy);
Result[2][3] = - static_cast<T>(1);
@@ -277,14 +277,14 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveLH(T fovy, T aspect, T zNear, T zFar)
{
assert(abs(aspect - std::numeric_limits<T>::epsilon()) > static_cast<T>(0));
T const tanHalfFovy = tan(fovy / static_cast<T>(2));
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = static_cast<T>(1) / (aspect * tanHalfFovy);
Result[1][1] = static_cast<T>(1) / (tanHalfFovy);
Result[2][3] = static_cast<T>(1);
@@ -300,8 +300,8 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFov(T fov, T width, T height, T zNear, T zFar)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return perspectiveFovLH(fov, width, height, zNear, zFar);
@@ -310,8 +310,8 @@ namespace glm
# endif
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovRH(T fov, T width, T height, T zNear, T zFar)
{
assert(width > static_cast<T>(0));
assert(height > static_cast<T>(0));
@@ -321,7 +321,7 @@ namespace glm
T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
T const w = h * height / width; ///todo max(width , Height) / min(width , Height)?
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = w;
Result[1][1] = h;
Result[2][3] = - static_cast<T>(1);
@@ -337,8 +337,8 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> perspectiveFovLH(T fov, T width, T height, T zNear, T zFar)
{
assert(width > static_cast<T>(0));
assert(height > static_cast<T>(0));
@@ -348,7 +348,7 @@ namespace glm
T const h = glm::cos(static_cast<T>(0.5) * rad) / glm::sin(static_cast<T>(0.5) * rad);
T const w = h * height / width; ///todo max(width , Height) / min(width , Height)?
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = w;
Result[1][1] = h;
Result[2][3] = static_cast<T>(1);
@@ -364,8 +364,8 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> infinitePerspective(T fovy, T aspect, T zNear)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspective(T fovy, T aspect, T zNear)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return infinitePerspectiveLH(fovy, aspect, zNear);
@@ -374,8 +374,8 @@ namespace glm
# endif
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveRH(T fovy, T aspect, T zNear)
{
T const range = tan(fovy / static_cast<T>(2)) * zNear;
T const left = -range * aspect;
@@ -383,7 +383,7 @@ namespace glm
T const bottom = -range;
T const top = range;
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = (static_cast<T>(2) * zNear) / (right - left);
Result[1][1] = (static_cast<T>(2) * zNear) / (top - bottom);
Result[2][2] = - static_cast<T>(1);
@@ -392,8 +392,8 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> infinitePerspectiveLH(T fovy, T aspect, T zNear)
{
T const range = tan(fovy / static_cast<T>(2)) * zNear;
T const left = -range * aspect;
@@ -401,7 +401,7 @@ namespace glm
T const bottom = -range;
T const top = range;
tmat4x4<T, defaultp> Result(T(0));
mat<4, 4, T, defaultp> Result(T(0));
Result[0][0] = (static_cast<T>(2) * zNear) / (right - left);
Result[1][1] = (static_cast<T>(2) * zNear) / (top - bottom);
Result[2][2] = static_cast<T>(1);
@@ -411,8 +411,8 @@ namespace glm
}
// Infinite projection matrix: http://www.terathon.com/gdc07_lengyel.pdf
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear, T ep)
{
T const range = tan(fovy / static_cast<T>(2)) * zNear;
T const left = -range * aspect;
@@ -420,7 +420,7 @@ namespace glm
T const bottom = -range;
T const top = range;
tmat4x4<T, defaultp> Result(static_cast<T>(0));
mat<4, 4, T, defaultp> Result(static_cast<T>(0));
Result[0][0] = (static_cast<T>(2) * zNear) / (right - left);
Result[1][1] = (static_cast<T>(2) * zNear) / (top - bottom);
Result[2][2] = ep - static_cast<T>(1);
@@ -429,22 +429,22 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> tweakedInfinitePerspective(T fovy, T aspect, T zNear)
{
return tweakedInfinitePerspective(fovy, aspect, zNear, epsilon<T>());
}
template <typename T, typename U, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> project
template<typename T, typename U, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> project
(
tvec3<T, P> const & obj,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
tvec4<U, P> const & viewport
vec<3, T, P> const & obj,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const & viewport
)
{
tvec4<T, P> tmp = tvec4<T, P>(obj, static_cast<T>(1));
vec<4, T, P> tmp = vec<4, T, P>(obj, static_cast<T>(1));
tmp = model * tmp;
tmp = proj * tmp;
@@ -458,21 +458,21 @@ namespace glm
tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]);
tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]);
return tvec3<T, P>(tmp);
return vec<3, T, P>(tmp);
}
template <typename T, typename U, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> unProject
template<typename T, typename U, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> unProject
(
tvec3<T, P> const & win,
tmat4x4<T, P> const & model,
tmat4x4<T, P> const & proj,
tvec4<U, P> const & viewport
vec<3, T, P> const & win,
mat<4, 4, T, P> const& model,
mat<4, 4, T, P> const& proj,
vec<4, U, P> const & viewport
)
{
tmat4x4<T, P> Inverse = inverse(proj * model);
mat<4, 4, T, P> Inverse = inverse(proj * model);
tvec4<T, P> tmp = tvec4<T, P>(win, T(1));
vec<4, T, P> tmp = vec<4, T, P>(win, T(1));
tmp.x = (tmp.x - T(viewport[0])) / T(viewport[2]);
tmp.y = (tmp.y - T(viewport[1])) / T(viewport[3]);
# if GLM_DEPTH_CLIP_SPACE == GLM_DEPTH_ZERO_TO_ONE
@@ -482,33 +482,33 @@ namespace glm
tmp = tmp * static_cast<T>(2) - static_cast<T>(1);
# endif
tvec4<T, P> obj = Inverse * tmp;
vec<4, T, P> obj = Inverse * tmp;
obj /= obj.w;
return tvec3<T, P>(obj);
return vec<3, T, P>(obj);
}
template <typename T, precision P, typename U>
GLM_FUNC_QUALIFIER tmat4x4<T, P> pickMatrix(tvec2<T, P> const & center, tvec2<T, P> const & delta, tvec4<U, P> const & viewport)
template<typename T, precision P, typename U>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> pickMatrix(vec<2, T, P> const & center, vec<2, T, P> const & delta, vec<4, U, P> const & viewport)
{
assert(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0));
tmat4x4<T, P> Result(static_cast<T>(1));
mat<4, 4, T, P> Result(static_cast<T>(1));
if(!(delta.x > static_cast<T>(0) && delta.y > static_cast<T>(0)))
return Result; // Error
tvec3<T, P> Temp(
vec<3, T, P> Temp(
(static_cast<T>(viewport[2]) - static_cast<T>(2) * (center.x - static_cast<T>(viewport[0]))) / delta.x,
(static_cast<T>(viewport[3]) - static_cast<T>(2) * (center.y - static_cast<T>(viewport[1]))) / delta.y,
static_cast<T>(0));
// Translate and scale the picked region to the entire window
Result = translate(Result, Temp);
return scale(Result, tvec3<T, P>(static_cast<T>(viewport[2]) / delta.x, static_cast<T>(viewport[3]) / delta.y, static_cast<T>(1)));
return scale(Result, vec<3, T, P>(static_cast<T>(viewport[2]) / delta.x, static_cast<T>(viewport[3]) / delta.y, static_cast<T>(1)));
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAt(tvec3<T, P> const & eye, tvec3<T, P> const & center, tvec3<T, P> const & up)
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAt(vec<3, T, P> const & eye, vec<3, T, P> const & center, vec<3, T, P> const & up)
{
# if GLM_COORDINATE_SYSTEM == GLM_LEFT_HANDED
return lookAtLH(eye, center, up);
@@ -517,19 +517,19 @@ namespace glm
# endif
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAtRH
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtRH
(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up
)
{
tvec3<T, P> const f(normalize(center - eye));
tvec3<T, P> const s(normalize(cross(f, up)));
tvec3<T, P> const u(cross(s, f));
vec<3, T, P> const f(normalize(center - eye));
vec<3, T, P> const s(normalize(cross(f, up)));
vec<3, T, P> const u(cross(s, f));
tmat4x4<T, P> Result(1);
mat<4, 4, T, P> Result(1);
Result[0][0] = s.x;
Result[1][0] = s.y;
Result[2][0] = s.z;
@@ -545,19 +545,19 @@ namespace glm
return Result;
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tmat4x4<T, P> lookAtLH
template<typename T, precision P>
GLM_FUNC_QUALIFIER mat<4, 4, T, P> lookAtLH
(
tvec3<T, P> const & eye,
tvec3<T, P> const & center,
tvec3<T, P> const & up
vec<3, T, P> const & eye,
vec<3, T, P> const & center,
vec<3, T, P> const & up
)
{
tvec3<T, P> const f(normalize(center - eye));
tvec3<T, P> const s(normalize(cross(up, f)));
tvec3<T, P> const u(cross(f, s));
vec<3, T, P> const f(normalize(center - eye));
vec<3, T, P> const s(normalize(cross(up, f)));
vec<3, T, P> const u(cross(f, s));
tmat4x4<T, P> Result(1);
mat<4, 4, T, P> Result(1);
Result[0][0] = s.x;
Result[1][0] = s.y;
Result[2][0] = s.z;

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -270,14 +270,14 @@ namespace detail
uint32 pack;
};
template <precision P, template <typename, precision> class vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_half
{};
template <precision P>
struct compute_half<P, tvec1>
template<precision P>
struct compute_half<1, P, vec>
{
GLM_FUNC_QUALIFIER static tvec1<uint16, P> pack(tvec1<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 tvec1<float, P> unpack(tvec1<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 tvec1<float, P>(detail::toFloat32(v.x));
return vec<1, float, P>(detail::toFloat32(v.x));
}
};
template <precision P>
struct compute_half<P, tvec2>
template<precision P>
struct compute_half<2, P, vec>
{
GLM_FUNC_QUALIFIER static tvec2<uint16, P> pack(tvec2<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<2, uint16, P> pack(vec<2, float, P> const & v)
{
tvec2<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 tvec2<float, P> unpack(tvec2<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 tvec2<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<P, tvec3>
template<precision P>
struct compute_half<3, P, vec>
{
GLM_FUNC_QUALIFIER static tvec3<uint16, P> pack(tvec3<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<3, uint16, P> pack(vec<3, float, P> const & v)
{
tvec3<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 tvec3<float, P> unpack(tvec3<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 tvec3<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<P, tvec4>
template<precision P>
struct compute_half<4, P, vec>
{
GLM_FUNC_QUALIFIER static tvec4<uint16, P> pack(tvec4<float, P> const & v)
GLM_FUNC_QUALIFIER static vec<4, uint16, P> pack(vec<4, float, P> const & v)
{
tvec4<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 tvec4<float, P> unpack(tvec4<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 tvec4<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
@@ -640,67 +640,67 @@ namespace detail
}
// Based on Brian Karis http://graphicrants.blogspot.fr/2009/04/rgbm-color-encoding.html
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> packRGBM(tvec3<T, P> const & rgb)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<4, T, P> packRGBM(vec<3, T, P> const & rgb)
{
tvec3<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 tvec4<T, P>(Color / Alpha, Alpha);
return vec<4, T, P>(Color / Alpha, Alpha);
}
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> unpackRGBM(tvec4<T, P> const & rgbm)
template<typename T, precision P>
GLM_FUNC_QUALIFIER vec<3, T, P> unpackRGBM(vec<4, T, P> const & rgbm)
{
return tvec3<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 <precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<uint16, P> packHalf(vecType<float, P> const & v)
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<L, uint16, P> packHalf(vecType<L, float, P> const & v)
{
return detail::compute_half<P, vecType>::pack(v);
return detail::compute_half<L, P, vecType>::pack(v);
}
template <precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<float, P> unpackHalf(vecType<uint16, P> const & v)
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<L, float, P> unpackHalf(vecType<L, uint16, P> const & v)
{
return detail::compute_half<P, vecType>::unpack(v);
return detail::compute_half<L, P, vecType>::unpack(v);
}
template <typename uintType, typename floatType, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<uintType, P> packUnorm(vecType<floatType, P> const & v)
template<typename uintType, length_t L, typename floatType, precision P>
GLM_FUNC_QUALIFIER vec<L, uintType, P> packUnorm(vec<L, floatType, P> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
return vecType<uintType, P>(round(clamp(v, static_cast<floatType>(0), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<uintType>::max())));
return vec<L, uintType, P>(round(clamp(v, static_cast<floatType>(0), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<uintType>::max())));
}
template <typename uintType, typename floatType, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<floatType, P> unpackUnorm(vecType<uintType, P> const & v)
template<typename floatType, length_t L, typename uintType, precision P>
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackUnorm(vec<L, uintType, P> const& v)
{
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
return vecType<float, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<uintType>::max()));
return vec<L, float, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<uintType>::max()));
}
template <typename intType, typename floatType, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<intType, P> packSnorm(vecType<floatType, P> const & v)
template<typename intType, length_t L, typename floatType, precision P>
GLM_FUNC_QUALIFIER vec<L, intType, P> packSnorm(vec<L, floatType, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
return vecType<intType, P>(round(clamp(v , static_cast<floatType>(-1), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<intType>::max())));
return vec<L, intType, P>(round(clamp(v , static_cast<floatType>(-1), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<intType>::max())));
}
template <typename intType, typename floatType, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<floatType, P> unpackSnorm(vecType<intType, P> const & v)
template<typename floatType, length_t L, typename intType, precision P>
GLM_FUNC_QUALIFIER vec<L, floatType, P> unpackSnorm(vec<L, intType, P> const & v)
{
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
return clamp(vecType<floatType, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<intType>::max())), static_cast<floatType>(-1), static_cast<floatType>(1));
return clamp(vec<L, floatType, P>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<intType>::max())), static_cast<floatType>(-1), static_cast<floatType>(1));
}
GLM_FUNC_QUALIFIER uint8 packUnorm2x4(vec2 const & v)

View File

@@ -29,7 +29,7 @@ namespace glm
/// @addtogroup gtc_quaternion
/// @{
template <typename T, precision P = defaultp>
template<typename T, precision P = defaultp>
struct tquat
{
// -- Implementation detail --
@@ -79,24 +79,24 @@ namespace glm
GLM_FUNC_DECL GLM_CONSTEXPR tquat() GLM_DEFAULT_CTOR;
GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, P> const & q) GLM_DEFAULT;
template <precision Q>
template<precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR tquat(tquat<T, Q> const & q);
// -- Explicit basic constructors --
GLM_FUNC_DECL GLM_CONSTEXPR_CTOR explicit tquat(ctor);
GLM_FUNC_DECL GLM_CONSTEXPR tquat(T const & s, tvec3<T, P> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR tquat(T const & s, vec<3, T, P> const & v);
GLM_FUNC_DECL GLM_CONSTEXPR tquat(T const & w, T const & x, T const & y, T const & z);
// -- Conversion constructors --
template <typename U, precision Q>
template<typename U, precision Q>
GLM_FUNC_DECL GLM_CONSTEXPR GLM_EXPLICIT tquat(tquat<U, Q> const & q);
/// Explicit conversion operators
# if GLM_HAS_EXPLICIT_CONVERSION_OPERATORS
GLM_FUNC_DECL explicit operator tmat3x3<T, P>();
GLM_FUNC_DECL explicit operator tmat4x4<T, P>();
GLM_FUNC_DECL explicit operator mat<3, 3, T, P>();
GLM_FUNC_DECL explicit operator mat<4, 4, T, P>();
# endif
/// Create a quaternion from two normalized axis
@@ -105,93 +105,93 @@ namespace glm
/// @param v A second normalized axis
/// @see gtc_quaternion
/// @see http://lolengine.net/blog/2013/09/18/beautiful-maths-quaternion-from-vectors
GLM_FUNC_DECL tquat(tvec3<T, P> const & u, tvec3<T, P> const & v);
GLM_FUNC_DECL tquat(vec<3, T, P> const & u, vec<3, T, P> const & v);
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
GLM_FUNC_DECL GLM_EXPLICIT tquat(tvec3<T, P> const & eulerAngles);
GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat3x3<T, P> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tquat(tmat4x4<T, P> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tquat(vec<3, T, P> const & eulerAngles);
GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<3, 3, T, P> const & m);
GLM_FUNC_DECL GLM_EXPLICIT tquat(mat<4, 4, T, P> const & m);
// -- Unary arithmetic operators --
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<T, P> const & m) GLM_DEFAULT;
template <typename U>
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator=(tquat<U, P> const & m);
template <typename U>
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator+=(tquat<U, P> const & q);
template <typename U>
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator-=(tquat<U, P> const & q);
template <typename U>
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator*=(tquat<U, P> const & q);
template <typename U>
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator*=(U s);
template <typename U>
template<typename U>
GLM_FUNC_DECL tquat<T, P> & operator/=(U s);
};
// -- Unary bit operators --
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q);
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator-(tquat<T, P> const & q);
// -- Binary operators --
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator+(tquat<T, P> const & q, tquat<T, P> const & p);
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, tquat<T, P> const & p);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tquat<T, P> const & q, tvec3<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(tquat<T, P> const & q, vec<3, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> operator*(tvec3<T, P> const & v, tquat<T, P> const & q);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> operator*(vec<3, T, P> const & v, tquat<T, P> const & q);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tquat<T, P> const & q, tvec4<T, P> const & v);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(tquat<T, P> const & q, vec<4, T, P> const & v);
template <typename T, precision P>
GLM_FUNC_DECL tvec4<T, P> operator*(tvec4<T, P> const & v, tquat<T, P> const & q);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, T, P> operator*(vec<4, T, P> const & v, tquat<T, P> const & q);
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator*(tquat<T, P> const & q, T const & s);
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator*(T const & s, tquat<T, P> const & q);
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> operator/(tquat<T, P> const & q, T const & s);
// -- Boolean operators --
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL bool operator==(tquat<T, P> const & q1, tquat<T, P> const & q2);
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL bool operator!=(tquat<T, P> const & q1, tquat<T, P> const & q2);
/// Returns the length of the quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL T length(tquat<T, P> const & q);
/// Returns the normalized quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> normalize(tquat<T, P> const & q);
/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
///
/// @see gtc_quaternion
template <typename T, precision P, template <typename, precision> class quatType>
GLM_FUNC_DECL T dot(quatType<T, P> const & x, quatType<T, P> const & y);
template<typename T, precision P>
GLM_FUNC_DECL T dot(tquat<T, P> const & x, tquat<T, P> const & y);
/// Spherical linear interpolation of two quaternions.
/// The interpolation is oriented and the rotation is performed at constant speed.
@@ -203,7 +203,7 @@ namespace glm
/// @tparam T Value type used to build the quaternion. Supported: half, float or double.
/// @see gtc_quaternion
/// @see - slerp(tquat<T, P> const & x, tquat<T, P> const & y, T const & a)
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> mix(tquat<T, P> const & x, tquat<T, P> const & y, T a);
/// Linear interpolation of two quaternions.
@@ -214,7 +214,7 @@ namespace glm
/// @param a Interpolation factor. The interpolation is defined in the range [0, 1].
/// @tparam T Value type used to build the quaternion. Supported: half, float or double.
/// @see gtc_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> lerp(tquat<T, P> const & x, tquat<T, P> const & y, T a);
/// Spherical linear interpolation of two quaternions.
@@ -225,19 +225,19 @@ namespace glm
/// @param a Interpolation factor. The interpolation is defined beyond the range [0, 1].
/// @tparam T Value type used to build the quaternion. Supported: half, float or double.
/// @see gtc_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> slerp(tquat<T, P> const & x, tquat<T, P> const & y, T a);
/// Returns the q conjugate.
///
/// @see gtc_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> conjugate(tquat<T, P> const & q);
/// Returns the q inverse.
///
/// @see gtc_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> inverse(tquat<T, P> const & q);
/// Rotates a quaternion from a vector of 3 components axis and an angle.
@@ -247,69 +247,69 @@ namespace glm
/// @param axis Axis of the rotation
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, tvec3<T, P> const & axis);
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> rotate(tquat<T, P> const & q, T const & angle, vec<3, T, P> const & axis);
/// Returns euler angles, pitch as x, yaw as y, roll as z.
/// The result is expressed in radians if GLM_FORCE_RADIANS is defined or degrees otherwise.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> eulerAngles(tquat<T, P> const & x);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> eulerAngles(tquat<T, P> const & x);
/// Returns roll value of euler angles expressed in radians.
///
/// @see gtx_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL T roll(tquat<T, P> const & x);
/// Returns pitch value of euler angles expressed in radians.
///
/// @see gtx_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL T pitch(tquat<T, P> const & x);
/// Returns yaw value of euler angles expressed in radians.
///
/// @see gtx_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL T yaw(tquat<T, P> const & x);
/// Converts a quaternion to a 3 * 3 matrix.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tmat3x3<T, P> mat3_cast(tquat<T, P> const & x);
template<typename T, precision P>
GLM_FUNC_DECL mat<3, 3, T, P> mat3_cast(tquat<T, P> const & x);
/// Converts a quaternion to a 4 * 4 matrix.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tmat4x4<T, P> mat4_cast(tquat<T, P> const & x);
template<typename T, precision P>
GLM_FUNC_DECL mat<4, 4, T, P> mat4_cast(tquat<T, P> const & x);
/// Converts a 3 * 3 matrix to a quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(tmat3x3<T, P> const & x);
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(mat<3, 3, T, P> const & x);
/// Converts a 4 * 4 matrix to a quaternion.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(tmat4x4<T, P> const & x);
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> quat_cast(mat<4, 4, T, P> const & x);
/// Returns the quaternion rotation angle.
///
/// @see gtc_quaternion
template <typename T, precision P>
template<typename T, precision P>
GLM_FUNC_DECL T angle(tquat<T, P> const & x);
/// Returns the q rotation axis.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> axis(tquat<T, P> const & x);
template<typename T, precision P>
GLM_FUNC_DECL vec<3, T, P> axis(tquat<T, P> const & x);
/// Build a quaternion from an angle and a normalized axis.
///
@@ -317,56 +317,56 @@ namespace glm
/// @param axis Axis of the quaternion, must be normalized.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tquat<T, P> angleAxis(T const & angle, tvec3<T, P> const & axis);
template<typename T, precision P>
GLM_FUNC_DECL tquat<T, P> angleAxis(T const & angle, vec<3, T, P> const & axis);
/// Returns the component-wise comparison result of x < y.
///
/// @tparam quatType Floating-point quaternion types.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> lessThan(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x <= y.
///
/// @tparam quatType Floating-point quaternion types.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> lessThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x > y.
///
/// @tparam quatType Floating-point quaternion types.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> greaterThan(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x >= y.
///
/// @tparam quatType Floating-point quaternion types.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> greaterThanEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x == y.
///
/// @tparam quatType Floating-point quaternion types.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> equal(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns the component-wise comparison of result x != y.
///
/// @tparam quatType Floating-point quaternion types.
///
/// @see gtc_quaternion
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> notEqual(tquat<T, P> const & x, tquat<T, P> const & y);
/// Returns true if x holds a NaN (not a number)
/// representation in the underlying implementation's set of
@@ -377,8 +377,8 @@ namespace glm
/// /!\ When using compiler fast math, this function may fail.
///
/// @tparam genType Floating-point scalar or vector types.
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> isnan(tquat<T, P> const & x);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> isnan(tquat<T, P> const & x);
/// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's
@@ -387,8 +387,8 @@ namespace glm
/// representations.
///
/// @tparam genType Floating-point scalar or vector types.
template <typename T, precision P>
GLM_FUNC_DECL tvec4<bool, P> isinf(tquat<T, P> const & x);
template<typename T, precision P>
GLM_FUNC_DECL vec<4, bool, P> isinf(tquat<T, P> const & x);
/// @}
} //namespace glm

View File

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

View File

@@ -7,7 +7,7 @@ namespace glm{
namespace detail
{
/*
template <precision P>
template<precision P>
struct compute_quat_mul<float, P, true>
{
static tquat<float, P> call(tquat<float, P> const& q1, tquat<float, P> const& q2)
@@ -61,8 +61,8 @@ namespace detail
};
*/
template <precision P>
struct compute_dot<tquat, float, P, true>
template<precision P>
struct compute_dot<tquat<float, P>, float, true>
{
static GLM_FUNC_QUALIFIER float call(tquat<float, P> const& x, tquat<float, P> const& y)
{
@@ -70,7 +70,7 @@ namespace detail
}
};
template <precision P>
template<precision P>
struct compute_quat_add<float, P, true>
{
static tquat<float, P> call(tquat<float, P> const& q, tquat<float, P> const& p)
@@ -82,7 +82,7 @@ namespace detail
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P>
template<precision P>
struct compute_quat_add<double, P, true>
{
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
@@ -94,19 +94,19 @@ namespace detail
};
# endif
template <precision P>
template<precision P>
struct compute_quat_sub<float, P, true>
{
static tquat<float, P> call(tquat<float, P> const& q, tquat<float, P> const& p)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_sub_ps(q.data, p.data);
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P>
template<precision P>
struct compute_quat_sub<double, P, true>
{
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
@@ -118,19 +118,19 @@ namespace detail
};
# endif
template <precision P>
template<precision P>
struct compute_quat_mul_scalar<float, P, true>
{
static tquat<float, P> call(tquat<float, P> const& q, float s)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s));
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P>
template<precision P>
struct compute_quat_mul_scalar<double, P, true>
{
static tquat<double, P> call(tquat<double, P> const& q, double s)
@@ -142,19 +142,19 @@ namespace detail
};
# endif
template <precision P>
template<precision P>
struct compute_quat_div_scalar<float, P, true>
{
static tquat<float, P> call(tquat<float, P> const& q, float s)
{
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_div_ps(q.data, _mm_set_ps1(s));
return Result;
}
};
# if GLM_ARCH & GLM_ARCH_AVX_BIT
template <precision P>
template<precision P>
struct compute_quat_div_scalar<double, P, true>
{
static tquat<double, P> call(tquat<double, P> const& q, double s)
@@ -166,10 +166,10 @@ namespace detail
};
# endif
template <precision P>
template<precision P>
struct compute_quat_mul_vec4<float, P, true>
{
static tvec4<float, P> call(tquat<float, P> const& q, tvec4<float, P> const& v)
static vec<4, float, P> call(tquat<float, P> const& q, vec<4, float, P> const& v)
{
__m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3));
__m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1));
@@ -186,7 +186,7 @@ namespace detail
uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two));
uuv = _mm_mul_ps(uuv, two);
tvec4<float, P> Result(uninitialize);
vec<4, float, P> Result(uninitialize);
Result.data = _mm_add_ps(v.Data, _mm_add_ps(uv, uuv));
return Result;
}

View File

@@ -32,7 +32,7 @@ namespace glm
/// @param Max
/// @tparam genType Value type. Currently supported: float or double scalars.
/// @see gtc_random
template <typename genTYpe>
template<typename genTYpe>
GLM_FUNC_DECL genTYpe linearRand(
genTYpe Min,
genTYpe Max);
@@ -44,17 +44,17 @@ namespace glm
/// @tparam T Value type. Currently supported: float or double.
/// @tparam vecType A vertor type: tvec1, tvec2, tvec3, tvec4 or compatible
/// @see gtc_random
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> linearRand(
vecType<T, P> const & Min,
vecType<T, P> const & Max);
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_DECL vecType<L, T, P> linearRand(
vecType<L, T, P> const& Min,
vecType<L, T, P> const& Max);
/// Generate random numbers in the interval [Min, Max], according a gaussian distribution
///
/// @param Mean
/// @param Deviation
/// @see gtc_random
template <typename genType>
template<typename genType>
GLM_FUNC_DECL genType gaussRand(
genType Mean,
genType Deviation);
@@ -63,32 +63,32 @@ namespace glm
///
/// @param Radius
/// @see gtc_random
template <typename T>
GLM_FUNC_DECL tvec2<T, defaultp> circularRand(
template<typename T>
GLM_FUNC_DECL vec<2, T, defaultp> circularRand(
T Radius);
/// Generate a random 3D vector which coordinates are regulary distributed on a sphere of a given radius
///
/// @param Radius
/// @see gtc_random
template <typename T>
GLM_FUNC_DECL tvec3<T, defaultp> sphericalRand(
template<typename T>
GLM_FUNC_DECL vec<3, T, defaultp> sphericalRand(
T Radius);
/// Generate a random 2D vector which coordinates are regulary distributed within the area of a disk of a given radius
///
/// @param Radius
/// @see gtc_random
template <typename T>
GLM_FUNC_DECL tvec2<T, defaultp> diskRand(
template<typename T>
GLM_FUNC_DECL vec<2, T, defaultp> diskRand(
T Radius);
/// Generate a random 3D vector which coordinates are regulary distributed within the volume of a ball of a given radius
///
/// @param Radius
/// @see gtc_random
template <typename T>
GLM_FUNC_DECL tvec3<T, defaultp> ballRand(
template<typename T>
GLM_FUNC_DECL vec<3, T, defaultp> ballRand(
T Radius);
/// @}

View File

@@ -10,51 +10,51 @@
namespace glm{
namespace detail
{
template <typename T, precision P, template <class, precision> class vecType>
template<length_t L, typename T, precision P, template<int, class, precision> class vecType>
struct compute_rand
{
GLM_FUNC_QUALIFIER static vecType<T, P> call();
GLM_FUNC_QUALIFIER static vecType<L, T, P> call();
};
template <precision P>
struct compute_rand<uint8, P, tvec1>
template<precision P>
struct compute_rand<1, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec1<uint8, P> call()
GLM_FUNC_QUALIFIER static vec<1, uint8, P> call()
{
return tvec1<uint8, P>(
return vec<1, uint8, P>(
std::rand() % std::numeric_limits<uint8>::max());
}
};
template <precision P>
struct compute_rand<uint8, P, tvec2>
template<precision P>
struct compute_rand<2, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec2<uint8, P> call()
GLM_FUNC_QUALIFIER static vec<2, uint8, P> call()
{
return tvec2<uint8, P>(
return vec<2, uint8, P>(
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max());
}
};
template <precision P>
struct compute_rand<uint8, P, tvec3>
template<precision P>
struct compute_rand<3, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec3<uint8, P> call()
GLM_FUNC_QUALIFIER static vec<3, uint8, P> call()
{
return tvec3<uint8, P>(
return vec<3, uint8, P>(
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max());
}
};
template <precision P>
struct compute_rand<uint8, P, tvec4>
template<precision P>
struct compute_rand<4, uint8, P, vec>
{
GLM_FUNC_QUALIFIER static tvec4<uint8, P> call()
GLM_FUNC_QUALIFIER static vec<4, uint8, P> call()
{
return tvec4<uint8, P>(
return vec<4, uint8, P>(
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max(),
std::rand() % std::numeric_limits<uint8>::max(),
@@ -62,214 +62,214 @@ namespace detail
}
};
template <precision P, template <class, precision> class vecType>
struct compute_rand<uint16, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_rand<L, uint16, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<uint16, P> call()
GLM_FUNC_QUALIFIER static vecType<L, uint16, P> call()
{
return
(vecType<uint16, P>(compute_rand<uint8, P, vecType>::call()) << static_cast<uint16>(8)) |
(vecType<uint16, P>(compute_rand<uint8, P, vecType>::call()) << static_cast<uint16>(0));
(vecType<L, uint16, P>(compute_rand<L, uint8, P, vecType>::call()) << static_cast<uint16>(8)) |
(vecType<L, uint16, P>(compute_rand<L, uint8, P, vecType>::call()) << static_cast<uint16>(0));
}
};
template <precision P, template <class, precision> class vecType>
struct compute_rand<uint32, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_rand<L, uint32, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<uint32, P> call()
GLM_FUNC_QUALIFIER static vecType<L, uint32, P> call()
{
return
(vecType<uint32, P>(compute_rand<uint16, P, vecType>::call()) << static_cast<uint32>(16)) |
(vecType<uint32, P>(compute_rand<uint16, P, vecType>::call()) << static_cast<uint32>(0));
(vecType<L, uint32, P>(compute_rand<L, uint16, P, vecType>::call()) << static_cast<uint32>(16)) |
(vecType<L, uint32, P>(compute_rand<L, uint16, P, vecType>::call()) << static_cast<uint32>(0));
}
};
template <precision P, template <class, precision> class vecType>
struct compute_rand<uint64, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_rand<L, uint64, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<uint64, P> call()
GLM_FUNC_QUALIFIER static vecType<L, uint64, P> call()
{
return
(vecType<uint64, P>(compute_rand<uint32, P, vecType>::call()) << static_cast<uint64>(32)) |
(vecType<uint64, P>(compute_rand<uint32, P, vecType>::call()) << static_cast<uint64>(0));
(vecType<L, uint64, P>(compute_rand<L, uint32, P, vecType>::call()) << static_cast<uint64>(32)) |
(vecType<L, uint64, P>(compute_rand<L, uint32, P, vecType>::call()) << static_cast<uint64>(0));
}
};
template <typename T, precision P, template <class, precision> class vecType>
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand
{
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & Min, vecType<T, P> const & Max);
GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & Min, vecType<L, T, P> const & Max);
};
template <precision P, template <class, precision> class vecType>
struct compute_linearRand<int8, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, int8, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<int8, P> call(vecType<int8, P> const & Min, vecType<int8, P> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, int8, P> call(vecType<L, int8, P> const & Min, vecType<L, int8, P> const & Max)
{
return (vecType<int8, P>(compute_rand<uint8, P, vecType>::call() % vecType<uint8, P>(Max + static_cast<int8>(1) - Min))) + Min;
return (vecType<L, int8, P>(compute_rand<L, uint8, P, vecType>::call() % vecType<L, uint8, P>(Max + static_cast<int8>(1) - Min))) + Min;
}
};
template <precision P, template <class, precision> class vecType>
struct compute_linearRand<uint8, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, uint8, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<uint8, P> call(vecType<uint8, P> const & Min, vecType<uint8, P> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, uint8, P> call(vecType<L, uint8, P> const & Min, vecType<L, uint8, P> const & Max)
{
return (compute_rand<uint8, P, vecType>::call() % (Max + static_cast<uint8>(1) - Min)) + Min;
return (compute_rand<L, uint8, P, vecType>::call() % (Max + static_cast<uint8>(1) - Min)) + Min;
}
};
template <precision P, template <class, precision> class vecType>
struct compute_linearRand<int16, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, int16, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<int16, P> call(vecType<int16, P> const & Min, vecType<int16, P> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, int16, P> call(vecType<L, int16, P> const & Min, vecType<L, int16, P> const & Max)
{
return (vecType<int16, P>(compute_rand<uint16, P, vecType>::call() % vecType<uint16, P>(Max + static_cast<int16>(1) - Min))) + Min;
return (vecType<L, int16, P>(compute_rand<L, uint16, P, vecType>::call() % vecType<L, uint16, P>(Max + static_cast<int16>(1) - Min))) + Min;
}
};
template <precision P, template <class, precision> class vecType>
struct compute_linearRand<uint16, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, uint16, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<uint16, P> call(vecType<uint16, P> const & Min, vecType<uint16, P> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, uint16, P> call(vecType<L, uint16, P> const & Min, vecType<L, uint16, P> const & Max)
{
return (compute_rand<uint16, P, vecType>::call() % (Max + static_cast<uint16>(1) - Min)) + Min;
return (compute_rand<L, uint16, P, vecType>::call() % (Max + static_cast<uint16>(1) - Min)) + Min;
}
};
template <precision P, template <class, precision> class vecType>
struct compute_linearRand<int32, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, int32, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<int32, P> call(vecType<int32, P> const & Min, vecType<int32, P> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, int32, P> call(vecType<L, int32, P> const & Min, vecType<L, int32, P> const & Max)
{
return (vecType<int32, P>(compute_rand<uint32, P, vecType>::call() % vecType<uint32, P>(Max + static_cast<int32>(1) - Min))) + Min;
return (vecType<L, int32, P>(compute_rand<L, uint32, P, vecType>::call() % vecType<L, uint32, P>(Max + static_cast<int32>(1) - Min))) + Min;
}
};
template <precision P, template <class, precision> class vecType>
struct compute_linearRand<uint32, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, uint32, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<uint32, P> call(vecType<uint32, P> const & Min, vecType<uint32, P> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, uint32, P> call(vecType<L, uint32, P> const & Min, vecType<L, uint32, P> const & Max)
{
return (compute_rand<uint32, P, vecType>::call() % (Max + static_cast<uint32>(1) - Min)) + Min;
return (compute_rand<L, uint32, P, vecType>::call() % (Max + static_cast<uint32>(1) - Min)) + Min;
}
};
template <precision P, template <class, precision> class vecType>
struct compute_linearRand<int64, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, int64, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<int64, P> call(vecType<int64, P> const & Min, vecType<int64, P> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, int64, P> call(vecType<L, int64, P> const & Min, vecType<L, int64, P> const & Max)
{
return (vecType<int64, P>(compute_rand<uint64, P, vecType>::call() % vecType<uint64, P>(Max + static_cast<int64>(1) - Min))) + Min;
return (vecType<L, int64, P>(compute_rand<L, uint64, P, vecType>::call() % vecType<L, uint64, P>(Max + static_cast<int64>(1) - Min))) + Min;
}
};
template <precision P, template <class, precision> class vecType>
struct compute_linearRand<uint64, P, vecType>
template<length_t L, precision P, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, uint64, P, vecType>
{
GLM_FUNC_QUALIFIER static vecType<uint64, P> call(vecType<uint64, P> const & Min, vecType<uint64, P> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, uint64, P> call(vecType<L, uint64, P> const & Min, vecType<L, uint64, P> const & Max)
{
return (compute_rand<uint64, P, vecType>::call() % (Max + static_cast<uint64>(1) - Min)) + Min;
return (compute_rand<L, uint64, P, vecType>::call() % (Max + static_cast<uint64>(1) - Min)) + Min;
}
};
template <template <class, precision> class vecType>
struct compute_linearRand<float, lowp, vecType>
template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, float, lowp, vecType>
{
GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & Min, vecType<float, lowp> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, float, lowp> call(vecType<L, float, lowp> const & Min, vecType<L, float, lowp> const & Max)
{
return vecType<float, lowp>(compute_rand<uint8, lowp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint8>::max()) * (Max - Min) + Min;
return vecType<L, float, lowp>(compute_rand<L, uint8, lowp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint8>::max()) * (Max - Min) + Min;
}
};
template <template <class, precision> class vecType>
struct compute_linearRand<float, mediump, vecType>
template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, float, mediump, vecType>
{
GLM_FUNC_QUALIFIER static vecType<float, mediump> call(vecType<float, mediump> const & Min, vecType<float, mediump> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, float, mediump> call(vecType<L, float, mediump> const & Min, vecType<L, float, mediump> const & Max)
{
return vecType<float, mediump>(compute_rand<uint16, mediump, vecType>::call()) / static_cast<float>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min;
return vecType<L, float, mediump>(compute_rand<L, uint16, mediump, vecType>::call()) / static_cast<float>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min;
}
};
template <template <class, precision> class vecType>
struct compute_linearRand<float, highp, vecType>
template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, float, highp, vecType>
{
GLM_FUNC_QUALIFIER static vecType<float, highp> call(vecType<float, highp> const & Min, vecType<float, highp> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, float, highp> call(vecType<L, float, highp> const & Min, vecType<L, float, highp> const & Max)
{
return vecType<float, highp>(compute_rand<uint32, highp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
return vecType<L, float, highp>(compute_rand<L, uint32, highp, vecType>::call()) / static_cast<float>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
}
};
template <template <class, precision> class vecType>
struct compute_linearRand<double, lowp, vecType>
template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, double, lowp, vecType>
{
GLM_FUNC_QUALIFIER static vecType<double, lowp> call(vecType<double, lowp> const & Min, vecType<double, lowp> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, double, lowp> call(vecType<L, double, lowp> const & Min, vecType<L, double, lowp> const & Max)
{
return vecType<double, lowp>(compute_rand<uint16, lowp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min;
return vecType<L, double, lowp>(compute_rand<L, uint16, lowp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint16>::max()) * (Max - Min) + Min;
}
};
template <template <class, precision> class vecType>
struct compute_linearRand<double, mediump, vecType>
template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, double, mediump, vecType>
{
GLM_FUNC_QUALIFIER static vecType<double, mediump> call(vecType<double, mediump> const & Min, vecType<double, mediump> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, double, mediump> call(vecType<L, double, mediump> const & Min, vecType<L, double, mediump> const & Max)
{
return vecType<double, mediump>(compute_rand<uint32, mediump, vecType>::call()) / static_cast<double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
return vecType<L, double, mediump>(compute_rand<L, uint32, mediump, vecType>::call()) / static_cast<double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
}
};
template <template <class, precision> class vecType>
struct compute_linearRand<double, highp, vecType>
template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, double, highp, vecType>
{
GLM_FUNC_QUALIFIER static vecType<double, highp> call(vecType<double, highp> const & Min, vecType<double, highp> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, double, highp> call(vecType<L, double, highp> const & Min, vecType<L, double, highp> const & Max)
{
return vecType<double, highp>(compute_rand<uint64, highp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
return vecType<L, double, highp>(compute_rand<L, uint64, highp, vecType>::call()) / static_cast<double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
}
};
template <template <class, precision> class vecType>
struct compute_linearRand<long double, lowp, vecType>
template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, long double, lowp, vecType>
{
GLM_FUNC_QUALIFIER static vecType<long double, lowp> call(vecType<long double, lowp> const & Min, vecType<long double, lowp> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, long double, lowp> call(vecType<L, long double, lowp> const & Min, vecType<L, long double, lowp> const & Max)
{
return vecType<long double, lowp>(compute_rand<uint32, lowp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
return vecType<L, long double, lowp>(compute_rand<L, uint32, lowp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint32>::max()) * (Max - Min) + Min;
}
};
template <template <class, precision> class vecType>
struct compute_linearRand<long double, mediump, vecType>
template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, long double, mediump, vecType>
{
GLM_FUNC_QUALIFIER static vecType<long double, mediump> call(vecType<long double, mediump> const & Min, vecType<long double, mediump> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, long double, mediump> call(vecType<L, long double, mediump> const & Min, vecType<L, long double, mediump> const & Max)
{
return vecType<long double, mediump>(compute_rand<uint64, mediump, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
return vecType<L, long double, mediump>(compute_rand<L, uint64, mediump, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
}
};
template <template <class, precision> class vecType>
struct compute_linearRand<long double, highp, vecType>
template<length_t L, template<length_t, typename, precision> class vecType>
struct compute_linearRand<L, long double, highp, vecType>
{
GLM_FUNC_QUALIFIER static vecType<long double, highp> call(vecType<long double, highp> const & Min, vecType<long double, highp> const & Max)
GLM_FUNC_QUALIFIER static vecType<L, long double, highp> call(vecType<L, long double, highp> const & Min, vecType<L, long double, highp> const & Max)
{
return vecType<long double, highp>(compute_rand<uint64, highp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
return vecType<L, long double, highp>(compute_rand<L, uint64, highp, vecType>::call()) / static_cast<long double>(std::numeric_limits<uint64>::max()) * (Max - Min) + Min;
}
};
}//namespace detail
template <typename genType>
template<typename genType>
GLM_FUNC_QUALIFIER genType linearRand(genType Min, genType Max)
{
return detail::compute_linearRand<genType, highp, tvec1>::call(
tvec1<genType, highp>(Min),
tvec1<genType, highp>(Max)).x;
return detail::compute_linearRand<1, genType, highp, vec>::call(
vec<1, genType, highp>(Min),
vec<1, genType, highp>(Max)).x;
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> linearRand(vecType<T, P> const & Min, vecType<T, P> const & Max)
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<L, T, P> linearRand(vecType<L, T, P> const & Min, vecType<L, T, P> const & Max)
{
return detail::compute_linearRand<T, P, vecType>::call(Min, Max);
return detail::compute_linearRand<L, T, P, vecType>::call(Min, Max);
}
template <typename genType>
template<typename genType>
GLM_FUNC_QUALIFIER genType gaussRand(genType Mean, genType Deviation)
{
genType w, x1, x2;
@@ -285,23 +285,23 @@ namespace detail
return x2 * Deviation * Deviation * sqrt((genType(-2) * log(w)) / w) + Mean;
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> gaussRand(vecType<T, P> const & Mean, vecType<T, P> const & Deviation)
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<L, T, P> gaussRand(vecType<L, T, P> const & Mean, vecType<L, T, P> const & Deviation)
{
return detail::functor2<T, P, vecType>::call(gaussRand, Mean, Deviation);
return detail::functor2<L, T, P>::call(gaussRand, Mean, Deviation);
}
template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> diskRand(T Radius)
template<typename T>
GLM_FUNC_QUALIFIER vec<2, T, defaultp> diskRand(T Radius)
{
tvec2<T, defaultp> Result(T(0));
vec<2, T, defaultp> Result(T(0));
T LenRadius(T(0));
do
{
Result = linearRand(
tvec2<T, defaultp>(-Radius),
tvec2<T, defaultp>(Radius));
vec<2, T, defaultp>(-Radius),
vec<2, T, defaultp>(Radius));
LenRadius = length(Result);
}
while(LenRadius > Radius);
@@ -309,17 +309,17 @@ namespace detail
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> ballRand(T Radius)
template<typename T>
GLM_FUNC_QUALIFIER vec<3, T, defaultp> ballRand(T Radius)
{
tvec3<T, defaultp> Result(T(0));
vec<3, T, defaultp> Result(T(0));
T LenRadius(T(0));
do
{
Result = linearRand(
tvec3<T, defaultp>(-Radius),
tvec3<T, defaultp>(Radius));
vec<3, T, defaultp>(-Radius),
vec<3, T, defaultp>(Radius));
LenRadius = length(Result);
}
while(LenRadius > Radius);
@@ -327,15 +327,15 @@ namespace detail
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> circularRand(T Radius)
template<typename T>
GLM_FUNC_QUALIFIER vec<2, T, defaultp> circularRand(T Radius)
{
T a = linearRand(T(0), T(6.283185307179586476925286766559f));
return tvec2<T, defaultp>(cos(a), sin(a)) * Radius;
return vec<2, T, defaultp>(cos(a), sin(a)) * Radius;
}
template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> sphericalRand(T Radius)
template<typename T>
GLM_FUNC_QUALIFIER vec<3, T, defaultp> sphericalRand(T Radius)
{
T z = linearRand(T(-1), T(1));
T a = linearRand(T(0), T(6.283185307179586476925286766559f));
@@ -345,6 +345,6 @@ namespace detail
T x = r * cos(a);
T y = r * sin(a);
return tvec3<T, defaultp>(x, y, z) * Radius;
return vec<3, T, defaultp>(x, y, z) * Radius;
}
}//namespace glm

View File

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

View File

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

View File

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

View File

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

View File

@@ -25,214 +25,210 @@
namespace glm
{
template <typename T, precision P> struct tvec1;
template <typename T, precision P> struct tvec2;
template <typename T, precision P> struct tvec3;
template <typename T, precision P> struct tvec4;
/// @addtogroup gtc_type_aligned
/// @{
// -- *vec1 --
typedef tvec1<float, aligned_highp> aligned_highp_vec1;
typedef tvec1<float, aligned_mediump> aligned_mediump_vec1;
typedef tvec1<float, aligned_lowp> aligned_lowp_vec1;
typedef tvec1<double, aligned_highp> aligned_highp_dvec1;
typedef tvec1<double, aligned_mediump> aligned_mediump_dvec1;
typedef tvec1<double, aligned_lowp> aligned_lowp_dvec1;
typedef tvec1<int, aligned_highp> aligned_highp_ivec1;
typedef tvec1<int, aligned_mediump> aligned_mediump_ivec1;
typedef tvec1<int, aligned_lowp> aligned_lowp_ivec1;
typedef tvec1<uint, aligned_highp> aligned_highp_uvec1;
typedef tvec1<uint, aligned_mediump> aligned_mediump_uvec1;
typedef tvec1<uint, aligned_lowp> aligned_lowp_uvec1;
typedef tvec1<bool, aligned_highp> aligned_highp_bvec1;
typedef tvec1<bool, aligned_mediump> aligned_mediump_bvec1;
typedef tvec1<bool, aligned_lowp> aligned_lowp_bvec1;
typedef vec<1, float, aligned_highp> aligned_highp_vec1;
typedef vec<1, float, aligned_mediump> aligned_mediump_vec1;
typedef vec<1, float, aligned_lowp> aligned_lowp_vec1;
typedef vec<1, double, aligned_highp> aligned_highp_dvec1;
typedef vec<1, double, aligned_mediump> aligned_mediump_dvec1;
typedef vec<1, double, aligned_lowp> aligned_lowp_dvec1;
typedef vec<1, int, aligned_highp> aligned_highp_ivec1;
typedef vec<1, int, aligned_mediump> aligned_mediump_ivec1;
typedef vec<1, int, aligned_lowp> aligned_lowp_ivec1;
typedef vec<1, uint, aligned_highp> aligned_highp_uvec1;
typedef vec<1, uint, aligned_mediump> aligned_mediump_uvec1;
typedef vec<1, uint, aligned_lowp> aligned_lowp_uvec1;
typedef vec<1, bool, aligned_highp> aligned_highp_bvec1;
typedef vec<1, bool, aligned_mediump> aligned_mediump_bvec1;
typedef vec<1, bool, aligned_lowp> aligned_lowp_bvec1;
typedef tvec1<float, packed_highp> packed_highp_vec1;
typedef tvec1<float, packed_mediump> packed_mediump_vec1;
typedef tvec1<float, packed_lowp> packed_lowp_vec1;
typedef tvec1<double, packed_highp> packed_highp_dvec1;
typedef tvec1<double, packed_mediump> packed_mediump_dvec1;
typedef tvec1<double, packed_lowp> packed_lowp_dvec1;
typedef tvec1<int, packed_highp> packed_highp_ivec1;
typedef tvec1<int, packed_mediump> packed_mediump_ivec1;
typedef tvec1<int, packed_lowp> packed_lowp_ivec1;
typedef tvec1<uint, packed_highp> packed_highp_uvec1;
typedef tvec1<uint, packed_mediump> packed_mediump_uvec1;
typedef tvec1<uint, packed_lowp> packed_lowp_uvec1;
typedef tvec1<bool, packed_highp> packed_highp_bvec1;
typedef tvec1<bool, packed_mediump> packed_mediump_bvec1;
typedef tvec1<bool, packed_lowp> packed_lowp_bvec1;
typedef vec<1, float, packed_highp> packed_highp_vec1;
typedef vec<1, float, packed_mediump> packed_mediump_vec1;
typedef vec<1, float, packed_lowp> packed_lowp_vec1;
typedef vec<1, double, packed_highp> packed_highp_dvec1;
typedef vec<1, double, packed_mediump> packed_mediump_dvec1;
typedef vec<1, double, packed_lowp> packed_lowp_dvec1;
typedef vec<1, int, packed_highp> packed_highp_ivec1;
typedef vec<1, int, packed_mediump> packed_mediump_ivec1;
typedef vec<1, int, packed_lowp> packed_lowp_ivec1;
typedef vec<1, uint, packed_highp> packed_highp_uvec1;
typedef vec<1, uint, packed_mediump> packed_mediump_uvec1;
typedef vec<1, uint, packed_lowp> packed_lowp_uvec1;
typedef vec<1, bool, packed_highp> packed_highp_bvec1;
typedef vec<1, bool, packed_mediump> packed_mediump_bvec1;
typedef vec<1, bool, packed_lowp> packed_lowp_bvec1;
// -- *vec2 --
/// 2 components vector of high single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<float, aligned_highp> aligned_highp_vec2;
typedef vec<2, float, aligned_highp> aligned_highp_vec2;
/// 2 components vector of medium single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<float, aligned_mediump> aligned_mediump_vec2;
typedef vec<2, float, aligned_mediump> aligned_mediump_vec2;
/// 2 components vector of low single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<float, aligned_lowp> aligned_lowp_vec2;
typedef vec<2, float, aligned_lowp> aligned_lowp_vec2;
/// 2 components vector of high double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<double, aligned_highp> aligned_highp_dvec2;
typedef vec<2, double, aligned_highp> aligned_highp_dvec2;
/// 2 components vector of medium double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<double, aligned_mediump> aligned_mediump_dvec2;
typedef vec<2, double, aligned_mediump> aligned_mediump_dvec2;
/// 2 components vector of low double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<double, aligned_lowp> aligned_lowp_dvec2;
typedef vec<2, double, aligned_lowp> aligned_lowp_dvec2;
/// 2 components vector of high precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<int, aligned_highp> aligned_highp_ivec2;
typedef vec<2, int, aligned_highp> aligned_highp_ivec2;
/// 2 components vector of medium precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<int, aligned_mediump> aligned_mediump_ivec2;
typedef vec<2, int, aligned_mediump> aligned_mediump_ivec2;
/// 2 components vector of low precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<int, aligned_lowp> aligned_lowp_ivec2;
typedef vec<2, int, aligned_lowp> aligned_lowp_ivec2;
/// 2 components vector of high precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<uint, aligned_highp> aligned_highp_uvec2;
typedef vec<2, uint, aligned_highp> aligned_highp_uvec2;
/// 2 components vector of medium precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<uint, aligned_mediump> aligned_mediump_uvec2;
typedef vec<2, uint, aligned_mediump> aligned_mediump_uvec2;
/// 2 components vector of low precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<uint, aligned_lowp> aligned_lowp_uvec2;
typedef vec<2, uint, aligned_lowp> aligned_lowp_uvec2;
/// 2 components vector of high precision bool numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<bool, aligned_highp> aligned_highp_bvec2;
typedef vec<2, bool, aligned_highp> aligned_highp_bvec2;
/// 2 components vector of medium precision bool numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<bool, aligned_mediump> aligned_mediump_bvec2;
typedef vec<2, bool, aligned_mediump> aligned_mediump_bvec2;
/// 2 components vector of low precision bool numbers.
/// There is no guarantee on the actual precision.
typedef tvec2<bool, aligned_lowp> aligned_lowp_bvec2;
typedef vec<2, bool, aligned_lowp> aligned_lowp_bvec2;
// -- *vec3 --
/// 3 components vector of high single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<float, aligned_highp> aligned_highp_vec3;
typedef vec<3, float, aligned_highp> aligned_highp_vec3;
/// 3 components vector of medium single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<float, aligned_mediump> aligned_mediump_vec3;
typedef vec<3, float, aligned_mediump> aligned_mediump_vec3;
/// 3 components vector of low single-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<float, aligned_lowp> aligned_lowp_vec3;
typedef vec<3, float, aligned_lowp> aligned_lowp_vec3;
/// 3 components vector of high double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<double, aligned_highp> aligned_highp_dvec3;
typedef vec<3, double, aligned_highp> aligned_highp_dvec3;
/// 3 components vector of medium double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<double, aligned_mediump> aligned_mediump_dvec3;
typedef vec<3, double, aligned_mediump> aligned_mediump_dvec3;
/// 3 components vector of low double-precision floating-point numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<double, aligned_lowp> aligned_lowp_dvec3;
typedef vec<3, double, aligned_lowp> aligned_lowp_dvec3;
/// 3 components vector of high precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<int, aligned_highp> aligned_highp_ivec3;
typedef vec<3, int, aligned_highp> aligned_highp_ivec3;
/// 3 components vector of medium precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<int, aligned_mediump> aligned_mediump_ivec3;
typedef vec<3, int, aligned_mediump> aligned_mediump_ivec3;
/// 3 components vector of low precision signed integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<int, aligned_lowp> aligned_lowp_ivec3;
typedef vec<3, int, aligned_lowp> aligned_lowp_ivec3;
/// 3 components vector of high precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<uint, aligned_highp> aligned_highp_uvec3;
typedef vec<3, uint, aligned_highp> aligned_highp_uvec3;
/// 3 components vector of medium precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<uint, aligned_mediump> aligned_mediump_uvec3;
typedef vec<3, uint, aligned_mediump> aligned_mediump_uvec3;
/// 3 components vector of low precision unsigned integer numbers.
/// There is no guarantee on the actual precision.
typedef tvec3<uint, aligned_lowp> aligned_lowp_uvec3;
typedef vec<3, uint, aligned_lowp> aligned_lowp_uvec3;
/// 3 components vector of high precision bool numbers.
typedef tvec3<bool, aligned_highp> aligned_highp_bvec3;
typedef vec<3, bool, aligned_highp> aligned_highp_bvec3;
/// 3 components vector of medium precision bool numbers.
typedef tvec3<bool, aligned_mediump> aligned_mediump_bvec3;
typedef vec<3, bool, aligned_mediump> aligned_mediump_bvec3;
/// 3 components vector of low precision bool numbers.
typedef tvec3<bool, aligned_lowp> aligned_lowp_bvec3;
typedef vec<3, bool, aligned_lowp> aligned_lowp_bvec3;
// -- *vec4 --
/// 4 components vector of high single-precision floating-point numbers.
typedef tvec4<float, aligned_highp> aligned_highp_vec4;
typedef vec<4, float, aligned_highp> aligned_highp_vec4;
/// 4 components vector of medium single-precision floating-point numbers.
typedef tvec4<float, aligned_mediump> aligned_mediump_vec4;
typedef vec<4, float, aligned_mediump> aligned_mediump_vec4;
/// 4 components vector of low single-precision floating-point numbers.
typedef tvec4<float, aligned_lowp> aligned_lowp_vec4;
typedef vec<4, float, aligned_lowp> aligned_lowp_vec4;
/// 4 components vector of high double-precision floating-point numbers.
typedef tvec4<double, aligned_highp> aligned_highp_dvec4;
typedef vec<4, double, aligned_highp> aligned_highp_dvec4;
/// 4 components vector of medium double-precision floating-point numbers.
typedef tvec4<double, aligned_mediump> aligned_mediump_dvec4;
typedef vec<4, double, aligned_mediump> aligned_mediump_dvec4;
/// 4 components vector of low double-precision floating-point numbers.
typedef tvec4<double, aligned_lowp> aligned_lowp_dvec4;
typedef vec<4, double, aligned_lowp> aligned_lowp_dvec4;
/// 4 components vector of high precision signed integer numbers.
typedef tvec4<int, aligned_highp> aligned_highp_ivec4;
typedef vec<4, int, aligned_highp> aligned_highp_ivec4;
/// 4 components vector of medium precision signed integer numbers.
typedef tvec4<int, aligned_mediump> aligned_mediump_ivec4;
typedef vec<4, int, aligned_mediump> aligned_mediump_ivec4;
/// 4 components vector of low precision signed integer numbers.
typedef tvec4<int, aligned_lowp> aligned_lowp_ivec4;
typedef vec<4, int, aligned_lowp> aligned_lowp_ivec4;
/// 4 components vector of high precision unsigned integer numbers.
typedef tvec4<uint, aligned_highp> aligned_highp_uvec4;
typedef vec<4, uint, aligned_highp> aligned_highp_uvec4;
/// 4 components vector of medium precision unsigned integer numbers.
typedef tvec4<uint, aligned_mediump> aligned_mediump_uvec4;
typedef vec<4, uint, aligned_mediump> aligned_mediump_uvec4;
/// 4 components vector of low precision unsigned integer numbers.
typedef tvec4<uint, aligned_lowp> aligned_lowp_uvec4;
typedef vec<4, uint, aligned_lowp> aligned_lowp_uvec4;
/// 4 components vector of high precision bool numbers.
typedef tvec4<bool, aligned_highp> aligned_highp_bvec4;
typedef vec<4, bool, aligned_highp> aligned_highp_bvec4;
/// 4 components vector of medium precision bool numbers.
typedef tvec4<bool, aligned_mediump> aligned_mediump_bvec4;
typedef vec<4, bool, aligned_mediump> aligned_mediump_bvec4;
/// 4 components vector of low precision bool numbers.
typedef tvec4<bool, aligned_lowp> aligned_lowp_bvec4;
typedef vec<4, bool, aligned_lowp> aligned_lowp_bvec4;
// -- default --

View File

@@ -247,70 +247,70 @@ namespace glm
/// 8 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i8, defaultp> i8vec1;
typedef vec<1, i8, defaultp> i8vec1;
/// 8 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i8, defaultp> i8vec2;
typedef vec<2, i8, defaultp> i8vec2;
/// 8 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i8, defaultp> i8vec3;
typedef vec<3, i8, defaultp> i8vec3;
/// 8 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i8, defaultp> i8vec4;
typedef vec<4, i8, defaultp> i8vec4;
/// 16 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i16, defaultp> i16vec1;
typedef vec<1, i16, defaultp> i16vec1;
/// 16 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i16, defaultp> i16vec2;
typedef vec<2, i16, defaultp> i16vec2;
/// 16 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i16, defaultp> i16vec3;
typedef vec<3, i16, defaultp> i16vec3;
/// 16 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i16, defaultp> i16vec4;
typedef vec<4, i16, defaultp> i16vec4;
/// 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i32, defaultp> i32vec1;
typedef vec<1, i32, defaultp> i32vec1;
/// 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i32, defaultp> i32vec2;
typedef vec<2, i32, defaultp> i32vec2;
/// 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i32, defaultp> i32vec3;
typedef vec<3, i32, defaultp> i32vec3;
/// 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i32, defaultp> i32vec4;
typedef vec<4, i32, defaultp> i32vec4;
/// 64 bit signed integer scalar type.
/// @see gtc_type_precision
typedef tvec1<i64, defaultp> i64vec1;
typedef vec<1, i64, defaultp> i64vec1;
/// 64 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<i64, defaultp> i64vec2;
typedef vec<2, i64, defaultp> i64vec2;
/// 64 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<i64, defaultp> i64vec3;
typedef vec<3, i64, defaultp> i64vec3;
/// 64 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<i64, defaultp> i64vec4;
typedef vec<4, i64, defaultp> i64vec4;
/////////////////////////////
@@ -519,70 +519,70 @@ namespace glm
/// Default precision 8 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u8, defaultp> u8vec1;
typedef vec<1, u8, defaultp> u8vec1;
/// Default precision 8 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u8, defaultp> u8vec2;
typedef vec<2, u8, defaultp> u8vec2;
/// Default precision 8 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u8, defaultp> u8vec3;
typedef vec<3, u8, defaultp> u8vec3;
/// Default precision 8 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u8, defaultp> u8vec4;
typedef vec<4, u8, defaultp> u8vec4;
/// Default precision 16 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u16, defaultp> u16vec1;
typedef vec<1, u16, defaultp> u16vec1;
/// Default precision 16 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u16, defaultp> u16vec2;
typedef vec<2, u16, defaultp> u16vec2;
/// Default precision 16 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u16, defaultp> u16vec3;
typedef vec<3, u16, defaultp> u16vec3;
/// Default precision 16 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u16, defaultp> u16vec4;
typedef vec<4, u16, defaultp> u16vec4;
/// Default precision 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u32, defaultp> u32vec1;
typedef vec<1, u32, defaultp> u32vec1;
/// Default precision 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u32, defaultp> u32vec2;
typedef vec<2, u32, defaultp> u32vec2;
/// Default precision 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u32, defaultp> u32vec3;
typedef vec<3, u32, defaultp> u32vec3;
/// Default precision 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u32, defaultp> u32vec4;
typedef vec<4, u32, defaultp> u32vec4;
/// Default precision 64 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef tvec1<u64, defaultp> u64vec1;
typedef vec<1, u64, defaultp> u64vec1;
/// Default precision 64 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef tvec2<u64, defaultp> u64vec2;
typedef vec<2, u64, defaultp> u64vec2;
/// Default precision 64 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef tvec3<u64, defaultp> u64vec3;
typedef vec<3, u64, defaultp> u64vec3;
/// Default precision 64 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef tvec4<u64, defaultp> u64vec4;
typedef vec<4, u64, defaultp> u64vec4;
//////////////////////
@@ -617,53 +617,53 @@ namespace glm
/// Single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<float, defaultp> fvec1;
typedef vec<1, float, defaultp> fvec1;
/// Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<float, defaultp> fvec2;
typedef vec<2, float, defaultp> fvec2;
/// Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<float, defaultp> fvec3;
typedef vec<3, float, defaultp> fvec3;
/// Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<float, defaultp> fvec4;
typedef vec<4, float, defaultp> fvec4;
/// Single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f32, defaultp> f32vec1;
typedef vec<1, f32, defaultp> f32vec1;
/// Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f32, defaultp> f32vec2;
typedef vec<2, f32, defaultp> f32vec2;
/// Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f32, defaultp> f32vec3;
typedef vec<3, f32, defaultp> f32vec3;
/// Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f32, defaultp> f32vec4;
typedef vec<4, f32, defaultp> f32vec4;
/// Double-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef tvec1<f64, defaultp> f64vec1;
typedef vec<1, f64, defaultp> f64vec1;
/// Double-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef tvec2<f64, defaultp> f64vec2;
typedef vec<2, f64, defaultp> f64vec2;
/// Double-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef tvec3<f64, defaultp> f64vec3;
typedef vec<3, f64, defaultp> f64vec3;
/// Double-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef tvec4<f64, defaultp> f64vec4;
typedef vec<4, f64, defaultp> f64vec4;
//////////////////////
@@ -675,15 +675,15 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, defaultp> fmat2;
typedef mat<2, 2, f32, defaultp> fmat2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, defaultp> fmat3;
typedef mat<3, 3, f32, defaultp> fmat3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, defaultp> fmat4;
typedef mat<4, 4, f32, defaultp> fmat4;
/// Single-precision floating-point 1x1 matrix.
@@ -692,39 +692,39 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, defaultp> fmat2x2;
typedef mat<2, 2, f32, defaultp> fmat2x2;
/// Single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, defaultp> fmat2x3;
typedef mat<2, 3, f32, defaultp> fmat2x3;
/// Single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, defaultp> fmat2x4;
typedef mat<2, 4, f32, defaultp> fmat2x4;
/// Single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, defaultp> fmat3x2;
typedef mat<3, 2, f32, defaultp> fmat3x2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, defaultp> fmat3x3;
typedef mat<3, 3, f32, defaultp> fmat3x3;
/// Single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, defaultp> fmat3x4;
typedef mat<3, 4, f32, defaultp> fmat3x4;
/// Single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, defaultp> fmat4x2;
typedef mat<4, 2, f32, defaultp> fmat4x2;
/// Single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, defaultp> fmat4x3;
typedef mat<4, 3, f32, defaultp> fmat4x3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, defaultp> fmat4x4;
typedef mat<4, 4, f32, defaultp> fmat4x4;
/// Single-precision floating-point 1x1 matrix.
@@ -733,15 +733,15 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, defaultp> f32mat2;
typedef mat<2, 2, f32, defaultp> f32mat2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, defaultp> f32mat3;
typedef mat<3, 3, f32, defaultp> f32mat3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, defaultp> f32mat4;
typedef mat<4, 4, f32, defaultp> f32mat4;
/// Single-precision floating-point 1x1 matrix.
@@ -750,39 +750,39 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f32, defaultp> f32mat2x2;
typedef mat<2, 2, f32, defaultp> f32mat2x2;
/// Single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f32, defaultp> f32mat2x3;
typedef mat<2, 3, f32, defaultp> f32mat2x3;
/// Single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f32, defaultp> f32mat2x4;
typedef mat<2, 4, f32, defaultp> f32mat2x4;
/// Single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f32, defaultp> f32mat3x2;
typedef mat<3, 2, f32, defaultp> f32mat3x2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f32, defaultp> f32mat3x3;
typedef mat<3, 3, f32, defaultp> f32mat3x3;
/// Single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f32, defaultp> f32mat3x4;
typedef mat<3, 4, f32, defaultp> f32mat3x4;
/// Single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f32, defaultp> f32mat4x2;
typedef mat<4, 2, f32, defaultp> f32mat4x2;
/// Single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f32, defaultp> f32mat4x3;
typedef mat<4, 3, f32, defaultp> f32mat4x3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f32, defaultp> f32mat4x4;
typedef mat<4, 4, f32, defaultp> f32mat4x4;
/// Double-precision floating-point 1x1 matrix.
@@ -791,15 +791,15 @@ namespace glm
/// Double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f64, defaultp> f64mat2;
typedef mat<2, 2, f64, defaultp> f64mat2;
/// Double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f64, defaultp> f64mat3;
typedef mat<3, 3, f64, defaultp> f64mat3;
/// Double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f64, defaultp> f64mat4;
typedef mat<4, 4, f64, defaultp> f64mat4;
/// Double-precision floating-point 1x1 matrix.
@@ -808,39 +808,39 @@ namespace glm
/// Double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef tmat2x2<f64, defaultp> f64mat2x2;
typedef mat<2, 2, f64, defaultp> f64mat2x2;
/// Double-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef tmat2x3<f64, defaultp> f64mat2x3;
typedef mat<2, 3, f64, defaultp> f64mat2x3;
/// Double-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef tmat2x4<f64, defaultp> f64mat2x4;
typedef mat<2, 4, f64, defaultp> f64mat2x4;
/// Double-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef tmat3x2<f64, defaultp> f64mat3x2;
typedef mat<3, 2, f64, defaultp> f64mat3x2;
/// Double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef tmat3x3<f64, defaultp> f64mat3x3;
typedef mat<3, 3, f64, defaultp> f64mat3x3;
/// Double-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef tmat3x4<f64, defaultp> f64mat3x4;
typedef mat<3, 4, f64, defaultp> f64mat3x4;
/// Double-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef tmat4x2<f64, defaultp> f64mat4x2;
typedef mat<4, 2, f64, defaultp> f64mat4x2;
/// Double-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef tmat4x3<f64, defaultp> f64mat4x3;
typedef mat<4, 3, f64, defaultp> f64mat4x3;
/// Double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef tmat4x4<f64, defaultp> f64mat4x4;
typedef mat<4, 4, f64, defaultp> f64mat4x4;
//////////////////////////

View File

@@ -60,82 +60,82 @@ namespace glm
/// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename genType>
GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const & vec);
GLM_FUNC_DECL typename genType::value_type const * value_ptr(genType const& v);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tvec2<T, defaultp> make_vec2(T const * const ptr);
GLM_FUNC_DECL vec<2, T, defaultp> make_vec2(T const * const ptr);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tvec3<T, defaultp> make_vec3(T const * const ptr);
GLM_FUNC_DECL vec<3, T, defaultp> make_vec3(T const * const ptr);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tvec4<T, defaultp> make_vec4(T const * const ptr);
GLM_FUNC_DECL vec<4, T, defaultp> make_vec4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2x2(T const * const ptr);
GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat2x3<T, defaultp> make_mat2x3(T const * const ptr);
GLM_FUNC_DECL mat<2, 3, T, defaultp> make_mat2x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat2x4<T, defaultp> make_mat2x4(T const * const ptr);
GLM_FUNC_DECL mat<2, 4, T, defaultp> make_mat2x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat3x2<T, defaultp> make_mat3x2(T const * const ptr);
GLM_FUNC_DECL mat<3, 2, T, defaultp> make_mat3x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3x3(T const * const ptr);
GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat3x4<T, defaultp> make_mat3x4(T const * const ptr);
GLM_FUNC_DECL mat<3, 4, T, defaultp> make_mat3x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat4x2<T, defaultp> make_mat4x2(T const * const ptr);
GLM_FUNC_DECL mat<4, 2, T, defaultp> make_mat4x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat4x3<T, defaultp> make_mat4x3(T const * const ptr);
GLM_FUNC_DECL mat<4, 3, T, defaultp> make_mat4x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4x4(T const * const ptr);
GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat2x2<T, defaultp> make_mat2(T const * const ptr);
GLM_FUNC_DECL mat<2, 2, T, defaultp> make_mat2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat3x3<T, defaultp> make_mat3(T const * const ptr);
GLM_FUNC_DECL mat<3, 3, T, defaultp> make_mat3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_DECL tmat4x4<T, defaultp> make_mat4(T const * const ptr);
GLM_FUNC_DECL mat<4, 4, T, defaultp> make_mat4(T const * const ptr);
/// Build a quaternion from a pointer.
/// @see gtc_type_ptr

View File

@@ -11,271 +11,199 @@ namespace glm
/// Return the constant address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tvec2<T, P> const & vec
)
GLM_FUNC_QUALIFIER T const* value_ptr(vec<2, T, P> const& v)
{
return &(vec.x);
return &(v.x);
}
//! Return the address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tvec2<T, P> & vec
)
GLM_FUNC_QUALIFIER T* value_ptr(vec<2, T, P>& v)
{
return &(vec.x);
return &(v.x);
}
/// Return the constant address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tvec3<T, P> const & vec
)
GLM_FUNC_QUALIFIER T const * value_ptr(vec<3, T, P> const& v)
{
return &(vec.x);
return &(v.x);
}
//! Return the address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tvec3<T, P> & vec
)
GLM_FUNC_QUALIFIER T* value_ptr(vec<3, T, P>& v)
{
return &(vec.x);
return &(v.x);
}
/// Return the constant address to the data of the vector input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tvec4<T, P> const & vec
)
GLM_FUNC_QUALIFIER T const* value_ptr(vec<4, T, P> const& v)
{
return &(vec.x);
return &(v.x);
}
//! Return the address to the data of the vector input.
//! From GLM_GTC_type_ptr extension.
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tvec4<T, P> & vec
)
GLM_FUNC_QUALIFIER T* value_ptr(vec<4, T, P>& v)
{
return &(vec.x);
return &(v.x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat2x2<T, P> const & mat
)
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 2, T, P> const& m)
{
return &(mat[0].x);
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat2x2<T, P> & mat
)
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 2, T, P>& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat3x3<T, P> const & mat
)
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 3, T, P> const& m)
{
return &(mat[0].x);
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat3x3<T, P> & mat
)
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 3, T, P>& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat4x4<T, P> const & mat
)
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 4, T, P> const& m)
{
return &(mat[0].x);
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
//! From GLM_GTC_type_ptr extension.
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat4x4<T, P> & mat
)
GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 4, T, P>& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat2x3<T, P> const & mat
)
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 3, T, P> const& m)
{
return &(mat[0].x);
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat2x3<T, P> & mat
)
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 3, T, P>& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat3x2<T, P> const & mat
)
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 2, T, P> const& m)
{
return &(mat[0].x);
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat3x2<T, P> & mat
)
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 2, T, P>& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat2x4<T, P> const & mat
)
GLM_FUNC_QUALIFIER T const* value_ptr(mat<2, 4, T, P> const& m)
{
return &(mat[0].x);
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat2x4<T, P> & mat
)
GLM_FUNC_QUALIFIER T* value_ptr(mat<2, 4, T, P>& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat4x2<T, P> const & mat
)
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 2, T, P> const& m)
{
return &(mat[0].x);
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat4x2<T, P> & mat
)
GLM_FUNC_QUALIFIER T* value_ptr(mat<4, 2, T, P>& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat3x4<T, P> const & mat
)
GLM_FUNC_QUALIFIER T const* value_ptr(mat<3, 4, T, P> const& m)
{
return &(mat[0].x);
return &(m[0].x);
}
//! Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tmat3x4<T, P> & mat
)
GLM_FUNC_QUALIFIER T* value_ptr(mat<3, 4, T, P>& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the constant address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tmat4x3<T, P> const & mat
)
GLM_FUNC_QUALIFIER T const* value_ptr(mat<4, 3, T, P> const& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the address to the data of the matrix input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr(tmat4x3<T, P> & mat)
GLM_FUNC_QUALIFIER T * value_ptr(mat<4, 3, T, P>& m)
{
return &(mat[0].x);
return &(m[0].x);
}
/// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
tquat<T, P> const & q
)
GLM_FUNC_QUALIFIER T const * value_ptr(tquat<T, P> const& q)
{
return &(q[0]);
}
@@ -283,162 +211,159 @@ namespace glm
/// Return the address to the data of the quaternion input.
/// @see gtc_type_ptr
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
tquat<T, P> & q
)
GLM_FUNC_QUALIFIER T* value_ptr(tquat<T, P>& q)
{
return &(q[0]);
}
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> make_vec2(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER vec<2, T, defaultp> make_vec2(T const *const ptr)
{
tvec2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tvec2<T, defaultp>));
vec<2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(vec<2, T, defaultp>));
return Result;
}
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> make_vec3(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER vec<3, T, defaultp> make_vec3(T const *const ptr)
{
tvec3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tvec3<T, defaultp>));
vec<3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(vec<3, T, defaultp>));
return Result;
}
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tvec4<T, defaultp> make_vec4(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER vec<4, T, defaultp> make_vec4(T const *const ptr)
{
tvec4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tvec4<T, defaultp>));
vec<4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(vec<4, T, defaultp>));
return Result;
}
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2x2(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2x2(T const *const ptr)
{
tmat2x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat2x2<T, defaultp>));
mat<2, 2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<2, 2, T, defaultp>));
return Result;
}
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat2x3<T, defaultp> make_mat2x3(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<2, 3, T, defaultp> make_mat2x3(T const *const ptr)
{
tmat2x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat2x3<T, defaultp>));
mat<2, 3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<2, 3, T, defaultp>));
return Result;
}
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat2x4<T, defaultp> make_mat2x4(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<2, 4, T, defaultp> make_mat2x4(T const *const ptr)
{
tmat2x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat2x4<T, defaultp>));
mat<2, 4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<2, 4, T, defaultp>));
return Result;
}
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat3x2<T, defaultp> make_mat3x2(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<3, 2, T, defaultp> make_mat3x2(T const *const ptr)
{
tmat3x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat3x2<T, defaultp>));
mat<3, 2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<3, 2, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3x3(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3x3(T const *const ptr)
{
tmat3x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat3x3<T, defaultp>));
mat<3, 3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<3, 3, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat3x4<T, defaultp> make_mat3x4(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<3, 4, T, defaultp> make_mat3x4(T const *const ptr)
{
tmat3x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat3x4<T, defaultp>));
mat<3, 4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<3, 4, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat4x2<T, defaultp> make_mat4x2(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 2, T, defaultp> make_mat4x2(T const *const ptr)
{
tmat4x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat4x2<T, defaultp>));
mat<4, 2, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<4, 2, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat4x3<T, defaultp> make_mat4x3(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 3, T, defaultp> make_mat4x3(T const *const ptr)
{
tmat4x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat4x3<T, defaultp>));
mat<4, 3, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<4, 3, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4x4(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4x4(T const *const ptr)
{
tmat4x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tmat4x4<T, defaultp>));
mat<4, 4, T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(mat<4, 4, T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat2x2<T, defaultp> make_mat2(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<2, 2, T, defaultp> make_mat2(T const *const ptr)
{
return make_mat2x2(ptr);
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat3x3<T, defaultp> make_mat3(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<3, 3, T, defaultp> make_mat3(T const *const ptr)
{
return make_mat3x3(ptr);
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tmat4x4<T, defaultp> make_mat4(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER mat<4, 4, T, defaultp> make_mat4(T const *const ptr)
{
return make_mat4x4(ptr);
}
//! Build a quaternion from a pointer.
/// @see gtc_type_ptr
template <typename T>
GLM_FUNC_QUALIFIER tquat<T, defaultp> make_quat(T const * const ptr)
template<typename T>
GLM_FUNC_QUALIFIER tquat<T, defaultp> make_quat(T const *const ptr)
{
tquat<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(tquat<T, defaultp>));

View File

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

View File

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

View File

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

View File

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

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