diff --git a/glm/detail/_noise.hpp b/glm/detail/_noise.hpp index 8e3a51e5..9b36db69 100644 --- a/glm/detail/_noise.hpp +++ b/glm/detail/_noise.hpp @@ -11,93 +11,93 @@ namespace glm{ namespace detail { - template + template GLM_FUNC_QUALIFIER T mod289(T const & x) { return x - floor(x * (static_cast(1.0) / static_cast(289.0))) * static_cast(289.0); } - template + template GLM_FUNC_QUALIFIER T permute(T const & x) { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } - template + template GLM_FUNC_QUALIFIER vec<2, T, P> permute(vec<2, T, P> const & x) { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } - template + template GLM_FUNC_QUALIFIER vec<3, T, P> permute(vec<3, T, P> const & x) { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } - template + template GLM_FUNC_QUALIFIER vec<4, T, P> permute(vec<4, T, P> const & x) { return mod289(((x * static_cast(34)) + static_cast(1)) * x); } /* - template class vecType> - GLM_FUNC_QUALIFIER vecType permute(vecType const & x) + template class vecType> + GLM_FUNC_QUALIFIER vecType permute(vecType const & x) { return mod289(((x * T(34)) + T(1)) * x); } */ - template + template GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) { return T(1.79284291400159) - T(0.85373472095314) * r; } - template + template GLM_FUNC_QUALIFIER vec<2, T, P> taylorInvSqrt(vec<2, T, P> const & r) { return T(1.79284291400159) - T(0.85373472095314) * r; } - template + template GLM_FUNC_QUALIFIER vec<3, T, P> taylorInvSqrt(vec<3, T, P> const & r) { return T(1.79284291400159) - T(0.85373472095314) * r; } - template + template GLM_FUNC_QUALIFIER vec<4, T, P> taylorInvSqrt(vec<4, T, P> const & r) { return T(1.79284291400159) - T(0.85373472095314) * r; } /* - template class vecType> - GLM_FUNC_QUALIFIER vecType taylorInvSqrt(vecType const & r) + template class vecType> + GLM_FUNC_QUALIFIER vecType taylorInvSqrt(vecType const & r) { return T(1.79284291400159) - T(0.85373472095314) * r; } */ - template + template GLM_FUNC_QUALIFIER vec<2, T, P> fade(vec<2, T, P> const & t) { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } - template + template GLM_FUNC_QUALIFIER vec<3, T, P> fade(vec<3, T, P> const & t) { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } - template + template GLM_FUNC_QUALIFIER vec<4, T, P> fade(vec<4, T, P> const & t) { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } /* - template class vecType> - GLM_FUNC_QUALIFIER vecType fade(vecType const & t) + template class vecType> + GLM_FUNC_QUALIFIER vecType fade(vecType const & t) { return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); } diff --git a/glm/detail/_swizzle.hpp b/glm/detail/_swizzle.hpp index 5e8b0d0b..f404f5da 100644 --- a/glm/detail/_swizzle.hpp +++ b/glm/detail/_swizzle.hpp @@ -7,7 +7,7 @@ namespace glm{ namespace detail { // Internal class for implementing swizzle operators - template + template struct _swizzle_base0 { protected: @@ -20,24 +20,24 @@ namespace detail char _buffer[1]; }; - template + template struct _swizzle_base1 : public _swizzle_base0 { }; - template + template struct _swizzle_base1<2, T, P, E0,E1,-1,-2, Aligned> : public _swizzle_base0 { GLM_FUNC_QUALIFIER vec<2, T, P> operator ()() const { return vec<2, T, P>(this->elem(E0), this->elem(E1)); } }; - template + template struct _swizzle_base1<3, T, P, E0,E1,E2,-1, Aligned> : public _swizzle_base0 { GLM_FUNC_QUALIFIER vec<3, T, P> operator ()() const { return vec<3, T, P>(this->elem(E0), this->elem(E1), this->elem(E2)); } }; - template + template struct _swizzle_base1<4, T, P, E0,E1,E2,E3, Aligned> : public _swizzle_base0 { GLM_FUNC_QUALIFIER vec<4, T, P> operator ()() const { return vec<4, T, P>(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } @@ -55,7 +55,7 @@ namespace detail DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles containing duplicate elements so that they cannot be used as r-values). */ - template + template struct _swizzle_base2 : public _swizzle_base1::value> { GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const T& t) @@ -118,7 +118,7 @@ namespace detail } protected: - template + template GLM_FUNC_QUALIFIER void _apply_op(vec const& that, U op) { // Make a copy of the data in this == &that. @@ -133,7 +133,7 @@ namespace detail }; // Specialization for swizzles containing duplicate elements. These cannot be modified. - template + template struct _swizzle_base2 : public _swizzle_base1::value> { struct Stub {}; @@ -147,7 +147,7 @@ namespace detail } }; - template + template struct _swizzle : public _swizzle_base2 { typedef _swizzle_base2 base_type; @@ -160,8 +160,8 @@ namespace detail // // To prevent the C++ syntax from getting entirely overwhelming, define some alias macros // -#define _GLM_SWIZZLE_TEMPLATE1 template -#define _GLM_SWIZZLE_TEMPLATE2 template +#define _GLM_SWIZZLE_TEMPLATE1 template +#define _GLM_SWIZZLE_TEMPLATE2 template #define _GLM_SWIZZLE_TYPE1 _swizzle #define _GLM_SWIZZLE_TYPE2 _swizzle diff --git a/glm/detail/_swizzle_func.hpp b/glm/detail/_swizzle_func.hpp index 06103621..0ca9bd8e 100644 --- a/glm/detail/_swizzle_func.hpp +++ b/glm/detail/_swizzle_func.hpp @@ -22,21 +22,21 @@ } #define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(T, P, L, CONST, A, B) \ - template \ + template \ vec vec::A ## B() CONST \ { \ return vec<2, T, P>(this->A, this->B); \ } #define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(T, P, L, CONST, A, B, C) \ - template \ + template \ vec<3, T, P> vec::A ## B ## C() CONST \ { \ return vec<3, T, P>(this->A, this->B, this->C); \ } #define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(T, P, L, CONST, A, B, C, D) \ - template \ + template \ vec<4, T, P> vec::A ## B ## C ## D() CONST \ { \ return vec<4, T, P>(this->A, this->B, this->C, this->D); \ diff --git a/glm/detail/_vectorize.hpp b/glm/detail/_vectorize.hpp index 8e77a05e..44fb0b5d 100644 --- a/glm/detail/_vectorize.hpp +++ b/glm/detail/_vectorize.hpp @@ -11,10 +11,10 @@ namespace glm{ namespace detail { - template + template struct functor1{}; - template + template struct functor1<1, R, T, P> { GLM_FUNC_QUALIFIER static vec<1, R, P> call(R (*Func) (T x), vec<1, T, P> const & v) @@ -23,7 +23,7 @@ namespace detail } }; - template + template struct functor1<2, R, T, P> { GLM_FUNC_QUALIFIER static vec<2, R, P> call(R (*Func) (T x), vec<2, T, P> const & v) @@ -32,7 +32,7 @@ namespace detail } }; - template + template struct functor1<3, R, T, P> { GLM_FUNC_QUALIFIER static vec<3, R, P> call(R (*Func) (T x), vec<3, T, P> const & v) @@ -41,7 +41,7 @@ namespace detail } }; - template + template struct functor1<4, R, T, P> { GLM_FUNC_QUALIFIER static vec<4, R, P> call(R (*Func) (T x), vec<4, T, P> const & v) @@ -50,10 +50,10 @@ namespace detail } }; - template + template struct functor2{}; - template + template struct functor2<1, T, P> { GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, vec<1, T, P> const & b) @@ -62,7 +62,7 @@ namespace detail } }; - template + template struct functor2<2, T, P> { GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, vec<2, T, P> const & b) @@ -71,7 +71,7 @@ namespace detail } }; - template + template struct functor2<3, T, P> { GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, vec<3, T, P> const & b) @@ -80,7 +80,7 @@ namespace detail } }; - template + template struct functor2<4, T, P> { GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, vec<4, T, P> const & b) @@ -89,10 +89,10 @@ namespace detail } }; - template + template struct functor2_vec_sca{}; - template + template struct functor2_vec_sca<1, T, P> { GLM_FUNC_QUALIFIER static vec<1, T, P> call(T (*Func) (T x, T y), vec<1, T, P> const & a, T b) @@ -101,7 +101,7 @@ namespace detail } }; - template + template struct functor2_vec_sca<2, T, P> { GLM_FUNC_QUALIFIER static vec<2, T, P> call(T (*Func) (T x, T y), vec<2, T, P> const & a, T b) @@ -110,7 +110,7 @@ namespace detail } }; - template + template struct functor2_vec_sca<3, T, P> { GLM_FUNC_QUALIFIER static vec<3, T, P> call(T (*Func) (T x, T y), vec<3, T, P> const & a, T b) @@ -119,7 +119,7 @@ namespace detail } }; - template + template struct functor2_vec_sca<4, T, P> { GLM_FUNC_QUALIFIER static vec<4, T, P> call(T (*Func) (T x, T y), vec<4, T, P> const & a, T b) diff --git a/glm/detail/dummy.cpp b/glm/detail/dummy.cpp index bf037c08..fb1daf38 100644 --- a/glm/detail/dummy.cpp +++ b/glm/detail/dummy.cpp @@ -166,21 +166,21 @@ glm::vec3 lighting */ /* -template class vecType> -T normalizeDotA(vecType const & x, vecType const & y) +template class vecType> +T normalizeDotA(vecType const & x, vecType const & y) { return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); } #define GLM_TEMPLATE_GENTYPE typename T, glm::precision P, template class -template -T normalizeDotB(vecType const & x, vecType const & y) +template +T normalizeDotB(vecType const & x, vecType const & y) { return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); } -template +template typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b) { return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b)); diff --git a/glm/detail/func_common.hpp b/glm/detail/func_common.hpp index 190b0cad..97326ca2 100644 --- a/glm/detail/func_common.hpp +++ b/glm/detail/func_common.hpp @@ -26,11 +26,11 @@ namespace glm /// /// @see GLSL abs man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template + template GLM_FUNC_DECL genType abs(genType x); - template class vecType> - GLM_FUNC_DECL vecType abs(vecType const & x); + template class vecType> + GLM_FUNC_DECL vecType abs(vecType const & x); /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. /// @@ -38,8 +38,8 @@ namespace glm /// /// @see GLSL sign man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template class vecType> - GLM_FUNC_DECL vecType sign(vecType const & x); + template class vecType> + GLM_FUNC_DECL vecType sign(vecType const & x); /// Returns a value equal to the nearest integer that is less then or equal to x. /// @@ -47,8 +47,8 @@ namespace glm /// /// @see GLSL floor man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template class vecType> - GLM_FUNC_DECL vecType floor(vecType const & x); + template class vecType> + GLM_FUNC_DECL vecType floor(vecType const & x); /// Returns a value equal to the nearest integer to x /// whose absolute value is not larger than the absolute value of x. @@ -57,8 +57,8 @@ namespace glm /// /// @see GLSL trunc man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template class vecType> - GLM_FUNC_DECL vecType trunc(vecType const & x); + template class vecType> + GLM_FUNC_DECL vecType trunc(vecType const & x); /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the @@ -70,8 +70,8 @@ namespace glm /// /// @see GLSL round man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template class vecType> - GLM_FUNC_DECL vecType round(vecType const & x); + template class vecType> + GLM_FUNC_DECL vecType round(vecType const & x); /// Returns a value equal to the nearest integer to x. /// A fractional part of 0.5 will round toward the nearest even @@ -82,8 +82,8 @@ namespace glm /// @see GLSL roundEven man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// @see New round to even technique - template class vecType> - GLM_FUNC_DECL vecType roundEven(vecType const & x); + template class vecType> + GLM_FUNC_DECL vecType roundEven(vecType const & x); /// Returns a value equal to the nearest integer /// that is greater than or equal to x. @@ -92,8 +92,8 @@ namespace glm /// /// @see GLSL ceil man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template class vecType> - GLM_FUNC_DECL vecType ceil(vecType const & x); + template class vecType> + GLM_FUNC_DECL vecType ceil(vecType const & x); /// Return x - floor(x). /// @@ -101,11 +101,11 @@ namespace glm /// /// @see GLSL fract man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template + template GLM_FUNC_DECL genType fract(genType x); - template class vecType> - GLM_FUNC_DECL vecType fract(vecType const & x); + template class vecType> + GLM_FUNC_DECL vecType fract(vecType const & x); /// Modulus. Returns x - y * floor(x / y) /// for each component in x using the floating point value y. @@ -114,14 +114,14 @@ namespace glm /// /// @see GLSL mod man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template + template GLM_FUNC_DECL genType mod(genType x, genType y); - template class vecType> - GLM_FUNC_DECL vecType mod(vecType const & x, T y); + template class vecType> + GLM_FUNC_DECL vecType mod(vecType const & x, T y); - template class vecType> - GLM_FUNC_DECL vecType mod(vecType const & x, vecType const & y); + template class vecType> + GLM_FUNC_DECL vecType mod(vecType const & x, vecType const & y); /// Returns the fractional part of x and sets i to the integer /// part (as a whole number floating point value). Both the @@ -132,7 +132,7 @@ namespace glm /// /// @see GLSL modf man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template + template GLM_FUNC_DECL genType modf(genType x, genType & i); /// Returns y if y < x; otherwise, it returns x. @@ -141,14 +141,14 @@ namespace glm /// /// @see GLSL min man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template + template GLM_FUNC_DECL genType min(genType x, genType y); - template class vecType> - GLM_FUNC_DECL vecType min(vecType const & x, T y); + template class vecType> + GLM_FUNC_DECL vecType min(vecType const & x, T y); - template class vecType> - GLM_FUNC_DECL vecType min(vecType const & x, vecType const & y); + template class vecType> + GLM_FUNC_DECL vecType min(vecType const & x, vecType const & y); /// Returns y if x < y; otherwise, it returns x. /// @@ -156,14 +156,14 @@ namespace glm /// /// @see GLSL max man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template + template GLM_FUNC_DECL genType max(genType x, genType y); - template class vecType> - GLM_FUNC_DECL vecType max(vecType const & x, T y); + template class vecType> + GLM_FUNC_DECL vecType max(vecType const & x, T y); - template class vecType> - GLM_FUNC_DECL vecType max(vecType const & x, vecType const & y); + template class vecType> + GLM_FUNC_DECL vecType max(vecType const & x, vecType const & y); /// Returns min(max(x, minVal), maxVal) for each component in x /// using the floating-point values minVal and maxVal. @@ -172,14 +172,14 @@ namespace glm /// /// @see GLSL clamp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template + template GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); - template class vecType> - GLM_FUNC_DECL vecType clamp(vecType const & x, T minVal, T maxVal); + template class vecType> + GLM_FUNC_DECL vecType clamp(vecType const & x, T minVal, T maxVal); - template class vecType> - GLM_FUNC_DECL vecType clamp(vecType const & x, vecType const & minVal, vecType const & maxVal); + template class vecType> + GLM_FUNC_DECL vecType clamp(vecType const & x, vecType const & minVal, vecType const & maxVal); /// If genTypeU is a floating scalar or vector: /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of @@ -223,35 +223,35 @@ namespace glm /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second. /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. /// @endcode - template class vecType> - GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, vecType const & a); + template class vecType> + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, vecType const & a); - template class vecType> - GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, U a); + template class vecType> + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, U a); - template + template GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. /// /// @see GLSL step man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template + template GLM_FUNC_DECL genType step(genType edge, genType x); /// Returns 0.0 if x < edge, otherwise it returns 1.0. /// /// @see GLSL step man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions - template