Added precision template parameter

This commit is contained in:
Christophe Riccio
2013-04-10 13:46:27 +02:00
parent bb0398ae4a
commit c14e2d7fbc
123 changed files with 10997 additions and 10245 deletions

View File

@@ -88,196 +88,196 @@ namespace glm
return abs(x - y) >= epsilon;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<bool, P> epsilonEqual
(
detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y,
valType const & epsilon)
detail::tvec2<T, P> const & x,
detail::tvec2<T, P> const & y,
T const & epsilon)
{
return detail::tvec2<bool>(
return detail::tvec2<bool, P>(
abs(x.x - y.x) < epsilon,
abs(x.y - y.y) < epsilon);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<bool, P> epsilonEqual
(
detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y,
detail::tvec2<valType> const & epsilon
detail::tvec2<T, P> const & x,
detail::tvec2<T, P> const & y,
detail::tvec2<T, P> const & epsilon
)
{
return detail::tvec2<bool>(
return detail::tvec2<bool, P>(
abs(x.x - y.x) < epsilon.x,
abs(x.y - y.y) < epsilon.y);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<bool, P> epsilonEqual
(
detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y,
valType const & epsilon)
detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y,
T const & epsilon)
{
return detail::tvec3<bool>(
return detail::tvec3<bool, P>(
abs(x.x - y.x) < epsilon,
abs(x.y - y.y) < epsilon,
abs(x.z - y.z) < epsilon);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<bool, P> epsilonEqual
(
detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y,
detail::tvec3<valType> const & epsilon
detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y,
detail::tvec3<T, P> const & epsilon
)
{
return detail::tvec3<bool>(
return detail::tvec3<bool, P>(
abs(x.x - y.x) < epsilon.x,
abs(x.y - y.y) < epsilon.y,
abs(x.z - y.z) < epsilon.z);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<bool, P> epsilonEqual
(
detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y,
valType const & epsilon
detail::tvec4<T, P> const & x,
detail::tvec4<T, P> const & y,
T const & epsilon
)
{
return detail::tvec4<bool>(
return detail::tvec4<bool, P>(
abs(x.x - y.x) < epsilon,
abs(x.y - y.y) < epsilon,
abs(x.z - y.z) < epsilon,
abs(x.w - y.w) < epsilon);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<bool, P> epsilonEqual
(
detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y,
detail::tvec4<valType> const & epsilon
detail::tvec4<T, P> const & x,
detail::tvec4<T, P> const & y,
detail::tvec4<T, P> const & epsilon
)
{
return detail::tvec4<bool>(
return detail::tvec4<bool, P>(
abs(x.x - y.x) < epsilon.x,
abs(x.y - y.y) < epsilon.y,
abs(x.z - y.z) < epsilon.z,
abs(x.w - y.w) < epsilon.w);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonNotEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<bool, P> epsilonNotEqual
(
detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y,
valType const & epsilon
detail::tvec2<T, P> const & x,
detail::tvec2<T, P> const & y,
T const & epsilon
)
{
return detail::tvec2<bool>(
return detail::tvec2<bool, P>(
abs(x.x - y.x) >= epsilon,
abs(x.y - y.y) >= epsilon);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec2<bool> epsilonNotEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec2<bool, P> epsilonNotEqual
(
detail::tvec2<valType> const & x,
detail::tvec2<valType> const & y,
detail::tvec2<valType> const & epsilon
detail::tvec2<T, P> const & x,
detail::tvec2<T, P> const & y,
detail::tvec2<T, P> const & epsilon
)
{
return detail::tvec2<bool>(
return detail::tvec2<bool, P>(
abs(x.x - y.x) >= epsilon.x,
abs(x.y - y.y) >= epsilon.y);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonNotEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<bool, P> epsilonNotEqual
(
detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y,
valType const & epsilon
detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y,
T const & epsilon
)
{
return detail::tvec3<bool>(
return detail::tvec3<bool, P>(
abs(x.x - y.x) >= epsilon,
abs(x.y - y.y) >= epsilon,
abs(x.z - y.z) >= epsilon);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec3<bool> epsilonNotEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<bool, P> epsilonNotEqual
(
detail::tvec3<valType> const & x,
detail::tvec3<valType> const & y,
detail::tvec3<valType> const & epsilon
detail::tvec3<T, P> const & x,
detail::tvec3<T, P> const & y,
detail::tvec3<T, P> const & epsilon
)
{
return detail::tvec3<bool>(
return detail::tvec3<bool, P>(
abs(x.x - y.x) >= epsilon.x,
abs(x.y - y.y) >= epsilon.y,
abs(x.z - y.z) >= epsilon.z);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonNotEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<bool, P> epsilonNotEqual
(
detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y,
valType const & epsilon
detail::tvec4<T, P> const & x,
detail::tvec4<T, P> const & y,
T const & epsilon
)
{
return detail::tvec4<bool>(
return detail::tvec4<bool, P>(
abs(x.x - y.x) >= epsilon,
abs(x.y - y.y) >= epsilon,
abs(x.z - y.z) >= epsilon,
abs(x.w - y.w) >= epsilon);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonNotEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<bool, P> epsilonNotEqual
(
detail::tvec4<valType> const & x,
detail::tvec4<valType> const & y,
detail::tvec4<valType> const & epsilon
detail::tvec4<T, P> const & x,
detail::tvec4<T, P> const & y,
detail::tvec4<T, P> const & epsilon
)
{
return detail::tvec4<bool>(
return detail::tvec4<bool, P>(
abs(x.x - y.x) >= epsilon.x,
abs(x.y - y.y) >= epsilon.y,
abs(x.z - y.z) >= epsilon.z,
abs(x.w - y.w) >= epsilon.w);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<bool, P> epsilonEqual
(
detail::tquat<valType> const & x,
detail::tquat<valType> const & y,
valType const & epsilon
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
T const & epsilon
)
{
return detail::tvec4<bool>(
return detail::tvec4<bool, P>(
abs(x.x - y.x) < epsilon,
abs(x.y - y.y) < epsilon,
abs(x.z - y.z) < epsilon,
abs(x.w - y.w) < epsilon);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tvec4<bool> epsilonNotEqual
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<bool, P> epsilonNotEqual
(
detail::tquat<valType> const & x,
detail::tquat<valType> const & y,
valType const & epsilon
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
T const & epsilon
)
{
return detail::tvec4<bool>(
return detail::tvec4<bool, P>(
abs(x.x - y.x) >= epsilon,
abs(x.y - y.y) >= epsilon,
abs(x.z - y.z) >= epsilon,

View File

@@ -49,7 +49,7 @@ namespace detail
{
#if(GLM_COMPONENT == GLM_COMPONENT_CXX98)
template <>
struct tvec2<half>
struct tvec2<half, defaultp>
{
enum ctor{null};
typedef half value_type;
@@ -58,8 +58,8 @@ namespace detail
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type value_size();
typedef tvec2<half> type;
typedef tvec2<bool> bool_type;
typedef tvec2<half, defaultp> type;
typedef tvec2<bool, defaultp> bool_type;
//////////////////////////////////////
// Data
@@ -76,7 +76,7 @@ namespace detail
// Implicit basic constructors
tvec2();
tvec2(tvec2<half> const & v);
tvec2(tvec2<half, defaultp> const & v);
//////////////////////////////////////
// Explicit basic constructors
@@ -85,22 +85,22 @@ namespace detail
explicit tvec2(
half const & s);
explicit tvec2(
half const & s1,
half const & s1,
half const & s2);
//////////////////////////////////////
// Swizzle constructors
tvec2(tref2<half> const & r);
tvec2(tref2<half, defaultp> const & r);
//////////////////////////////////////
// Convertion scalar constructors
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
template <typename U>
explicit tvec2(U const & x);
//! Explicit converions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U, typename V>
template <typename U, typename V>
explicit tvec2(U const & x, V const & y);
//////////////////////////////////////
@@ -108,42 +108,42 @@ namespace detail
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
explicit tvec2(tvec2<U> const & v);
explicit tvec2(tvec2<U, defaultp> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
explicit tvec2(tvec3<U> const & v);
explicit tvec2(tvec3<U, defaultp> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
explicit tvec2(tvec4<U> const & v);
explicit tvec2(tvec4<U, defaultp> const & v);
//////////////////////////////////////
// Unary arithmetic operators
tvec2<half>& operator= (tvec2<half> const & v);
tvec2<half, defaultp>& operator= (tvec2<half, defaultp> const & v);
tvec2<half>& operator+=(half const & s);
tvec2<half>& operator+=(tvec2<half> const & v);
tvec2<half>& operator-=(half const & s);
tvec2<half>& operator-=(tvec2<half> const & v);
tvec2<half>& operator*=(half const & s);
tvec2<half>& operator*=(tvec2<half> const & v);
tvec2<half>& operator/=(half const & s);
tvec2<half>& operator/=(tvec2<half> const & v);
tvec2<half>& operator++();
tvec2<half>& operator--();
tvec2<half, defaultp>& operator+=(half const & s);
tvec2<half, defaultp>& operator+=(tvec2<half, defaultp> const & v);
tvec2<half, defaultp>& operator-=(half const & s);
tvec2<half, defaultp>& operator-=(tvec2<half, defaultp> const & v);
tvec2<half, defaultp>& operator*=(half const & s);
tvec2<half, defaultp>& operator*=(tvec2<half, defaultp> const & v);
tvec2<half, defaultp>& operator/=(half const & s);
tvec2<half, defaultp>& operator/=(tvec2<half, defaultp> const & v);
tvec2<half, defaultp>& operator++();
tvec2<half, defaultp>& operator--();
//////////////////////////////////////
// Swizzle operators
half swizzle(comp X) const;
tvec2<half> swizzle(comp X, comp Y) const;
tvec3<half> swizzle(comp X, comp Y, comp Z) const;
tvec4<half> swizzle(comp X, comp Y, comp Z, comp W) const;
tref2<half> swizzle(comp X, comp Y);
tvec2<half, defaultp> swizzle(comp X, comp Y) const;
tvec3<half, defaultp> swizzle(comp X, comp Y, comp Z) const;
tvec4<half, defaultp> swizzle(comp X, comp Y, comp Z, comp W) const;
tref2<half, defaultp> swizzle(comp X, comp Y);
};
template <>
struct tvec3<half>
struct tvec3<half, defaultp>
{
enum ctor{null};
typedef half value_type;
@@ -151,8 +151,8 @@ namespace detail
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type value_size();
typedef tvec3<half> type;
typedef tvec3<bool> bool_type;
typedef tvec3<half, defaultp> type;
typedef tvec3<bool, defaultp> bool_type;
//////////////////////////////////////
// Data
@@ -169,7 +169,7 @@ namespace detail
// Implicit basic constructors
tvec3();
tvec3(tvec3<half> const & v);
tvec3(tvec3<half, defaultp> const & v);
//////////////////////////////////////
// Explicit basic constructors
@@ -178,14 +178,14 @@ namespace detail
explicit tvec3(
half const & s);
explicit tvec3(
half const & s1,
half const & s2,
half const & s1,
half const & s2,
half const & s3);
//////////////////////////////////////
// Swizzle constructors
tvec3(tref3<half> const & r);
tvec3(tref3<half, defaultp> const & r);
//////////////////////////////////////
// Convertion scalar constructors
@@ -202,45 +202,45 @@ namespace detail
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
explicit tvec3(tvec2<A> const & v, B const & s);
explicit tvec3(tvec2<A, defaultp> const & v, B const & s);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
explicit tvec3(A const & s, tvec2<B> const & v);
explicit tvec3(A const & s, tvec2<B, defaultp> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
explicit tvec3(tvec3<U> const & v);
explicit tvec3(tvec3<U, defaultp> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
explicit tvec3(tvec4<U> const & v);
explicit tvec3(tvec4<U, defaultp> const & v);
//////////////////////////////////////
// Unary arithmetic operators
tvec3<half>& operator= (tvec3<half> const & v);
tvec3<half, defaultp>& operator= (tvec3<half, defaultp> const & v);
tvec3<half>& operator+=(half const & s);
tvec3<half>& operator+=(tvec3<half> const & v);
tvec3<half>& operator-=(half const & s);
tvec3<half>& operator-=(tvec3<half> const & v);
tvec3<half>& operator*=(half const & s);
tvec3<half>& operator*=(tvec3<half> const & v);
tvec3<half>& operator/=(half const & s);
tvec3<half>& operator/=(tvec3<half> const & v);
tvec3<half>& operator++();
tvec3<half>& operator--();
tvec3<half, defaultp>& operator+=(half const & s);
tvec3<half, defaultp>& operator+=(tvec3<half, defaultp> const & v);
tvec3<half, defaultp>& operator-=(half const & s);
tvec3<half, defaultp>& operator-=(tvec3<half, defaultp> const & v);
tvec3<half, defaultp>& operator*=(half const & s);
tvec3<half, defaultp>& operator*=(tvec3<half, defaultp> const & v);
tvec3<half, defaultp>& operator/=(half const & s);
tvec3<half, defaultp>& operator/=(tvec3<half, defaultp> const & v);
tvec3<half, defaultp>& operator++();
tvec3<half, defaultp>& operator--();
//////////////////////////////////////
// Swizzle operators
half swizzle(comp X) const;
tvec2<half> swizzle(comp X, comp Y) const;
tvec3<half> swizzle(comp X, comp Y, comp Z) const;
tvec4<half> swizzle(comp X, comp Y, comp Z, comp W) const;
tref3<half> swizzle(comp X, comp Y, comp Z);
tvec2<half, defaultp> swizzle(comp X, comp Y) const;
tvec3<half, defaultp> swizzle(comp X, comp Y, comp Z) const;
tvec4<half, defaultp> swizzle(comp X, comp Y, comp Z, comp W) const;
tref3<half, defaultp> swizzle(comp X, comp Y, comp Z);
};
template <>
struct tvec4<half>
struct tvec4<half, defaultp>
{
enum ctor{null};
typedef half value_type;
@@ -248,8 +248,8 @@ namespace detail
GLM_FUNC_DECL size_type length() const;
static GLM_FUNC_DECL size_type value_size();
typedef tvec4<half> type;
typedef tvec4<bool> bool_type;
typedef tvec4<half, defaultp> type;
typedef tvec4<bool, defaultp> bool_type;
//////////////////////////////////////
// Data
@@ -266,7 +266,7 @@ namespace detail
// Implicit basic constructors
tvec4();
tvec4(tvec4<half> const & v);
tvec4(tvec4<half, defaultp> const & v);
//////////////////////////////////////
// Explicit basic constructors
@@ -275,15 +275,15 @@ namespace detail
explicit tvec4(
half const & s);
explicit tvec4(
half const & s0,
half const & s1,
half const & s2,
half const & s0,
half const & s1,
half const & s2,
half const & s3);
//////////////////////////////////////
// Swizzle constructors
tvec4(tref4<half> const & r);
tvec4(tref4<half, defaultp> const & r);
//////////////////////////////////////
// Convertion scalar constructors
@@ -300,50 +300,50 @@ namespace detail
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C>
explicit tvec4(tvec2<A> const & v, B const & s1, C const & s2);
explicit tvec4(tvec2<A, defaultp> const & v, B const & s1, C const & s2);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C>
explicit tvec4(A const & s1, tvec2<B> const & v, C const & s2);
explicit tvec4(A const & s1, tvec2<B, defaultp> const & v, C const & s2);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B, typename C>
explicit tvec4(A const & s1, B const & s2, tvec2<C> const & v);
explicit tvec4(A const & s1, B const & s2, tvec2<C, defaultp> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
explicit tvec4(tvec3<A> const & v, B const & s);
explicit tvec4(tvec3<A, defaultp> const & v, B const & s);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
explicit tvec4(A const & s, tvec3<B> const & v);
explicit tvec4(A const & s, tvec3<B, defaultp> const & v);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename A, typename B>
explicit tvec4(tvec2<A> const & v1, tvec2<B> const & v2);
explicit tvec4(tvec2<A, defaultp> const & v1, tvec2<B, defaultp> const & v2);
//! Explicit conversions (From section 5.4.1 Conversion and scalar constructors of GLSL 1.30.08 specification)
template <typename U>
explicit tvec4(tvec4<U> const & v);
explicit tvec4(tvec4<U, defaultp> const & v);
//////////////////////////////////////
// Unary arithmetic operators
tvec4<half>& operator= (tvec4<half> const & v);
tvec4<half, defaultp>& operator= (tvec4<half, defaultp> const & v);
tvec4<half>& operator+=(half const & s);
tvec4<half>& operator+=(tvec4<half> const & v);
tvec4<half>& operator-=(half const & s);
tvec4<half>& operator-=(tvec4<half> const & v);
tvec4<half>& operator*=(half const & s);
tvec4<half>& operator*=(tvec4<half> const & v);
tvec4<half>& operator/=(half const & s);
tvec4<half>& operator/=(tvec4<half> const & v);
tvec4<half>& operator++();
tvec4<half>& operator--();
tvec4<half, defaultp>& operator+=(half const & s);
tvec4<half, defaultp>& operator+=(tvec4<half, defaultp> const & v);
tvec4<half, defaultp>& operator-=(half const & s);
tvec4<half, defaultp>& operator-=(tvec4<half, defaultp> const & v);
tvec4<half, defaultp>& operator*=(half const & s);
tvec4<half, defaultp>& operator*=(tvec4<half, defaultp> const & v);
tvec4<half, defaultp>& operator/=(half const & s);
tvec4<half, defaultp>& operator/=(tvec4<half, defaultp> const & v);
tvec4<half, defaultp>& operator++();
tvec4<half, defaultp>& operator--();
//////////////////////////////////////
// Swizzle operators
half swizzle(comp X) const;
tvec2<half> swizzle(comp X, comp Y) const;
tvec3<half> swizzle(comp X, comp Y, comp Z) const;
tvec4<half> swizzle(comp X, comp Y, comp Z, comp W) const;
tref4<half> swizzle(comp X, comp Y, comp Z, comp W);
tvec2<half, defaultp> swizzle(comp X, comp Y) const;
tvec3<half, defaultp> swizzle(comp X, comp Y, comp Z) const;
tvec4<half, defaultp> swizzle(comp X, comp Y, comp Z, comp W) const;
tref4<half, defaultp> swizzle(comp X, comp Y, comp Z, comp W);
};
#endif//(GLM_COMPONENT == GLM_COMPONENT_CXX98)
}
@@ -351,71 +351,321 @@ namespace detail
/// @addtogroup gtc_half_float
/// @{
/// Type for half-precision floating-point numbers.
//////////////////////////////////////////////
// High half precision floating-point numbers.
/// Vector of 2 high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::half half;
/// Vector of 2 half-precision floating-point numbers.
typedef detail::tvec2<half_t, highp> highp_hvec2;
/// Vector of 3 high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tvec2<detail::half> hvec2;
/// Vector of 3 half-precision floating-point numbers.
typedef detail::tvec3<half_t, highp> highp_hvec3;
/// Vector of 4 high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tvec3<detail::half> hvec3;
/// Vector of 4 half-precision floating-point numbers.
typedef detail::tvec4<half_t, highp> highp_hvec4;
/// 2 * 2 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tvec4<detail::half> hvec4;
/// 2 * 2 matrix of half-precision floating-point numbers.
typedef detail::tmat2x2<half_t, highp> highp_hmat2;
/// 3 * 3 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x2<detail::half> hmat2;
/// 3 * 3 matrix of half-precision floating-point numbers.
typedef detail::tmat3x3<half_t, highp> highp_hmat3;
/// 4 * 4 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x3<detail::half> hmat3;
/// 4 * 4 matrix of half-precision floating-point numbers.
typedef detail::tmat4x4<half_t, highp> highp_hmat4;
/// 2 * 2 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x4<detail::half> hmat4;
/// 2 * 2 matrix of half-precision floating-point numbers.
typedef detail::tmat2x2<half_t, highp> highp_hmat2x2;
/// 2 * 3 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x2<detail::half> hmat2x2;
/// 2 * 3 matrix of half-precision floating-point numbers.
typedef detail::tmat2x3<half_t, highp> highp_hmat2x3;
/// 2 * 4 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x3<detail::half> hmat2x3;
/// 2 * 4 matrix of half-precision floating-point numbers.
typedef detail::tmat2x4<half_t, highp> highp_hmat2x4;
/// 3 * 2 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x4<detail::half> hmat2x4;
/// 3 * 2 matrix of half-precision floating-point numbers.
typedef detail::tmat3x2<half_t, highp> highp_hmat3x2;
/// 3 * 3 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x2<detail::half> hmat3x2;
/// 3 * 3 matrix of half-precision floating-point numbers.
typedef detail::tmat3x3<half_t, highp> highp_hmat3x3;
/// 3 * 4 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x3<detail::half> hmat3x3;
/// 3 * 4 matrix of half-precision floating-point numbers.
typedef detail::tmat3x4<half_t, highp> highp_hmat3x4;
/// 4 * 2 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x4<detail::half> hmat3x4;
/// 4 * 2 matrix of half-precision floating-point numbers.
typedef detail::tmat4x2<half_t, highp> highp_hmat4x2;
/// 4 * 3 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x2<detail::half> hmat4x2;
/// 4 * 3 matrix of half-precision floating-point numbers.
typedef detail::tmat4x3<half_t, highp> highp_hmat4x3;
/// 4 * 4 matrix of high half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x3<detail::half> hmat4x3;
/// 4 * 4 matrix of half-precision floating-point numbers.
typedef detail::tmat4x4<half_t, highp> highp_hmat4x4;
//////////////////////////////////////////////
// Medium half precision floating-point numbers.
/// Vector of 2 medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x4<detail::half> hmat4x4;
typedef detail::tvec2<half_t, mediump> mediump_hvec2;
/// Vector of 3 medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tvec3<half_t, mediump> mediump_hvec3;
/// Vector of 4 medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tvec4<half_t, mediump> mediump_hvec4;
/// 2 * 2 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x2<half_t, mediump> mediump_hmat2;
/// 3 * 3 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x3<half_t, mediump> mediump_hmat3;
/// 4 * 4 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x4<half_t, mediump> mediump_hmat4;
/// 2 * 2 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x2<half_t, mediump> mediump_hmat2x2;
/// 2 * 3 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x3<half_t, mediump> mediump_hmat2x3;
/// 2 * 4 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x4<half_t, mediump> mediump_hmat2x4;
/// 3 * 2 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x2<half_t, mediump> mediump_hmat3x2;
/// 3 * 3 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x3<half_t, mediump> mediump_hmat3x3;
/// 3 * 4 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x4<half_t, mediump> mediump_hmat3x4;
/// 4 * 2 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x2<half_t, mediump> mediump_hmat4x2;
/// 4 * 3 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x3<half_t, mediump> mediump_hmat4x3;
/// 4 * 4 matrix of medium half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x4<half_t, mediump> mediump_hmat4x4;
//////////////////////////////////////////////
// Low half precision floating-point numbers.
/// Vector of 2 low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tvec2<half_t, lowp> lowp_hvec2;
/// Vector of 3 low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tvec3<half_t, lowp> lowp_hvec3;
/// Vector of 4 low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tvec4<half_t, lowp> lowp_hvec4;
/// 2 * 2 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x2<half_t, lowp> lowp_hmat2;
/// 3 * 3 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x3<half_t, lowp> lowp_hmat3;
/// 4 * 4 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x4<half_t, lowp> lowp_hmat4;
/// 2 * 2 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x2<half_t, lowp> lowp_hmat2x2;
/// 2 * 3 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x3<half_t, lowp> lowp_hmat2x3;
/// 2 * 4 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat2x4<half_t, lowp> lowp_hmat2x4;
/// 3 * 2 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x2<half_t, lowp> lowp_hmat3x2;
/// 3 * 3 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x3<half_t, lowp> lowp_hmat3x3;
/// 3 * 4 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat3x4<half_t, lowp> lowp_hmat3x4;
/// 4 * 2 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x2<half_t, lowp> lowp_hmat4x2;
/// 4 * 3 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x3<half_t, lowp> lowp_hmat4x3;
/// 4 * 4 matrix of low half-precision floating-point numbers.
/// @see gtc_half_float
typedef detail::tmat4x4<half_t, lowp> lowp_hmat4x4;
//////////////////////////////////////////////
// Default half precision floating-point numbers.
/// Type for default half-precision floating-point numbers.
/// @see gtc_half_float
typedef half_t half;
#if(!defined(GLM_PRECISION_HIGHP_HALF) && !defined(GLM_PRECISION_MEDIUMP_HALF) && !defined(GLM_PRECISION_LOWP_HALF))
//////////////////////////////////////////////
// Default half precision floating-point numbers.
/// Vector of 2 default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hvec2 hvec2;
/// Vector of 3 default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hvec3 hvec3;
/// Vector of 4 default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hvec4 hvec4;
/// 2 * 2 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat2x2 hmat2;
/// 3 * 3 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat3x3 hmat3;
/// 4 * 4 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat4x4 hmat4;
/// 2 * 2 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat2x2 hmat2x2;
/// 2 * 3 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat2x3 hmat2x3;
/// 2 * 4 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat2x4 hmat2x4;
/// 3 * 2 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat3x2 hmat3x2;
/// 3 * 3 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat3x3 hmat3x3;
/// 3 * 4 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat3x4 hmat3x4;
/// 4 * 2 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat4x2 hmat4x2;
/// 4 * 3 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat4x3 hmat4x3;
/// 4 * 4 matrix of default half-precision floating-point numbers.
/// @see gtc_half_float
typedef mediump_hmat4x4 hmat4x4;
#elif(defined(GLM_PRECISION_HIGHP_HALF) && !defined(GLM_PRECISION_MEDIUMP_HALF) && !defined(GLM_PRECISION_LOWP_HALF))
typedef detail::tvec2<half_t, highp> hvec2;
typedef detail::tvec3<half_t, highp> hvec3;
typedef detail::tvec4<half_t, highp> hvec4;
typedef detail::tmat2x2<half_t, highp> hmat2;
typedef detail::tmat3x3<half_t, highp> hmat3;
typedef detail::tmat4x4<half_t, highp> hmat4;
typedef detail::tmat2x2<half_t, highp> hmat2x2;
typedef detail::tmat2x3<half_t, highp> hmat2x3;
typedef detail::tmat2x4<half_t, highp> hmat2x4;
typedef detail::tmat3x2<half_t, highp> hmat3x2;
typedef detail::tmat3x3<half_t, highp> hmat3x3;
typedef detail::tmat3x4<half_t, highp> hmat3x4;
typedef detail::tmat4x2<half_t, highp> hmat4x2;
typedef detail::tmat4x3<half_t, highp> hmat4x3;
typedef detail::tmat4x4<half_t, highp> hmat4x4;
#elif(!defined(GLM_PRECISION_HIGHP_HALF) && defined(GLM_PRECISION_MEDIUMP_HALF) && !defined(GLM_PRECISION_LOWP_HALF))
typedef detail::tvec2<half_t, mediump> hvec2;
typedef detail::tvec3<half_t, mediump> hvec3;
typedef detail::tvec4<half_t, mediump> hvec4;
typedef detail::tmat2x2<half_t, mediump> hmat2;
typedef detail::tmat3x3<half_t, mediump> hmat3;
typedef detail::tmat4x4<half_t, mediump> hmat4;
typedef detail::tmat2x2<half_t, mediump> hmat2x2;
typedef detail::tmat2x3<half_t, mediump> hmat2x3;
typedef detail::tmat2x4<half_t, mediump> hmat2x4;
typedef detail::tmat3x2<half_t, mediump> hmat3x2;
typedef detail::tmat3x3<half_t, mediump> hmat3x3;
typedef detail::tmat3x4<half_t, mediump> hmat3x4;
typedef detail::tmat4x2<half_t, mediump> hmat4x2;
typedef detail::tmat4x3<half_t, mediump> hmat4x3;
typedef detail::tmat4x4<half_t, mediump> hmat4x4;
#elif(!defined(GLM_PRECISION_HIGHP_HALF) && !defined(GLM_PRECISION_MEDIUMP_HALF) && defined(GLM_PRECISION_LOWP_HALF))
typedef detail::tvec2<half_t, lowp> hvec2;
typedef detail::tvec3<half_t, lowp> hvec3;
typedef detail::tvec4<half_t, lowp> hvec4;
typedef detail::tmat2x2<half_t, lowp> hmat2;
typedef detail::tmat3x3<half_t, lowp> hmat3;
typedef detail::tmat4x4<half_t, lowp> hmat4;
typedef detail::tmat2x2<half_t, lowp> hmat2x2;
typedef detail::tmat2x3<half_t, lowp> hmat2x3;
typedef detail::tmat2x4<half_t, lowp> hmat2x4;
typedef detail::tmat3x2<half_t, lowp> hmat3x2;
typedef detail::tmat3x3<half_t, lowp> hmat3x3;
typedef detail::tmat3x4<half_t, lowp> hmat3x4;
typedef detail::tmat4x2<half_t, lowp> hmat4x2;
typedef detail::tmat4x3<half_t, lowp> hmat4x3;
typedef detail::tmat4x4<half_t, lowp> hmat4x4;
#endif
/// Returns the absolute value of a half-precision floating-point value
/// @see gtc_half_float
half abs(half const & x);

View File

@@ -34,12 +34,12 @@ namespace detail
//////////////////////////////////////
// hvec2
GLM_FUNC_QUALIFIER tvec2<half>::size_type tvec2<half>::length() const
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::size_type tvec2<half, defaultp>::length() const
{
return 2;
}
GLM_FUNC_QUALIFIER tvec2<half>::size_type tvec2<half>::value_size()
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::size_type tvec2<half, defaultp>::value_size()
{
return 2;
}
@@ -47,29 +47,29 @@ namespace detail
//////////////////////////////////////
// Accesses
GLM_FUNC_QUALIFIER half & tvec2<half>::operator[](tvec2<half>::size_type i)
GLM_FUNC_QUALIFIER half & tvec2<half, defaultp>::operator[](tvec2<half, defaultp>::size_type i)
{
assert(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
assert(i < this->length());
return (&x)[i];
}
GLM_FUNC_QUALIFIER half const & tvec2<half>::operator[](tvec2<half>::size_type i) const
GLM_FUNC_QUALIFIER half const & tvec2<half, defaultp>::operator[](tvec2<half, defaultp>::size_type i) const
{
assert(/*i >= tvec2<half>::size_type(0) && */i < tvec2<half>::value_size());
assert(i < this->length());
return (&x)[i];
}
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_QUALIFIER tvec2<half>::tvec2() :
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2() :
x(half(0.f)),
y(half(0.f))
{}
GLM_FUNC_QUALIFIER tvec2<half>::tvec2
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2
(
tvec2<half> const & v
tvec2<half, defaultp> const & v
) :
x(v.x),
y(v.y)
@@ -78,7 +78,7 @@ namespace detail
//////////////////////////////////////
// Explicit basic constructors
GLM_FUNC_QUALIFIER tvec2<half>::tvec2
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2
(
half const & s
) :
@@ -86,7 +86,7 @@ namespace detail
y(s)
{}
GLM_FUNC_QUALIFIER tvec2<half>::tvec2
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2
(
half const & s1,
half const & s2
@@ -98,9 +98,9 @@ namespace detail
//////////////////////////////////////
// Swizzle constructors
GLM_FUNC_QUALIFIER tvec2<half>::tvec2
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2
(
tref2<half> const & r
tref2<half, defaultp> const & r
) :
x(r.x),
y(r.y)
@@ -109,8 +109,8 @@ namespace detail
//////////////////////////////////////
// Convertion scalar constructors
template <typename U>
GLM_FUNC_QUALIFIER tvec2<half>::tvec2
template <typename U>
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2
(
U const & x
) :
@@ -118,10 +118,10 @@ namespace detail
y(half(x))
{}
template <typename U, typename V>
GLM_FUNC_QUALIFIER tvec2<half>::tvec2
template <typename U, typename V>
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2
(
U const & x,
U const & x,
V const & y
) :
x(half(x)),
@@ -131,28 +131,28 @@ namespace detail
//////////////////////////////////////
// Convertion vector constructors
template <typename U>
GLM_FUNC_QUALIFIER tvec2<half>::tvec2
template <typename U>
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2
(
tvec2<U> const & v
tvec2<U, defaultp> const & v
) :
x(half(v.x)),
y(half(v.y))
{}
template <typename U>
GLM_FUNC_QUALIFIER tvec2<half>::tvec2
template <typename U>
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2
(
tvec3<U> const & v
tvec3<U, defaultp> const & v
) :
x(half(v.x)),
y(half(v.y))
{}
template <typename U>
GLM_FUNC_QUALIFIER tvec2<half>::tvec2
template <typename U>
GLM_FUNC_QUALIFIER tvec2<half, defaultp>::tvec2
(
tvec4<U> const & v
tvec4<U, defaultp> const & v
) :
x(half(v.x)),
y(half(v.y))
@@ -161,9 +161,9 @@ namespace detail
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_QUALIFIER tvec2<half> & tvec2<half>::operator=
GLM_FUNC_QUALIFIER tvec2<half, defaultp> & tvec2<half, defaultp>::operator=
(
tvec2<half> const & v
tvec2<half, defaultp> const & v
)
{
this->x = v.x;
@@ -171,7 +171,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half> & tvec2<half>::operator+=
GLM_FUNC_QUALIFIER tvec2<half, defaultp> & tvec2<half, defaultp>::operator+=
(
half const & s
)
@@ -181,9 +181,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half> & tvec2<half>::operator+=
GLM_FUNC_QUALIFIER tvec2<half, defaultp> & tvec2<half, defaultp>::operator+=
(
tvec2<half> const & v
tvec2<half, defaultp> const & v
)
{
this->x += v.x;
@@ -191,7 +191,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half> & tvec2<half>::operator-=
GLM_FUNC_QUALIFIER tvec2<half, defaultp> & tvec2<half, defaultp>::operator-=
(
half const & s
)
@@ -201,9 +201,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half> & tvec2<half>::operator-=
GLM_FUNC_QUALIFIER tvec2<half, defaultp> & tvec2<half, defaultp>::operator-=
(
tvec2<half> const & v
tvec2<half, defaultp> const & v
)
{
this->x -= v.x;
@@ -211,7 +211,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half>& tvec2<half>::operator*=
GLM_FUNC_QUALIFIER tvec2<half, defaultp>& tvec2<half, defaultp>::operator*=
(
half const & s
)
@@ -221,9 +221,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half> & tvec2<half>::operator*=
GLM_FUNC_QUALIFIER tvec2<half, defaultp> & tvec2<half, defaultp>::operator*=
(
tvec2<half> const & v
tvec2<half, defaultp> const & v
)
{
this->x *= v.x;
@@ -231,7 +231,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half> & tvec2<half>::operator/=
GLM_FUNC_QUALIFIER tvec2<half, defaultp> & tvec2<half, defaultp>::operator/=
(
half const & s
)
@@ -241,9 +241,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half> & tvec2<half>::operator/=
GLM_FUNC_QUALIFIER tvec2<half, defaultp> & tvec2<half, defaultp>::operator/=
(
tvec2<half> const & v
tvec2<half, defaultp> const & v
)
{
this->x /= v.x;
@@ -251,14 +251,14 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half> & tvec2<half>::operator++()
GLM_FUNC_QUALIFIER tvec2<half, defaultp> & tvec2<half, defaultp>::operator++()
{
++this->x;
++this->y;
return *this;
}
GLM_FUNC_QUALIFIER tvec2<half>& tvec2<half>::operator--()
GLM_FUNC_QUALIFIER tvec2<half, defaultp>& tvec2<half, defaultp>::operator--()
{
--this->x;
--this->y;
@@ -268,38 +268,38 @@ namespace detail
//////////////////////////////////////
// Swizzle operators
GLM_FUNC_QUALIFIER half tvec2<half>::swizzle(comp x) const
GLM_FUNC_QUALIFIER half tvec2<half, defaultp>::swizzle(comp x) const
{
return (*this)[x];
}
GLM_FUNC_QUALIFIER tvec2<half> tvec2<half>::swizzle(comp x, comp y) const
GLM_FUNC_QUALIFIER tvec2<half, defaultp> tvec2<half, defaultp>::swizzle(comp x, comp y) const
{
return tvec2<half>(
return tvec2<half, defaultp>(
(*this)[x],
(*this)[y]);
}
GLM_FUNC_QUALIFIER tvec3<half> tvec2<half>::swizzle(comp x, comp y, comp z) const
GLM_FUNC_QUALIFIER tvec3<half, defaultp> tvec2<half, defaultp>::swizzle(comp x, comp y, comp z) const
{
return tvec3<half>(
return tvec3<half, defaultp>(
(*this)[x],
(*this)[y],
(*this)[z]);
}
GLM_FUNC_QUALIFIER tvec4<half> tvec2<half>::swizzle(comp x, comp y, comp z, comp w) const
GLM_FUNC_QUALIFIER tvec4<half, defaultp> tvec2<half, defaultp>::swizzle(comp x, comp y, comp z, comp w) const
{
return tvec4<half>(
return tvec4<half, defaultp>(
(*this)[x],
(*this)[y],
(*this)[z],
(*this)[w]);
}
GLM_FUNC_QUALIFIER tref2<half> tvec2<half>::swizzle(comp x, comp y)
GLM_FUNC_QUALIFIER tref2<half, defaultp> tvec2<half, defaultp>::swizzle(comp x, comp y)
{
return tref2<half>(
return tref2<half, defaultp>(
(*this)[x],
(*this)[y]);
}
@@ -307,12 +307,12 @@ namespace detail
//////////////////////////////////////
// hvec3
GLM_FUNC_QUALIFIER tvec3<half>::size_type tvec3<half>::length() const
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::size_type tvec3<half, defaultp>::length() const
{
return 3;
}
GLM_FUNC_QUALIFIER tvec3<half>::size_type tvec3<half>::value_size()
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::size_type tvec3<half, defaultp>::value_size()
{
return 3;
}
@@ -320,22 +320,22 @@ namespace detail
//////////////////////////////////////
// Accesses
GLM_FUNC_QUALIFIER half & tvec3<half>::operator[]
GLM_FUNC_QUALIFIER half & tvec3<half, defaultp>::operator[]
(
tvec3<half>::size_type i
tvec3<half, defaultp>::size_type i
)
{
assert(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
assert(i < this->length());
return (&x)[i];
}
GLM_FUNC_QUALIFIER half const & tvec3<half>::operator[]
GLM_FUNC_QUALIFIER half const & tvec3<half, defaultp>::operator[]
(
tvec3<half>::size_type i
tvec3<half, defaultp>::size_type i
) const
{
assert(/*i >= tvec3<half>::size_type(0) &&*/ i < tvec3<half>::value_size());
assert(i < this->length());
return (&x)[i];
}
@@ -343,15 +343,15 @@ namespace detail
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_QUALIFIER tvec3<half>::tvec3() :
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3() :
x(half(0)),
y(half(0)),
z(half(0))
{}
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
tvec3<half> const & v
tvec3<half, defaultp> const & v
) :
x(v.x),
y(v.y),
@@ -361,7 +361,7 @@ namespace detail
//////////////////////////////////////
// Explicit basic constructors
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
half const & s
) :
@@ -370,7 +370,7 @@ namespace detail
z(s)
{}
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
half const & s0,
half const & s1,
@@ -384,9 +384,9 @@ namespace detail
//////////////////////////////////////
// Swizzle constructors
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
tref3<half> const & r
tref3<half, defaultp> const & r
) :
x(r.x),
y(r.y),
@@ -396,8 +396,8 @@ namespace detail
//////////////////////////////////////
// Convertion scalar constructors
template <typename U>
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
template <typename U>
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
U const & x
) :
@@ -407,7 +407,7 @@ namespace detail
{}
template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
A const & x,
B const & y,
@@ -421,10 +421,10 @@ namespace detail
//////////////////////////////////////
// Convertion vector constructors
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
tvec2<A> const & v,
tvec2<A, defaultp> const & v,
B const & s
) :
x(half(v.x)),
@@ -432,31 +432,31 @@ namespace detail
z(half(s))
{}
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
A const & s,
tvec2<B> const & v
A const & s,
tvec2<B, defaultp> const & v
) :
x(half(s)),
y(half(v.x)),
z(half(v.y))
{}
template <typename U>
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
template <typename U>
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
tvec3<U> const & v
tvec3<U, defaultp> const & v
) :
x(half(v.x)),
y(half(v.y)),
z(half(v.z))
{}
template <typename U>
GLM_FUNC_QUALIFIER tvec3<half>::tvec3
template <typename U>
GLM_FUNC_QUALIFIER tvec3<half, defaultp>::tvec3
(
tvec4<U> const & v
tvec4<U, defaultp> const & v
) :
x(half(v.x)),
y(half(v.y)),
@@ -466,9 +466,9 @@ namespace detail
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator=
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator=
(
tvec3<half> const & v
tvec3<half, defaultp> const & v
)
{
this->x = v.x;
@@ -477,7 +477,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator+=
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator+=
(
half const & s
)
@@ -488,9 +488,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator+=
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator+=
(
tvec3<half> const & v
tvec3<half, defaultp> const & v
)
{
this->x += v.x;
@@ -499,7 +499,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator-=
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator-=
(
half const & s
)
@@ -510,9 +510,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator-=
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator-=
(
tvec3<half> const & v
tvec3<half, defaultp> const & v
)
{
this->x -= v.x;
@@ -521,7 +521,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator*=
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator*=
(
half const & s
)
@@ -532,9 +532,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator*=
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator*=
(
tvec3<half> const & v
tvec3<half, defaultp> const & v
)
{
this->x *= v.x;
@@ -543,7 +543,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator/=
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator/=
(
half const & s
)
@@ -554,9 +554,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator/=
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator/=
(
tvec3<half> const & v
tvec3<half, defaultp> const & v
)
{
this->x /= v.x;
@@ -565,7 +565,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator++()
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator++()
{
++this->x;
++this->y;
@@ -573,7 +573,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec3<half> & tvec3<half>::operator--()
GLM_FUNC_QUALIFIER tvec3<half, defaultp> & tvec3<half, defaultp>::operator--()
{
--this->x;
--this->y;
@@ -584,38 +584,38 @@ namespace detail
//////////////////////////////////////
// Swizzle operators
GLM_FUNC_QUALIFIER half tvec3<half>::swizzle(comp x) const
GLM_FUNC_QUALIFIER half tvec3<half, defaultp>::swizzle(comp x) const
{
return (*this)[x];
}
GLM_FUNC_QUALIFIER tvec2<half> tvec3<half>::swizzle(comp x, comp y) const
GLM_FUNC_QUALIFIER tvec2<half, defaultp> tvec3<half, defaultp>::swizzle(comp x, comp y) const
{
return tvec2<half>(
return tvec2<half, defaultp>(
(*this)[x],
(*this)[y]);
}
GLM_FUNC_QUALIFIER tvec3<half> tvec3<half>::swizzle(comp x, comp y, comp z) const
GLM_FUNC_QUALIFIER tvec3<half, defaultp> tvec3<half, defaultp>::swizzle(comp x, comp y, comp z) const
{
return tvec3<half>(
return tvec3<half, defaultp>(
(*this)[x],
(*this)[y],
(*this)[z]);
}
GLM_FUNC_QUALIFIER tvec4<half> tvec3<half>::swizzle(comp x, comp y, comp z, comp w) const
GLM_FUNC_QUALIFIER tvec4<half, defaultp> tvec3<half, defaultp>::swizzle(comp x, comp y, comp z, comp w) const
{
return tvec4<half>(
return tvec4<half, defaultp>(
(*this)[x],
(*this)[y],
(*this)[z],
(*this)[w]);
}
GLM_FUNC_QUALIFIER tref3<half> tvec3<half>::swizzle(comp x, comp y, comp z)
GLM_FUNC_QUALIFIER tref3<half, defaultp> tvec3<half, defaultp>::swizzle(comp x, comp y, comp z)
{
return tref3<half>(
return tref3<half, defaultp>(
(*this)[x],
(*this)[y],
(*this)[z]);
@@ -624,12 +624,12 @@ namespace detail
//////////////////////////////////////
// hvec4
GLM_FUNC_QUALIFIER tvec4<half>::size_type tvec4<half>::length() const
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::size_type tvec4<half, defaultp>::length() const
{
return 4;
}
GLM_FUNC_QUALIFIER tvec4<half>::size_type tvec4<half>::value_size()
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::size_type tvec4<half, defaultp>::value_size()
{
return 4;
}
@@ -637,22 +637,22 @@ namespace detail
//////////////////////////////////////
// Accesses
GLM_FUNC_QUALIFIER half & tvec4<half>::operator[]
GLM_FUNC_QUALIFIER half & tvec4<half, defaultp>::operator[]
(
tvec4<half>::size_type i
tvec4<half, defaultp>::size_type i
)
{
assert(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
assert(i < this->length());
return (&x)[i];
}
GLM_FUNC_QUALIFIER half const & tvec4<half>::operator[]
GLM_FUNC_QUALIFIER half const & tvec4<half, defaultp>::operator[]
(
tvec4<half>::size_type i
tvec4<half, defaultp>::size_type i
) const
{
assert(/*i >= tvec4<half>::size_type(0) && */i < tvec4<half>::value_size());
assert(i < this->length());
return (&x)[i];
}
@@ -660,16 +660,16 @@ namespace detail
//////////////////////////////////////
// Implicit basic constructors
GLM_FUNC_QUALIFIER tvec4<half>::tvec4() :
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4() :
x(half(0)),
y(half(0)),
z(half(0)),
w(half(0))
{}
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
tvec4<half> const & v
tvec4<half, defaultp> const & v
) :
x(v.x),
y(v.y),
@@ -680,7 +680,7 @@ namespace detail
//////////////////////////////////////
// Explicit basic constructors
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
half const & s
) :
@@ -690,7 +690,7 @@ namespace detail
w(s)
{}
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
half const & s1,
half const & s2,
@@ -706,9 +706,9 @@ namespace detail
//////////////////////////////////////
// Swizzle constructors
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
tref4<half> const & r
tref4<half, defaultp> const & r
) :
x(r.x),
y(r.y),
@@ -720,7 +720,7 @@ namespace detail
// Convertion scalar constructors
template <typename U>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
U const & x
) :
@@ -731,7 +731,7 @@ namespace detail
{}
template <typename A, typename B, typename C, typename D>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
A const & x,
B const & y,
@@ -748,9 +748,9 @@ namespace detail
// Convertion vector constructors
template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
tvec2<A> const & v,
tvec2<A, defaultp> const & v,
B const & s1,
C const & s2
) :
@@ -761,10 +761,10 @@ namespace detail
{}
template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
A const & s1,
tvec2<B> const & v,
tvec2<B, defaultp> const & v,
C const & s2
) :
x(half(s1)),
@@ -774,11 +774,11 @@ namespace detail
{}
template <typename A, typename B, typename C>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
A const & s1,
B const & s2,
tvec2<C> const & v
tvec2<C, defaultp> const & v
) :
x(half(s1)),
y(half(s2)),
@@ -787,9 +787,9 @@ namespace detail
{}
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
tvec3<A> const & v,
tvec3<A, defaultp> const & v,
B const & s
) :
x(half(v.x)),
@@ -799,10 +799,10 @@ namespace detail
{}
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
A const & s,
tvec3<B> const & v
tvec3<B, defaultp> const & v
) :
x(half(s)),
y(half(v.x)),
@@ -811,10 +811,10 @@ namespace detail
{}
template <typename A, typename B>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
tvec2<A> const & v1,
tvec2<B> const & v2
tvec2<A, defaultp> const & v1,
tvec2<B, defaultp> const & v2
) :
x(half(v1.x)),
y(half(v1.y)),
@@ -823,9 +823,9 @@ namespace detail
{}
template <typename U>
GLM_FUNC_QUALIFIER tvec4<half>::tvec4
GLM_FUNC_QUALIFIER tvec4<half, defaultp>::tvec4
(
tvec4<U> const & v
tvec4<U, defaultp> const & v
) :
x(half(v.x)),
y(half(v.y)),
@@ -836,9 +836,9 @@ namespace detail
//////////////////////////////////////
// Unary arithmetic operators
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator=
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator=
(
tvec4<half> const & v
tvec4<half, defaultp> const & v
)
{
this->x = v.x;
@@ -848,7 +848,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator+=
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator+=
(
half const & s
)
@@ -860,9 +860,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator+=
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator+=
(
tvec4<half> const & v
tvec4<half, defaultp> const & v
)
{
this->x += v.x;
@@ -872,7 +872,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator-=
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator-=
(
half const & s
)
@@ -884,9 +884,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator-=
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator-=
(
tvec4<half> const & v
tvec4<half, defaultp> const & v
)
{
this->x -= v.x;
@@ -896,7 +896,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator*=
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator*=
(
half const & s
)
@@ -908,9 +908,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator*=
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator*=
(
tvec4<half> const & v
tvec4<half, defaultp> const & v
)
{
this->x *= v.x;
@@ -920,7 +920,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator/=
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator/=
(
half const & s
)
@@ -932,9 +932,9 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator/=
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator/=
(
tvec4<half> const & v
tvec4<half, defaultp> const & v
)
{
this->x /= v.x;
@@ -944,7 +944,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator++()
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator++()
{
++this->x;
++this->y;
@@ -953,7 +953,7 @@ namespace detail
return *this;
}
GLM_FUNC_QUALIFIER tvec4<half>& tvec4<half>::operator--()
GLM_FUNC_QUALIFIER tvec4<half, defaultp>& tvec4<half, defaultp>::operator--()
{
--this->x;
--this->y;
@@ -965,38 +965,38 @@ namespace detail
//////////////////////////////////////
// Swizzle operators
GLM_FUNC_QUALIFIER half tvec4<half>::swizzle(comp x) const
GLM_FUNC_QUALIFIER half tvec4<half, defaultp>::swizzle(comp x) const
{
return (*this)[x];
}
GLM_FUNC_QUALIFIER tvec2<half> tvec4<half>::swizzle(comp x, comp y) const
GLM_FUNC_QUALIFIER tvec2<half, defaultp> tvec4<half, defaultp>::swizzle(comp x, comp y) const
{
return tvec2<half>(
return tvec2<half, defaultp>(
(*this)[x],
(*this)[y]);
}
GLM_FUNC_QUALIFIER tvec3<half> tvec4<half>::swizzle(comp x, comp y, comp z) const
GLM_FUNC_QUALIFIER tvec3<half, defaultp> tvec4<half, defaultp>::swizzle(comp x, comp y, comp z) const
{
return tvec3<half>(
return tvec3<half, defaultp>(
(*this)[x],
(*this)[y],
(*this)[z]);
}
GLM_FUNC_QUALIFIER tvec4<half> tvec4<half>::swizzle(comp x, comp y, comp z, comp w) const
GLM_FUNC_QUALIFIER tvec4<half, defaultp> tvec4<half, defaultp>::swizzle(comp x, comp y, comp z, comp w) const
{
return tvec4<half>(
return tvec4<half, defaultp>(
(*this)[x],
(*this)[y],
(*this)[z],
(*this)[w]);
}
GLM_FUNC_QUALIFIER tref4<half> tvec4<half>::swizzle(comp x, comp y, comp z, comp w)
GLM_FUNC_QUALIFIER tref4<half, defaultp> tvec4<half, defaultp>::swizzle(comp x, comp y, comp z, comp w)
{
return tref4<half>(
return tref4<half, defaultp>(
(*this)[x],
(*this)[y],
(*this)[z],

View File

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

View File

@@ -28,43 +28,43 @@
namespace glm
{
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> affineInverse
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> affineInverse
(
detail::tmat3x3<T> const & m
detail::tmat3x3<T, P> const & m
)
{
detail::tmat3x3<T> Result(m);
Result[2] = detail::tvec3<T>(0, 0, 1);
detail::tmat3x3<T, P> Result(m);
Result[2] = detail::tvec3<T, P>(0, 0, 1);
Result = transpose(Result);
detail::tvec3<T> Translation = Result * detail::tvec3<T>(-detail::tvec2<T>(m[2]), m[2][2]);
detail::tvec3<T, P> Translation = Result * detail::tvec3<T, P>(-detail::tvec2<T, P>(m[2]), m[2][2]);
Result[2] = Translation;
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> affineInverse
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> affineInverse
(
detail::tmat4x4<T> const & m
detail::tmat4x4<T, P> const & m
)
{
detail::tmat4x4<T> Result(m);
Result[3] = detail::tvec4<T>(0, 0, 0, 1);
detail::tmat4x4<T, P> Result(m);
Result[3] = detail::tvec4<T, P>(0, 0, 0, 1);
Result = transpose(Result);
detail::tvec4<T> Translation = Result * detail::tvec4<T>(-detail::tvec3<T>(m[3]), m[3][3]);
detail::tvec4<T, P> Translation = Result * detail::tvec4<T, P>(-detail::tvec3<T, P>(m[3]), m[3][3]);
Result[3] = Translation;
return Result;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat2x2<valType> inverseTranspose
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat2x2<T, P> inverseTranspose
(
detail::tmat2x2<valType> const & m
detail::tmat2x2<T, P> const & m
)
{
valType Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
T Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1];
detail::tmat2x2<valType> Inverse(
detail::tmat2x2<T, P> Inverse(
+ m[1][1] / Determinant,
- m[0][1] / Determinant,
- m[1][0] / Determinant,
@@ -73,18 +73,18 @@ namespace glm
return Inverse;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat3x3<valType> inverseTranspose
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> inverseTranspose
(
detail::tmat3x3<valType> const & m
detail::tmat3x3<T, P> const & m
)
{
valType Determinant =
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]);
detail::tmat3x3<valType> Inverse;
detail::tmat3x3<T, P> Inverse;
Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]);
Inverse[0][1] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]);
Inverse[0][2] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]);
@@ -99,33 +99,33 @@ namespace glm
return Inverse;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> inverseTranspose
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> inverseTranspose
(
detail::tmat4x4<valType> const & m
detail::tmat4x4<T, P> const & m
)
{
valType SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
valType SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
valType SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
valType SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];
valType SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2];
valType SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1];
valType SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3];
valType SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3];
valType SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2];
valType SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3];
valType SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2];
valType SubFactor11 = m[1][1] * m[3][3] - m[3][1] * m[1][3];
valType SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1];
valType SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3];
valType SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3];
valType SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2];
valType SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3];
valType SubFactor17 = m[1][0] * m[2][2] - m[2][0] * m[1][2];
valType SubFactor18 = m[1][0] * m[2][1] - m[2][0] * m[1][1];
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];
T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2];
T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3];
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];
T SubFactor06 = m[1][2] * m[3][3] - m[3][2] * m[1][3];
T SubFactor07 = m[1][1] * m[3][3] - m[3][1] * m[1][3];
T SubFactor08 = m[1][1] * m[3][2] - m[3][1] * m[1][2];
T SubFactor09 = m[1][0] * m[3][3] - m[3][0] * m[1][3];
T SubFactor10 = m[1][0] * m[3][2] - m[3][0] * m[1][2];
T SubFactor11 = m[1][1] * m[3][3] - m[3][1] * m[1][3];
T SubFactor12 = m[1][0] * m[3][1] - m[3][0] * m[1][1];
T SubFactor13 = m[1][2] * m[2][3] - m[2][2] * m[1][3];
T SubFactor14 = m[1][1] * m[2][3] - m[2][1] * m[1][3];
T SubFactor15 = m[1][1] * m[2][2] - m[2][1] * m[1][2];
T SubFactor16 = m[1][0] * m[2][3] - m[2][0] * m[1][3];
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];
detail::tmat4x4<valType> Inverse;
detail::tmat4x4<T, P> Inverse;
Inverse[0][0] = + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02);
Inverse[0][1] = - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04);
Inverse[0][2] = + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05);
@@ -146,10 +146,10 @@ namespace glm
Inverse[3][2] = - (m[0][0] * SubFactor14 - m[0][1] * SubFactor16 + m[0][3] * SubFactor18);
Inverse[3][3] = + (m[0][0] * SubFactor15 - m[0][1] * SubFactor17 + m[0][2] * SubFactor18);
valType Determinant =
+ m[0][0] * Inverse[0][0]
+ m[0][1] * Inverse[0][1]
+ m[0][2] * Inverse[0][2]
T Determinant =
+ m[0][0] * Inverse[0][0]
+ m[0][1] * Inverse[0][1]
+ m[0][2] * Inverse[0][2]
+ m[0][3] * Inverse[0][3];
Inverse /= Determinant;

View File

@@ -76,12 +76,12 @@ namespace glm
/// @see gtc_matrix_transform
/// @see gtx_transform
/// @see - translate(T x, T y, T z)
/// @see - translate(detail::tmat4x4<T> const & m, T x, T y, T z)
/// @see - translate(detail::tvec3<T> const & v)
template <typename T>
detail::tmat4x4<T> translate(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v);
/// @see - translate(detail::tmat4x4<T, P> const & m, T x, T y, T z)
/// @see - translate(detail::tvec3<T, P> const & v)
template <typename T, precision P>
detail::tmat4x4<T, P> translate(
detail::tmat4x4<T, P> const & m,
detail::tvec3<T, P> const & v);
/// Builds a rotation 4 * 4 matrix created from an axis vector and an angle.
///
@@ -92,13 +92,13 @@ namespace glm
/// @see gtc_matrix_transform
/// @see gtx_transform
/// @see - rotate(T angle, T x, T y, T z)
/// @see - rotate(detail::tmat4x4<T> const & m, T angle, T x, T y, T z)
/// @see - rotate(T angle, detail::tvec3<T> const & v)
template <typename T>
detail::tmat4x4<T> rotate(
detail::tmat4x4<T> const & m,
T const & angle,
detail::tvec3<T> const & axis);
/// @see - rotate(detail::tmat4x4<T, P> const & m, T angle, T x, T y, T z)
/// @see - rotate(T angle, detail::tvec3<T, P> const & v)
template <typename T, precision P>
detail::tmat4x4<T, P> rotate(
detail::tmat4x4<T, P> const & m,
T const & angle,
detail::tvec3<T, P> const & axis);
/// Builds a scale 4 * 4 matrix created from 3 scalars.
///
@@ -108,12 +108,12 @@ namespace glm
/// @see gtc_matrix_transform
/// @see gtx_transform
/// @see - scale(T x, T y, T z) scale(T const & x, T const & y, T const & z)
/// @see - scale(detail::tmat4x4<T> const & m, T x, T y, T z)
/// @see - scale(detail::tvec3<T> const & v)
template <typename T>
detail::tmat4x4<T> scale(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v);
/// @see - scale(detail::tmat4x4<T, P> const & m, T x, T y, T z)
/// @see - scale(detail::tvec3<T, P> const & v)
template <typename T, precision P>
detail::tmat4x4<T, P> scale(
detail::tmat4x4<T, P> const & m,
detail::tvec3<T, P> const & v);
/// Creates a matrix for an orthographic parallel viewing volume.
///
@@ -126,13 +126,13 @@ 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>
detail::tmat4x4<T> ortho(
T const & left,
T const & right,
T const & bottom,
T const & top,
T const & zNear,
template <typename T>
detail::tmat4x4<T, defaultp> ortho(
T const & left,
T const & right,
T const & bottom,
T const & top,
T const & zNear,
T const & zFar);
/// Creates a matrix for projecting two-dimensional coordinates onto the screen.
@@ -144,11 +144,11 @@ 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>
detail::tmat4x4<T> ortho(
T const & left,
T const & right,
T const & bottom,
template <typename T>
detail::tmat4x4<T, defaultp> ortho(
T const & left,
T const & right,
T const & bottom,
T const & top);
/// Creates a frustum matrix.
@@ -161,13 +161,13 @@ 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>
detail::tmat4x4<T> frustum(
T const & left,
T const & right,
T const & bottom,
T const & top,
T const & near,
template <typename T, precision P>
detail::tmat4x4<T, P> frustum(
T const & left,
T const & right,
T const & bottom,
T const & top,
T const & near,
T const & far);
/// Creates a matrix for a symetric perspective-view frustum.
@@ -178,11 +178,11 @@ 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>
detail::tmat4x4<T> perspective(
T const & fovy,
T const & aspect,
T const & near,
template <typename T, precision P>
detail::tmat4x4<T, P> perspective(
T const & fovy,
T const & aspect,
T const & near,
T const & far);
/// Builds a perspective projection matrix based on a field of view.
@@ -194,13 +194,13 @@ 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 valType>
detail::tmat4x4<valType> perspectiveFov(
valType const & fov,
valType const & width,
valType const & height,
valType const & near,
valType const & far);
template <typename T, precision P>
detail::tmat4x4<T, P> perspectiveFov(
T const & fov,
T const & width,
T const & height,
T const & near,
T const & far);
/// Creates a matrix for a symmetric perspective-view frustum with far plane at infinite.
///
@@ -209,8 +209,8 @@ namespace glm
/// @param near
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
detail::tmat4x4<T> infinitePerspective(
template <typename T, precision P>
detail::tmat4x4<T, P> infinitePerspective(
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.
@@ -220,8 +220,8 @@ namespace glm
/// @param near
/// @tparam T Value type used to build the matrix. Currently supported: half (not recommanded), float or double.
/// @see gtc_matrix_transform
template <typename T>
detail::tmat4x4<T> tweakedInfinitePerspective(
template <typename T, precision P>
detail::tmat4x4<T, P> tweakedInfinitePerspective(
T fovy, T aspect, T near);
/// Map the specified object coordinates (obj.x, obj.y, obj.z) into window coordinates.
@@ -233,55 +233,55 @@ 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>
detail::tvec3<T> project(
detail::tvec3<T> const & obj,
detail::tmat4x4<T> const & model,
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport);
template <typename T, typename U, precision P>
detail::tvec3<T, P> project(
detail::tvec3<T, P> const & obj,
detail::tmat4x4<T, P> const & model,
detail::tmat4x4<T, P> const & proj,
detail::tvec4<U, P> const & viewport);
/// Map the specified window coordinates (win.x, win.y, win.z) into object coordinates.
///
/// @param win
/// @param model
///
/// @param win
/// @param model
/// @param proj
/// @param viewport
/// @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>
detail::tvec3<T> unProject(
detail::tvec3<T> const & win,
detail::tmat4x4<T> const & model,
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport);
/// Define a picking region
///
/// @param center
/// @param delta
/// @param viewport
/// @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>
detail::tmat4x4<T> pickMatrix(
detail::tvec2<T> const & center,
detail::tvec2<T> const & delta,
detail::tvec4<U> const & viewport);
template <typename T, typename U, precision P>
detail::tvec3<T, P> unProject(
detail::tvec3<T, P> const & win,
detail::tmat4x4<T, P> const & model,
detail::tmat4x4<T, P> const & proj,
detail::tvec4<U, P> const & viewport);
/// Define a picking region
///
/// @param center
/// @param delta
/// @param viewport
/// @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>
detail::tmat4x4<T, P> pickMatrix(
detail::tvec2<T, P> const & center,
detail::tvec2<T, P> const & delta,
detail::tvec4<U, P> const & viewport);
/// Build a look at view matrix.
///
///
/// @param eye Position of the camera
/// @param center Position where the camera is looking at
/// @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>
detail::tmat4x4<T> lookAt(
detail::tvec3<T> const & eye,
detail::tvec3<T> const & center,
detail::tvec3<T> const & up);
template <typename T, precision P>
detail::tmat4x4<T, P> lookAt(
detail::tvec3<T, P> const & eye,
detail::tvec3<T, P> const & center,
detail::tvec3<T, P> const & up);
/// @}
}//namespace glm

View File

@@ -28,24 +28,24 @@
namespace glm
{
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> translate
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
detail::tmat4x4<T, P> const & m,
detail::tvec3<T, P> const & v
)
{
detail::tmat4x4<T> Result(m);
detail::tmat4x4<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>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> rotate
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> rotate
(
detail::tmat4x4<T> const & m,
T const & angle,
detail::tvec3<T> const & v
detail::tmat4x4<T, P> const & m,
T const & angle,
detail::tvec3<T, P> const & v
)
{
#ifdef GLM_FORCE_RADIANS
@@ -56,11 +56,11 @@ namespace glm
T c = cos(a);
T s = sin(a);
detail::tvec3<T> axis = normalize(v);
detail::tvec3<T, P> axis = normalize(v);
detail::tvec3<T> temp = (T(1) - c) * axis;
detail::tvec3<T, P> temp = (T(1) - c) * axis;
detail::tmat4x4<T> Rotate(detail::tmat4x4<T>::null);
detail::tmat4x4<T, P> Rotate(detail::tmat4x4<T, P>::null);
Rotate[0][0] = c + temp[0] * axis[0];
Rotate[0][1] = 0 + temp[0] * axis[1] + s * axis[2];
Rotate[0][2] = 0 + temp[0] * axis[2] - s * axis[1];
@@ -73,7 +73,7 @@ namespace glm
Rotate[2][1] = 0 + temp[2] * axis[1] - s * axis[0];
Rotate[2][2] = c + temp[2] * axis[2];
detail::tmat4x4<T> Result(detail::tmat4x4<T>::null);
detail::tmat4x4<T, P> Result(detail::tmat4x4<T, P>::null);
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];
@@ -81,14 +81,14 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
detail::tmat4x4<T, P> const & m,
detail::tvec3<T, P> const & v
)
{
detail::tmat4x4<T> Result(detail::tmat4x4<T>::null);
detail::tmat4x4<T, P> Result(detail::tmat4x4<T, P>::null);
Result[0] = m[0] * v[0];
Result[1] = m[1] * v[1];
Result[2] = m[2] * v[2];
@@ -96,15 +96,15 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> translate_slow
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> translate_slow
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
detail::tmat4x4<T, P> const & m,
detail::tvec3<T, P> const & v
)
{
detail::tmat4x4<T> Result(T(1));
Result[3] = detail::tvec4<T>(v, T(1));
detail::tmat4x4<T, P> Result(T(1));
Result[3] = detail::tvec4<T, P>(v, T(1));
return m * Result;
//detail::tmat4x4<valType> Result(m);
@@ -116,12 +116,12 @@ namespace glm
//return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> rotate_slow
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> rotate_slow
(
detail::tmat4x4<T> const & m,
detail::tmat4x4<T, P> const & m,
T const & angle,
detail::tvec3<T> const & v
detail::tvec3<T, P> const & v
)
{
#ifdef GLM_FORCE_RADIANS
@@ -131,9 +131,9 @@ namespace glm
#endif
T c = cos(a);
T s = sin(a);
detail::tmat4x4<T> Result;
detail::tmat4x4<T, P> Result;
detail::tvec3<T> axis = normalize(v);
detail::tvec3<T, P> axis = normalize(v);
Result[0][0] = c + (1 - c) * axis.x * axis.x;
Result[0][1] = (1 - c) * axis.x * axis.y + s * axis.z;
@@ -150,73 +150,75 @@ namespace glm
Result[2][2] = c + (1 - c) * axis.z * axis.z;
Result[2][3] = 0;
Result[3] = detail::tvec4<T>(0, 0, 0, 1);
Result[3] = detail::tvec4<T, P>(0, 0, 0, 1);
return m * Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> scale_slow
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> scale_slow
(
detail::tmat4x4<T> const & m,
detail::tvec3<T> const & v
detail::tmat4x4<T, P> const & m,
detail::tvec3<T, P> const & v
)
{
detail::tmat4x4<T> Result(T(1));
detail::tmat4x4<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 valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> ortho
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, defaultp> ortho
(
valType const & left,
valType const & right,
valType const & bottom,
valType const & top,
valType const & zNear,
valType const & zFar
T const & left,
T const & right,
T const & bottom,
T const & top,
T const & zNear,
T const & zFar
)
{
detail::tmat4x4<valType> Result(1);
Result[0][0] = valType(2) / (right - left);
Result[1][1] = valType(2) / (top - bottom);
Result[2][2] = - valType(2) / (zFar - zNear);
detail::tmat4x4<T, defaultp> Result(1);
Result[0][0] = T(2) / (right - left);
Result[1][1] = T(2) / (top - bottom);
Result[2][2] = - T(2) / (zFar - zNear);
Result[3][0] = - (right + left) / (right - left);
Result[3][1] = - (top + bottom) / (top - bottom);
Result[3][2] = - (zFar + zNear) / (zFar - zNear);
return Result;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> ortho(
valType const & left,
valType const & right,
valType const & bottom,
valType const & top)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, defaultp> ortho
(
T const & left,
T const & right,
T const & bottom,
T const & top
)
{
detail::tmat4x4<valType> Result(1);
Result[0][0] = valType(2) / (right - left);
Result[1][1] = valType(2) / (top - bottom);
Result[2][2] = - valType(1);
detail::tmat4x4<T, defaultp> Result(1);
Result[0][0] = T(2) / (right - left);
Result[1][1] = T(2) / (top - bottom);
Result[2][2] = - T(1);
Result[3][0] = - (right + left) / (right - left);
Result[3][1] = - (top + bottom) / (top - bottom);
return Result;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> frustum
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType, defaultp> frustum
(
valType const & left,
valType const & right,
valType const & bottom,
valType const & top,
valType const & nearVal,
valType const & left,
valType const & right,
valType const & bottom,
valType const & top,
valType const & nearVal,
valType const & farVal
)
{
detail::tmat4x4<valType> Result(0);
detail::tmat4x4<valType, defaultp> Result(0);
Result[0][0] = (valType(2) * nearVal) / (right - left);
Result[1][1] = (valType(2) * nearVal) / (top - bottom);
Result[2][0] = (right + left) / (right - left);
@@ -227,12 +229,12 @@ namespace glm
return Result;
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> perspective
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType, defaultp> perspective
(
valType const & fovy,
valType const & aspect,
valType const & zNear,
valType const & fovy,
valType const & aspect,
valType const & zNear,
valType const & zFar
)
{
@@ -247,7 +249,7 @@ namespace glm
valType bottom = -range;
valType top = range;
detail::tmat4x4<valType> Result(valType(0));
detail::tmat4x4<valType, defaultp> Result(valType(0));
Result[0][0] = (valType(2) * zNear) / (right - left);
Result[1][1] = (valType(2) * zNear) / (top - bottom);
Result[2][2] = - (zFar + zNear) / (zFar - zNear);
@@ -257,12 +259,12 @@ namespace glm
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tmat4x4<valType> perspectiveFov
GLM_FUNC_QUALIFIER detail::tmat4x4<valType, defaultp> perspectiveFov
(
valType const & fov,
valType const & width,
valType const & height,
valType const & zNear,
valType const & fov,
valType const & width,
valType const & height,
valType const & zNear,
valType const & zFar
)
{
@@ -274,7 +276,7 @@ namespace glm
valType h = glm::cos(valType(0.5) * rad) / glm::sin(valType(0.5) * rad);
valType w = h * height / width; ///todo max(width , Height) / min(width , Height)?
detail::tmat4x4<valType> Result(valType(0));
detail::tmat4x4<valType, defaultp> Result(valType(0));
Result[0][0] = w;
Result[1][1] = h;
Result[2][2] = - (zFar + zNear) / (zFar - zNear);
@@ -283,8 +285,8 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> infinitePerspective
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, defaultp> infinitePerspective
(
T fovy,
T aspect,
@@ -301,7 +303,7 @@ namespace glm
T bottom = -range;
T top = range;
detail::tmat4x4<T> Result(T(0));
detail::tmat4x4<T, defaultp> Result(T(0));
Result[0][0] = (T(2) * zNear) / (right - left);
Result[1][1] = (T(2) * zNear) / (top - bottom);
Result[2][2] = - T(1);
@@ -310,8 +312,8 @@ namespace glm
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> tweakedInfinitePerspective
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, defaultp> tweakedInfinitePerspective
(
T fovy,
T aspect,
@@ -328,7 +330,7 @@ namespace glm
T bottom = -range;
T top = range;
detail::tmat4x4<T> Result(T(0));
detail::tmat4x4<T, defaultp> Result(T(0));
Result[0][0] = (T(2) * zNear) / (right - left);
Result[1][1] = (T(2) * zNear) / (top - bottom);
Result[2][2] = T(0.0001) - T(1);
@@ -337,16 +339,16 @@ namespace glm
return Result;
}
template <typename T, typename U>
GLM_FUNC_QUALIFIER detail::tvec3<T> project
template <typename T, precision P, typename U>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> project
(
detail::tvec3<T> const & obj,
detail::tmat4x4<T> const & model,
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport
detail::tvec3<T, P> const & obj,
detail::tmat4x4<T, P> const & model,
detail::tmat4x4<T, P> const & proj,
detail::tvec4<U, P> const & viewport
)
{
detail::tvec4<T> tmp = detail::tvec4<T>(obj, T(1));
detail::tvec4<T, P> tmp = detail::tvec4<T, P>(obj, T(1));
tmp = model * tmp;
tmp = proj * tmp;
@@ -355,69 +357,69 @@ namespace glm
tmp[0] = tmp[0] * T(viewport[2]) + T(viewport[0]);
tmp[1] = tmp[1] * T(viewport[3]) + T(viewport[1]);
return detail::tvec3<T>(tmp);
return detail::tvec3<T, P>(tmp);
}
template <typename T, typename U>
GLM_FUNC_QUALIFIER detail::tvec3<T> unProject
template <typename T, precision P, typename U>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> unProject
(
detail::tvec3<T> const & win,
detail::tmat4x4<T> const & model,
detail::tmat4x4<T> const & proj,
detail::tvec4<U> const & viewport
detail::tvec3<T, P> const & win,
detail::tmat4x4<T, P> const & model,
detail::tmat4x4<T, P> const & proj,
detail::tvec4<U, P> const & viewport
)
{
detail::tmat4x4<T> inverse = glm::inverse(proj * model);
detail::tmat4x4<T, P> inverse = glm::inverse(proj * model);
detail::tvec4<T> tmp = detail::tvec4<T>(win, T(1));
detail::tvec4<T, P> tmp = detail::tvec4<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]);
tmp = tmp * T(2) - T(1);
detail::tvec4<T> obj = inverse * tmp;
detail::tvec4<T, P> obj = inverse * tmp;
obj /= obj.w;
return detail::tvec3<T>(obj);
return detail::tvec3<T, P>(obj);
}
template <typename T, typename U>
detail::tmat4x4<T> pickMatrix
template <typename T, precision P, typename U>
detail::tmat4x4<T, P> pickMatrix
(
detail::tvec2<T> const & center,
detail::tvec2<T> const & delta,
detail::tvec4<U> const & viewport
detail::tvec2<T, P> const & center,
detail::tvec2<T, P> const & delta,
detail::tvec4<U, P> const & viewport
)
{
assert(delta.x > T(0) && delta.y > T(0));
detail::tmat4x4<T> Result(1.0f);
detail::tmat4x4<T, P> Result(1.0f);
if(!(delta.x > T(0) && delta.y > T(0)))
return Result; // Error
detail::tvec3<T> Temp(
detail::tvec3<T, P> Temp(
(T(viewport[2]) - T(2) * (center.x - T(viewport[0]))) / delta.x,
(T(viewport[3]) - T(2) * (center.y - T(viewport[1]))) / delta.y,
T(0));
// Translate and scale the picked region to the entire window
Result = translate(Result, Temp);
return scale(Result, detail::tvec3<T>(T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)));
return scale(Result, detail::tvec3<T, P>(T(viewport[2]) / delta.x, T(viewport[3]) / delta.y, T(1)));
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> lookAt
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> lookAt
(
detail::tvec3<T> const & eye,
detail::tvec3<T> const & center,
detail::tvec3<T> const & up
detail::tvec3<T, P> const & eye,
detail::tvec3<T, P> const & center,
detail::tvec3<T, P> const & up
)
{
detail::tvec3<T> f = normalize(center - eye);
detail::tvec3<T> u = normalize(up);
detail::tvec3<T> s = normalize(cross(f, u));
detail::tvec3<T, P> f = normalize(center - eye);
detail::tvec3<T, P> u = normalize(up);
detail::tvec3<T, P> s = normalize(cross(f, u));
u = cross(s, f);
detail::tmat4x4<T> Result(1);
detail::tmat4x4<T, P> Result(1);
Result[0][0] = s.x;
Result[1][0] = s.y;
Result[2][0] = s.z;

File diff suppressed because it is too large Load Diff

View File

@@ -52,7 +52,7 @@
namespace glm{
namespace detail
{
template <typename T>
template <typename T, precision P>
struct tquat// : public genType<T, tquat>
{
enum ctor{null};
@@ -68,108 +68,108 @@ namespace detail
// Constructors
tquat();
explicit tquat(
value_type const & s,
glm::detail::tvec3<T> const & v);
value_type const & s,
glm::detail::tvec3<T, P> const & v);
explicit tquat(
value_type const & w,
value_type const & x,
value_type const & y,
value_type const & w,
value_type const & x,
value_type const & y,
value_type const & z);
// Convertions
/// Build a quaternion from euler angles (pitch, yaw, roll), in radians.
explicit tquat(
tvec3<T> const & eulerAngles);
tvec3<T, P> const & eulerAngles);
explicit tquat(
tmat3x3<T> const & m);
tmat3x3<T, P> const & m);
explicit tquat(
tmat4x4<T> const & m);
tmat4x4<T, P> const & m);
// Accesses
value_type & operator[](int i);
value_type const & operator[](int i) const;
// Operators
tquat<T> & operator*=(value_type const & s);
tquat<T> & operator/=(value_type const & s);
tquat<T, P> & operator*=(value_type const & s);
tquat<T, P> & operator/=(value_type const & s);
};
template <typename T>
detail::tquat<T> operator- (
detail::tquat<T> const & q);
template <typename T, precision P>
detail::tquat<T, P> operator- (
detail::tquat<T, P> const & q);
template <typename T>
detail::tquat<T> operator+ (
detail::tquat<T> const & q,
detail::tquat<T> const & p);
template <typename T, precision P>
detail::tquat<T, P> operator+ (
detail::tquat<T, P> const & q,
detail::tquat<T, P> const & p);
template <typename T>
detail::tquat<T> operator* (
detail::tquat<T> const & q,
detail::tquat<T> const & p);
template <typename T, precision P>
detail::tquat<T, P> operator* (
detail::tquat<T, P> const & q,
detail::tquat<T, P> const & p);
template <typename T>
detail::tvec3<T> operator* (
detail::tquat<T> const & q,
detail::tvec3<T> const & v);
template <typename T, precision P>
detail::tvec3<T, P> operator* (
detail::tquat<T, P> const & q,
detail::tvec3<T, P> const & v);
template <typename T>
detail::tvec3<T> operator* (
detail::tvec3<T> const & v,
detail::tquat<T> const & q);
template <typename T, precision P>
detail::tvec3<T, P> operator* (
detail::tvec3<T, P> const & v,
detail::tquat<T, P> const & q);
template <typename T>
detail::tvec4<T> operator* (
detail::tquat<T> const & q,
detail::tvec4<T> const & v);
template <typename T, precision P>
detail::tvec4<T, P> operator* (
detail::tquat<T, P> const & q,
detail::tvec4<T, P> const & v);
template <typename T>
detail::tvec4<T> operator* (
detail::tvec4<T> const & v,
detail::tquat<T> const & q);
template <typename T, precision P>
detail::tvec4<T, P> operator* (
detail::tvec4<T, P> const & v,
detail::tquat<T, P> const & q);
template <typename T>
detail::tquat<T> operator* (
detail::tquat<T> const & q,
typename detail::tquat<T>::value_type const & s);
template <typename T, precision P>
detail::tquat<T, P> operator* (
detail::tquat<T, P> const & q,
T const & s);
template <typename T>
detail::tquat<T> operator* (
typename detail::tquat<T>::value_type const & s,
detail::tquat<T> const & q);
template <typename T, precision P>
detail::tquat<T, P> operator* (
T const & s,
detail::tquat<T, P> const & q);
template <typename T>
detail::tquat<T> operator/ (
detail::tquat<T> const & q,
typename detail::tquat<T>::value_type const & s);
template <typename T, precision P>
detail::tquat<T, P> operator/ (
detail::tquat<T, P> const & q,
T const & s);
} //namespace detail
/// @addtogroup gtc_quaternion
/// @{
/// Returns the length of the quaternion.
/// Returns the length of the quaternion.
///
/// @see gtc_quaternion
template <typename T>
template <typename T, precision P>
T length(
detail::tquat<T> const & q);
detail::tquat<T, P> const & q);
/// Returns the normalized quaternion.
/// Returns the normalized quaternion.
///
/// @see gtc_quaternion
template <typename T>
detail::tquat<T> normalize(
detail::tquat<T> const & q);
template <typename T, precision P>
detail::tquat<T, P> normalize(
detail::tquat<T, P> const & q);
/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
/// Returns dot product of q1 and q2, i.e., q1[0] * q2[0] + q1[1] * q2[1] + ...
///
/// @see gtc_quaternion
template <typename T>
template <typename T, precision P>
T dot(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2);
detail::tquat<T, P> const & q1,
detail::tquat<T, P> const & q2);
/// Spherical linear interpolation of two quaternions.
/// The interpolation is oriented and the rotation is performed at constant speed.
@@ -180,14 +180,14 @@ namespace detail
/// @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
/// @see - slerp(detail::tquat<T> const & x, detail::tquat<T> const & y, T const & a)
template <typename T>
detail::tquat<T> mix(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
/// @see - slerp(detail::tquat<T, P> const & x, detail::tquat<T, P> const & y, T const & a)
template <typename T, precision P>
detail::tquat<T, P> mix(
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
T const & a);
/// Linear interpolation of two quaternions.
/// Linear interpolation of two quaternions.
/// The interpolation is oriented.
///
/// @param x A quaternion
@@ -195,10 +195,10 @@ namespace detail
/// @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>
detail::tquat<T> lerp(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
template <typename T, precision P>
detail::tquat<T, P> lerp(
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
T const & a);
/// Spherical linear interpolation of two quaternions.
@@ -209,25 +209,25 @@ namespace detail
/// @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>
detail::tquat<T> slerp(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
template <typename T, precision P>
detail::tquat<T, P> slerp(
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
T const & a);
/// Returns the q conjugate.
/// Returns the q conjugate.
///
/// @see gtc_quaternion
template <typename T>
detail::tquat<T> conjugate(
detail::tquat<T> const & q);
template <typename T, precision P>
detail::tquat<T, P> conjugate(
detail::tquat<T, P> const & q);
/// Returns the q inverse.
/// Returns the q inverse.
///
/// @see gtc_quaternion
template <typename T>
detail::tquat<T> inverse(
detail::tquat<T> const & q);
template <typename T, precision P>
detail::tquat<T, P> inverse(
detail::tquat<T, P> const & q);
/// Rotates a quaternion from a vector of 3 components axis and an angle.
///
@@ -236,83 +236,79 @@ namespace detail
/// @param axis Axis of the rotation
///
/// @see gtc_quaternion
template <typename T>
detail::tquat<T> rotate(
detail::tquat<T> const & q,
typename detail::tquat<T>::value_type const & angle,
detail::tvec3<T> const & axis);
template <typename T, precision P>
detail::tquat<T, P> rotate(
detail::tquat<T, P> const & q,
T const & angle,
detail::tvec3<T, P> const & axis);
/// Returns euler angles, yitch as x, yaw as y, roll as z.
/// Returns euler angles, yitch as x, yaw as y, roll as z.
///
/// @see gtc_quaternion
template <typename T>
detail::tvec3<T> eulerAngles(
detail::tquat<T> const & x);
template <typename T, precision P>
detail::tvec3<T, P> eulerAngles(
detail::tquat<T, P> const & x);
/// Returns roll value of euler angles expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
///
/// @see gtx_quaternion
template <typename valType>
valType roll(
detail::tquat<valType> const & x);
template <typename T, precision P>
T roll(detail::tquat<T, P> const & x);
/// Returns pitch value of euler angles expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
///
/// @see gtx_quaternion
template <typename valType>
valType pitch(
detail::tquat<valType> const & x);
template <typename T, precision P>
T pitch(detail::tquat<T, P> const & x);
/// Returns yaw value of euler angles expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
///
/// @see gtx_quaternion
template <typename valType>
valType yaw(
detail::tquat<valType> const & x);
template <typename T, precision P>
T yaw(detail::tquat<T, P> const & x);
/// Converts a quaternion to a 3 * 3 matrix.
/// Converts a quaternion to a 3 * 3 matrix.
///
/// @see gtc_quaternion
template <typename T>
detail::tmat3x3<T> mat3_cast(
detail::tquat<T> const & x);
template <typename T, precision P>
detail::tmat3x3<T, P> mat3_cast(
detail::tquat<T, P> const & x);
/// Converts a quaternion to a 4 * 4 matrix.
/// Converts a quaternion to a 4 * 4 matrix.
///
/// @see gtc_quaternion
template <typename T>
detail::tmat4x4<T> mat4_cast(
detail::tquat<T> const & x);
template <typename T, precision P>
detail::tmat4x4<T, P> mat4_cast(
detail::tquat<T, P> const & x);
/// Converts a 3 * 3 matrix to a quaternion.
/// Converts a 3 * 3 matrix to a quaternion.
///
/// @see gtc_quaternion
template <typename T>
detail::tquat<T> quat_cast(
detail::tmat3x3<T> const & x);
template <typename T, precision P>
detail::tquat<T, P> quat_cast(
detail::tmat3x3<T, P> const & x);
/// Converts a 4 * 4 matrix to a quaternion.
/// Converts a 4 * 4 matrix to a quaternion.
///
/// @see gtc_quaternion
template <typename T>
detail::tquat<T> quat_cast(
detail::tmat4x4<T> const & x);
template <typename T, precision P>
detail::tquat<T, P> quat_cast(
detail::tmat4x4<T, P> const & x);
/// Returns the quaternion rotation angle.
/// Returns the quaternion rotation angle.
///
/// @see gtc_quaternion
template <typename valType>
valType angle(
detail::tquat<valType> const & x);
template <typename T, precision P>
T angle(detail::tquat<T, P> const & x);
/// Returns the q rotation axis.
/// Returns the q rotation axis.
///
/// @see gtc_quaternion
template <typename valType>
detail::tvec3<valType> axis(
detail::tquat<valType> const & x);
template <typename T, precision P>
detail::tvec3<T, P> axis(
detail::tquat<T, P> const & x);
/// Build a quaternion from an angle and a normalized axis.
/// Build a quaternion from an angle and a normalized axis.
///
/// @param angle Angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
/// @param x x component of the x-axis, x, y, z must be a normalized axis
@@ -320,23 +316,23 @@ namespace detail
/// @param z z component of the z-axis, x, y, z must be a normalized axis
///
/// @see gtc_quaternion
template <typename valType>
detail::tquat<valType> angleAxis(
valType const & angle,
valType const & x,
valType const & y,
valType const & z);
template <typename T, precision P>
detail::tquat<T, P> angleAxis(
T const & angle,
T const & x,
T const & y,
T const & z);
/// Build a quaternion from an angle and a normalized axis.
///
/// @param angle Angle expressed in radians if GLM_FORCE_RADIANS is define or degrees otherwise.
/// @param axis Axis of the quaternion, must be normalized.
/// @param axis Axis of the quaternion, must be normalized.
///
/// @see gtc_quaternion
template <typename valType>
detail::tquat<valType> angleAxis(
valType const & angle,
detail::tvec3<valType> const & axis);
template <typename T, precision P>
detail::tquat<T, P> angleAxis(
T const & angle,
detail::tvec3<T, P> const & axis);
/// @}
} //namespace glm

View File

@@ -31,39 +31,39 @@
namespace glm{
namespace detail
{
template <typename T>
GLM_FUNC_QUALIFIER typename tquat<T>::size_type tquat<T>::length() const
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tquat<T, P>::size_type tquat<T, P>::length() const
{
return 4;
}
template <typename T>
GLM_FUNC_QUALIFIER tquat<T>::tquat() :
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat() :
x(0),
y(0),
z(0),
w(1)
{}
template <typename T>
GLM_FUNC_QUALIFIER tquat<T>::tquat
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
value_type const & s,
tvec3<T> const & v
) :
T const & s,
tvec3<T, P> const & v
) :
x(v.x),
y(v.y),
z(v.z),
w(s)
{}
template <typename T>
GLM_FUNC_QUALIFIER tquat<T>::tquat
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
value_type const & w,
value_type const & x,
value_type const & y,
value_type const & z
T const & w,
T const & x,
T const & y,
T const & z
) :
x(x),
y(y),
@@ -77,8 +77,8 @@ namespace detail
//template <typename valType>
//GLM_FUNC_QUALIFIER tquat<valType>::tquat
//(
// valType const & pitch,
// valType const & yaw,
// valType const & pitch,
// valType const & yaw,
// valType const & roll
//)
//{
@@ -92,14 +92,14 @@ namespace detail
// this->z = c.x * c.y * s.z - s.x * s.y * c.z;
//}
template <typename T>
GLM_FUNC_QUALIFIER tquat<T>::tquat
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
tvec3<T> const & eulerAngle
tvec3<T, P> const & eulerAngle
)
{
tvec3<T> c = glm::cos(eulerAngle * value_type(0.5));
tvec3<T> s = glm::sin(eulerAngle * value_type(0.5));
tvec3<T, P> c = glm::cos(eulerAngle * value_type(0.5));
tvec3<T, P> s = glm::sin(eulerAngle * value_type(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;
@@ -107,35 +107,35 @@ namespace detail
this->z = c.x * c.y * s.z - s.x * s.y * c.z;
}
template <typename T>
GLM_FUNC_QUALIFIER tquat<T>::tquat
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
tmat3x3<T> const & m
tmat3x3<T, P> const & m
)
{
*this = quat_cast(m);
}
template <typename T>
GLM_FUNC_QUALIFIER tquat<T>::tquat
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P>::tquat
(
tmat4x4<T> const & m
tmat4x4<T, P> const & m
)
{
*this = quat_cast(m);
}
//////////////////////////////////////////////////////////////
// tquat<T> accesses
// tquat<T, P> accesses
template <typename T>
GLM_FUNC_QUALIFIER typename tquat<T>::value_type & tquat<T>::operator [] (int i)
template <typename T, precision P>
GLM_FUNC_QUALIFIER T & tquat<T, P>::operator [](int i)
{
return (&x)[i];
}
template <typename T>
GLM_FUNC_QUALIFIER typename tquat<T>::value_type const & tquat<T>::operator [] (int i) const
template <typename T, precision P>
GLM_FUNC_QUALIFIER T const & tquat<T, P>::operator [](int i) const
{
return (&x)[i];
}
@@ -143,10 +143,10 @@ namespace detail
//////////////////////////////////////////////////////////////
// tquat<valType> operators
template <typename T>
GLM_FUNC_QUALIFIER tquat<T> & tquat<T>::operator *=
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator *=
(
value_type const & s
T const & s
)
{
this->w *= s;
@@ -156,10 +156,10 @@ namespace detail
return *this;
}
template <typename T>
GLM_FUNC_QUALIFIER tquat<T> & tquat<T>::operator /=
template <typename T, precision P>
GLM_FUNC_QUALIFIER tquat<T, P> & tquat<T, P>::operator /=
(
value_type const & s
T const & s
)
{
this->w /= s;
@@ -172,143 +172,143 @@ namespace detail
//////////////////////////////////////////////////////////////
// tquat<valType> external operators
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> operator-
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> operator-
(
detail::tquat<T> const & q
detail::tquat<T, P> const & q
)
{
return detail::tquat<T>(-q.w, -q.x, -q.y, -q.z);
return detail::tquat<T, P>(-q.w, -q.x, -q.y, -q.z);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> operator+
(
detail::tquat<T> const & q,
detail::tquat<T> const & p
)
{
return detail::tquat<T>(
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> operator+
(
detail::tquat<T, P> const & q,
detail::tquat<T, P> const & p
)
{
return detail::tquat<T, P>(
q.w + p.w,
q.x + p.x,
q.y + p.y,
q.z + p.z);
}
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> operator*
(
detail::tquat<T> const & q,
detail::tquat<T> const & p
)
{
return detail::tquat<T>(
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> operator*
(
detail::tquat<T, P> const & q,
detail::tquat<T, P> const & p
)
{
return detail::tquat<T, P>(
q.w * p.w - q.x * p.x - q.y * p.y - q.z * p.z,
q.w * p.x + q.x * p.w + q.y * p.z - q.z * p.y,
q.w * p.y + q.y * p.w + q.z * p.x - q.x * p.z,
q.w * p.z + q.z * p.w + q.x * p.y - q.y * p.x);
}
}
// Transformation
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T> operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> operator*
(
detail::tquat<T> const & q,
detail::tvec3<T> const & v
detail::tquat<T, P> const & q,
detail::tvec3<T, P> const & v
)
{
typename detail::tquat<T>::value_type Two(2);
typename detail::tquat<T, P>::value_type Two(2);
detail::tvec3<T> uv, uuv;
detail::tvec3<T> QuatVector(q.x, q.y, q.z);
detail::tvec3<T, P> uv, uuv;
detail::tvec3<T, P> QuatVector(q.x, q.y, q.z);
uv = glm::cross(QuatVector, v);
uuv = glm::cross(QuatVector, uv);
uv *= (Two * q.w);
uuv *= Two;
uv *= (Two * q.w);
uuv *= Two;
return v + uv + uuv;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T> operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> operator*
(
detail::tvec3<T> const & v,
detail::tquat<T> const & q
detail::tvec3<T, P> const & v,
detail::tquat<T, P> const & q
)
{
return inverse(q) * v;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec4<T> operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> operator*
(
detail::tquat<T> const & q,
detail::tvec4<T> const & v
detail::tquat<T, P> const & q,
detail::tvec4<T, P> const & v
)
{
return detail::tvec4<T>(q * detail::tvec3<T>(v), v.w);
return detail::tvec4<T, P>(q * detail::tvec3<T, P>(v), v.w);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec4<T> operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> operator*
(
detail::tvec4<T> const & v,
detail::tquat<T> const & q
detail::tvec4<T, P> const & v,
detail::tquat<T, P> const & q
)
{
return inverse(q) * v;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> operator*
(
detail::tquat<T> const & q,
typename detail::tquat<T>::value_type const & s
detail::tquat<T, P> const & q,
T const & s
)
{
return detail::tquat<T>(
return detail::tquat<T, P>(
q.w * s, q.x * s, q.y * s, q.z * s);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> operator*
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> operator*
(
typename detail::tquat<T>::value_type const & s,
detail::tquat<T> const & q
T const & s,
detail::tquat<T, P> const & q
)
{
return q * s;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> operator/
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> operator/
(
detail::tquat<T> const & q,
typename detail::tquat<T>::value_type const & s
detail::tquat<T, P> const & q,
T const & s
)
{
return detail::tquat<T>(
return detail::tquat<T, P>(
q.w / s, q.x / s, q.y / s, q.z / s);
}
//////////////////////////////////////
// Boolean operators
template <typename T>
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator==
(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2
detail::tquat<T, P> const & q1,
detail::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>
template <typename T, precision P>
GLM_FUNC_QUALIFIER bool operator!=
(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2
detail::tquat<T, P> const & q1,
detail::tquat<T, P> const & q2
)
{
return (q1.x != q2.x) || (q1.y != q2.y) || (q1.z != q2.z) || (q1.w != q2.w);
@@ -317,46 +317,46 @@ namespace detail
}//namespace detail
////////////////////////////////////////////////////////
template <typename T>
template <typename T, precision P>
GLM_FUNC_QUALIFIER T length
(
detail::tquat<T> const & q
detail::tquat<T, P> const & q
)
{
return glm::sqrt(dot(q, q));
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> normalize
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> normalize
(
detail::tquat<T> const & q
detail::tquat<T, P> const & q
)
{
typename detail::tquat<T>::value_type len = length(q);
if(len <= typename detail::tquat<T>::value_type(0)) // Problem
return detail::tquat<T>(1, 0, 0, 0);
typename detail::tquat<T>::value_type oneOverLen = typename detail::tquat<T>::value_type(1) / len;
return detail::tquat<T>(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen);
typename detail::tquat<T, P>::value_type len = length(q);
if(len <= typename detail::tquat<T, P>::value_type(0)) // Problem
return detail::tquat<T, P>(1, 0, 0, 0);
typename detail::tquat<T, P>::value_type oneOverLen = typename detail::tquat<T, P>::value_type(1) / len;
return detail::tquat<T, P>(q.w * oneOverLen, q.x * oneOverLen, q.y * oneOverLen, q.z * oneOverLen);
}
template <typename T>
template <typename T, precision P>
GLM_FUNC_QUALIFIER T dot
(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2
detail::tquat<T, P> const & q1,
detail::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>
GLM_FUNC_QUALIFIER detail::tquat<T> cross
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> cross
(
detail::tquat<T> const & q1,
detail::tquat<T> const & q2
detail::tquat<T, P> const & q1,
detail::tquat<T, P> const & q2
)
{
return detail::tquat<T>(
return detail::tquat<T, P>(
q1.w * q2.w - q1.x * q2.x - q1.y * q2.y - q1.z * q2.z,
q1.w * q2.x + q1.x * q2.w + q1.y * q2.z - q1.z * q2.y,
q1.w * q2.y + q1.y * q2.w + q1.z * q2.x - q1.x * q2.z,
@@ -364,20 +364,20 @@ namespace detail
}
/*
// (x * sin(1 - a) * angle / sin(angle)) + (y * sin(a) * angle / sin(angle))
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> mix
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> mix
(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
typename detail::tquat<T>::value_type const & a
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
typename detail::tquat<T, P>::value_type const & a
)
{
if(a <= typename detail::tquat<T>::value_type(0)) return x;
if(a >= typename detail::tquat<T>::value_type(1)) return y;
if(a <= typename detail::tquat<T, P>::value_type(0)) return x;
if(a >= typename detail::tquat<T, P>::value_type(1)) return y;
float fCos = dot(x, y);
detail::tquat<T> y2(y); //BUG!!! tquat<T> y2;
if(fCos < typename detail::tquat<T>::value_type(0))
detail::tquat<T, P> y2(y); //BUG!!! tquat<T, P> y2;
if(fCos < typename detail::tquat<T, P>::value_type(0))
{
y2 = -y;
fCos = -fCos;
@@ -385,32 +385,32 @@ namespace detail
//if(fCos > 1.0f) // problem
float k0, k1;
if(fCos > typename detail::tquat<T>::value_type(0.9999))
if(fCos > typename detail::tquat<T, P>::value_type(0.9999))
{
k0 = typename detail::tquat<T>::value_type(1) - a;
k1 = typename detail::tquat<T>::value_type(0) + a; //BUG!!! 1.0f + a;
k0 = typename detail::tquat<T, P>::value_type(1) - a;
k1 = typename detail::tquat<T, P>::value_type(0) + a; //BUG!!! 1.0f + a;
}
else
{
typename detail::tquat<T>::value_type fSin = sqrt(T(1) - fCos * fCos);
typename detail::tquat<T>::value_type fAngle = atan(fSin, fCos);
typename detail::tquat<T>::value_type fOneOverSin = T(1) / fSin;
k0 = sin((typename detail::tquat<T>::value_type(1) - a) * fAngle) * fOneOverSin;
k1 = sin((typename detail::tquat<T>::value_type(0) + a) * fAngle) * fOneOverSin;
typename detail::tquat<T, P>::value_type fSin = sqrt(T(1) - fCos * fCos);
typename detail::tquat<T, P>::value_type fAngle = atan(fSin, fCos);
typename detail::tquat<T, P>::value_type fOneOverSin = T(1) / fSin;
k0 = sin((typename detail::tquat<T, P>::value_type(1) - a) * fAngle) * fOneOverSin;
k1 = sin((typename detail::tquat<T, P>::value_type(0) + a) * fAngle) * fOneOverSin;
}
return detail::tquat<T>(
return detail::tquat<T, P>(
k0 * x.w + k1 * y2.w,
k0 * x.x + k1 * y2.x,
k0 * x.y + k1 * y2.y,
k0 * x.z + k1 * y2.z);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> mix2
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> mix2
(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
T const & a
)
{
@@ -444,11 +444,11 @@ namespace detail
}
*/
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> mix
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> mix
(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
T const & a
)
{
@@ -458,7 +458,7 @@ namespace detail
if(cosTheta > T(1) - epsilon<T>())
{
// Linear interpolation
return detail::tquat<T>(
return detail::tquat<T, P>(
mix(x.w, y.w, a),
mix(x.x, y.x, a),
mix(x.y, y.y, a),
@@ -472,11 +472,11 @@ namespace detail
}
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> lerp
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> lerp
(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
T const & a
)
{
@@ -487,15 +487,15 @@ namespace detail
return x * (T(1) - a) + (y * a);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> slerp
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> slerp
(
detail::tquat<T> const & x,
detail::tquat<T> const & y,
detail::tquat<T, P> const & x,
detail::tquat<T, P> const & y,
T const & a
)
{
detail::tquat<T> z = y;
detail::tquat<T, P> z = y;
T cosTheta = dot(x, y);
@@ -511,7 +511,7 @@ namespace detail
if(cosTheta > T(1) - epsilon<T>())
{
// Linear interpolation
return detail::tquat<T>(
return detail::tquat<T, P>(
mix(x.w, y.w, a),
mix(x.x, y.x, a),
mix(x.y, y.y, a),
@@ -525,36 +525,36 @@ namespace detail
}
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> conjugate
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> conjugate
(
detail::tquat<T> const & q
detail::tquat<T, P> const & q
)
{
return detail::tquat<T>(q.w, -q.x, -q.y, -q.z);
return detail::tquat<T, P>(q.w, -q.x, -q.y, -q.z);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> inverse
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> inverse
(
detail::tquat<T> const & q
detail::tquat<T, P> const & q
)
{
return conjugate(q) / dot(q, q);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> rotate
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> rotate
(
detail::tquat<T> const & q,
typename detail::tquat<T>::value_type const & angle,
detail::tvec3<T> const & v
detail::tquat<T, P> const & q,
typename detail::tquat<T, P>::value_type const & angle,
detail::tvec3<T, P> const & v
)
{
detail::tvec3<T> Tmp = v;
detail::tvec3<T, P> Tmp = v;
// Axis of rotation must be normalised
typename detail::tquat<T>::value_type len = glm::length(Tmp);
typename detail::tquat<T, P>::value_type len = glm::length(Tmp);
if(abs(len - T(1)) > T(0.001))
{
T oneOverLen = T(1) / len;
@@ -564,71 +564,71 @@ namespace detail
}
#ifdef GLM_FORCE_RADIANS
typename detail::tquat<T>::value_type const AngleRad(angle);
typename detail::tquat<T, P>::value_type const AngleRad(angle);
#else
typename detail::tquat<T>::value_type const AngleRad = radians(angle);
typename detail::tquat<T, P>::value_type const AngleRad = radians(angle);
#endif
typename detail::tquat<T>::value_type const Sin = sin(AngleRad * T(0.5));
typename detail::tquat<T, P>::value_type const Sin = sin(AngleRad * T(0.5));
return q * detail::tquat<T>(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin);
//return gtc::quaternion::cross(q, detail::tquat<T>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin));
return q * detail::tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * Sin, Tmp.y * Sin, Tmp.z * Sin);
//return gtc::quaternion::cross(q, detail::tquat<T, P>(cos(AngleRad * T(0.5)), Tmp.x * fSin, Tmp.y * fSin, Tmp.z * fSin));
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T> eulerAngles
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> eulerAngles
(
detail::tquat<T> const & x
detail::tquat<T, P> const & x
)
{
return detail::tvec3<T>(pitch(x), yaw(x), roll(x));
return detail::tvec3<T, P>(pitch(x), yaw(x), roll(x));
}
template <typename valType>
GLM_FUNC_QUALIFIER valType roll
template <typename T, precision P>
GLM_FUNC_QUALIFIER T roll
(
detail::tquat<valType> const & q
detail::tquat<T, P> const & q
)
{
#ifdef GLM_FORCE_RADIANS
return valType(atan2(valType(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
return T(atan2(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));
#else
return glm::degrees(atan(valType(2) * (q.x * q.y + q.w * q.z), q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z));
return glm::degrees(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));
#endif
}
template <typename valType>
GLM_FUNC_QUALIFIER valType pitch
template <typename T, precision P>
GLM_FUNC_QUALIFIER T pitch
(
detail::tquat<valType> const & q
detail::tquat<T, P> const & q
)
{
#ifdef GLM_FORCE_RADIANS
return valType(atan2(valType(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));
return T(atan2(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));
#else
return glm::degrees(atan(valType(2) * (q.y * q.z + q.w * q.x), q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z));
return glm::degrees(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));
#endif
}
template <typename valType>
GLM_FUNC_QUALIFIER valType yaw
template <typename T, precision P>
GLM_FUNC_QUALIFIER T yaw
(
detail::tquat<valType> const & q
detail::tquat<T, P> const & q
)
{
#ifdef GLM_FORCE_RADIANS
return asin(valType(-2) * (q.x * q.z - q.w * q.y));
return asin(T(-2) * (q.x * q.z - q.w * q.y));
#else
return glm::degrees(asin(valType(-2) * (q.x * q.z - q.w * q.y)));
return glm::degrees(asin(T(-2) * (q.x * q.z - q.w * q.y)));
#endif
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> mat3_cast
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, P> mat3_cast
(
detail::tquat<T> const & q
detail::tquat<T, P> const & q
)
{
detail::tmat3x3<T> Result(T(1));
detail::tmat3x3<T, P> Result(T(1));
Result[0][0] = 1 - 2 * q.y * q.y - 2 * q.z * q.z;
Result[0][1] = 2 * q.x * q.y + 2 * q.w * q.z;
Result[0][2] = 2 * q.x * q.z - 2 * q.w * q.y;
@@ -643,28 +643,28 @@ namespace detail
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> mat4_cast
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, P> mat4_cast
(
detail::tquat<T> const & q
detail::tquat<T, P> const & q
)
{
return detail::tmat4x4<T>(mat3_cast(q));
return detail::tmat4x4<T, P>(mat3_cast(q));
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> quat_cast
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> quat_cast
(
detail::tmat3x3<T> const & m
detail::tmat3x3<T, P> const & m
)
{
typename detail::tquat<T>::value_type fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2];
typename detail::tquat<T>::value_type fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2];
typename detail::tquat<T>::value_type fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1];
typename detail::tquat<T>::value_type fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2];
typename detail::tquat<T, P>::value_type fourXSquaredMinus1 = m[0][0] - m[1][1] - m[2][2];
typename detail::tquat<T, P>::value_type fourYSquaredMinus1 = m[1][1] - m[0][0] - m[2][2];
typename detail::tquat<T, P>::value_type fourZSquaredMinus1 = m[2][2] - m[0][0] - m[1][1];
typename detail::tquat<T, P>::value_type fourWSquaredMinus1 = m[0][0] + m[1][1] + m[2][2];
int biggestIndex = 0;
typename detail::tquat<T>::value_type fourBiggestSquaredMinus1 = fourWSquaredMinus1;
typename detail::tquat<T, P>::value_type fourBiggestSquaredMinus1 = fourWSquaredMinus1;
if(fourXSquaredMinus1 > fourBiggestSquaredMinus1)
{
fourBiggestSquaredMinus1 = fourXSquaredMinus1;
@@ -681,14 +681,14 @@ namespace detail
biggestIndex = 3;
}
typename detail::tquat<T>::value_type biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5);
typename detail::tquat<T>::value_type mult = T(0.25) / biggestVal;
typename detail::tquat<T, P>::value_type biggestVal = sqrt(fourBiggestSquaredMinus1 + T(1)) * T(0.5);
typename detail::tquat<T, P>::value_type mult = T(0.25) / biggestVal;
detail::tquat<T> Result;
detail::tquat<T, P> Result;
switch(biggestIndex)
{
case 0:
Result.w = biggestVal;
Result.w = biggestVal;
Result.x = (m[1][2] - m[2][1]) * mult;
Result.y = (m[2][0] - m[0][2]) * mult;
Result.z = (m[0][1] - m[1][0]) * mult;
@@ -719,19 +719,19 @@ namespace detail
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T> quat_cast
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> quat_cast
(
detail::tmat4x4<T> const & m4
detail::tmat4x4<T, P> const & m4
)
{
return quat_cast(detail::tmat3x3<T>(m4));
return quat_cast(detail::tmat3x3<T, P>(m4));
}
template <typename T>
template <typename T, precision P>
GLM_FUNC_QUALIFIER T angle
(
detail::tquat<T> const & x
detail::tquat<T, P> const & x
)
{
#ifdef GLM_FORCE_RADIANS
@@ -741,48 +741,48 @@ namespace detail
#endif
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T> axis
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> axis
(
detail::tquat<T> const & x
detail::tquat<T, P> const & x
)
{
T tmp1 = T(1) - x.w * x.w;
if(tmp1 <= T(0))
return detail::tvec3<T>(0, 0, 1);
return detail::tvec3<T, P>(0, 0, 1);
T tmp2 = T(1) / sqrt(tmp1);
return detail::tvec3<T>(x.x * tmp2, x.y * tmp2, x.z * tmp2);
return detail::tvec3<T, P>(x.x * tmp2, x.y * tmp2, x.z * tmp2);
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tquat<valType> angleAxis
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T, defaultp> angleAxis
(
valType const & angle,
valType const & x,
valType const & y,
valType const & z
T const & angle,
T const & x,
T const & y,
T const & z
)
{
return angleAxis(angle, detail::tvec3<valType>(x, y, z));
return angleAxis(angle, detail::tvec3<T, defaultp>(x, y, z));
}
template <typename valType>
GLM_FUNC_QUALIFIER detail::tquat<valType> angleAxis
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tquat<T, P> angleAxis
(
valType const & angle,
detail::tvec3<valType> const & v
T const & angle,
detail::tvec3<T, P> const & v
)
{
detail::tquat<valType> result;
detail::tquat<T, P> result;
#ifdef GLM_FORCE_RADIANS
valType a(angle);
T const a(angle);
#else
valType a(glm::radians(angle));
T const a(glm::radians(angle));
#endif
valType s = glm::sin(a * valType(0.5));
T s = glm::sin(a * T(0.5));
result.w = glm::cos(a * valType(0.5));
result.w = glm::cos(a * T(0.5));
result.x = v.x * s;
result.y = v.y * s;
result.z = v.z * s;

View File

@@ -59,9 +59,9 @@ namespace glm
/// @param Max
/// @tparam genType Value type. Currently supported: half (not recommanded), float or double scalars and vectors.
/// @see gtc_random
template <typename genType>
template <typename genType>
genType linearRand(
genType const & Min,
genType const & Min,
genType const & Max);
/// Generate random numbers in the interval [Min, Max], according a gaussian distribution
@@ -71,39 +71,39 @@ namespace glm
/// @see gtc_random
template <typename genType>
genType gaussRand(
genType const & Mean,
genType const & Mean,
genType const & Deviation);
/// Generate a random 2D vector which coordinates are regulary distributed on a circle of a given radius
///
/// @param Radius
/// @see gtc_random
template <typename T>
detail::tvec2<T> circularRand(
T const & Radius);
template <typename T>
detail::tvec2<T, defaultp> circularRand(
T const & 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>
detail::tvec3<T> sphericalRand(
T const & Radius);
template <typename T>
detail::tvec3<T, defaultp> sphericalRand(
T const & 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>
detail::tvec2<T> diskRand(
T const & Radius);
template <typename T>
detail::tvec2<T, defaultp> diskRand(
T const & 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_QUALIFIER detail::tvec3<T> ballRand(
detail::tvec3<T, defaultp> ballRand(
T const & Radius);
/// @}

View File

@@ -105,17 +105,19 @@ namespace detail
VECTORIZE_VEC_VEC(gaussRand)
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec2<T> diskRand
GLM_FUNC_QUALIFIER detail::tvec2<T, defaultp> diskRand
(
T const & Radius
)
{
detail::tvec2<T> Result(T(0));
detail::tvec2<T, defaultp> Result(T(0));
T LenRadius(T(0));
do
{
Result = linearRand(detail::tvec2<T>(-Radius), detail::tvec2<T>(Radius));
Result = linearRand(
detail::tvec2<T, defaultp>(-Radius),
detail::tvec2<T, defaultp>(Radius));
LenRadius = length(Result);
}
while(LenRadius > Radius);
@@ -124,17 +126,19 @@ namespace detail
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T> ballRand
GLM_FUNC_QUALIFIER detail::tvec3<T, defaultp> ballRand
(
T const & Radius
)
{
detail::tvec3<T> Result(T(0));
detail::tvec3<T, defaultp> Result(T(0));
T LenRadius(T(0));
do
{
Result = linearRand(detail::tvec3<T>(-Radius), detail::tvec3<T>(Radius));
Result = linearRand(
detail::tvec3<T, defaultp>(-Radius),
detail::tvec3<T, defaultp>(Radius));
LenRadius = length(Result);
}
while(LenRadius > Radius);
@@ -142,18 +146,18 @@ namespace detail
return Result;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec2<T> circularRand
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec2<T, defaultp> circularRand
(
T const & Radius
)
{
T a = linearRand(T(0), T(6.283185307179586476925286766559f));
return detail::tvec2<T>(cos(a), sin(a)) * Radius;
return detail::tvec2<T, defaultp>(cos(a), sin(a)) * Radius;
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T> sphericalRand
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T, defaultp> sphericalRand
(
T const & Radius
)
@@ -166,6 +170,6 @@ namespace detail
T x = r * cos(a);
T y = r * sin(a);
return detail::tvec3<T>(x, y, z) * Radius;
return detail::tvec3<T, defaultp>(x, y, z) * Radius;
}
}//namespace glm

View File

@@ -51,54 +51,54 @@ namespace glm
/// @addtogroup gtc_swizzle
/// @{
template <typename T, template <typename> class vecType>
template <typename T, precision P, template <typename, precision> class vecType>
T const & swizzle(
vecType<T> const & v,
vecType<T, P> const & v,
comp x);
template <typename T, template <typename> class vecType>
detail::tvec2<T> const & swizzle(
vecType<T> const & v,
template <typename T, precision P, template <typename, precision> class vecType>
detail::tvec2<T, P> const & swizzle(
vecType<T, P> const & v,
comp x, comp y);
template <typename T, template <typename> class vecType>
detail::tvec3<T> const & swizzle(
vecType<T> const & v,
template <typename T, precision P, template <typename, precision> class vecType>
detail::tvec3<T, P> const & swizzle(
vecType<T, P> const & v,
comp x, comp y, comp z);
template <typename T, template <typename> class vecType>
detail::tvec4<T> const & swizzle(
vecType<T> const & v,
template <typename T, precision P, template <typename, precision> class vecType>
detail::tvec4<T, P> const & swizzle(
vecType<T, P> const & v,
comp x, comp y, comp z, comp w);
template <typename T, template <typename> class vecType>
template <typename T, precision P, template <typename, precision> class vecType>
T & swizzle(
vecType<T> & v,
vecType<T, P> & v,
comp x);
template <typename T, template <typename> class vecType>
detail::tref2<T> swizzle(
vecType<T> & v,
template <typename T, precision P, template <typename, precision> class vecType>
detail::tref2<T, P> swizzle(
vecType<T, P> & v,
comp x, comp y);
template <typename T, template <typename> class vecType>
detail::tref3<T> swizzle(
vecType<T> & v,
template <typename T, precision P, template <typename, precision> class vecType>
detail::tref3<T, P> swizzle(
vecType<T, P> & v,
comp x, comp y, comp z);
template <typename T, template <typename> class vecType>
detail::tref4<T> swizzle(
vecType<T> & v,
template <typename T, precision P, template <typename, precision> class vecType>
detail::tref4<T, P> swizzle(
vecType<T, P> & v,
comp x, comp y, comp z, comp w);
# define static_swizzle1_const(TYPE, SIZE) \
template <comp x> \
GLM_FUNC_QUALIFIER TYPE swizzle(detail::tvec##SIZE<TYPE> const & v) \
# define static_swizzle1_const(TYPE, SIZE) \
template <comp x> \
GLM_FUNC_QUALIFIER TYPE swizzle(detail::tvec##SIZE<TYPE, defaultp> const & v) \
{return v[x];}
# define static_swizzle1_ref(TYPE, SIZE) \
template <comp x> \
GLM_FUNC_QUALIFIER TYPE& swizzle(detail::tvec##SIZE<TYPE> & v) \
# define static_swizzle1_ref(TYPE, SIZE) \
template <comp x> \
GLM_FUNC_QUALIFIER TYPE& swizzle(detail::tvec##SIZE<TYPE, defaultp> & v) \
{return v[x];}
static_swizzle1_ref(detail::float16, 2)
@@ -155,18 +155,21 @@ namespace glm
# define static_swizzle2_const(TYPE, SIZE) \
template <comp x, comp y> \
GLM_FUNC_QUALIFIER detail::tvec2<TYPE> swizzle(detail::tvec##SIZE<TYPE> const & v) \
{return detail::tvec2<TYPE>(v[x], v[y]);}
GLM_FUNC_QUALIFIER detail::tvec2<TYPE, defaultp> swizzle( \
detail::tvec##SIZE<TYPE, defaultp> const & v) \
{return detail::tvec2<TYPE, defaultp>(v[x], v[y]);}
# define static_swizzle3_const(TYPE, SIZE) \
template <comp x, comp y, comp z> \
GLM_FUNC_QUALIFIER detail::tvec3<TYPE> swizzle(detail::tvec##SIZE<TYPE> const & v) \
{return detail::tvec3<TYPE>(v[x], v[y], v[z]);}
GLM_FUNC_QUALIFIER detail::tvec3<TYPE, defaultp> swizzle( \
detail::tvec##SIZE<TYPE, defaultp> const & v) \
{return detail::tvec3<TYPE, defaultp>(v[x], v[y], v[z]);}
# define static_swizzle4_const(TYPE, SIZE) \
template <comp x, comp y, comp z, comp w> \
GLM_FUNC_QUALIFIER detail::tvec4<TYPE> swizzle(detail::tvec##SIZE<TYPE> const & v) \
{return detail::tvec4<TYPE>(v[x], v[y], v[z], v[w]);}
GLM_FUNC_QUALIFIER detail::tvec4<TYPE, defaultp> swizzle( \
detail::tvec##SIZE<TYPE, defaultp> const & v) \
{return detail::tvec4<TYPE, defaultp>(v[x], v[y], v[z], v[w]);}
static_swizzle2_const(glm::f16, 2)
@@ -277,20 +280,23 @@ namespace glm
static_swizzle4_const(glm::u64, 3)
static_swizzle4_const(glm::u64, 4)
# define static_swizzle2_ref(TYPE, SIZE) \
template <glm::comp x, glm::comp y> \
GLM_FUNC_QUALIFIER glm::detail::tref2<TYPE> swizzle(detail::tvec##SIZE<TYPE> & v) \
{return glm::detail::tref2<TYPE>(v[x], v[y]);}
# define static_swizzle2_ref(TYPE, SIZE) \
template <glm::comp x, glm::comp y> \
GLM_FUNC_QUALIFIER glm::detail::tref2<TYPE, defaultp> swizzle( \
detail::tvec##SIZE<TYPE, defaultp> & v) \
{return glm::detail::tref2<TYPE, defaultp>(v[x], v[y]);}
# define static_swizzle3_ref(TYPE, SIZE) \
template <glm::comp x, glm::comp y, glm::comp z> \
GLM_FUNC_QUALIFIER glm::detail::tref3<TYPE> swizzle(detail::tvec##SIZE<TYPE> & v) \
{return glm::detail::tref3<TYPE>(v[x], v[y], v[z]);}
# define static_swizzle3_ref(TYPE, SIZE) \
template <glm::comp x, glm::comp y, glm::comp z> \
GLM_FUNC_QUALIFIER glm::detail::tref3<TYPE, defaultp> swizzle( \
detail::tvec##SIZE<TYPE, defaultp> & v) \
{return glm::detail::tref3<TYPE, defaultp>(v[x], v[y], v[z]);}
# define static_swizzle4_ref(TYPE, SIZE) \
template <glm::comp x, glm::comp y, glm::comp z, glm::comp w> \
GLM_FUNC_QUALIFIER glm::detail::tref4<TYPE> swizzle(detail::tvec##SIZE<TYPE> & v) \
{return glm::detail::tref4<TYPE>(v[x], v[y], v[z], v[w]);}
# define static_swizzle4_ref(TYPE, SIZE) \
template <glm::comp x, glm::comp y, glm::comp z, glm::comp w> \
GLM_FUNC_QUALIFIER glm::detail::tref4<TYPE, defaultp> swizzle( \
detail::tvec##SIZE<TYPE, defaultp> & v) \
{return glm::detail::tref4<TYPE, defaultp>(v[x], v[y], v[z], v[w]);}
static_swizzle2_ref(glm::f16, 2)
static_swizzle2_ref(glm::f16, 3)

View File

@@ -28,89 +28,89 @@
namespace glm
{
template <typename T, template <typename> class vecType>
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T swizzle
(
vecType<T> const & v,
vecType<T, P> const & v,
comp x
)
{
assert(int(x) < int(vecType<T>::value_size));
assert(int(x) < int(vecType<T, P>::value_size));
return v[x];
}
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER detail::tvec2<T> swizzle
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER detail::tvec2<T, P> swizzle
(
vecType<T> const & v,
vecType<T, P> const & v,
comp x, comp y
)
{
return detail::tvec2<T>(
return detail::tvec2<T, P>(
v[x],
v[y]);
}
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER detail::tvec3<T> swizzle
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER detail::tvec3<T, P> swizzle
(
vecType<T> const & v,
vecType<T, P> const & v,
comp x, comp y, comp z
)
{
return detail::tvec3<T>(
return detail::tvec3<T, P>(
v[x],
v[y],
v[z]);
}
template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER detail::tvec4<T> swizzle
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER detail::tvec4<T, P> swizzle
(
vecType<T> const & v,
vecType<T, P> const & v,
comp x, comp y, comp z, comp w
)
{
return detail::tvec4<T>(v[x], v[y], v[z], v[w]);
return detail::tvec4<T, P>(v[x], v[y], v[z], v[w]);
}
template <typename T>
template <typename T, precision P>
GLM_FUNC_QUALIFIER T& swizzle
(
detail::tvec4<T> & v,
detail::tvec4<T, P> & v,
comp x
)
{
return v[x];
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tref2<T> swizzle
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tref2<T, P> swizzle
(
detail::tvec4<T> & v,
detail::tvec4<T, P> & v,
comp x, comp y
)
{
return detail::tref2<T>(v[x], v[y]);
return detail::tref2<T, P>(v[x], v[y]);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tref3<T> swizzle
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tref3<T, P> swizzle
(
detail::tvec4<T> & v,
detail::tvec4<T, P> & v,
comp x, comp y, comp z
)
{
return detail::tref3<T>(v[x], v[y], v[z]);
return detail::tref3<T, P>(v[x], v[y], v[z]);
}
template <typename T>
GLM_FUNC_QUALIFIER detail::tref4<T> swizzle
template <typename T, precision P>
GLM_FUNC_QUALIFIER detail::tref4<T, P> swizzle
(
detail::tvec4<T> & v,
detail::tvec4<T, P> & v,
comp x, comp y, comp z, comp w
)
{
return detail::tref4<T>(v[x], v[y], v[z], v[w]);
return detail::tref4<T, P>(v[x], v[y], v[z], v[w]);
}
}//namespace glm

View File

@@ -113,70 +113,70 @@ namespace glm
/// 8 bit signed integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<i8> i8vec1;
typedef detail::tvec1<i8, defaultp> i8vec1;
/// 8 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<i8> i8vec2;
typedef detail::tvec2<i8, defaultp> i8vec2;
/// 8 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<i8> i8vec3;
typedef detail::tvec3<i8, defaultp> i8vec3;
/// 8 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<i8> i8vec4;
typedef detail::tvec4<i8, defaultp> i8vec4;
/// 16 bit signed integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<i16> i16vec1;
typedef detail::tvec1<i16, defaultp> i16vec1;
/// 16 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<i16> i16vec2;
typedef detail::tvec2<i16, defaultp> i16vec2;
/// 16 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<i16> i16vec3;
typedef detail::tvec3<i16, defaultp> i16vec3;
/// 16 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<i16> i16vec4;
typedef detail::tvec4<i16, defaultp> i16vec4;
/// 32 bit signed integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<i32> i32vec1;
typedef detail::tvec1<i32, defaultp> i32vec1;
/// 32 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<i32> i32vec2;
typedef detail::tvec2<i32, defaultp> i32vec2;
/// 32 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<i32> i32vec3;
typedef detail::tvec3<i32, defaultp> i32vec3;
/// 32 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<i32> i32vec4;
typedef detail::tvec4<i32, defaultp> i32vec4;
/// 64 bit signed integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<i64> i64vec1;
typedef detail::tvec1<i64, defaultp> i64vec1;
/// 64 bit signed integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<i64> i64vec2;
typedef detail::tvec2<i64, defaultp> i64vec2;
/// 64 bit signed integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<i64> i64vec3;
typedef detail::tvec3<i64, defaultp> i64vec3;
/// 64 bit signed integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<i64> i64vec4;
typedef detail::tvec4<i64, defaultp> i64vec4;
/////////////////////////////
@@ -235,70 +235,70 @@ namespace glm
/// 8 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<u8> u8vec1;
typedef detail::tvec1<u8, defaultp> u8vec1;
/// 8 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<u8> u8vec2;
typedef detail::tvec2<u8, defaultp> u8vec2;
/// 8 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<u8> u8vec3;
typedef detail::tvec3<u8, defaultp> u8vec3;
/// 8 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<u8> u8vec4;
typedef detail::tvec4<u8, defaultp> u8vec4;
/// 16 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<u16> u16vec1;
typedef detail::tvec1<u16, defaultp> u16vec1;
/// 16 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<u16> u16vec2;
typedef detail::tvec2<u16, defaultp> u16vec2;
/// 16 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<u16> u16vec3;
typedef detail::tvec3<u16, defaultp> u16vec3;
/// 16 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<u16> u16vec4;
typedef detail::tvec4<u16, defaultp> u16vec4;
/// 32 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<u32> u32vec1;
typedef detail::tvec1<u32, defaultp> u32vec1;
/// 32 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<u32> u32vec2;
typedef detail::tvec2<u32, defaultp> u32vec2;
/// 32 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<u32> u32vec3;
typedef detail::tvec3<u32, defaultp> u32vec3;
/// 32 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<u32> u32vec4;
typedef detail::tvec4<u32, defaultp> u32vec4;
/// 64 bit unsigned integer scalar type.
/// @see gtc_type_precision
typedef detail::tvec1<u64> u64vec1;
typedef detail::tvec1<u64, defaultp> u64vec1;
/// 64 bit unsigned integer vector of 2 components type.
/// @see gtc_type_precision
typedef detail::tvec2<u64> u64vec2;
typedef detail::tvec2<u64, defaultp> u64vec2;
/// 64 bit unsigned integer vector of 3 components type.
/// @see gtc_type_precision
typedef detail::tvec3<u64> u64vec3;
typedef detail::tvec3<u64, defaultp> u64vec3;
/// 64 bit unsigned integer vector of 4 components type.
/// @see gtc_type_precision
typedef detail::tvec4<u64> u64vec4;
typedef detail::tvec4<u64, defaultp> u64vec4;
//////////////////////
@@ -345,70 +345,70 @@ namespace glm
/// Single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef detail::tvec1<float> fvec1;
typedef detail::tvec1<float, defaultp> fvec1;
/// Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef detail::tvec2<float> fvec2;
typedef detail::tvec2<float, defaultp> fvec2;
/// Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef detail::tvec3<float> fvec3;
typedef detail::tvec3<float, defaultp> fvec3;
/// Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef detail::tvec4<float> fvec4;
typedef detail::tvec4<float, defaultp> fvec4;
/// Half-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef detail::tvec1<f16> f16vec1;
typedef detail::tvec1<f16, defaultp> f16vec1;
/// Half-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef detail::tvec2<f16> f16vec2;
typedef detail::tvec2<f16, defaultp> f16vec2;
/// Half-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef detail::tvec3<f16> f16vec3;
typedef detail::tvec3<f16, defaultp> f16vec3;
/// Half-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef detail::tvec4<f16> f16vec4;
typedef detail::tvec4<f16, defaultp> f16vec4;
/// Single-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef detail::tvec1<f32> f32vec1;
typedef detail::tvec1<f32, defaultp> f32vec1;
/// Single-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef detail::tvec2<f32> f32vec2;
typedef detail::tvec2<f32, defaultp> f32vec2;
/// Single-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef detail::tvec3<f32> f32vec3;
typedef detail::tvec3<f32, defaultp> f32vec3;
/// Single-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef detail::tvec4<f32> f32vec4;
typedef detail::tvec4<f32, defaultp> f32vec4;
/// Double-precision floating-point vector of 1 component.
/// @see gtc_type_precision
typedef detail::tvec1<f64> f64vec1;
typedef detail::tvec1<f64, defaultp> f64vec1;
/// Double-precision floating-point vector of 2 components.
/// @see gtc_type_precision
typedef detail::tvec2<f64> f64vec2;
typedef detail::tvec2<f64, defaultp> f64vec2;
/// Double-precision floating-point vector of 3 components.
/// @see gtc_type_precision
typedef detail::tvec3<f64> f64vec3;
typedef detail::tvec3<f64, defaultp> f64vec3;
/// Double-precision floating-point vector of 4 components.
/// @see gtc_type_precision
typedef detail::tvec4<f64> f64vec4;
typedef detail::tvec4<f64, defaultp> f64vec4;
//////////////////////
@@ -420,15 +420,15 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f32> fmat2;
typedef detail::tmat2x2<f32, defaultp> fmat2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f32> fmat3;
typedef detail::tmat3x3<f32, defaultp> fmat3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f32> fmat4;
typedef detail::tmat4x4<f32, defaultp> fmat4;
/// Single-precision floating-point 1x1 matrix.
@@ -437,56 +437,56 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f32> fmat2x2;
typedef detail::tmat2x2<f32, defaultp> fmat2x2;
/// Single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x3<f32> fmat2x3;
typedef detail::tmat2x3<f32, defaultp> fmat2x3;
/// Single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x4<f32> fmat2x4;
typedef detail::tmat2x4<f32, defaultp> fmat2x4;
/// Single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x2<f32> fmat3x2;
typedef detail::tmat3x2<f32, defaultp> fmat3x2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f32> fmat3x3;
typedef detail::tmat3x3<f32, defaultp> fmat3x3;
/// Single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x4<f32> fmat3x4;
typedef detail::tmat3x4<f32, defaultp> fmat3x4;
/// Single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x2<f32> fmat4x2;
typedef detail::tmat4x2<f32, defaultp> fmat4x2;
/// Single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x3<f32> fmat4x3;
typedef detail::tmat4x3<f32, defaultp> fmat4x3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f32> fmat4x4;
typedef detail::tmat4x4<f32, defaultp> fmat4x4;
/// Half-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f16> f16mat1;
//typedef detail::tmat1x1<f16, defaultp> f16mat1;
/// Half-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f16> f16mat2;
typedef detail::tmat2x2<f16, defaultp> f16mat2;
/// Half-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f16> f16mat3;
typedef detail::tmat3x3<f16, defaultp> f16mat3;
/// Half-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f16> f16mat4;
typedef detail::tmat4x4<f16, defaultp> f16mat4;
/// Half-precision floating-point 1x1 matrix.
@@ -495,56 +495,56 @@ namespace glm
/// Half-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f16> f16mat2x2;
typedef detail::tmat2x2<f16, defaultp> f16mat2x2;
/// Half-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x3<f16> f16mat2x3;
typedef detail::tmat2x3<f16, defaultp> f16mat2x3;
/// Half-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x4<f16> f16mat2x4;
typedef detail::tmat2x4<f16, defaultp> f16mat2x4;
/// Half-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x2<f16> f16mat3x2;
typedef detail::tmat3x2<f16, defaultp> f16mat3x2;
/// Half-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f16> f16mat3x3;
typedef detail::tmat3x3<f16, defaultp> f16mat3x3;
/// Half-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x4<f16> f16mat3x4;
typedef detail::tmat3x4<f16, defaultp> f16mat3x4;
/// Half-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x2<f16> f16mat4x2;
typedef detail::tmat4x2<f16, defaultp> f16mat4x2;
/// Half-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x3<f16> f16mat4x3;
typedef detail::tmat4x3<f16, defaultp> f16mat4x3;
/// Half-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f16> f16mat4x4;
typedef detail::tmat4x4<f16, defaultp> f16mat4x4;
/// Single-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f32> f32mat1;
//typedef detail::tmat1x1<f32, defaultp> f32mat1;
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f32> f32mat2;
typedef detail::tmat2x2<f32, defaultp> f32mat2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f32> f32mat3;
typedef detail::tmat3x3<f32, defaultp> f32mat3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f32> f32mat4;
typedef detail::tmat4x4<f32, defaultp> f32mat4;
/// Single-precision floating-point 1x1 matrix.
@@ -553,56 +553,56 @@ namespace glm
/// Single-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f32> f32mat2x2;
typedef detail::tmat2x2<f32, defaultp> f32mat2x2;
/// Single-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x3<f32> f32mat2x3;
typedef detail::tmat2x3<f32, defaultp> f32mat2x3;
/// Single-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x4<f32> f32mat2x4;
typedef detail::tmat2x4<f32, defaultp> f32mat2x4;
/// Single-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x2<f32> f32mat3x2;
typedef detail::tmat3x2<f32, defaultp> f32mat3x2;
/// Single-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f32> f32mat3x3;
typedef detail::tmat3x3<f32, defaultp> f32mat3x3;
/// Single-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x4<f32> f32mat3x4;
typedef detail::tmat3x4<f32, defaultp> f32mat3x4;
/// Single-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x2<f32> f32mat4x2;
typedef detail::tmat4x2<f32, defaultp> f32mat4x2;
/// Single-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x3<f32> f32mat4x3;
typedef detail::tmat4x3<f32, defaultp> f32mat4x3;
/// Single-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f32> f32mat4x4;
typedef detail::tmat4x4<f32, defaultp> f32mat4x4;
/// Double-precision floating-point 1x1 matrix.
/// @see gtc_type_precision
//typedef detail::tmat1x1<f64> f64mat1;
//typedef detail::tmat1x1<f64, defaultp> f64mat1;
/// Double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f64> f64mat2;
typedef detail::tmat2x2<f64, defaultp> f64mat2;
/// Double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f64> f64mat3;
typedef detail::tmat3x3<f64, defaultp> f64mat3;
/// Double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f64> f64mat4;
typedef detail::tmat4x4<f64, defaultp> f64mat4;
/// Double-precision floating-point 1x1 matrix.
@@ -611,55 +611,55 @@ namespace glm
/// Double-precision floating-point 2x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x2<f64> f64mat2x2;
typedef detail::tmat2x2<f64, defaultp> f64mat2x2;
/// Double-precision floating-point 2x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x3<f64> f64mat2x3;
typedef detail::tmat2x3<f64, defaultp> f64mat2x3;
/// Double-precision floating-point 2x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat2x4<f64> f64mat2x4;
typedef detail::tmat2x4<f64, defaultp> f64mat2x4;
/// Double-precision floating-point 3x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x2<f64> f64mat3x2;
typedef detail::tmat3x2<f64, defaultp> f64mat3x2;
/// Double-precision floating-point 3x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x3<f64> f64mat3x3;
typedef detail::tmat3x3<f64, defaultp> f64mat3x3;
/// Double-precision floating-point 3x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat3x4<f64> f64mat3x4;
typedef detail::tmat3x4<f64, defaultp> f64mat3x4;
/// Double-precision floating-point 4x2 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x2<f64> f64mat4x2;
typedef detail::tmat4x2<f64, defaultp> f64mat4x2;
/// Double-precision floating-point 4x3 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x3<f64> f64mat4x3;
typedef detail::tmat4x3<f64, defaultp> f64mat4x3;
/// Double-precision floating-point 4x4 matrix.
/// @see gtc_type_precision
typedef detail::tmat4x4<f64> f64mat4x4;
typedef detail::tmat4x4<f64, defaultp> f64mat4x4;
//////////////////////////
// Quaternion types
/// Half-precision floating-point quaternion.
/// Half-precision floating-point quaternion.
/// @see gtc_type_precision
typedef detail::tquat<f16> f16quat;
typedef detail::tquat<f16, defaultp> f16quat;
/// Single-precision floating-point quaternion.
/// Single-precision floating-point quaternion.
/// @see gtc_type_precision
typedef detail::tquat<f32> f32quat;
typedef detail::tquat<f32, defaultp> f32quat;
/// Double-precision floating-point quaternion.
/// Double-precision floating-point quaternion.
/// @see gtc_type_precision
typedef detail::tquat<f64> f64quat;
typedef detail::tquat<f64, defaultp> f64quat;
/// @}
}//namespace glm

View File

@@ -82,83 +82,83 @@ namespace glm
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tvec2<T> make_vec2(T const * const ptr);
detail::tvec2<T, defaultp> make_vec2(T const * const ptr);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tvec3<T> make_vec3(T const * const ptr);
detail::tvec3<T, defaultp> make_vec3(T const * const ptr);
/// Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tvec4<T> make_vec4(T const * const ptr);
detail::tvec4<T, defaultp> make_vec4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat2x2<T> make_mat2x2(T const * const ptr);
detail::tmat2x2<T, defaultp> make_mat2x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat2x3<T> make_mat2x3(T const * const ptr);
detail::tmat2x3<T, defaultp> make_mat2x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat2x4<T> make_mat2x4(T const * const ptr);
detail::tmat2x4<T, defaultp> make_mat2x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat3x2<T> make_mat3x2(T const * const ptr);
detail::tmat3x2<T, defaultp> make_mat3x2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat3x3<T> make_mat3x3(T const * const ptr);
detail::tmat3x3<T, defaultp> make_mat3x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat3x4<T> make_mat3x4(T const * const ptr);
detail::tmat3x4<T, defaultp> make_mat3x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat4x2<T> make_mat4x2(
detail::tmat4x2<T, defaultp> make_mat4x2(
T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat4x3<T> make_mat4x3(T const * const ptr);
detail::tmat4x3<T, defaultp> make_mat4x3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat4x4<T> make_mat4x4(T const * const ptr);
detail::tmat4x4<T, defaultp> make_mat4x4(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat2x2<T> make_mat2(T const * const ptr);
detail::tmat2x2<T, defaultp> make_mat2(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat3x3<T> make_mat3(T const * const ptr);
detail::tmat3x3<T, defaultp> make_mat3(T const * const ptr);
/// Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tmat4x4<T> make_mat4(T const * const ptr);
detail::tmat4x4<T, defaultp> make_mat4(T const * const ptr);
/// Build a quaternion from a pointer.
/// @see gtc_type_ptr
template<typename T>
detail::tquat<T> make_quat(T const * const ptr);
detail::tquat<T, defaultp> make_quat(T const * const ptr);
/// @}
}//namespace glm

View File

@@ -33,10 +33,10 @@ namespace glm
/// Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tvec2<T> const & vec
detail::tvec2<T, P> const & vec
)
{
return &(vec.x);
@@ -44,10 +44,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tvec2<T> & vec
detail::tvec2<T, P> & vec
)
{
return &(vec.x);
@@ -55,10 +55,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tvec3<T> const & vec
detail::tvec3<T, P> const & vec
)
{
return &(vec.x);
@@ -66,10 +66,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tvec3<T> & vec
detail::tvec3<T, P> & vec
)
{
return &(vec.x);
@@ -77,10 +77,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tvec4<T> const & vec
detail::tvec4<T, P> const & vec
)
{
return &(vec.x);
@@ -88,10 +88,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
//! From GLM_GTC_type_ptr extension.
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tvec4<T> & vec
detail::tvec4<T, P> & vec
)
{
return &(vec.x);
@@ -99,10 +99,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tmat2x2<T> const & mat
detail::tmat2x2<T, P> const & mat
)
{
return &(mat[0].x);
@@ -110,10 +110,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tmat2x2<T> & mat
detail::tmat2x2<T, P> & mat
)
{
return &(mat[0].x);
@@ -121,10 +121,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tmat3x3<T> const & mat
detail::tmat3x3<T, P> const & mat
)
{
return &(mat[0].x);
@@ -132,10 +132,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tmat3x3<T> & mat
detail::tmat3x3<T, P> & mat
)
{
return &(mat[0].x);
@@ -143,10 +143,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tmat4x4<T> const & mat
detail::tmat4x4<T, P> const & mat
)
{
return &(mat[0].x);
@@ -154,10 +154,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
//! From GLM_GTC_type_ptr extension.
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tmat4x4<T> & mat
detail::tmat4x4<T, P> & mat
)
{
return &(mat[0].x);
@@ -165,10 +165,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tmat2x3<T> const & mat
detail::tmat2x3<T, P> const & mat
)
{
return &(mat[0].x);
@@ -176,10 +176,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tmat2x3<T> & mat
detail::tmat2x3<T, P> & mat
)
{
return &(mat[0].x);
@@ -187,10 +187,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tmat3x2<T> const & mat
detail::tmat3x2<T, P> const & mat
)
{
return &(mat[0].x);
@@ -198,10 +198,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tmat3x2<T> & mat
detail::tmat3x2<T, P> & mat
)
{
return &(mat[0].x);
@@ -209,10 +209,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tmat2x4<T> const & mat
detail::tmat2x4<T, P> const & mat
)
{
return &(mat[0].x);
@@ -220,10 +220,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tmat2x4<T> & mat
detail::tmat2x4<T, P> & mat
)
{
return &(mat[0].x);
@@ -231,10 +231,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tmat4x2<T> const & mat
detail::tmat4x2<T, P> const & mat
)
{
return &(mat[0].x);
@@ -242,10 +242,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tmat4x2<T> & mat
detail::tmat4x2<T, P> & mat
)
{
return &(mat[0].x);
@@ -253,10 +253,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tmat3x4<T> const & mat
detail::tmat3x4<T, P> const & mat
)
{
return &(mat[0].x);
@@ -264,10 +264,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr
(
detail::tmat3x4<T> & mat
detail::tmat3x4<T, P> & mat
)
{
return &(mat[0].x);
@@ -275,10 +275,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tmat4x3<T> const & mat
detail::tmat4x3<T, P> const & mat
)
{
return &(mat[0].x);
@@ -286,10 +286,10 @@ namespace glm
//! Return the constant address to the data of the input parameter.
/// @see gtc_type_ptr
template<typename T>
template<typename T, precision P>
GLM_FUNC_QUALIFIER T const * value_ptr
(
detail::tquat<T> const & q
detail::tquat<T, P> const & q
)
{
return &(q[0]);
@@ -297,163 +297,163 @@ namespace glm
//! Get the address of the matrix content.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER T * value_ptr(detail::tmat4x3<T> & mat)
template<typename T, precision P>
GLM_FUNC_QUALIFIER T * value_ptr(detail::tmat4x3<T, P> & mat)
{
return &(mat[0].x);
}
//! Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tvec2<T> make_vec2(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec2<T, defaultp> make_vec2(T const * const ptr)
{
detail::tvec2<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tvec2<T>));
detail::tvec2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tvec2<T, defaultp>));
return Result;
}
//! Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T> make_vec3(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec3<T, defaultp> make_vec3(T const * const ptr)
{
detail::tvec3<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tvec3<T>));
detail::tvec3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tvec3<T, defaultp>));
return Result;
}
//! Build a vector from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tvec4<T> make_vec4(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tvec4<T, defaultp> make_vec4(T const * const ptr)
{
detail::tvec4<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tvec4<T>));
detail::tvec4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tvec4<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat2x2<T> make_mat2x2(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x2<T, defaultp> make_mat2x2(T const * const ptr)
{
detail::tmat2x2<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x2<T>));
detail::tmat2x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x2<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat2x3<T> make_mat2x3(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x3<T, defaultp> make_mat2x3(T const * const ptr)
{
detail::tmat2x3<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x3<T>));
detail::tmat2x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x3<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat2x4<T> make_mat2x4(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x4<T, defaultp> make_mat2x4(T const * const ptr)
{
detail::tmat2x4<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x4<T>));
detail::tmat2x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat2x4<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat3x2<T> make_mat3x2(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x2<T, defaultp> make_mat3x2(T const * const ptr)
{
detail::tmat3x2<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x2<T>));
detail::tmat3x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x2<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T> make_mat3x3(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<T, defaultp> make_mat3x3(T const * const ptr)
{
detail::tmat3x3<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x3<T>));
detail::tmat3x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x3<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat3x4<T> make_mat3x4(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x4<T, defaultp> make_mat3x4(T const * const ptr)
{
detail::tmat3x4<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x4<T>));
detail::tmat3x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat3x4<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat4x2<T> make_mat4x2(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x2<T, defaultp> make_mat4x2(T const * const ptr)
{
detail::tmat4x2<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x2<T>));
detail::tmat4x2<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x2<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat4x3<T> make_mat4x3(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x3<T, defaultp> make_mat4x3(T const * const ptr)
{
detail::tmat4x3<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x3<T>));
detail::tmat4x3<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x3<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T> make_mat4x4(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<T, defaultp> make_mat4x4(T const * const ptr)
{
detail::tmat4x4<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x4<T>));
detail::tmat4x4<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tmat4x4<T, defaultp>));
return Result;
}
//! Build a matrix from a pointer.
/// @see gtc_type_ptr
template<typename T>
GLM_FUNC_QUALIFIER detail::tmat2x2<T> make_mat2(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat2x2<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 detail::tmat3x3<T> make_mat3(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat3x3<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 detail::tmat4x4<T> make_mat4(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tmat4x4<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 detail::tquat<T> make_quat(T const * const ptr)
template <typename T>
GLM_FUNC_QUALIFIER detail::tquat<T, defaultp> make_quat(T const * const ptr)
{
detail::tquat<T> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tquat<T>));
detail::tquat<T, defaultp> Result;
memcpy(value_ptr(Result), ptr, sizeof(detail::tquat<T, defaultp>));
return Result;
}