Add GLM_NOEXCEPT to most functions in glm/detail

- No class members, though
This commit is contained in:
Jesse Talavera-Greenberg 2015-09-11 19:20:16 -04:00
parent 5a6df6214c
commit f7f1239bb7
30 changed files with 414 additions and 414 deletions

View File

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

View File

@ -46,7 +46,7 @@ namespace detail
template <typename R, typename T, precision P> template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec1> struct functor1<R, T, P, tvec1>
{ {
GLM_FUNC_QUALIFIER static tvec1<R, P> call(R (*Func) (T x), tvec1<T, P> const & v) GLM_FUNC_QUALIFIER static tvec1<R, P> call(R (*Func) (T x), tvec1<T, P> const & v) GLM_NOEXCEPT
{ {
return tvec1<R, P>(Func(v.x)); return tvec1<R, P>(Func(v.x));
} }
@ -55,7 +55,7 @@ namespace detail
template <typename R, typename T, precision P> template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec2> struct functor1<R, T, P, tvec2>
{ {
GLM_FUNC_QUALIFIER static tvec2<R, P> call(R (*Func) (T x), tvec2<T, P> const & v) GLM_FUNC_QUALIFIER static tvec2<R, P> call(R (*Func) (T x), tvec2<T, P> const & v) GLM_NOEXCEPT
{ {
return tvec2<R, P>(Func(v.x), Func(v.y)); return tvec2<R, P>(Func(v.x), Func(v.y));
} }
@ -64,7 +64,7 @@ namespace detail
template <typename R, typename T, precision P> template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec3> struct functor1<R, T, P, tvec3>
{ {
GLM_FUNC_QUALIFIER static tvec3<R, P> call(R (*Func) (T x), tvec3<T, P> const & v) GLM_FUNC_QUALIFIER static tvec3<R, P> call(R (*Func) (T x), tvec3<T, P> const & v) GLM_NOEXCEPT
{ {
return tvec3<R, P>(Func(v.x), Func(v.y), Func(v.z)); return tvec3<R, P>(Func(v.x), Func(v.y), Func(v.z));
} }
@ -73,7 +73,7 @@ namespace detail
template <typename R, typename T, precision P> template <typename R, typename T, precision P>
struct functor1<R, T, P, tvec4> struct functor1<R, T, P, tvec4>
{ {
GLM_FUNC_QUALIFIER static tvec4<R, P> call(R (*Func) (T x), tvec4<T, P> const & v) GLM_FUNC_QUALIFIER static tvec4<R, P> call(R (*Func) (T x), tvec4<T, P> const & v) GLM_NOEXCEPT
{ {
return tvec4<R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); return tvec4<R, P>(Func(v.x), Func(v.y), Func(v.z), Func(v.w));
} }
@ -85,7 +85,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct functor2<T, P, tvec1> struct functor2<T, P, tvec1>
{ {
GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, tvec1<T, P> const & b) GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, tvec1<T, P> const & b) GLM_NOEXCEPT
{ {
return tvec1<T, P>(Func(a.x, b.x)); return tvec1<T, P>(Func(a.x, b.x));
} }
@ -94,7 +94,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct functor2<T, P, tvec2> struct functor2<T, P, tvec2>
{ {
GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, tvec2<T, P> const & b) GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, tvec2<T, P> const & b) GLM_NOEXCEPT
{ {
return tvec2<T, P>(Func(a.x, b.x), Func(a.y, b.y)); return tvec2<T, P>(Func(a.x, b.x), Func(a.y, b.y));
} }
@ -103,7 +103,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct functor2<T, P, tvec3> struct functor2<T, P, tvec3>
{ {
GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, tvec3<T, P> const & b) GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, tvec3<T, P> const & b) GLM_NOEXCEPT
{ {
return tvec3<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); return tvec3<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z));
} }
@ -112,7 +112,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct functor2<T, P, tvec4> struct functor2<T, P, tvec4>
{ {
GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, tvec4<T, P> const & b) GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, tvec4<T, P> const & b) GLM_NOEXCEPT
{ {
return tvec4<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); return tvec4<T, P>(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w));
} }
@ -124,7 +124,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec1> struct functor2_vec_sca<T, P, tvec1>
{ {
GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, T b) GLM_FUNC_QUALIFIER static tvec1<T, P> call(T (*Func) (T x, T y), tvec1<T, P> const & a, T b) GLM_NOEXCEPT
{ {
return tvec1<T, P>(Func(a.x, b)); return tvec1<T, P>(Func(a.x, b));
} }
@ -133,7 +133,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec2> struct functor2_vec_sca<T, P, tvec2>
{ {
GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, T b) GLM_FUNC_QUALIFIER static tvec2<T, P> call(T (*Func) (T x, T y), tvec2<T, P> const & a, T b) GLM_NOEXCEPT
{ {
return tvec2<T, P>(Func(a.x, b), Func(a.y, b)); return tvec2<T, P>(Func(a.x, b), Func(a.y, b));
} }
@ -142,7 +142,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec3> struct functor2_vec_sca<T, P, tvec3>
{ {
GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, T b) GLM_FUNC_QUALIFIER static tvec3<T, P> call(T (*Func) (T x, T y), tvec3<T, P> const & a, T b) GLM_NOEXCEPT
{ {
return tvec3<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b)); return tvec3<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b));
} }
@ -151,7 +151,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct functor2_vec_sca<T, P, tvec4> struct functor2_vec_sca<T, P, tvec4>
{ {
GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, T b) GLM_FUNC_QUALIFIER static tvec4<T, P> call(T (*Func) (T x, T y), tvec4<T, P> const & a, T b) GLM_NOEXCEPT
{ {
return tvec4<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); return tvec4<T, P>(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b));
} }

View File

@ -56,10 +56,10 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType abs(genType x); GLM_FUNC_DECL genType abs(genType x) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> abs(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> abs(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
/// ///
@ -68,7 +68,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sign(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> sign(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns a value equal to the nearest integer that is less then or equal to x. /// Returns a value equal to the nearest integer that is less then or equal to x.
/// ///
@ -77,7 +77,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> floor(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> floor(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns a value equal to the nearest integer to x /// Returns a value equal to the nearest integer to x
/// whose absolute value is not larger than the absolute value of x. /// whose absolute value is not larger than the absolute value of x.
@ -87,7 +87,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> trunc(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> trunc(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns a value equal to the nearest integer to x. /// Returns a value equal to the nearest integer to x.
/// The fraction 0.5 will round in a direction chosen by the /// The fraction 0.5 will round in a direction chosen by the
@ -100,7 +100,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> round(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> round(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns a value equal to the nearest integer to x. /// Returns a value equal to the nearest integer to x.
/// A fractional part of 0.5 will round toward the nearest even /// A fractional part of 0.5 will round toward the nearest even
@ -112,7 +112,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a> /// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> roundEven(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> roundEven(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns a value equal to the nearest integer /// Returns a value equal to the nearest integer
/// that is greater than or equal to x. /// that is greater than or equal to x.
@ -122,7 +122,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> ceil(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> ceil(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Return x - floor(x). /// Return x - floor(x).
/// ///
@ -131,10 +131,10 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType fract(genType x); GLM_FUNC_DECL genType fract(genType x) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> fract(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> fract(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Modulus. Returns x - y * floor(x / y) /// Modulus. Returns x - y * floor(x / y)
/// for each component in x using the floating point value y. /// for each component in x using the floating point value y.
@ -144,13 +144,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType mod(genType x, genType y); GLM_FUNC_DECL genType mod(genType x, genType y) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, T y); GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, T y) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y); GLM_FUNC_DECL vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT;
/// Returns the fractional part of x and sets i to the integer /// Returns the fractional part of x and sets i to the integer
/// part (as a whole number floating point value). Both the /// part (as a whole number floating point value). Both the
@ -162,7 +162,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType modf(genType x, genType & i); GLM_FUNC_DECL genType modf(genType x, genType & i) GLM_NOEXCEPT;
/// Returns y if y < x; otherwise, it returns x. /// Returns y if y < x; otherwise, it returns x.
/// ///
@ -171,13 +171,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType min(genType x, genType y); GLM_FUNC_DECL genType min(genType x, genType y) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, T y); GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, T y) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, vecType<T, P> const & y); GLM_FUNC_DECL vecType<T, P> min(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT;
/// Returns y if x < y; otherwise, it returns x. /// Returns y if x < y; otherwise, it returns x.
/// ///
@ -186,13 +186,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType max(genType x, genType y); GLM_FUNC_DECL genType max(genType x, genType y) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, T y); GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, T y) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, vecType<T, P> const & y); GLM_FUNC_DECL vecType<T, P> max(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT;
/// Returns min(max(x, minVal), maxVal) for each component in x /// Returns min(max(x, minVal), maxVal) for each component in x
/// using the floating-point values minVal and maxVal. /// using the floating-point values minVal and maxVal.
@ -202,13 +202,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal); GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal); GLM_FUNC_DECL vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal) GLM_NOEXCEPT;
/// If genTypeU is a floating scalar or vector: /// If genTypeU is a floating scalar or vector:
/// Returns x * (1.0 - a) + y * a, i.e., the linear blend of /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of
@ -253,34 +253,34 @@ namespace glm
/// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter.
/// @endcode /// @endcode
template <typename T, typename U, precision P, template <typename, precision> class vecType> template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a); GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a) GLM_NOEXCEPT;
template <typename T, typename U, precision P, template <typename, precision> class vecType> template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a); GLM_FUNC_DECL vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a) GLM_NOEXCEPT;
template <typename genTypeT, typename genTypeU> template <typename genTypeT, typename genTypeU>
GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a) GLM_NOEXCEPT;
/// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType step(genType edge, genType x); GLM_FUNC_DECL genType step(genType edge, genType x) GLM_NOEXCEPT;
/// Returns 0.0 if x < edge, otherwise it returns 1.0. /// Returns 0.0 if x < edge, otherwise it returns 1.0.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, typename T, precision P> template <template <typename, precision> class vecType, typename T, precision P>
GLM_FUNC_DECL vecType<T, P> step(T edge, vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> step(T edge, vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns 0.0 if x < edge, otherwise it returns 1.0. /// Returns 0.0 if x < edge, otherwise it returns 1.0.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, typename T, precision P> template <template <typename, precision> class vecType, typename T, precision P>
GLM_FUNC_DECL vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
/// performs smooth Hermite interpolation between 0 and 1 /// performs smooth Hermite interpolation between 0 and 1
@ -297,13 +297,13 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x); GLM_FUNC_DECL genType smoothstep(genType edge0, genType edge1, genType x) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns true if x holds a NaN (not a number) /// Returns true if x holds a NaN (not a number)
/// representation in the underlying implementation's set of /// representation in the underlying implementation's set of
@ -318,7 +318,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isnan(vecType<T, P> const & x); GLM_FUNC_DECL vecType<bool, P> isnan(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns true if x holds a positive infinity or negative /// Returns true if x holds a positive infinity or negative
/// infinity representation in the underlying implementation's /// infinity representation in the underlying implementation's
@ -331,7 +331,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<bool, P> isinf(vecType<T, P> const & x); GLM_FUNC_DECL vecType<bool, P> isinf(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns a signed integer value representing /// Returns a signed integer value representing
/// the encoding of a floating-point value. The floating-point /// the encoding of a floating-point value. The floating-point
@ -339,7 +339,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL int floatBitsToInt(float const & v); GLM_FUNC_DECL int floatBitsToInt(float const & v) GLM_NOEXCEPT;
/// Returns a signed integer value representing /// Returns a signed integer value representing
/// the encoding of a floating-point value. The floatingpoint /// the encoding of a floating-point value. The floatingpoint
@ -348,7 +348,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, precision P> template <template <typename, precision> class vecType, precision P>
GLM_FUNC_DECL vecType<int, P> floatBitsToInt(vecType<float, P> const & v); GLM_FUNC_DECL vecType<int, P> floatBitsToInt(vecType<float, P> const & v) GLM_NOEXCEPT;
/// Returns a unsigned integer value representing /// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint /// the encoding of a floating-point value. The floatingpoint
@ -356,7 +356,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL uint floatBitsToUint(float const & v); GLM_FUNC_DECL uint floatBitsToUint(float const & v) GLM_NOEXCEPT;
/// Returns a unsigned integer value representing /// Returns a unsigned integer value representing
/// the encoding of a floating-point value. The floatingpoint /// the encoding of a floating-point value. The floatingpoint
@ -365,7 +365,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, precision P> template <template <typename, precision> class vecType, precision P>
GLM_FUNC_DECL vecType<uint, P> floatBitsToUint(vecType<float, P> const & v); GLM_FUNC_DECL vecType<uint, P> floatBitsToUint(vecType<float, P> const & v) GLM_NOEXCEPT;
/// Returns a floating-point value corresponding to a signed /// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value. /// integer encoding of a floating-point value.
@ -375,7 +375,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL float intBitsToFloat(int const & v); GLM_FUNC_DECL float intBitsToFloat(int const & v) GLM_NOEXCEPT;
/// Returns a floating-point value corresponding to a signed /// Returns a floating-point value corresponding to a signed
/// integer encoding of a floating-point value. /// integer encoding of a floating-point value.
@ -386,7 +386,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, precision P> template <template <typename, precision> class vecType, precision P>
GLM_FUNC_DECL vecType<float, P> intBitsToFloat(vecType<int, P> const & v); GLM_FUNC_DECL vecType<float, P> intBitsToFloat(vecType<int, P> const & v) GLM_NOEXCEPT;
/// Returns a floating-point value corresponding to a /// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value. /// unsigned integer encoding of a floating-point value.
@ -396,7 +396,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
GLM_FUNC_DECL float uintBitsToFloat(uint const & v); GLM_FUNC_DECL float uintBitsToFloat(uint const & v) GLM_NOEXCEPT;
/// Returns a floating-point value corresponding to a /// Returns a floating-point value corresponding to a
/// unsigned integer encoding of a floating-point value. /// unsigned integer encoding of a floating-point value.
@ -407,7 +407,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <template <typename, precision> class vecType, precision P> template <template <typename, precision> class vecType, precision P>
GLM_FUNC_DECL vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v); GLM_FUNC_DECL vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v) GLM_NOEXCEPT;
/// Computes and returns a * b + c. /// Computes and returns a * b + c.
/// ///
@ -416,7 +416,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c); GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c) GLM_NOEXCEPT;
/// Splits x into a floating-point significand in the range /// Splits x into a floating-point significand in the range
/// [0.5, 1.0) and an integral exponent of two, such that: /// [0.5, 1.0) and an integral exponent of two, such that:
@ -433,7 +433,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genIType> template <typename genType, typename genIType>
GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp); GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp) GLM_NOEXCEPT;
/// Builds a floating-point number from x and the /// Builds a floating-point number from x and the
/// corresponding integral exponent of two in exp, returning: /// corresponding integral exponent of two in exp, returning:
@ -447,7 +447,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>; /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
template <typename genType, typename genIType> template <typename genType, typename genIType>
GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp); GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -47,7 +47,7 @@ namespace detail
template <typename genFIType> template <typename genFIType>
struct compute_abs<genFIType, true> struct compute_abs<genFIType, true>
{ {
GLM_FUNC_QUALIFIER static genFIType call(genFIType x) GLM_FUNC_QUALIFIER static genFIType call(genFIType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT( GLM_STATIC_ASSERT(
std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed, std::numeric_limits<genFIType>::is_iec559 || std::numeric_limits<genFIType>::is_signed,
@ -61,7 +61,7 @@ namespace detail
template <typename genFIType> template <typename genFIType>
struct compute_abs<genFIType, false> struct compute_abs<genFIType, false>
{ {
GLM_FUNC_QUALIFIER static genFIType call(genFIType x) GLM_FUNC_QUALIFIER static genFIType call(genFIType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT( GLM_STATIC_ASSERT(
!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer, !std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
@ -73,7 +73,7 @@ namespace detail
template <typename T, typename U, precision P, template <class, precision> class vecType> template <typename T, typename U, precision P, template <class, precision> class vecType>
struct compute_mix_vector struct compute_mix_vector
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a");
@ -84,7 +84,7 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType> template <typename T, precision P, template <class, precision> class vecType>
struct compute_mix_vector<T, bool, P, vecType> struct compute_mix_vector<T, bool, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<bool, P> const & a) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vecType<bool, P> const & a) GLM_NOEXCEPT
{ {
vecType<T, P> Result(uninitialize); vecType<T, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(x); ++i) for(detail::component_count_t i = 0; i < detail::component_count(x); ++i)
@ -96,7 +96,7 @@ namespace detail
template <typename T, typename U, precision P, template <class, precision> class vecType> template <typename T, typename U, precision P, template <class, precision> class vecType>
struct compute_mix_scalar struct compute_mix_scalar
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, U const & a) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, U const & a) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a");
@ -107,7 +107,7 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType> template <typename T, precision P, template <class, precision> class vecType>
struct compute_mix_scalar<T, bool, P, vecType> struct compute_mix_scalar<T, bool, P, vecType>
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, bool const & a) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, bool const & a) GLM_NOEXCEPT
{ {
return a ? y : x; return a ? y : x;
} }
@ -116,7 +116,7 @@ namespace detail
template <typename T, typename U> template <typename T, typename U>
struct compute_mix struct compute_mix
{ {
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a) GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a"); GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559, "'mix' only accept floating-point inputs for the interpolator a");
@ -127,7 +127,7 @@ namespace detail
template <typename T> template <typename T>
struct compute_mix<T, bool> struct compute_mix<T, bool>
{ {
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a) GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a) GLM_NOEXCEPT
{ {
return a ? y : x; return a ? y : x;
} }
@ -136,7 +136,7 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType, bool isFloat = true, bool isSigned = true> template <typename T, precision P, template <class, precision> class vecType, bool isFloat = true, bool isSigned = true>
struct compute_sign struct compute_sign
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return vecType<T, P>(glm::lessThan(vecType<T, P>(0), x)) - vecType<T, P>(glm::lessThan(x, vecType<T, P>(0))); return vecType<T, P>(glm::lessThan(vecType<T, P>(0), x)) - vecType<T, P>(glm::lessThan(x, vecType<T, P>(0)));
} }
@ -145,7 +145,7 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType> template <typename T, precision P, template <class, precision> class vecType>
struct compute_sign<T, P, vecType, false, false> struct compute_sign<T, P, vecType, false, false>
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return vecType<T, P>(glm::greaterThan(x , vecType<T, P>(0))); return vecType<T, P>(glm::greaterThan(x , vecType<T, P>(0)));
} }
@ -154,7 +154,7 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType> template <typename T, precision P, template <class, precision> class vecType>
struct compute_sign<T, P, vecType, false, true> struct compute_sign<T, P, vecType, false, true>
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
T const Shift(static_cast<T>(sizeof(T) * 8 - 1)); T const Shift(static_cast<T>(sizeof(T) * 8 - 1));
vecType<T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift)); vecType<T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
@ -166,7 +166,7 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType, typename genType, bool isFloat = true> template <typename T, precision P, template <class, precision> class vecType, typename genType, bool isFloat = true>
struct compute_mod struct compute_mod
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & a, genType const & b) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & a, genType const & b) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs."); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
return a - b * floor(a / b); return a - b * floor(a / b);
@ -176,20 +176,20 @@ namespace detail
// abs // abs
template <> template <>
GLM_FUNC_QUALIFIER int32 abs(int32 x) GLM_FUNC_QUALIFIER int32 abs(int32 x) GLM_NOEXCEPT
{ {
int32 const y = x >> 31; int32 const y = x >> 31;
return (x ^ y) - y; return (x ^ y) - y;
} }
template <typename genFIType> template <typename genFIType>
GLM_FUNC_QUALIFIER genFIType abs(genFIType x) GLM_FUNC_QUALIFIER genFIType abs(genFIType x) GLM_NOEXCEPT
{ {
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x); return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> abs(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> abs(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(abs, x); return detail::functor1<T, T, P, vecType>::call(abs, x);
} }
@ -197,17 +197,17 @@ namespace detail
// sign // sign
// fast and works for any type // fast and works for any type
template <typename genFIType> template <typename genFIType>
GLM_FUNC_QUALIFIER genFIType sign(genFIType x) GLM_FUNC_QUALIFIER genFIType sign(genFIType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT( GLM_STATIC_ASSERT(
std::numeric_limits<genFIType>::is_iec559 || (std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer), std::numeric_limits<genFIType>::is_iec559 || (std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer),
"'sign' only accept signed inputs"); "'sign' only accept signed inputs");
return detail::compute_sign<genFIType, defaultp, tvec1, std::numeric_limits<genFIType>::is_iec559>::call(tvec1<genFIType>(x)).x; return detail::compute_sign<genFIType, defaultp, tvec1, std::numeric_limits<genFIType>::is_iec559>::call(tvec1<genFIType>(x)).x;
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sign(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> sign(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT( GLM_STATIC_ASSERT(
std::numeric_limits<T>::is_iec559 || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer), std::numeric_limits<T>::is_iec559 || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer),
@ -219,7 +219,7 @@ namespace detail
// floor // floor
using ::std::floor; using ::std::floor;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> floor(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> floor(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(floor, x); return detail::functor1<T, T, P, vecType>::call(floor, x);
} }
@ -229,7 +229,7 @@ namespace detail
using ::std::trunc; using ::std::trunc;
# else # else
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType trunc(genType x) GLM_FUNC_QUALIFIER genType trunc(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'trunc' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'trunc' only accept floating-point inputs");
@ -238,7 +238,7 @@ namespace detail
# endif # endif
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> trunc(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> trunc(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(trunc, x); return detail::functor1<T, T, P, vecType>::call(trunc, x);
} }
@ -248,7 +248,7 @@ namespace detail
using ::std::round; using ::std::round;
# else # else
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType round(genType x) GLM_FUNC_QUALIFIER genType round(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'round' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'round' only accept floating-point inputs");
@ -257,7 +257,7 @@ namespace detail
# endif # endif
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> round(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> round(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(round, x); return detail::functor1<T, T, P, vecType>::call(round, x);
} }
@ -265,7 +265,7 @@ namespace detail
/* /*
// roundEven // roundEven
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType roundEven(genType const& x) GLM_FUNC_QUALIFIER genType roundEven(genType const& x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs");
@ -275,10 +275,10 @@ namespace detail
// roundEven // roundEven
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType roundEven(genType x) GLM_FUNC_QUALIFIER genType roundEven(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs");
int Integer = static_cast<int>(x); int Integer = static_cast<int>(x);
genType IntegerPart = static_cast<genType>(Integer); genType IntegerPart = static_cast<genType>(Integer);
genType FractionalPart = fract(x); genType FractionalPart = fract(x);
@ -306,7 +306,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> roundEven(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> roundEven(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(roundEven, x); return detail::functor1<T, T, P, vecType>::call(roundEven, x);
} }
@ -314,14 +314,14 @@ namespace detail
// ceil // ceil
using ::std::ceil; using ::std::ceil;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> ceil(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> ceil(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(ceil, x); return detail::functor1<T, T, P, vecType>::call(ceil, x);
} }
// fract // fract
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType fract(genType x) GLM_FUNC_QUALIFIER genType fract(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'fract' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'fract' only accept floating-point inputs");
@ -329,33 +329,33 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> fract(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> fract(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return x - floor(x); return x - floor(x);
} }
// mod // mod
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType mod(genType x, genType y) GLM_FUNC_QUALIFIER genType mod(genType x, genType y) GLM_NOEXCEPT
{ {
return mod(tvec1<genType>(x), y).x; return mod(tvec1<genType>(x), y).x;
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, T y) GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, T y) GLM_NOEXCEPT
{ {
return detail::compute_mod<T, P, vecType, T, std::numeric_limits<T>::is_iec559>::call(x, y); return detail::compute_mod<T, P, vecType, T, std::numeric_limits<T>::is_iec559>::call(x, y);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT
{ {
return detail::compute_mod<T, P, vecType, vecType<T, P>, std::numeric_limits<T>::is_iec559>::call(x, y); return detail::compute_mod<T, P, vecType, vecType<T, P>, std::numeric_limits<T>::is_iec559>::call(x, y);
} }
// modf // modf
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'modf' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'modf' only accept floating-point inputs");
@ -363,14 +363,14 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> modf(tvec1<T, P> const & x, tvec1<T, P> & i) GLM_FUNC_QUALIFIER tvec1<T, P> modf(tvec1<T, P> const & x, tvec1<T, P> & i) GLM_NOEXCEPT
{ {
return tvec1<T, P>( return tvec1<T, P>(
modf(x.x, i.x)); modf(x.x, i.x));
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> modf(tvec2<T, P> const & x, tvec2<T, P> & i) GLM_FUNC_QUALIFIER tvec2<T, P> modf(tvec2<T, P> const & x, tvec2<T, P> & i) GLM_NOEXCEPT
{ {
return tvec2<T, P>( return tvec2<T, P>(
modf(x.x, i.x), modf(x.x, i.x),
@ -378,7 +378,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> modf(tvec3<T, P> const & x, tvec3<T, P> & i) GLM_FUNC_QUALIFIER tvec3<T, P> modf(tvec3<T, P> const & x, tvec3<T, P> & i) GLM_NOEXCEPT
{ {
return tvec3<T, P>( return tvec3<T, P>(
modf(x.x, i.x), modf(x.x, i.x),
@ -387,7 +387,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> modf(tvec4<T, P> const & x, tvec4<T, P> & i) GLM_FUNC_QUALIFIER tvec4<T, P> modf(tvec4<T, P> const & x, tvec4<T, P> & i) GLM_NOEXCEPT
{ {
return tvec4<T, P>( return tvec4<T, P>(
modf(x.x, i.x), modf(x.x, i.x),
@ -406,7 +406,7 @@ namespace detail
// min // min
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType min(genType x, genType y) GLM_FUNC_QUALIFIER genType min(genType x, genType y) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'min' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'min' only accept floating-point or integer inputs");
@ -414,20 +414,20 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> min(vecType<T, P> const & a, T b) GLM_FUNC_QUALIFIER vecType<T, P> min(vecType<T, P> const & a, T b) GLM_NOEXCEPT
{ {
return detail::functor2_vec_sca<T, P, vecType>::call(min, a, b); return detail::functor2_vec_sca<T, P, vecType>::call(min, a, b);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> min(vecType<T, P> const & a, vecType<T, P> const & b) GLM_FUNC_QUALIFIER vecType<T, P> min(vecType<T, P> const & a, vecType<T, P> const & b) GLM_NOEXCEPT
{ {
return detail::functor2<T, P, vecType>::call(min, a, b); return detail::functor2<T, P, vecType>::call(min, a, b);
} }
// max // max
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType max(genType x, genType y) GLM_FUNC_QUALIFIER genType max(genType x, genType y) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'max' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'max' only accept floating-point or integer inputs");
@ -435,28 +435,28 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> max(vecType<T, P> const & a, T b) GLM_FUNC_QUALIFIER vecType<T, P> max(vecType<T, P> const & a, T b) GLM_NOEXCEPT
{ {
return detail::functor2_vec_sca<T, P, vecType>::call(max, a, b); return detail::functor2_vec_sca<T, P, vecType>::call(max, a, b);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> max(vecType<T, P> const & a, vecType<T, P> const & b) GLM_FUNC_QUALIFIER vecType<T, P> max(vecType<T, P> const & a, vecType<T, P> const & b) GLM_NOEXCEPT
{ {
return detail::functor2<T, P, vecType>::call(max, a, b); return detail::functor2<T, P, vecType>::call(max, a, b);
} }
// clamp // clamp
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal) GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'clamp' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'clamp' only accept floating-point or integer inputs");
return min(max(x, minVal), maxVal); return min(max(x, minVal), maxVal);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal) GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
@ -464,7 +464,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal) GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecType<T, P> const & maxVal) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
@ -472,32 +472,32 @@ namespace detail
} }
template <typename genTypeT, typename genTypeU> template <typename genTypeT, typename genTypeU>
GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a) GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a) GLM_NOEXCEPT
{ {
return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a); return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a);
} }
template <typename T, typename U, precision P, template <typename, precision> class vecType> template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a) GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a) GLM_NOEXCEPT
{ {
return detail::compute_mix_scalar<T, U, P, vecType>::call(x, y, a); return detail::compute_mix_scalar<T, U, P, vecType>::call(x, y, a);
} }
template <typename T, typename U, precision P, template <typename, precision> class vecType> template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a) GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a) GLM_NOEXCEPT
{ {
return detail::compute_mix_vector<T, U, P, vecType>::call(x, y, a); return detail::compute_mix_vector<T, U, P, vecType>::call(x, y, a);
} }
// step // step
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType step(genType edge, genType x) GLM_FUNC_QUALIFIER genType step(genType edge, genType x) GLM_NOEXCEPT
{ {
return mix(static_cast<genType>(1), static_cast<genType>(0), glm::lessThan(x, edge)); return mix(static_cast<genType>(1), static_cast<genType>(0), glm::lessThan(x, edge));
} }
template <template <typename, precision> class vecType, typename T, precision P> template <template <typename, precision> class vecType, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<T, P> step(T edge, vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> step(T edge, vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'step' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'step' only accept floating-point inputs");
@ -505,14 +505,14 @@ namespace detail
} }
template <template <typename, precision> class vecType, typename T, precision P> template <template <typename, precision> class vecType, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return mix(vecType<T, P>(1), vecType<T, P>(0), glm::lessThan(x, edge)); return mix(vecType<T, P>(1), vecType<T, P>(0), glm::lessThan(x, edge));
} }
// smoothstep // smoothstep
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'smoothstep' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -521,7 +521,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -530,7 +530,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -542,7 +542,7 @@ namespace detail
using std::isnan; using std::isnan;
# else # else
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER bool isnan(genType x) GLM_FUNC_QUALIFIER bool isnan(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isnan' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isnan' only accept floating-point inputs");
@ -565,7 +565,7 @@ namespace detail
# endif # endif
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> isnan(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<bool, P> isnan(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
@ -576,7 +576,7 @@ namespace detail
using std::isinf; using std::isinf;
# else # else
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER bool isinf(genType x) GLM_FUNC_QUALIFIER bool isinf(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isinf' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isinf' only accept floating-point inputs");
@ -600,65 +600,65 @@ namespace detail
# endif # endif
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> isinf(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<bool, P> isinf(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
return detail::functor1<bool, T, P, vecType>::call(isinf, x); return detail::functor1<bool, T, P, vecType>::call(isinf, x);
} }
GLM_FUNC_QUALIFIER int floatBitsToInt(float const & v) GLM_FUNC_QUALIFIER int floatBitsToInt(float const & v) GLM_NOEXCEPT
{ {
return reinterpret_cast<int&>(const_cast<float&>(v)); return reinterpret_cast<int&>(const_cast<float&>(v));
} }
template <template <typename, precision> class vecType, precision P> template <template <typename, precision> class vecType, precision P>
GLM_FUNC_QUALIFIER vecType<int, P> floatBitsToInt(vecType<float, P> const & v) GLM_FUNC_QUALIFIER vecType<int, P> floatBitsToInt(vecType<float, P> const & v) GLM_NOEXCEPT
{ {
return reinterpret_cast<vecType<int, P>&>(const_cast<vecType<float, P>&>(v)); return reinterpret_cast<vecType<int, P>&>(const_cast<vecType<float, P>&>(v));
} }
GLM_FUNC_QUALIFIER uint floatBitsToUint(float const & v) GLM_FUNC_QUALIFIER uint floatBitsToUint(float const & v) GLM_NOEXCEPT
{ {
return reinterpret_cast<uint&>(const_cast<float&>(v)); return reinterpret_cast<uint&>(const_cast<float&>(v));
} }
template <template <typename, precision> class vecType, precision P> template <template <typename, precision> class vecType, precision P>
GLM_FUNC_QUALIFIER vecType<uint, P> floatBitsToUint(vecType<float, P> const & v) GLM_FUNC_QUALIFIER vecType<uint, P> floatBitsToUint(vecType<float, P> const & v) GLM_NOEXCEPT
{ {
return reinterpret_cast<vecType<uint, P>&>(const_cast<vecType<float, P>&>(v)); return reinterpret_cast<vecType<uint, P>&>(const_cast<vecType<float, P>&>(v));
} }
GLM_FUNC_QUALIFIER float intBitsToFloat(int const & v) GLM_FUNC_QUALIFIER float intBitsToFloat(int const & v) GLM_NOEXCEPT
{ {
return reinterpret_cast<float&>(const_cast<int&>(v)); return reinterpret_cast<float&>(const_cast<int&>(v));
} }
template <template <typename, precision> class vecType, precision P> template <template <typename, precision> class vecType, precision P>
GLM_FUNC_QUALIFIER vecType<float, P> intBitsToFloat(vecType<int, P> const & v) GLM_FUNC_QUALIFIER vecType<float, P> intBitsToFloat(vecType<int, P> const & v) GLM_NOEXCEPT
{ {
return reinterpret_cast<vecType<float, P>&>(const_cast<vecType<int, P>&>(v)); return reinterpret_cast<vecType<float, P>&>(const_cast<vecType<int, P>&>(v));
} }
GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & v) GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & v) GLM_NOEXCEPT
{ {
return reinterpret_cast<float&>(const_cast<uint&>(v)); return reinterpret_cast<float&>(const_cast<uint&>(v));
} }
template <template <typename, precision> class vecType, precision P> template <template <typename, precision> class vecType, precision P>
GLM_FUNC_QUALIFIER vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v) GLM_FUNC_QUALIFIER vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v) GLM_NOEXCEPT
{ {
return reinterpret_cast<vecType<float, P>&>(const_cast<vecType<uint, P>&>(v)); return reinterpret_cast<vecType<float, P>&>(const_cast<vecType<uint, P>&>(v));
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType fma(genType const & a, genType const & b, genType const & c) GLM_FUNC_QUALIFIER genType fma(genType const & a, genType const & b, genType const & c) GLM_NOEXCEPT
{ {
return a * b + c; return a * b + c;
} }
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType frexp(genType x, int & exp) GLM_FUNC_QUALIFIER genType frexp(genType x, int & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'frexp' only accept floating-point inputs");
@ -666,7 +666,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> frexp(tvec1<T, P> const & x, tvec1<int, P> & exp) GLM_FUNC_QUALIFIER tvec1<T, P> frexp(tvec1<T, P> const & x, tvec1<int, P> & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
@ -674,7 +674,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> frexp(tvec2<T, P> const & x, tvec2<int, P> & exp) GLM_FUNC_QUALIFIER tvec2<T, P> frexp(tvec2<T, P> const & x, tvec2<int, P> & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
@ -684,7 +684,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> frexp(tvec3<T, P> const & x, tvec3<int, P> & exp) GLM_FUNC_QUALIFIER tvec3<T, P> frexp(tvec3<T, P> const & x, tvec3<int, P> & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
@ -695,7 +695,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> frexp(tvec4<T, P> const & x, tvec4<int, P> & exp) GLM_FUNC_QUALIFIER tvec4<T, P> frexp(tvec4<T, P> const & x, tvec4<int, P> & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
@ -707,7 +707,7 @@ namespace detail
} }
template <typename genType, precision P> template <typename genType, precision P>
GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp) GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'ldexp' only accept floating-point inputs");
@ -715,7 +715,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> ldexp(tvec1<T, P> const & x, tvec1<int, P> const & exp) GLM_FUNC_QUALIFIER tvec1<T, P> ldexp(tvec1<T, P> const & x, tvec1<int, P> const & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
@ -724,7 +724,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> ldexp(tvec2<T, P> const & x, tvec2<int, P> const & exp) GLM_FUNC_QUALIFIER tvec2<T, P> ldexp(tvec2<T, P> const & x, tvec2<int, P> const & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
@ -734,7 +734,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> ldexp(tvec3<T, P> const & x, tvec3<int, P> const & exp) GLM_FUNC_QUALIFIER tvec3<T, P> ldexp(tvec3<T, P> const & x, tvec3<int, P> const & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
@ -745,7 +745,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> ldexp(tvec4<T, P> const & x, tvec4<int, P> const & exp) GLM_FUNC_QUALIFIER tvec4<T, P> ldexp(tvec4<T, P> const & x, tvec4<int, P> const & exp) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");

View File

@ -59,7 +59,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent); GLM_FUNC_DECL vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent) GLM_NOEXCEPT;
/// Returns the natural exponentiation of x, i.e., e^x. /// Returns the natural exponentiation of x, i.e., e^x.
/// ///
@ -69,7 +69,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> exp(vecType<T, P> const & v); GLM_FUNC_DECL vecType<T, P> exp(vecType<T, P> const & v) GLM_NOEXCEPT;
/// Returns the natural logarithm of v, i.e., /// Returns the natural logarithm of v, i.e.,
/// returns the value y which satisfies the equation x = e^y. /// returns the value y which satisfies the equation x = e^y.
@ -81,7 +81,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> log(vecType<T, P> const & v); GLM_FUNC_DECL vecType<T, P> log(vecType<T, P> const & v) GLM_NOEXCEPT;
/// Returns 2 raised to the v power. /// Returns 2 raised to the v power.
/// ///
@ -91,7 +91,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> exp2(vecType<T, P> const & v); GLM_FUNC_DECL vecType<T, P> exp2(vecType<T, P> const & v) GLM_NOEXCEPT;
/// Returns the base 2 log of x, i.e., returns the value y, /// Returns the base 2 log of x, i.e., returns the value y,
/// which satisfies the equation x = 2 ^ y. /// which satisfies the equation x = 2 ^ y.
@ -102,7 +102,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> log2(vecType<T, P> const & v); GLM_FUNC_DECL vecType<T, P> log2(vecType<T, P> const & v) GLM_NOEXCEPT;
/// Returns the positive square root of v. /// Returns the positive square root of v.
/// ///
@ -112,10 +112,10 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
//template <typename genType> //template <typename genType>
//GLM_FUNC_DECL genType sqrt(genType const & x); //GLM_FUNC_DECL genType sqrt(genType const & x) GLM_NOEXCEPT;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sqrt(vecType<T, P> const & v);
GLM_FUNC_DECL vecType<T, P> sqrt(vecType<T, P> const & v) GLM_NOEXCEPT;
/// Returns the reciprocal of the positive square root of v. /// Returns the reciprocal of the positive square root of v.
/// ///
/// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type precision. /// @param v inversesqrt function is defined for input values of v defined in the range [0, inf+) in the limit of the type precision.
@ -124,7 +124,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2 Exponential Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> inversesqrt(vecType<T, P> const & v); GLM_FUNC_DECL vecType<T, P> inversesqrt(vecType<T, P> const & v) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -52,7 +52,7 @@ namespace detail
template <typename T, precision P, template <class, precision> class vecType, bool isFloat = true> template <typename T, precision P, template <class, precision> class vecType, bool isFloat = true>
struct compute_log2 struct compute_log2
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & vec) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(log2, vec); return detail::functor1<T, T, P, vecType>::call(log2, vec);
} }
@ -61,16 +61,16 @@ namespace detail
template <template <class, precision> class vecType, typename T, precision P> template <template <class, precision> class vecType, typename T, precision P>
struct compute_inversesqrt struct compute_inversesqrt
{ {
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return static_cast<T>(1) / sqrt(x); return static_cast<T>(1) / sqrt(x);
} }
}; };
template <template <class, precision> class vecType> template <template <class, precision> class vecType>
struct compute_inversesqrt<vecType, float, lowp> struct compute_inversesqrt<vecType, float, lowp>
{ {
GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & x) GLM_FUNC_QUALIFIER static vecType<float, lowp> call(vecType<float, lowp> const & x) GLM_NOEXCEPT
{ {
vecType<float, lowp> tmp(x); vecType<float, lowp> tmp(x);
vecType<float, lowp> xhalf(tmp * 0.5f); vecType<float, lowp> xhalf(tmp * 0.5f);
@ -87,7 +87,7 @@ namespace detail
// pow // pow
using std::pow; using std::pow;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent) GLM_FUNC_QUALIFIER vecType<T, P> pow(vecType<T, P> const & base, vecType<T, P> const & exponent) GLM_NOEXCEPT
{ {
return detail::functor2<T, P, vecType>::call(pow, base, exponent); return detail::functor2<T, P, vecType>::call(pow, base, exponent);
} }
@ -95,7 +95,7 @@ namespace detail
// exp // exp
using std::exp; using std::exp;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> exp(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> exp(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(exp, x); return detail::functor1<T, T, P, vecType>::call(exp, x);
} }
@ -103,14 +103,14 @@ namespace detail
// log // log
using std::log; using std::log;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> log(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> log(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(log, x); return detail::functor1<T, T, P, vecType>::call(log, x);
} }
//exp2, ln2 = 0.69314718055994530941723212145818f //exp2, ln2 = 0.69314718055994530941723212145818f
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType exp2(genType x) GLM_FUNC_QUALIFIER genType exp2(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'exp2' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'exp2' only accept floating-point inputs");
@ -118,20 +118,20 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> exp2(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> exp2(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(exp2, x); return detail::functor1<T, T, P, vecType>::call(exp2, x);
} }
// log2, ln2 = 0.69314718055994530941723212145818f // log2, ln2 = 0.69314718055994530941723212145818f
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType log2(genType x) GLM_FUNC_QUALIFIER genType log2(genType x) GLM_NOEXCEPT
{ {
return log2(tvec1<genType>(x)).x; return log2(tvec1<genType>(x)).x;
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> log2(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> log2(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
return detail::compute_log2<T, P, vecType, std::numeric_limits<T>::is_iec559>::call(x); return detail::compute_log2<T, P, vecType, std::numeric_limits<T>::is_iec559>::call(x);
} }
@ -139,7 +139,7 @@ namespace detail
// sqrt // sqrt
using std::sqrt; using std::sqrt;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sqrt(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> sqrt(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'sqrt' only accept floating-point inputs");
return detail::functor1<T, T, P, vecType>::call(sqrt, x); return detail::functor1<T, T, P, vecType>::call(sqrt, x);
@ -147,13 +147,13 @@ namespace detail
// inversesqrt // inversesqrt
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType inversesqrt(genType x) GLM_FUNC_QUALIFIER genType inversesqrt(genType x) GLM_NOEXCEPT
{ {
return static_cast<genType>(1) / sqrt(x); return static_cast<genType>(1) / sqrt(x);
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> inversesqrt(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> inversesqrt(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inversesqrt' only accept floating-point inputs");
return detail::compute_inversesqrt<vecType, T, P>::call(x); return detail::compute_inversesqrt<vecType, T, P>::call(x);

View File

@ -54,7 +54,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T length( GLM_FUNC_DECL T length(
vecType<T, P> const & x); vecType<T, P> const & x) GLM_NOEXCEPT;
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
/// ///
@ -65,7 +65,7 @@ namespace glm
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T distance( GLM_FUNC_DECL T distance(
vecType<T, P> const & p0, vecType<T, P> const & p0,
vecType<T, P> const & p1); vecType<T, P> const & p1) GLM_NOEXCEPT;
/// Returns the dot product of x and y, i.e., result = x * y. /// Returns the dot product of x and y, i.e., result = x * y.
/// ///
@ -76,7 +76,7 @@ namespace glm
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL T dot( GLM_FUNC_DECL T dot(
vecType<T, P> const & x, vecType<T, P> const & x,
vecType<T, P> const & y); vecType<T, P> const & y) GLM_NOEXCEPT;
/// Returns the cross product of x and y. /// Returns the cross product of x and y.
/// ///
@ -87,7 +87,7 @@ namespace glm
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_DECL tvec3<T, P> cross( GLM_FUNC_DECL tvec3<T, P> cross(
tvec3<T, P> const & x, tvec3<T, P> const & x,
tvec3<T, P> const & y); tvec3<T, P> const & y) GLM_NOEXCEPT;
/// Returns a vector in the same direction as x but with length of 1. /// Returns a vector in the same direction as x but with length of 1.
/// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error. /// According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefined and generate an error.
@ -96,7 +96,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5 Geometric Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> normalize( GLM_FUNC_DECL vecType<T, P> normalize(
vecType<T, P> const & x); vecType<T, P> const & x) GLM_NOEXCEPT;
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N. /// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
/// ///
@ -108,7 +108,7 @@ namespace glm
GLM_FUNC_DECL vecType<T, P> faceforward( GLM_FUNC_DECL vecType<T, P> faceforward(
vecType<T, P> const & N, vecType<T, P> const & N,
vecType<T, P> const & I, vecType<T, P> const & I,
vecType<T, P> const & Nref); vecType<T, P> const & Nref) GLM_NOEXCEPT;
/// For the incident vector I and surface orientation N, /// For the incident vector I and surface orientation N,
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
@ -120,7 +120,7 @@ namespace glm
template <typename genType> template <typename genType>
GLM_FUNC_DECL genType reflect( GLM_FUNC_DECL genType reflect(
genType const & I, genType const & I,
genType const & N); genType const & N) GLM_NOEXCEPT;
/// For the incident vector I and surface normal N, /// For the incident vector I and surface normal N,
/// and the ratio of indices of refraction eta, /// and the ratio of indices of refraction eta,
@ -134,7 +134,7 @@ namespace glm
GLM_FUNC_DECL vecType<T, P> refract( GLM_FUNC_DECL vecType<T, P> refract(
vecType<T, P> const & I, vecType<T, P> const & I,
vecType<T, P> const & N, vecType<T, P> const & N,
T eta); T eta) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -45,7 +45,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_dot<tvec1, T, P> struct compute_dot<tvec1, T, P>
{ {
GLM_FUNC_QUALIFIER static T call(tvec1<T, P> const & a, tvec1<T, P> const & b) GLM_FUNC_QUALIFIER static T call(tvec1<T, P> const & a, tvec1<T, P> const & b) GLM_NOEXCEPT
{ {
return a.x * b.x; return a.x * b.x;
} }
@ -54,7 +54,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_dot<tvec2, T, P> struct compute_dot<tvec2, T, P>
{ {
GLM_FUNC_QUALIFIER static T call(tvec2<T, P> const & x, tvec2<T, P> const & y) GLM_FUNC_QUALIFIER static T call(tvec2<T, P> const & x, tvec2<T, P> const & y) GLM_NOEXCEPT
{ {
tvec2<T, P> tmp(x * y); tvec2<T, P> tmp(x * y);
return tmp.x + tmp.y; return tmp.x + tmp.y;
@ -64,7 +64,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_dot<tvec3, T, P> struct compute_dot<tvec3, T, P>
{ {
GLM_FUNC_QUALIFIER static T call(tvec3<T, P> const & x, tvec3<T, P> const & y) GLM_FUNC_QUALIFIER static T call(tvec3<T, P> const & x, tvec3<T, P> const & y) GLM_NOEXCEPT
{ {
tvec3<T, P> tmp(x * y); tvec3<T, P> tmp(x * y);
return tmp.x + tmp.y + tmp.z; return tmp.x + tmp.y + tmp.z;
@ -74,7 +74,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_dot<tvec4, T, P> struct compute_dot<tvec4, T, P>
{ {
GLM_FUNC_QUALIFIER static T call(tvec4<T, P> const & x, tvec4<T, P> const & y) GLM_FUNC_QUALIFIER static T call(tvec4<T, P> const & x, tvec4<T, P> const & y) GLM_NOEXCEPT
{ {
tvec4<T, P> tmp(x * y); tvec4<T, P> tmp(x * y);
return (tmp.x + tmp.y) + (tmp.z + tmp.w); return (tmp.x + tmp.y) + (tmp.z + tmp.w);
@ -84,7 +84,7 @@ namespace detail
// length // length
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType length(genType x) GLM_FUNC_QUALIFIER genType length(genType x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' only accept floating-point inputs");
@ -92,7 +92,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T length(vecType<T, P> const & v) GLM_FUNC_QUALIFIER T length(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' only accept floating-point inputs");
@ -101,7 +101,7 @@ namespace detail
// distance // distance
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType distance(genType const & p0, genType const & p1) GLM_FUNC_QUALIFIER genType distance(genType const & p0, genType const & p1) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' only accept floating-point inputs");
@ -109,21 +109,21 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T distance(vecType<T, P> const & p0, vecType<T, P> const & p1) GLM_FUNC_QUALIFIER T distance(vecType<T, P> const & p0, vecType<T, P> const & p1) GLM_NOEXCEPT
{ {
return length(p1 - p0); return length(p1 - p0);
} }
// dot // dot
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER T dot(T x, T y) GLM_FUNC_QUALIFIER T dot(T x, T y) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs");
return x * y; return x * y;
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER T dot(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER T dot(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' only accept floating-point inputs");
return detail::compute_dot<vecType, T, P>::call(x, y); return detail::compute_dot<vecType, T, P>::call(x, y);
@ -131,7 +131,7 @@ namespace detail
// cross // cross
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> cross(tvec3<T, P> const & x, tvec3<T, P> const & y) GLM_FUNC_QUALIFIER tvec3<T, P> cross(tvec3<T, P> const & x, tvec3<T, P> const & y) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' only accept floating-point inputs");
@ -143,7 +143,7 @@ namespace detail
// normalize // normalize
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType normalize(genType const & x) GLM_FUNC_QUALIFIER genType normalize(genType const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' only accept floating-point inputs");
@ -151,7 +151,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> normalize(vecType<T, P> const & x) GLM_FUNC_QUALIFIER vecType<T, P> normalize(vecType<T, P> const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' only accept floating-point inputs");
@ -160,27 +160,27 @@ namespace detail
// faceforward // faceforward
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType faceforward(genType const & N, genType const & I, genType const & Nref) GLM_FUNC_QUALIFIER genType faceforward(genType const & N, genType const & I, genType const & Nref) GLM_NOEXCEPT
{ {
return dot(Nref, I) < static_cast<genType>(0) ? N : -N; return dot(Nref, I) < static_cast<genType>(0) ? N : -N;
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> faceforward(vecType<T, P> const & N, vecType<T, P> const & I, vecType<T, P> const & Nref) GLM_FUNC_QUALIFIER vecType<T, P> faceforward(vecType<T, P> const & N, vecType<T, P> const & I, vecType<T, P> const & Nref) GLM_NOEXCEPT
{ {
return dot(Nref, I) < static_cast<T>(0) ? N : -N; return dot(Nref, I) < static_cast<T>(0) ? N : -N;
} }
// reflect // reflect
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType reflect(genType const & I, genType const & N) GLM_FUNC_QUALIFIER genType reflect(genType const & I, genType const & N) GLM_NOEXCEPT
{ {
return I - N * dot(N, I) * static_cast<genType>(2); return I - N * dot(N, I) * static_cast<genType>(2);
} }
// refract // refract
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType const & eta) GLM_FUNC_QUALIFIER genType refract(genType const & I, genType const & N, genType const & eta) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' only accept floating-point inputs");
@ -190,7 +190,7 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> refract(vecType<T, P> const & I, vecType<T, P> const & N, T eta) GLM_FUNC_QUALIFIER vecType<T, P> refract(vecType<T, P> const & I, vecType<T, P> const & N, T eta) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' only accept floating-point inputs");

View File

@ -130,7 +130,7 @@ namespace detail
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename T, precision P, template <typename, precision> class matType> template <typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y); GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y) GLM_NOEXCEPT;
/// Treats the first parameter c as a column vector /// Treats the first parameter c as a column vector
/// and the second parameter r as a row vector /// and the second parameter r as a row vector
@ -141,7 +141,7 @@ namespace detail
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB> template <typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB>
GLM_FUNC_DECL typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r); GLM_FUNC_DECL typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r) GLM_NOEXCEPT;
/// Returns the transposed matrix of x /// Returns the transposed matrix of x
/// ///
@ -151,7 +151,7 @@ namespace detail
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
# if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012)) # if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))
template <typename T, precision P, template <typename, precision> class matType> template <typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x); GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x) GLM_NOEXCEPT;
# endif # endif
/// Return the determinant of a squared matrix. /// Return the determinant of a squared matrix.
@ -161,7 +161,7 @@ namespace detail
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename T, precision P, template <typename, precision> class matType> template <typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_DECL T determinant(matType<T, P> const & m); GLM_FUNC_DECL T determinant(matType<T, P> const & m) GLM_NOEXCEPT;
/// Return the inverse of a squared matrix. /// Return the inverse of a squared matrix.
/// ///
@ -170,7 +170,7 @@ namespace detail
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6 Matrix Functions</a>
template <typename T, precision P, template <typename, precision> class matType> template <typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m); GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -42,7 +42,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_transpose<tmat2x2, T, P> struct compute_transpose<tmat2x2, T, P>
{ {
GLM_FUNC_QUALIFIER static tmat2x2<T, P> call(tmat2x2<T, P> const & m) GLM_FUNC_QUALIFIER static tmat2x2<T, P> call(tmat2x2<T, P> const & m) GLM_NOEXCEPT
{ {
tmat2x2<T, P> result(uninitialize); tmat2x2<T, P> result(uninitialize);
result[0][0] = m[0][0]; result[0][0] = m[0][0];
@ -56,7 +56,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_transpose<tmat2x3, T, P> struct compute_transpose<tmat2x3, T, P>
{ {
GLM_FUNC_QUALIFIER static tmat3x2<T, P> call(tmat2x3<T, P> const & m) GLM_FUNC_QUALIFIER static tmat3x2<T, P> call(tmat2x3<T, P> const & m) GLM_NOEXCEPT
{ {
tmat3x2<T, P> result(uninitialize); tmat3x2<T, P> result(uninitialize);
result[0][0] = m[0][0]; result[0][0] = m[0][0];
@ -72,7 +72,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_transpose<tmat2x4, T, P> struct compute_transpose<tmat2x4, T, P>
{ {
GLM_FUNC_QUALIFIER static tmat4x2<T, P> call(tmat2x4<T, P> const & m) GLM_FUNC_QUALIFIER static tmat4x2<T, P> call(tmat2x4<T, P> const & m) GLM_NOEXCEPT
{ {
tmat4x2<T, P> result(uninitialize); tmat4x2<T, P> result(uninitialize);
result[0][0] = m[0][0]; result[0][0] = m[0][0];
@ -90,7 +90,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_transpose<tmat3x2, T, P> struct compute_transpose<tmat3x2, T, P>
{ {
GLM_FUNC_QUALIFIER static tmat2x3<T, P> call(tmat3x2<T, P> const & m) GLM_FUNC_QUALIFIER static tmat2x3<T, P> call(tmat3x2<T, P> const & m) GLM_NOEXCEPT
{ {
tmat2x3<T, P> result(uninitialize); tmat2x3<T, P> result(uninitialize);
result[0][0] = m[0][0]; result[0][0] = m[0][0];
@ -106,7 +106,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_transpose<tmat3x3, T, P> struct compute_transpose<tmat3x3, T, P>
{ {
GLM_FUNC_QUALIFIER static tmat3x3<T, P> call(tmat3x3<T, P> const & m) GLM_FUNC_QUALIFIER static tmat3x3<T, P> call(tmat3x3<T, P> const & m) GLM_NOEXCEPT
{ {
tmat3x3<T, P> result(uninitialize); tmat3x3<T, P> result(uninitialize);
result[0][0] = m[0][0]; result[0][0] = m[0][0];
@ -127,7 +127,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_transpose<tmat3x4, T, P> struct compute_transpose<tmat3x4, T, P>
{ {
GLM_FUNC_QUALIFIER static tmat4x3<T, P> call(tmat3x4<T, P> const & m) GLM_FUNC_QUALIFIER static tmat4x3<T, P> call(tmat3x4<T, P> const & m) GLM_NOEXCEPT
{ {
tmat4x3<T, P> result(uninitialize); tmat4x3<T, P> result(uninitialize);
result[0][0] = m[0][0]; result[0][0] = m[0][0];
@ -149,7 +149,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_transpose<tmat4x2, T, P> struct compute_transpose<tmat4x2, T, P>
{ {
GLM_FUNC_QUALIFIER static tmat2x4<T, P> call(tmat4x2<T, P> const & m) GLM_FUNC_QUALIFIER static tmat2x4<T, P> call(tmat4x2<T, P> const & m) GLM_NOEXCEPT
{ {
tmat2x4<T, P> result(uninitialize); tmat2x4<T, P> result(uninitialize);
result[0][0] = m[0][0]; result[0][0] = m[0][0];
@ -167,7 +167,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_transpose<tmat4x3, T, P> struct compute_transpose<tmat4x3, T, P>
{ {
GLM_FUNC_QUALIFIER static tmat3x4<T, P> call(tmat4x3<T, P> const & m) GLM_FUNC_QUALIFIER static tmat3x4<T, P> call(tmat4x3<T, P> const & m) GLM_NOEXCEPT
{ {
tmat3x4<T, P> result(uninitialize); tmat3x4<T, P> result(uninitialize);
result[0][0] = m[0][0]; result[0][0] = m[0][0];
@ -189,7 +189,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_transpose<tmat4x4, T, P> struct compute_transpose<tmat4x4, T, P>
{ {
GLM_FUNC_QUALIFIER static tmat4x4<T, P> call(tmat4x4<T, P> const & m) GLM_FUNC_QUALIFIER static tmat4x4<T, P> call(tmat4x4<T, P> const & m) GLM_NOEXCEPT
{ {
tmat4x4<T, P> result(uninitialize); tmat4x4<T, P> result(uninitialize);
result[0][0] = m[0][0]; result[0][0] = m[0][0];
@ -221,7 +221,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_determinant<tmat2x2, T, P> struct compute_determinant<tmat2x2, T, P>
{ {
GLM_FUNC_QUALIFIER static T call(tmat2x2<T, P> const & m) GLM_FUNC_QUALIFIER static T call(tmat2x2<T, P> const & m) GLM_NOEXCEPT
{ {
return m[0][0] * m[1][1] - m[1][0] * m[0][1]; return m[0][0] * m[1][1] - m[1][0] * m[0][1];
} }
@ -230,7 +230,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_determinant<tmat3x3, T, P> struct compute_determinant<tmat3x3, T, P>
{ {
GLM_FUNC_QUALIFIER static T call(tmat3x3<T, P> const & m) GLM_FUNC_QUALIFIER static T call(tmat3x3<T, P> const & m) GLM_NOEXCEPT
{ {
return return
+ m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2])
@ -242,7 +242,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
struct compute_determinant<tmat4x4, T, P> struct compute_determinant<tmat4x4, T, P>
{ {
GLM_FUNC_QUALIFIER static T call(tmat4x4<T, P> const & m) GLM_FUNC_QUALIFIER static T call(tmat4x4<T, P> const & m) GLM_NOEXCEPT
{ {
T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3];
T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3];
@ -265,7 +265,7 @@ namespace detail
}//namespace detail }//namespace detail
template <typename T, precision P, template <typename, precision> class matType> template <typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_QUALIFIER matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y) GLM_FUNC_QUALIFIER matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'matrixCompMult' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'matrixCompMult' only accept floating-point inputs");
@ -276,7 +276,7 @@ namespace detail
} }
template<typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB> template<typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB>
GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r) GLM_FUNC_QUALIFIER typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'outerProduct' only accept floating-point inputs");
@ -287,21 +287,21 @@ namespace detail
} }
template <typename T, precision P, template <typename, precision> class matType> template <typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_QUALIFIER typename matType<T, P>::transpose_type transpose(matType<T, P> const & m) GLM_FUNC_QUALIFIER typename matType<T, P>::transpose_type transpose(matType<T, P> const & m) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'transpose' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'transpose' only accept floating-point inputs");
return detail::compute_transpose<matType, T, P>::call(m); return detail::compute_transpose<matType, T, P>::call(m);
} }
template <typename T, precision P, template <typename, precision> class matType> template <typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_QUALIFIER T determinant(matType<T, P> const & m) GLM_FUNC_QUALIFIER T determinant(matType<T, P> const & m) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'determinant' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'determinant' only accept floating-point inputs");
return detail::compute_determinant<matType, T, P>::call(m); return detail::compute_determinant<matType, T, P>::call(m);
} }
template <typename T, precision P, template <typename, precision> class matType> template <typename T, precision P, template <typename, precision> class matType>
GLM_FUNC_QUALIFIER matType<T, P> inverse(matType<T, P> const & m) GLM_FUNC_QUALIFIER matType<T, P> inverse(matType<T, P> const & m) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inverse' only accept floating-point inputs"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'inverse' only accept floating-point inputs");
return detail::compute_inverse(m); return detail::compute_inverse(m);

View File

@ -58,7 +58,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL typename genType::value_type noise1(genType const & x); GLM_FUNC_DECL typename genType::value_type noise1(genType const & x) GLM_NOEXCEPT;
/// Returns a 2D noise value based on the input value x. /// Returns a 2D noise value based on the input value x.
/// ///
@ -67,7 +67,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL tvec2<typename genType::value_type, defaultp> noise2(genType const & x); GLM_FUNC_DECL tvec2<typename genType::value_type, defaultp> noise2(genType const & x) GLM_NOEXCEPT;
/// Returns a 3D noise value based on the input value x. /// Returns a 3D noise value based on the input value x.
/// ///
@ -76,7 +76,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL tvec3<typename genType::value_type, defaultp> noise3(genType const & x); GLM_FUNC_DECL tvec3<typename genType::value_type, defaultp> noise3(genType const & x) GLM_NOEXCEPT;
/// Returns a 4D noise value based on the input value x. /// Returns a 4D noise value based on the input value x.
/// ///
@ -85,7 +85,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13 Noise Functions</a>
template <typename genType> template <typename genType>
GLM_FUNC_DECL tvec4<typename genType::value_type, defaultp> noise4(genType const & x); GLM_FUNC_DECL tvec4<typename genType::value_type, defaultp> noise4(genType const & x) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -37,7 +37,7 @@ namespace glm{
namespace detail namespace detail
{ {
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> grad4(T const & j, tvec4<T, P> const & ip) GLM_FUNC_QUALIFIER tvec4<T, P> grad4(T const & j, tvec4<T, P> const & ip) GLM_NOEXCEPT
{ {
tvec3<T, P> pXYZ = floor(fract(tvec3<T, P>(j) * tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1); tvec3<T, P> pXYZ = floor(fract(tvec3<T, P>(j) * tvec3<T, P>(ip)) * T(7)) * ip[2] - T(1);
T pW = static_cast<T>(1.5) - dot(abs(pXYZ), tvec3<T, P>(1)); T pW = static_cast<T>(1.5) - dot(abs(pXYZ), tvec3<T, P>(1));
@ -48,13 +48,13 @@ namespace detail
}//namespace detail }//namespace detail
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER T noise1(T const & x) GLM_FUNC_QUALIFIER T noise1(T const & x) GLM_NOEXCEPT
{ {
return noise1(tvec2<T, defaultp>(x, T(0))); return noise1(tvec2<T, defaultp>(x, T(0)));
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec2<T, defaultp> noise2(T const & x) GLM_FUNC_QUALIFIER tvec2<T, defaultp> noise2(T const & x) GLM_NOEXCEPT
{ {
return tvec2<T, defaultp>( return tvec2<T, defaultp>(
noise1(x + T(0.0)), noise1(x + T(0.0)),
@ -62,7 +62,7 @@ namespace detail
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec3<T, defaultp> noise3(T const & x) GLM_FUNC_QUALIFIER tvec3<T, defaultp> noise3(T const & x) GLM_NOEXCEPT
{ {
return tvec3<T, defaultp>( return tvec3<T, defaultp>(
noise1(x - T(1.0)), noise1(x - T(1.0)),
@ -71,7 +71,7 @@ namespace detail
} }
template <typename T> template <typename T>
GLM_FUNC_QUALIFIER tvec4<T, defaultp> noise4(T const & x) GLM_FUNC_QUALIFIER tvec4<T, defaultp> noise4(T const & x) GLM_NOEXCEPT
{ {
return tvec4<T, defaultp>( return tvec4<T, defaultp>(
noise1(x - T(1.0)), noise1(x - T(1.0)),
@ -81,7 +81,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T noise1(tvec2<T, P> const & v) GLM_FUNC_QUALIFIER T noise1(tvec2<T, P> const & v) GLM_NOEXCEPT
{ {
tvec4<T, P> const C = tvec4<T, P>( tvec4<T, P> const C = tvec4<T, P>(
T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0 T( 0.211324865405187), // (3.0 - sqrt(3.0)) / 6.0
@ -139,7 +139,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T noise1(tvec3<T, P> const & v) GLM_FUNC_QUALIFIER T noise1(tvec3<T, P> const & v) GLM_NOEXCEPT
{ {
tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0); tvec2<T, P> const C(1.0 / 6.0, 1.0 / 3.0);
tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0); tvec4<T, P> const D(0.0, 0.5, 1.0, 2.0);
@ -214,7 +214,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER T noise1(tvec4<T, P> const & v) GLM_FUNC_QUALIFIER T noise1(tvec4<T, P> const & v) GLM_NOEXCEPT
{ {
tvec4<T, P> const C( tvec4<T, P> const C(
0.138196601125011, // (5 - sqrt(5))/20 G4 0.138196601125011, // (5 - sqrt(5))/20 G4
@ -304,7 +304,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec2<T, P> const & x) GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec2<T, P> const & x) GLM_NOEXCEPT
{ {
return tvec2<T, P>( return tvec2<T, P>(
noise1(x + tvec2<T, P>(0.0)), noise1(x + tvec2<T, P>(0.0)),
@ -312,7 +312,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec3<T, P> const & x) GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec3<T, P> const & x) GLM_NOEXCEPT
{ {
return tvec2<T, P>( return tvec2<T, P>(
noise1(x + tvec3<T, P>(0.0)), noise1(x + tvec3<T, P>(0.0)),
@ -320,7 +320,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec4<T, P> const & x) GLM_FUNC_QUALIFIER tvec2<T, P> noise2(tvec4<T, P> const & x) GLM_NOEXCEPT
{ {
return tvec2<T, P>( return tvec2<T, P>(
noise1(x + tvec4<T, P>(0)), noise1(x + tvec4<T, P>(0)),
@ -328,7 +328,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec2<T, P> const & x) GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec2<T, P> const & x) GLM_NOEXCEPT
{ {
return tvec3<T, P>( return tvec3<T, P>(
noise1(x - tvec2<T, P>(1.0)), noise1(x - tvec2<T, P>(1.0)),
@ -337,7 +337,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec3<T, P> const & x) GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec3<T, P> const & x) GLM_NOEXCEPT
{ {
return tvec3<T, P>( return tvec3<T, P>(
noise1(x - tvec3<T, P>(1.0)), noise1(x - tvec3<T, P>(1.0)),
@ -346,7 +346,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec4<T, P> const & x) GLM_FUNC_QUALIFIER tvec3<T, P> noise3(tvec4<T, P> const & x) GLM_NOEXCEPT
{ {
return tvec3<T, P>( return tvec3<T, P>(
noise1(x - tvec4<T, P>(1)), noise1(x - tvec4<T, P>(1)),
@ -355,7 +355,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec2<T, P> const & x) GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec2<T, P> const & x) GLM_NOEXCEPT
{ {
return tvec4<T, P>( return tvec4<T, P>(
noise1(x - tvec2<T, P>(1)), noise1(x - tvec2<T, P>(1)),
@ -366,7 +366,7 @@ namespace detail
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec3<T, P> const & x) GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec3<T, P> const & x) GLM_NOEXCEPT
{ {
return tvec4<T, P>( return tvec4<T, P>(
noise1(x - tvec3<T, P>(1)), noise1(x - tvec3<T, P>(1)),
@ -376,7 +376,7 @@ namespace detail
} }
template <typename T, precision P> template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec4<T, P> const & x) GLM_FUNC_QUALIFIER tvec4<T, P> noise4(tvec4<T, P> const & x) GLM_NOEXCEPT
{ {
return tvec4<T, P>( return tvec4<T, P>(
noise1(x - tvec4<T, P>(1)), noise1(x - tvec4<T, P>(1)),

View File

@ -59,7 +59,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm2x16.xml">GLSL packUnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint packUnorm2x16(vec2 const & v); GLM_FUNC_DECL uint packUnorm2x16(vec2 const & v) GLM_NOEXCEPT;
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
/// Then, the results are packed into the returned 32-bit unsigned integer. /// Then, the results are packed into the returned 32-bit unsigned integer.
@ -72,7 +72,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm2x16.xml">GLSL packSnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint packSnorm2x16(vec2 const & v); GLM_FUNC_DECL uint packSnorm2x16(vec2 const & v) GLM_NOEXCEPT;
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
/// Then, the results are packed into the returned 32-bit unsigned integer. /// Then, the results are packed into the returned 32-bit unsigned integer.
@ -85,7 +85,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packUnorm4x8.xml">GLSL packUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint packUnorm4x8(vec4 const & v); GLM_FUNC_DECL uint packUnorm4x8(vec4 const & v) GLM_NOEXCEPT;
/// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. /// First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values.
/// Then, the results are packed into the returned 32-bit unsigned integer. /// Then, the results are packed into the returned 32-bit unsigned integer.
@ -98,7 +98,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packSnorm4x8.xml">GLSL packSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint packSnorm4x8(vec4 const & v); GLM_FUNC_DECL uint packSnorm4x8(vec4 const & v) GLM_NOEXCEPT;
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -111,7 +111,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm2x16.xml">GLSL unpackUnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec2 unpackUnorm2x16(uint p); GLM_FUNC_DECL vec2 unpackUnorm2x16(uint p) GLM_NOEXCEPT;
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -124,7 +124,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm2x16.xml">GLSL unpackSnorm2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec2 unpackSnorm2x16(uint p); GLM_FUNC_DECL vec2 unpackSnorm2x16(uint p) GLM_NOEXCEPT;
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -137,7 +137,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackUnorm4x8.xml">GLSL unpackUnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec4 unpackUnorm4x8(uint p); GLM_FUNC_DECL vec4 unpackUnorm4x8(uint p) GLM_NOEXCEPT;
/// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers.
/// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector.
@ -150,7 +150,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackSnorm4x8.xml">GLSL unpackSnorm4x8 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec4 unpackSnorm4x8(uint p); GLM_FUNC_DECL vec4 unpackSnorm4x8(uint p) GLM_NOEXCEPT;
/// Returns a double-precision value obtained by packing the components of v into a 64-bit value. /// Returns a double-precision value obtained by packing the components of v into a 64-bit value.
/// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. /// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified.
@ -160,7 +160,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packDouble2x32.xml">GLSL packDouble2x32 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL double packDouble2x32(uvec2 const & v); GLM_FUNC_DECL double packDouble2x32(uvec2 const & v) GLM_NOEXCEPT;
/// Returns a two-component unsigned integer vector representation of v. /// Returns a two-component unsigned integer vector representation of v.
/// The bit-level representation of v is preserved. /// The bit-level representation of v is preserved.
@ -169,7 +169,7 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackDouble2x32.xml">GLSL unpackDouble2x32 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uvec2 unpackDouble2x32(double v); GLM_FUNC_DECL uvec2 unpackDouble2x32(double v) GLM_NOEXCEPT;
/// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector /// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector
/// to the 16-bit floating-point representation found in the OpenGL Specification, /// to the 16-bit floating-point representation found in the OpenGL Specification,
@ -179,18 +179,18 @@ namespace glm
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/packHalf2x16.xml">GLSL packHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL uint packHalf2x16(vec2 const & v);
/// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, /// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values,
/// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification,
GLM_FUNC_DECL uint packHalf2x16(vec2 const & v) GLM_NOEXCEPT;
/// and converting them to 32-bit floating-point values. /// and converting them to 32-bit floating-point values.
/// The first component of the vector is obtained from the 16 least-significant bits of v; /// The first component of the vector is obtained from the 16 least-significant bits of v;
/// the second component is obtained from the 16 most-significant bits of v. /// the second component is obtained from the 16 most-significant bits of v.
/// ///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/unpackHalf2x16.xml">GLSL unpackHalf2x16 man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions</a>
GLM_FUNC_DECL vec2 unpackHalf2x16(uint v);
GLM_FUNC_DECL vec2 unpackHalf2x16(uint v) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -36,7 +36,7 @@
namespace glm namespace glm
{ {
GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v) GLM_FUNC_QUALIFIER uint packUnorm2x16(vec2 const & v) GLM_NOEXCEPT
{ {
union union
{ {
@ -52,7 +52,7 @@ namespace glm
return u.out; return u.out;
} }
GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint p) GLM_FUNC_QUALIFIER vec2 unpackUnorm2x16(uint p) GLM_NOEXCEPT
{ {
union union
{ {
@ -65,7 +65,7 @@ namespace glm
return vec2(u.out[0], u.out[1]) * 1.5259021896696421759365224689097e-5f; return vec2(u.out[0], u.out[1]) * 1.5259021896696421759365224689097e-5f;
} }
GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v) GLM_FUNC_QUALIFIER uint packSnorm2x16(vec2 const & v) GLM_NOEXCEPT
{ {
union union
{ {
@ -81,7 +81,7 @@ namespace glm
return u.out; return u.out;
} }
GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint p) GLM_FUNC_QUALIFIER vec2 unpackSnorm2x16(uint p) GLM_NOEXCEPT
{ {
union union
{ {
@ -94,7 +94,7 @@ namespace glm
return clamp(vec2(u.out[0], u.out[1]) * 3.0518509475997192297128208258309e-5f, -1.0f, 1.0f); return clamp(vec2(u.out[0], u.out[1]) * 3.0518509475997192297128208258309e-5f, -1.0f, 1.0f);
} }
GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v) GLM_FUNC_QUALIFIER uint packUnorm4x8(vec4 const & v) GLM_NOEXCEPT
{ {
union union
{ {
@ -112,7 +112,7 @@ namespace glm
return u.out; return u.out;
} }
GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint p) GLM_FUNC_QUALIFIER vec4 unpackUnorm4x8(uint p) GLM_NOEXCEPT
{ {
union union
{ {
@ -125,7 +125,7 @@ namespace glm
return vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0039215686274509803921568627451f; return vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0039215686274509803921568627451f;
} }
GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const & v) GLM_FUNC_QUALIFIER uint packSnorm4x8(vec4 const & v) GLM_NOEXCEPT
{ {
union union
{ {
@ -143,7 +143,7 @@ namespace glm
return u.out; return u.out;
} }
GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint p) GLM_FUNC_QUALIFIER glm::vec4 unpackSnorm4x8(uint p) GLM_NOEXCEPT
{ {
union union
{ {
@ -156,7 +156,7 @@ namespace glm
return clamp(vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0078740157480315f, -1.0f, 1.0f); return clamp(vec4(u.out[0], u.out[1], u.out[2], u.out[3]) * 0.0078740157480315f, -1.0f, 1.0f);
} }
GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const & v) GLM_FUNC_QUALIFIER double packDouble2x32(uvec2 const & v) GLM_NOEXCEPT
{ {
union union
{ {
@ -170,7 +170,7 @@ namespace glm
return u.out; return u.out;
} }
GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double v) GLM_FUNC_QUALIFIER uvec2 unpackDouble2x32(double v) GLM_NOEXCEPT
{ {
union union
{ {
@ -183,7 +183,7 @@ namespace glm
return uvec2(u.out[0], u.out[1]); return uvec2(u.out[0], u.out[1]);
} }
GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const & v) GLM_FUNC_QUALIFIER uint packHalf2x16(vec2 const & v) GLM_NOEXCEPT
{ {
union union
{ {
@ -197,7 +197,7 @@ namespace glm
return u.out; return u.out;
} }
GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint v) GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint v) GLM_NOEXCEPT
{ {
union union
{ {

View File

@ -58,7 +58,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/radians.xml">GLSL radians man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL GLM_CONSTEXPR vecType<T, P> radians(vecType<T, P> const & degrees); GLM_FUNC_DECL GLM_CONSTEXPR vecType<T, P> radians(vecType<T, P> const & degrees) GLM_NOEXCEPT;
/// Converts radians to degrees and returns the result. /// Converts radians to degrees and returns the result.
/// ///
@ -67,7 +67,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/degrees.xml">GLSL degrees man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL GLM_CONSTEXPR vecType<T, P> degrees(vecType<T, P> const & radians); GLM_FUNC_DECL GLM_CONSTEXPR vecType<T, P> degrees(vecType<T, P> const & radians) GLM_NOEXCEPT;
/// The standard trigonometric sine function. /// The standard trigonometric sine function.
/// The values returned by this function will range from [-1, 1]. /// The values returned by this function will range from [-1, 1].
@ -77,7 +77,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sin.xml">GLSL sin man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sin(vecType<T, P> const & angle); GLM_FUNC_DECL vecType<T, P> sin(vecType<T, P> const & angle) GLM_NOEXCEPT;
/// The standard trigonometric cosine function. /// The standard trigonometric cosine function.
/// The values returned by this function will range from [-1, 1]. /// The values returned by this function will range from [-1, 1].
@ -87,7 +87,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cos.xml">GLSL cos man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> cos(vecType<T, P> const & angle); GLM_FUNC_DECL vecType<T, P> cos(vecType<T, P> const & angle) GLM_NOEXCEPT;
/// The standard trigonometric tangent function. /// The standard trigonometric tangent function.
/// ///
@ -96,7 +96,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tan.xml">GLSL tan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> tan(vecType<T, P> const & angle); GLM_FUNC_DECL vecType<T, P> tan(vecType<T, P> const & angle) GLM_NOEXCEPT;
/// Arc sine. Returns an angle whose sine is x. /// Arc sine. Returns an angle whose sine is x.
/// The range of values returned by this function is [-PI/2, PI/2]. /// The range of values returned by this function is [-PI/2, PI/2].
@ -107,7 +107,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asin.xml">GLSL asin man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> asin(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> asin(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Arc cosine. Returns an angle whose sine is x. /// Arc cosine. Returns an angle whose sine is x.
/// The range of values returned by this function is [0, PI]. /// The range of values returned by this function is [0, PI].
@ -118,7 +118,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acos.xml">GLSL acos man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> acos(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> acos(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Arc tangent. Returns an angle whose tangent is y/x. /// Arc tangent. Returns an angle whose tangent is y/x.
/// The signs of x and y are used to determine what /// The signs of x and y are used to determine what
@ -131,7 +131,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> atan(vecType<T, P> const & y, vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> atan(vecType<T, P> const & y, vecType<T, P> const & x) GLM_NOEXCEPT;
/// Arc tangent. Returns an angle whose tangent is y_over_x. /// Arc tangent. Returns an angle whose tangent is y_over_x.
/// The range of values returned by this function is [-PI/2, PI/2]. /// The range of values returned by this function is [-PI/2, PI/2].
@ -141,7 +141,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atan.xml">GLSL atan man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> atan(vecType<T, P> const & y_over_x); GLM_FUNC_DECL vecType<T, P> atan(vecType<T, P> const & y_over_x) GLM_NOEXCEPT;
/// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2
/// ///
@ -150,7 +150,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sinh.xml">GLSL sinh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> sinh(vecType<T, P> const & angle); GLM_FUNC_DECL vecType<T, P> sinh(vecType<T, P> const & angle) GLM_NOEXCEPT;
/// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2
/// ///
@ -159,7 +159,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cosh.xml">GLSL cosh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> cosh(vecType<T, P> const & angle); GLM_FUNC_DECL vecType<T, P> cosh(vecType<T, P> const & angle) GLM_NOEXCEPT;
/// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)
/// ///
@ -168,7 +168,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/tanh.xml">GLSL tanh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> tanh(vecType<T, P> const & angle); GLM_FUNC_DECL vecType<T, P> tanh(vecType<T, P> const & angle) GLM_NOEXCEPT;
/// Arc hyperbolic sine; returns the inverse of sinh. /// Arc hyperbolic sine; returns the inverse of sinh.
/// ///
@ -177,8 +177,8 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/asinh.xml">GLSL asinh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> asinh(vecType<T, P> const & x);
GLM_FUNC_DECL vecType<T, P> asinh(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Arc hyperbolic cosine; returns the non-negative inverse /// Arc hyperbolic cosine; returns the non-negative inverse
/// of cosh. Results are undefined if x < 1. /// of cosh. Results are undefined if x < 1.
/// ///
@ -187,7 +187,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/acosh.xml">GLSL acosh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> acosh(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> acosh(vecType<T, P> const & x) GLM_NOEXCEPT;
/// Arc hyperbolic tangent; returns the inverse of tanh. /// Arc hyperbolic tangent; returns the inverse of tanh.
/// Results are undefined if abs(x) >= 1. /// Results are undefined if abs(x) >= 1.
@ -197,7 +197,7 @@ namespace glm
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/atanh.xml">GLSL atanh man page</a>
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a> /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions</a>
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_DECL vecType<T, P> atanh(vecType<T, P> const & x); GLM_FUNC_DECL vecType<T, P> atanh(vecType<T, P> const & x) GLM_NOEXCEPT;
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -38,7 +38,7 @@ namespace glm
{ {
// radians // radians
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees) GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'radians' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'radians' only accept floating-point input");
@ -46,14 +46,14 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<T, P> radians(vecType<T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<T, P> radians(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(radians, v); return detail::functor1<T, T, P, vecType>::call(radians, v);
} }
// degrees // degrees
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians) GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'degrees' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'degrees' only accept floating-point input");
@ -61,7 +61,7 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<T, P> degrees(vecType<T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<T, P> degrees(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(degrees, v); return detail::functor1<T, T, P, vecType>::call(degrees, v);
} }
@ -70,7 +70,7 @@ namespace glm
using ::std::sin; using ::std::sin;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sin(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> sin(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(sin, v); return detail::functor1<T, T, P, vecType>::call(sin, v);
} }
@ -79,7 +79,7 @@ namespace glm
using std::cos; using std::cos;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> cos(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> cos(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(cos, v); return detail::functor1<T, T, P, vecType>::call(cos, v);
} }
@ -88,7 +88,7 @@ namespace glm
using std::tan; using std::tan;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> tan(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> tan(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(tan, v); return detail::functor1<T, T, P, vecType>::call(tan, v);
} }
@ -97,7 +97,7 @@ namespace glm
using std::asin; using std::asin;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> asin(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> asin(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(asin, v); return detail::functor1<T, T, P, vecType>::call(asin, v);
} }
@ -106,14 +106,14 @@ namespace glm
using std::acos; using std::acos;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> acos(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> acos(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(acos, v); return detail::functor1<T, T, P, vecType>::call(acos, v);
} }
// atan // atan
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType atan(genType const & y, genType const & x) GLM_FUNC_QUALIFIER genType atan(genType const & y, genType const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atan' only accept floating-point input");
@ -121,7 +121,7 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & a, vecType<T, P> const & b) GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & a, vecType<T, P> const & b) GLM_NOEXCEPT
{ {
return detail::functor2<T, P, vecType>::call(atan2, a, b); return detail::functor2<T, P, vecType>::call(atan2, a, b);
} }
@ -129,7 +129,7 @@ namespace glm
using std::atan; using std::atan;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> atan(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(atan, v); return detail::functor1<T, T, P, vecType>::call(atan, v);
} }
@ -138,7 +138,7 @@ namespace glm
using std::sinh; using std::sinh;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sinh(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> sinh(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(sinh, v); return detail::functor1<T, T, P, vecType>::call(sinh, v);
} }
@ -147,7 +147,7 @@ namespace glm
using std::cosh; using std::cosh;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> cosh(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> cosh(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(cosh, v); return detail::functor1<T, T, P, vecType>::call(cosh, v);
} }
@ -156,7 +156,7 @@ namespace glm
using std::tanh; using std::tanh;
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> tanh(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> tanh(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(tanh, v); return detail::functor1<T, T, P, vecType>::call(tanh, v);
} }
@ -166,7 +166,7 @@ namespace glm
using std::asinh; using std::asinh;
# else # else
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType asinh(genType const & x) GLM_FUNC_QUALIFIER genType asinh(genType const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asinh' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'asinh' only accept floating-point input");
@ -175,7 +175,7 @@ namespace glm
# endif # endif
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> asinh(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> asinh(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(asinh, v); return detail::functor1<T, T, P, vecType>::call(asinh, v);
} }
@ -185,7 +185,7 @@ namespace glm
using std::acosh; using std::acosh;
# else # else
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType acosh(genType const & x) GLM_FUNC_QUALIFIER genType acosh(genType const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acosh' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'acosh' only accept floating-point input");
@ -196,7 +196,7 @@ namespace glm
# endif # endif
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> acosh(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> acosh(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(acosh, v); return detail::functor1<T, T, P, vecType>::call(acosh, v);
} }
@ -206,10 +206,10 @@ namespace glm
using std::atanh; using std::atanh;
# else # else
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER genType atanh(genType const & x) GLM_FUNC_QUALIFIER genType atanh(genType const & x) GLM_NOEXCEPT
{ {
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atanh' only accept floating-point input"); GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'atanh' only accept floating-point input");
if(abs(x) >= static_cast<genType>(1)) if(abs(x) >= static_cast<genType>(1))
return 0; return 0;
return static_cast<genType>(0.5) * log((static_cast<genType>(1) + x) / (static_cast<genType>(1) - x)); return static_cast<genType>(0.5) * log((static_cast<genType>(1) + x) / (static_cast<genType>(1) - x));
@ -217,7 +217,7 @@ namespace glm
# endif # endif
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> atanh(vecType<T, P> const & v) GLM_FUNC_QUALIFIER vecType<T, P> atanh(vecType<T, P> const & v) GLM_NOEXCEPT
{ {
return detail::functor1<T, T, P, vecType>::call(atanh, v); return detail::functor1<T, T, P, vecType>::call(atanh, v);
} }

View File

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

View File

@ -35,7 +35,7 @@
namespace glm namespace glm
{ {
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> lessThan(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER vecType<bool, P> lessThan(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT
{ {
assert(detail::component_count(x) == detail::component_count(y)); assert(detail::component_count(x) == detail::component_count(y));
@ -47,7 +47,7 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER vecType<bool, P> lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT
{ {
assert(detail::component_count(x) == detail::component_count(y)); assert(detail::component_count(x) == detail::component_count(y));
@ -58,7 +58,7 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> greaterThan(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER vecType<bool, P> greaterThan(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT
{ {
assert(detail::component_count(x) == detail::component_count(y)); assert(detail::component_count(x) == detail::component_count(y));
@ -69,7 +69,7 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER vecType<bool, P> greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT
{ {
assert(detail::component_count(x) == detail::component_count(y)); assert(detail::component_count(x) == detail::component_count(y));
@ -80,7 +80,7 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> equal(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER vecType<bool, P> equal(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT
{ {
assert(detail::component_count(x) == detail::component_count(y)); assert(detail::component_count(x) == detail::component_count(y));
@ -91,7 +91,7 @@ namespace glm
} }
template <typename T, precision P, template <typename, precision> class vecType> template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> notEqual(vecType<T, P> const & x, vecType<T, P> const & y) GLM_FUNC_QUALIFIER vecType<bool, P> notEqual(vecType<T, P> const & x, vecType<T, P> const & y) GLM_NOEXCEPT
{ {
assert(detail::component_count(x) == detail::component_count(y)); assert(detail::component_count(x) == detail::component_count(y));
@ -102,7 +102,7 @@ namespace glm
} }
template <precision P, template <typename, precision> class vecType> template <precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER bool any(vecType<bool, P> const & v) GLM_FUNC_QUALIFIER bool any(vecType<bool, P> const & v) GLM_NOEXCEPT
{ {
bool Result = false; bool Result = false;
for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) for(detail::component_count_t i = 0; i < detail::component_count(v); ++i)
@ -111,7 +111,7 @@ namespace glm
} }
template <precision P, template <typename, precision> class vecType> template <precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER bool all(vecType<bool, P> const & v) GLM_FUNC_QUALIFIER bool all(vecType<bool, P> const & v) GLM_NOEXCEPT
{ {
bool Result = true; bool Result = true;
for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) for(detail::component_count_t i = 0; i < detail::component_count(v); ++i)
@ -120,7 +120,7 @@ namespace glm
} }
template <precision P, template <typename, precision> class vecType> template <precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<bool, P> not_(vecType<bool, P> const & v) GLM_FUNC_QUALIFIER vecType<bool, P> not_(vecType<bool, P> const & v) GLM_NOEXCEPT
{ {
vecType<bool, P> Result(uninitialize); vecType<bool, P> Result(uninitialize);
for(detail::component_count_t i = 0; i < detail::component_count(v); ++i) for(detail::component_count_t i = 0; i < detail::component_count(v); ++i)

View File

@ -37,47 +37,47 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
__m128 sse_abs_ps(__m128 x); __m128 sse_abs_ps(__m128 x) GLM_NOEXCEPT;
__m128 sse_sgn_ps(__m128 x); __m128 sse_sgn_ps(__m128 x) GLM_NOEXCEPT;
//floor //floor
__m128 sse_flr_ps(__m128 v); __m128 sse_flr_ps(__m128 v) GLM_NOEXCEPT;
//trunc //trunc
__m128 sse_trc_ps(__m128 v); __m128 sse_trc_ps(__m128 v) GLM_NOEXCEPT;
//round //round
__m128 sse_nd_ps(__m128 v); __m128 sse_nd_ps(__m128 v) GLM_NOEXCEPT;
//roundEven //roundEven
__m128 sse_rde_ps(__m128 v); __m128 sse_rde_ps(__m128 v) GLM_NOEXCEPT;
__m128 sse_rnd_ps(__m128 x); __m128 sse_rnd_ps(__m128 x) GLM_NOEXCEPT;
__m128 sse_ceil_ps(__m128 v); __m128 sse_ceil_ps(__m128 v) GLM_NOEXCEPT;
__m128 sse_frc_ps(__m128 x); __m128 sse_frc_ps(__m128 x) GLM_NOEXCEPT;
__m128 sse_mod_ps(__m128 x, __m128 y); __m128 sse_mod_ps(__m128 x, __m128 y) GLM_NOEXCEPT;
__m128 sse_modf_ps(__m128 x, __m128i & i); __m128 sse_modf_ps(__m128 x, __m128i & i) GLM_NOEXCEPT;
//GLM_FUNC_QUALIFIER __m128 sse_min_ps(__m128 x, __m128 y) //GLM_FUNC_QUALIFIER __m128 sse_min_ps(__m128 x, __m128 y) GLM_NOEXCEPT
//GLM_FUNC_QUALIFIER __m128 sse_max_ps(__m128 x, __m128 y) //GLM_FUNC_QUALIFIER __m128 sse_max_ps(__m128 x, __m128 y) GLM_NOEXCEPT
__m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal); __m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal) GLM_NOEXCEPT;
__m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a); __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a) GLM_NOEXCEPT;
__m128 sse_stp_ps(__m128 edge, __m128 x); __m128 sse_stp_ps(__m128 edge, __m128 x) GLM_NOEXCEPT;
__m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x); __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x) GLM_NOEXCEPT;
__m128 sse_nan_ps(__m128 x); __m128 sse_nan_ps(__m128 x) GLM_NOEXCEPT;
__m128 sse_inf_ps(__m128 x); __m128 sse_inf_ps(__m128 x) GLM_NOEXCEPT;
}//namespace detail }//namespace detail
}//namespace glm }//namespace glm

View File

@ -151,12 +151,12 @@ namespace detail{
static const __m128 GLM_VAR_USED _ps_log_c0 = _mm_set_ps1(0.693147180559945f); static const __m128 GLM_VAR_USED _ps_log_c0 = _mm_set_ps1(0.693147180559945f);
static const __m128 GLM_VAR_USED _ps_log2_c0 = _mm_set_ps1(1.44269504088896340735992f); static const __m128 GLM_VAR_USED _ps_log2_c0 = _mm_set_ps1(1.44269504088896340735992f);
GLM_FUNC_QUALIFIER __m128 sse_abs_ps(__m128 x) GLM_FUNC_QUALIFIER __m128 sse_abs_ps(__m128 x) GLM_NOEXCEPT
{ {
return _mm_and_ps(glm::detail::abs4Mask, x); return _mm_and_ps(glm::detail::abs4Mask, x);
} }
GLM_FUNC_QUALIFIER __m128 sse_sgn_ps(__m128 x) GLM_FUNC_QUALIFIER __m128 sse_sgn_ps(__m128 x) GLM_NOEXCEPT
{ {
__m128 Neg = _mm_set1_ps(-1.0f); __m128 Neg = _mm_set1_ps(-1.0f);
__m128 Pos = _mm_set1_ps(1.0f); __m128 Pos = _mm_set1_ps(1.0f);
@ -171,7 +171,7 @@ GLM_FUNC_QUALIFIER __m128 sse_sgn_ps(__m128 x)
} }
//floor //floor
GLM_FUNC_QUALIFIER __m128 sse_flr_ps(__m128 x) GLM_FUNC_QUALIFIER __m128 sse_flr_ps(__m128 x) GLM_NOEXCEPT
{ {
__m128 rnd0 = sse_rnd_ps(x); __m128 rnd0 = sse_rnd_ps(x);
__m128 cmp0 = _mm_cmplt_ps(x, rnd0); __m128 cmp0 = _mm_cmplt_ps(x, rnd0);
@ -182,13 +182,13 @@ GLM_FUNC_QUALIFIER __m128 sse_flr_ps(__m128 x)
//trunc //trunc
/* /*
GLM_FUNC_QUALIFIER __m128 _mm_trc_ps(__m128 v) GLM_FUNC_QUALIFIER __m128 _mm_trc_ps(__m128 v) GLM_NOEXCEPT
{ {
return __m128(); return __m128();
} }
*/ */
//round //round
GLM_FUNC_QUALIFIER __m128 sse_rnd_ps(__m128 x) GLM_FUNC_QUALIFIER __m128 sse_rnd_ps(__m128 x) GLM_NOEXCEPT
{ {
__m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x); __m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x);
__m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23); __m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23);
@ -198,7 +198,7 @@ GLM_FUNC_QUALIFIER __m128 sse_rnd_ps(__m128 x)
} }
//roundEven //roundEven
GLM_FUNC_QUALIFIER __m128 sse_rde_ps(__m128 x) GLM_FUNC_QUALIFIER __m128 sse_rde_ps(__m128 x) GLM_NOEXCEPT
{ {
__m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x); __m128 and0 = _mm_and_ps(glm::detail::_epi32_sign_mask, x);
__m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23); __m128 or0 = _mm_or_ps(and0, glm::detail::_ps_2pow23);
@ -207,7 +207,7 @@ GLM_FUNC_QUALIFIER __m128 sse_rde_ps(__m128 x)
return sub0; return sub0;
} }
GLM_FUNC_QUALIFIER __m128 sse_ceil_ps(__m128 x) GLM_FUNC_QUALIFIER __m128 sse_ceil_ps(__m128 x) GLM_NOEXCEPT
{ {
__m128 rnd0 = sse_rnd_ps(x); __m128 rnd0 = sse_rnd_ps(x);
__m128 cmp0 = _mm_cmpgt_ps(x, rnd0); __m128 cmp0 = _mm_cmpgt_ps(x, rnd0);
@ -216,14 +216,14 @@ GLM_FUNC_QUALIFIER __m128 sse_ceil_ps(__m128 x)
return add0; return add0;
} }
GLM_FUNC_QUALIFIER __m128 sse_frc_ps(__m128 x) GLM_FUNC_QUALIFIER __m128 sse_frc_ps(__m128 x) GLM_NOEXCEPT
{ {
__m128 flr0 = sse_flr_ps(x); __m128 flr0 = sse_flr_ps(x);
__m128 sub0 = _mm_sub_ps(x, flr0); __m128 sub0 = _mm_sub_ps(x, flr0);
return sub0; return sub0;
} }
GLM_FUNC_QUALIFIER __m128 sse_mod_ps(__m128 x, __m128 y) GLM_FUNC_QUALIFIER __m128 sse_mod_ps(__m128 x, __m128 y) GLM_NOEXCEPT
{ {
__m128 div0 = _mm_div_ps(x, y); __m128 div0 = _mm_div_ps(x, y);
__m128 flr0 = sse_flr_ps(div0); __m128 flr0 = sse_flr_ps(div0);
@ -234,25 +234,25 @@ GLM_FUNC_QUALIFIER __m128 sse_mod_ps(__m128 x, __m128 y)
/// TODO /// TODO
/* /*
GLM_FUNC_QUALIFIER __m128 sse_modf_ps(__m128 x, __m128i & i) GLM_FUNC_QUALIFIER __m128 sse_modf_ps(__m128 x, __m128i & i) GLM_NOEXCEPT
{ {
__m128 empty; __m128 empty;
return empty; return empty;
} }
*/ */
//GLM_FUNC_QUALIFIER __m128 _mm_min_ps(__m128 x, __m128 y) //GLM_FUNC_QUALIFIER __m128 _mm_min_ps(__m128 x, __m128 y) GLM_NOEXCEPT
//GLM_FUNC_QUALIFIER __m128 _mm_max_ps(__m128 x, __m128 y) //GLM_FUNC_QUALIFIER __m128 _mm_max_ps(__m128 x, __m128 y) GLM_NOEXCEPT
GLM_FUNC_QUALIFIER __m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal) GLM_FUNC_QUALIFIER __m128 sse_clp_ps(__m128 v, __m128 minVal, __m128 maxVal) GLM_NOEXCEPT
{ {
__m128 min0 = _mm_min_ps(v, maxVal); __m128 min0 = _mm_min_ps(v, maxVal);
__m128 max0 = _mm_max_ps(min0, minVal); __m128 max0 = _mm_max_ps(min0, minVal);
return max0; return max0;
} }
GLM_FUNC_QUALIFIER __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a) GLM_FUNC_QUALIFIER __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a) GLM_NOEXCEPT
{ {
__m128 sub0 = _mm_sub_ps(glm::detail::one, a); __m128 sub0 = _mm_sub_ps(glm::detail::one, a);
__m128 mul0 = _mm_mul_ps(v1, sub0); __m128 mul0 = _mm_mul_ps(v1, sub0);
@ -261,7 +261,7 @@ GLM_FUNC_QUALIFIER __m128 sse_mix_ps(__m128 v1, __m128 v2, __m128 a)
return add0; return add0;
} }
GLM_FUNC_QUALIFIER __m128 sse_stp_ps(__m128 edge, __m128 x) GLM_FUNC_QUALIFIER __m128 sse_stp_ps(__m128 edge, __m128 x) GLM_NOEXCEPT
{ {
__m128 cmp = _mm_cmple_ps(x, edge); __m128 cmp = _mm_cmple_ps(x, edge);
if(_mm_movemask_ps(cmp) == 0) if(_mm_movemask_ps(cmp) == 0)
@ -270,7 +270,7 @@ GLM_FUNC_QUALIFIER __m128 sse_stp_ps(__m128 edge, __m128 x)
return glm::detail::zero; return glm::detail::zero;
} }
GLM_FUNC_QUALIFIER __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x) GLM_FUNC_QUALIFIER __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x) GLM_NOEXCEPT
{ {
__m128 sub0 = _mm_sub_ps(x, edge0); __m128 sub0 = _mm_sub_ps(x, edge0);
__m128 sub1 = _mm_sub_ps(edge1, edge0); __m128 sub1 = _mm_sub_ps(edge1, edge0);
@ -284,14 +284,14 @@ GLM_FUNC_QUALIFIER __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x)
} }
/// \todo /// \todo
//GLM_FUNC_QUALIFIER __m128 sse_nan_ps(__m128 x) //GLM_FUNC_QUALIFIER __m128 sse_nan_ps(__m128 x) GLM_NOEXCEPT
//{ //{
// __m128 empty; // __m128 empty;
// return empty; // return empty;
//} //}
/// \todo /// \todo
//GLM_FUNC_QUALIFIER __m128 sse_inf_ps(__m128 x) //GLM_FUNC_QUALIFIER __m128 sse_inf_ps(__m128 x) GLM_NOEXCEPT
//{ //{
// __m128 empty; // __m128 empty;
// return empty; // return empty;
@ -299,7 +299,7 @@ GLM_FUNC_QUALIFIER __m128 sse_ssp_ps(__m128 edge0, __m128 edge1, __m128 x)
// SSE scalar reciprocal sqrt using rsqrt op, plus one Newton-Rhaphson iteration // SSE scalar reciprocal sqrt using rsqrt op, plus one Newton-Rhaphson iteration
// By Elan Ruskin, http://assemblyrequired.crashworks.org/ // By Elan Ruskin, http://assemblyrequired.crashworks.org/
GLM_FUNC_QUALIFIER __m128 sse_sqrt_wip_ss(__m128 const & x) GLM_FUNC_QUALIFIER __m128 sse_sqrt_wip_ss(__m128 const & x) GLM_NOEXCEPT
{ {
__m128 const recip = _mm_rsqrt_ss(x); // "estimate" opcode __m128 const recip = _mm_rsqrt_ss(x); // "estimate" opcode
__m128 const half = _mm_set_ps1(0.5f); __m128 const half = _mm_set_ps1(0.5f);

View File

@ -38,7 +38,7 @@ namespace glm{
namespace detail namespace detail
{ {
/* /*
GLM_FUNC_QUALIFIER __m128 sse_rsqrt_nr_ss(__m128 const x) GLM_FUNC_QUALIFIER __m128 sse_rsqrt_nr_ss(__m128 const x) GLM_NOEXCEPT
{ {
__m128 recip = _mm_rsqrt_ss( x ); // "estimate" opcode __m128 recip = _mm_rsqrt_ss( x ); // "estimate" opcode
const static __m128 three = { 3, 3, 3, 3 }; // aligned consts for fast load const static __m128 three = { 3, 3, 3, 3 }; // aligned consts for fast load
@ -48,7 +48,7 @@ GLM_FUNC_QUALIFIER __m128 sse_rsqrt_nr_ss(__m128 const x)
return _mm_mul_ss( halfrecip, threeminus_xrr ); return _mm_mul_ss( halfrecip, threeminus_xrr );
} }
GLM_FUNC_QUALIFIER __m128 sse_normalize_fast_ps( float * RESTRICT vOut, float * RESTRICT vIn ) GLM_FUNC_QUALIFIER __m128 sse_normalize_fast_ps( float * RESTRICT vOut, float * RESTRICT vIn ) GLM_NOEXCEPT
{ {
__m128 x = _mm_load_ss(&vIn[0]); __m128 x = _mm_load_ss(&vIn[0]);
__m128 y = _mm_load_ss(&vIn[1]); __m128 y = _mm_load_ss(&vIn[1]);

View File

@ -40,31 +40,31 @@ namespace glm{
namespace detail namespace detail
{ {
//length //length
__m128 sse_len_ps(__m128 x); __m128 sse_len_ps(__m128 x) GLM_NOEXCEPT;
//distance //distance
__m128 sse_dst_ps(__m128 p0, __m128 p1); __m128 sse_dst_ps(__m128 p0, __m128 p1) GLM_NOEXCEPT;
//dot //dot
__m128 sse_dot_ps(__m128 v1, __m128 v2); __m128 sse_dot_ps(__m128 v1, __m128 v2) GLM_NOEXCEPT;
// SSE1 // SSE1
__m128 sse_dot_ss(__m128 v1, __m128 v2); __m128 sse_dot_ss(__m128 v1, __m128 v2) GLM_NOEXCEPT;
//cross //cross
__m128 sse_xpd_ps(__m128 v1, __m128 v2); __m128 sse_xpd_ps(__m128 v1, __m128 v2) GLM_NOEXCEPT;
//normalize //normalize
__m128 sse_nrm_ps(__m128 v); __m128 sse_nrm_ps(__m128 v) GLM_NOEXCEPT;
//faceforward //faceforward
__m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref); __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref) GLM_NOEXCEPT;
//reflect //reflect
__m128 sse_rfe_ps(__m128 I, __m128 N); __m128 sse_rfe_ps(__m128 I, __m128 N) GLM_NOEXCEPT;
//refract //refract
__m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta); __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta) GLM_NOEXCEPT;
}//namespace detail }//namespace detail
}//namespace glm }//namespace glm

View File

@ -30,7 +30,7 @@ namespace glm{
namespace detail{ namespace detail{
//length //length
GLM_FUNC_QUALIFIER __m128 sse_len_ps(__m128 x) GLM_FUNC_QUALIFIER __m128 sse_len_ps(__m128 x) GLM_NOEXCEPT
{ {
__m128 dot0 = sse_dot_ps(x, x); __m128 dot0 = sse_dot_ps(x, x);
__m128 sqt0 = _mm_sqrt_ps(dot0); __m128 sqt0 = _mm_sqrt_ps(dot0);
@ -38,7 +38,7 @@ GLM_FUNC_QUALIFIER __m128 sse_len_ps(__m128 x)
} }
//distance //distance
GLM_FUNC_QUALIFIER __m128 sse_dst_ps(__m128 p0, __m128 p1) GLM_FUNC_QUALIFIER __m128 sse_dst_ps(__m128 p0, __m128 p1) GLM_NOEXCEPT
{ {
__m128 sub0 = _mm_sub_ps(p0, p1); __m128 sub0 = _mm_sub_ps(p0, p1);
__m128 len0 = sse_len_ps(sub0); __m128 len0 = sse_len_ps(sub0);
@ -46,7 +46,7 @@ GLM_FUNC_QUALIFIER __m128 sse_dst_ps(__m128 p0, __m128 p1)
} }
//dot //dot
GLM_FUNC_QUALIFIER __m128 sse_dot_ps(__m128 v1, __m128 v2) GLM_FUNC_QUALIFIER __m128 sse_dot_ps(__m128 v1, __m128 v2) GLM_NOEXCEPT
{ {
# if(GLM_ARCH & GLM_ARCH_AVX) # if(GLM_ARCH & GLM_ARCH_AVX)
@ -62,7 +62,7 @@ GLM_FUNC_QUALIFIER __m128 sse_dot_ps(__m128 v1, __m128 v2)
} }
// SSE1 // SSE1
GLM_FUNC_QUALIFIER __m128 sse_dot_ss(__m128 v1, __m128 v2) GLM_FUNC_QUALIFIER __m128 sse_dot_ss(__m128 v1, __m128 v2) GLM_NOEXCEPT
{ {
__m128 mul0 = _mm_mul_ps(v1, v2); __m128 mul0 = _mm_mul_ps(v1, v2);
__m128 mov0 = _mm_movehl_ps(mul0, mul0); __m128 mov0 = _mm_movehl_ps(mul0, mul0);
@ -73,7 +73,7 @@ GLM_FUNC_QUALIFIER __m128 sse_dot_ss(__m128 v1, __m128 v2)
} }
//cross //cross
GLM_FUNC_QUALIFIER __m128 sse_xpd_ps(__m128 v1, __m128 v2) GLM_FUNC_QUALIFIER __m128 sse_xpd_ps(__m128 v1, __m128 v2) GLM_NOEXCEPT
{ {
__m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1)); __m128 swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1));
__m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2)); __m128 swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2));
@ -86,7 +86,7 @@ GLM_FUNC_QUALIFIER __m128 sse_xpd_ps(__m128 v1, __m128 v2)
} }
//normalize //normalize
GLM_FUNC_QUALIFIER __m128 sse_nrm_ps(__m128 v) GLM_FUNC_QUALIFIER __m128 sse_nrm_ps(__m128 v) GLM_NOEXCEPT
{ {
__m128 dot0 = sse_dot_ps(v, v); __m128 dot0 = sse_dot_ps(v, v);
__m128 isr0 = _mm_rsqrt_ps(dot0); __m128 isr0 = _mm_rsqrt_ps(dot0);
@ -95,7 +95,7 @@ GLM_FUNC_QUALIFIER __m128 sse_nrm_ps(__m128 v)
} }
//faceforward //faceforward
GLM_FUNC_QUALIFIER __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref) GLM_FUNC_QUALIFIER __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref) GLM_NOEXCEPT
{ {
//__m128 dot0 = _mm_dot_ps(v, v); //__m128 dot0 = _mm_dot_ps(v, v);
//__m128 neg0 = _mm_neg_ps(N); //__m128 neg0 = _mm_neg_ps(N);
@ -111,7 +111,7 @@ GLM_FUNC_QUALIFIER __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref)
} }
//reflect //reflect
GLM_FUNC_QUALIFIER __m128 sse_rfe_ps(__m128 I, __m128 N) GLM_FUNC_QUALIFIER __m128 sse_rfe_ps(__m128 I, __m128 N) GLM_NOEXCEPT
{ {
__m128 dot0 = sse_dot_ps(N, I); __m128 dot0 = sse_dot_ps(N, I);
__m128 mul0 = _mm_mul_ps(N, dot0); __m128 mul0 = _mm_mul_ps(N, dot0);
@ -121,7 +121,7 @@ GLM_FUNC_QUALIFIER __m128 sse_rfe_ps(__m128 I, __m128 N)
} }
//refract //refract
GLM_FUNC_QUALIFIER __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta) GLM_FUNC_QUALIFIER __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta) GLM_NOEXCEPT
{ {
__m128 dot0 = sse_dot_ps(N, I); __m128 dot0 = sse_dot_ps(N, I);
__m128 mul0 = _mm_mul_ps(eta, eta); __m128 mul0 = _mm_mul_ps(eta, eta);

View File

@ -37,8 +37,8 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
__m128i _mm_bit_interleave_si128(__m128i x); __m128i _mm_bit_interleave_si128(__m128i x) GLM_NOEXCEPT;
__m128i _mm_bit_interleave_si128(__m128i x, __m128i y); __m128i _mm_bit_interleave_si128(__m128i x, __m128i y) GLM_NOEXCEPT;
}//namespace detail }//namespace detail
}//namespace glm }//namespace glm

View File

@ -29,7 +29,7 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
inline __m128i _mm_bit_interleave_si128(__m128i x) inline __m128i _mm_bit_interleave_si128(__m128i x) GLM_NOEXCEPT
{ {
__m128i const Mask4 = _mm_set1_epi32(0x0000FFFF); __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF);
__m128i const Mask3 = _mm_set1_epi32(0x00FF00FF); __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF);
@ -83,7 +83,7 @@ namespace detail
return Reg1; return Reg1;
} }
inline __m128i _mm_bit_interleave_si128(__m128i x, __m128i y) inline __m128i _mm_bit_interleave_si128(__m128i x, __m128i y) GLM_NOEXCEPT
{ {
__m128i const Mask4 = _mm_set1_epi32(0x0000FFFF); __m128i const Mask4 = _mm_set1_epi32(0x0000FFFF);
__m128i const Mask3 = _mm_set1_epi32(0x00FF00FF); __m128i const Mask3 = _mm_set1_epi32(0x00FF00FF);

View File

@ -39,25 +39,25 @@
namespace glm{ namespace glm{
namespace detail namespace detail
{ {
void sse_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); void sse_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]) GLM_NOEXCEPT;
void sse_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]); void sse_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]) GLM_NOEXCEPT;
__m128 sse_mul_ps(__m128 m[4], __m128 v); __m128 sse_mul_ps(__m128 m[4], __m128 v) GLM_NOEXCEPT;
__m128 sse_mul_ps(__m128 v, __m128 m[4]); __m128 sse_mul_ps(__m128 v, __m128 m[4]) GLM_NOEXCEPT;
void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]); void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) GLM_NOEXCEPT;
void sse_transpose_ps(__m128 const in[4], __m128 out[4]); void sse_transpose_ps(__m128 const in[4], __m128 out[4]) GLM_NOEXCEPT;
void sse_inverse_ps(__m128 const in[4], __m128 out[4]); void sse_inverse_ps(__m128 const in[4], __m128 out[4]) GLM_NOEXCEPT;
void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]); void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) GLM_NOEXCEPT;
__m128 sse_det_ps(__m128 const m[4]); __m128 sse_det_ps(__m128 const m[4]);
__m128 sse_slow_det_ps(__m128 const m[4]); __m128 sse_slow_det_ps(__m128 const m[4]) GLM_NOEXCEPT;
}//namespace detail }//namespace detail
}//namespace glm }//namespace glm

View File

@ -38,7 +38,7 @@ GLM_FUNC_QUALIFIER matType sse_comp_mul_ps
__m128 const in1[4], __m128 const in1[4],
__m128 const in2[4], __m128 const in2[4],
__m128 out[4] __m128 out[4]
) ) GLM_NOEXCEPT
{ {
out[0] = _mm_mul_ps(in1[0], in2[0]); out[0] = _mm_mul_ps(in1[0], in2[0]);
out[1] = _mm_mul_ps(in1[1], in2[1]); out[1] = _mm_mul_ps(in1[1], in2[1]);
@ -46,7 +46,7 @@ GLM_FUNC_QUALIFIER matType sse_comp_mul_ps
out[3] = _mm_mul_ps(in1[3], in2[3]); out[3] = _mm_mul_ps(in1[3], in2[3]);
} }
GLM_FUNC_QUALIFIER void sse_add_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) GLM_FUNC_QUALIFIER void sse_add_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) GLM_NOEXCEPT
{ {
{ {
out[0] = _mm_add_ps(in1[0], in2[0]); out[0] = _mm_add_ps(in1[0], in2[0]);
@ -56,7 +56,7 @@ GLM_FUNC_QUALIFIER void sse_add_ps(__m128 const in1[4], __m128 const in2[4], __m
} }
} }
GLM_FUNC_QUALIFIER void sse_sub_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) GLM_FUNC_QUALIFIER void sse_sub_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) GLM_NOEXCEPT
{ {
{ {
out[0] = _mm_sub_ps(in1[0], in2[0]); out[0] = _mm_sub_ps(in1[0], in2[0]);
@ -66,7 +66,7 @@ GLM_FUNC_QUALIFIER void sse_sub_ps(__m128 const in1[4], __m128 const in2[4], __m
} }
} }
GLM_FUNC_QUALIFIER __m128 sse_mul_ps(__m128 const m[4], __m128 v) GLM_FUNC_QUALIFIER __m128 sse_mul_ps(__m128 const m[4], __m128 v) GLM_NOEXCEPT
{ {
__m128 v0 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0)); __m128 v0 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(0, 0, 0, 0));
__m128 v1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1)); __m128 v1 = _mm_shuffle_ps(v, v, _MM_SHUFFLE(1, 1, 1, 1));
@ -85,7 +85,7 @@ GLM_FUNC_QUALIFIER __m128 sse_mul_ps(__m128 const m[4], __m128 v)
return a2; return a2;
} }
GLM_FUNC_QUALIFIER __m128 sse_mul_ps(__m128 v, __m128 const m[4]) GLM_FUNC_QUALIFIER __m128 sse_mul_ps(__m128 v, __m128 const m[4]) GLM_NOEXCEPT
{ {
__m128 i0 = m[0]; __m128 i0 = m[0];
__m128 i1 = m[1]; __m128 i1 = m[1];
@ -112,7 +112,7 @@ GLM_FUNC_QUALIFIER __m128 sse_mul_ps(__m128 v, __m128 const m[4])
return f2; return f2;
} }
GLM_FUNC_QUALIFIER void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) GLM_FUNC_QUALIFIER void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]) GLM_NOEXCEPT
{ {
{ {
__m128 e0 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(0, 0, 0, 0)); __m128 e0 = _mm_shuffle_ps(in2[0], in2[0], _MM_SHUFFLE(0, 0, 0, 0));
@ -188,7 +188,7 @@ GLM_FUNC_QUALIFIER void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m
} }
} }
GLM_FUNC_QUALIFIER void sse_transpose_ps(__m128 const in[4], __m128 out[4]) GLM_FUNC_QUALIFIER void sse_transpose_ps(__m128 const in[4], __m128 out[4]) GLM_NOEXCEPT
{ {
__m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44); __m128 tmp0 = _mm_shuffle_ps(in[0], in[1], 0x44);
__m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE); __m128 tmp2 = _mm_shuffle_ps(in[0], in[1], 0xEE);
@ -201,7 +201,7 @@ GLM_FUNC_QUALIFIER void sse_transpose_ps(__m128 const in[4], __m128 out[4])
out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD); out[3] = _mm_shuffle_ps(tmp2, tmp3, 0xDD);
} }
GLM_FUNC_QUALIFIER __m128 sse_slow_det_ps(__m128 const in[4]) GLM_FUNC_QUALIFIER __m128 sse_slow_det_ps(__m128 const in[4]) GLM_NOEXCEPT
{ {
__m128 Fac0; __m128 Fac0;
{ {
@ -547,7 +547,7 @@ GLM_FUNC_QUALIFIER __m128 sse_det_ps
return sse_dot_ps(m[0], DetCof); return sse_dot_ps(m[0], DetCof);
} }
GLM_FUNC_QUALIFIER void sse_inverse_ps(__m128 const in[4], __m128 out[4]) GLM_FUNC_QUALIFIER void sse_inverse_ps(__m128 const in[4], __m128 out[4]) GLM_NOEXCEPT
{ {
__m128 Fac0; __m128 Fac0;
{ {
@ -768,7 +768,7 @@ GLM_FUNC_QUALIFIER void sse_inverse_ps(__m128 const in[4], __m128 out[4])
out[3] = _mm_mul_ps(Inv3, Rcp0); out[3] = _mm_mul_ps(Inv3, Rcp0);
} }
GLM_FUNC_QUALIFIER void sse_inverse_fast_ps(__m128 const in[4], __m128 out[4]) GLM_FUNC_QUALIFIER void sse_inverse_fast_ps(__m128 const in[4], __m128 out[4]) GLM_NOEXCEPT
{ {
__m128 Fac0; __m128 Fac0;
{ {
@ -988,7 +988,7 @@ GLM_FUNC_QUALIFIER void sse_inverse_fast_ps(__m128 const in[4], __m128 out[4])
out[3] = _mm_mul_ps(Inv3, Rcp0); out[3] = _mm_mul_ps(Inv3, Rcp0);
} }
/* /*
GLM_FUNC_QUALIFIER void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) GLM_FUNC_QUALIFIER void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]) GLM_NOEXCEPT
{ {
float a = glm::radians(Angle); float a = glm::radians(Angle);
float c = cos(a); float c = cos(a);
@ -1058,7 +1058,7 @@ GLM_FUNC_QUALIFIER void sse_rotate_ps(__m128 const in[4], float Angle, float con
sse_mul_ps(in, Result, out); sse_mul_ps(in, Result, out);
} }
*/ */
GLM_FUNC_QUALIFIER void sse_outer_ps(__m128 const & c, __m128 const & r, __m128 out[4]) GLM_FUNC_QUALIFIER void sse_outer_ps(__m128 const & c, __m128 const & r, __m128 out[4]) GLM_NOEXCEPT
{ {
out[0] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(0, 0, 0, 0))); out[0] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(0, 0, 0, 0)));
out[1] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(1, 1, 1, 1))); out[1] = _mm_mul_ps(c, _mm_shuffle_ps(r, r, _MM_SHUFFLE(1, 1, 1, 1)));

View File

@ -995,7 +995,7 @@ namespace detail
# endif # endif
template <typename genType> template <typename genType>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR component_count_t component_count(genType const & m) GLM_FUNC_QUALIFIER GLM_CONSTEXPR component_count_t component_count(genType const & m) GLM_NOEXCEPT
{ {
# ifdef GLM_FORCE_SIZE_FUNC # ifdef GLM_FORCE_SIZE_FUNC
return m.size(); return m.size();
@ -1028,7 +1028,7 @@ namespace detail
namespace glm namespace glm
{ {
template <typename T, std::size_t N> template <typename T, std::size_t N>
constexpr std::size_t countof(T const (&)[N]) constexpr std::size_t countof(T const (&)[N]) GLM_NOEXCEPT
{ {
return N; return N;
} }

View File

@ -39,8 +39,8 @@ namespace detail
{ {
typedef short hdata; typedef short hdata;
GLM_FUNC_DECL float toFloat32(hdata value); GLM_FUNC_DECL float toFloat32(hdata value) GLM_NOEXCEPT;
GLM_FUNC_DECL hdata toFloat16(float const & value); GLM_FUNC_DECL hdata toFloat16(float const & value) GLM_NOEXCEPT;
}//namespace detail }//namespace detail
}//namespace glm }//namespace glm

View File

@ -48,15 +48,15 @@ namespace detail
union uif32 union uif32
{ {
GLM_FUNC_QUALIFIER uif32() : GLM_FUNC_QUALIFIER uif32() GLM_NOEXCEPT :
i(0) i(0)
{} {}
GLM_FUNC_QUALIFIER uif32(float f) : GLM_FUNC_QUALIFIER uif32(float f) GLM_NOEXCEPT :
f(f) f(f)
{} {}
GLM_FUNC_QUALIFIER uif32(uint32 i) : GLM_FUNC_QUALIFIER uif32(uint32 i) GLM_NOEXCEPT :
i(i) i(i)
{} {}
@ -64,7 +64,7 @@ namespace detail
uint32 i; uint32 i;
}; };
GLM_FUNC_QUALIFIER float toFloat32(hdata value) GLM_FUNC_QUALIFIER float toFloat32(hdata value) GLM_NOEXCEPT
{ {
int s = (value >> 15) & 0x00000001; int s = (value >> 15) & 0x00000001;
int e = (value >> 10) & 0x0000001f; int e = (value >> 10) & 0x0000001f;
@ -138,7 +138,7 @@ namespace detail
return Result.f; return Result.f;
} }
GLM_FUNC_QUALIFIER hdata toFloat16(float const & f) GLM_FUNC_QUALIFIER hdata toFloat16(float const & f) GLM_NOEXCEPT
{ {
uif32 Entry; uif32 Entry;
Entry.f = f; Entry.f = f;