From c2fe3fccf6b2a123ed72a9bd6a41eee42489d35b Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Fri, 30 Dec 2016 20:05:04 +0100 Subject: [PATCH] Use length_t instead of int for vec and mat lengths #584 --- glm/detail/_noise.hpp | 36 +-- glm/detail/_swizzle.hpp | 22 +- glm/detail/_swizzle_func.hpp | 6 +- glm/detail/_vectorize.hpp | 30 +-- glm/detail/dummy.cpp | 10 +- glm/detail/func_common.hpp | 138 +++++----- glm/detail/func_common.inl | 350 ++++++++++++------------- glm/detail/func_common_simd.inl | 38 +-- glm/detail/func_exponential.hpp | 30 +-- glm/detail/func_exponential.inl | 82 +++--- glm/detail/func_exponential_simd.inl | 4 +- glm/detail/func_geometric.hpp | 44 ++-- glm/detail/func_geometric.inl | 96 +++---- glm/detail/func_geometric_simd.inl | 16 +- glm/detail/func_integer.hpp | 76 +++--- glm/detail/func_integer.inl | 196 +++++++------- glm/detail/func_integer_simd.inl | 8 +- glm/detail/func_matrix.hpp | 28 +- glm/detail/func_matrix.inl | 48 ++-- glm/detail/func_matrix_simd.inl | 8 +- glm/detail/func_trigonometric.hpp | 60 ++--- glm/detail/func_trigonometric.inl | 102 ++++---- glm/detail/func_vector_relational.hpp | 36 +-- glm/detail/func_vector_relational.inl | 50 ++-- glm/detail/precision.hpp | 6 +- glm/detail/setup.hpp | 2 +- glm/detail/type_gentype.hpp | 20 +- glm/detail/type_gentype.inl | 52 ++-- glm/detail/type_int.hpp | 44 ++-- glm/detail/type_mat.hpp | 4 +- glm/detail/type_mat2x2.hpp | 72 +++--- glm/detail/type_mat2x2.inl | 138 +++++----- glm/detail/type_mat2x3.hpp | 58 ++--- glm/detail/type_mat2x3.inl | 120 ++++----- glm/detail/type_mat2x4.hpp | 58 ++--- glm/detail/type_mat2x4.inl | 120 ++++----- glm/detail/type_mat3x2.hpp | 56 ++-- glm/detail/type_mat3x2.inl | 120 ++++----- glm/detail/type_mat3x3.hpp | 70 ++--- glm/detail/type_mat3x3.inl | 138 +++++----- glm/detail/type_mat3x4.hpp | 56 ++-- glm/detail/type_mat3x4.inl | 120 ++++----- glm/detail/type_mat4x2.hpp | 58 ++--- glm/detail/type_mat4x2.inl | 120 ++++----- glm/detail/type_mat4x3.hpp | 58 ++--- glm/detail/type_mat4x3.inl | 120 ++++----- glm/detail/type_mat4x4.hpp | 72 +++--- glm/detail/type_mat4x4.inl | 138 +++++----- glm/detail/type_vec.hpp | 22 +- glm/detail/type_vec1.hpp | 130 +++++----- glm/detail/type_vec1.inl | 200 +++++++------- glm/detail/type_vec2.hpp | 192 +++++++------- glm/detail/type_vec2.inl | 286 ++++++++++---------- glm/detail/type_vec3.hpp | 202 +++++++-------- glm/detail/type_vec3.inl | 298 ++++++++++----------- glm/detail/type_vec4.hpp | 222 ++++++++-------- glm/detail/type_vec4.inl | 358 +++++++++++++------------- glm/detail/type_vec4_simd.inl | 116 ++++----- glm/fwd.hpp | 2 +- glm/gtc/bitfield.hpp | 28 +- glm/gtc/bitfield.inl | 54 ++-- glm/gtc/color_space.hpp | 16 +- glm/gtc/color_space.inl | 48 ++-- glm/gtc/constants.hpp | 58 ++--- glm/gtc/constants.inl | 58 ++--- glm/gtc/epsilon.hpp | 14 +- glm/gtc/epsilon.inl | 56 ++-- glm/gtc/functions.hpp | 4 +- glm/gtc/functions.inl | 4 +- glm/gtc/integer.hpp | 20 +- glm/gtc/integer.inl | 30 +-- glm/gtc/matrix_access.hpp | 8 +- glm/gtc/matrix_access.inl | 8 +- glm/gtc/matrix_inverse.hpp | 4 +- glm/gtc/matrix_inverse.inl | 10 +- glm/gtc/matrix_transform.hpp | 54 ++-- glm/gtc/matrix_transform.inl | 58 ++--- glm/gtc/noise.hpp | 14 +- glm/gtc/noise.inl | 22 +- glm/gtc/packing.hpp | 40 +-- glm/gtc/packing.inl | 50 ++-- glm/gtc/quaternion.hpp | 100 +++---- glm/gtc/quaternion.inl | 160 ++++++------ glm/gtc/quaternion_simd.inl | 22 +- glm/gtc/random.hpp | 20 +- glm/gtc/random.inl | 206 +++++++-------- glm/gtc/reciprocal.hpp | 24 +- glm/gtc/reciprocal.inl | 96 +++---- glm/gtc/round.hpp | 60 ++--- glm/gtc/round.inl | 152 +++++------ glm/gtc/type_ptr.hpp | 2 +- glm/gtc/type_ptr.inl | 241 ++++++----------- glm/gtc/ulp.hpp | 10 +- glm/gtc/ulp.inl | 40 +-- glm/gtx/associated_min_max.hpp | 156 +++++------ glm/gtx/associated_min_max.inl | 188 +++++++------- glm/gtx/bit.hpp | 26 +- glm/gtx/bit.inl | 40 +-- glm/gtx/closest_point.hpp | 4 +- glm/gtx/closest_point.inl | 4 +- glm/gtx/color_encoding.hpp | 8 +- glm/gtx/color_encoding.inl | 8 +- glm/gtx/color_space.hpp | 12 +- glm/gtx/color_space.inl | 12 +- glm/gtx/color_space_YCoCg.hpp | 8 +- glm/gtx/color_space_YCoCg.inl | 12 +- glm/gtx/common.hpp | 6 +- glm/gtx/common.inl | 36 +-- glm/gtx/compatibility.hpp | 40 +-- glm/gtx/compatibility.inl | 10 +- glm/gtx/component_wise.hpp | 16 +- glm/gtx/component_wise.inl | 78 +++--- glm/gtx/dual_quaternion.hpp | 52 ++-- glm/gtx/dual_quaternion.inl | 82 +++--- glm/gtx/euler_angles.hpp | 34 +-- glm/gtx/euler_angles.inl | 34 +-- glm/gtx/extend.hpp | 2 +- glm/gtx/extend.inl | 8 +- glm/gtx/extended_min_max.hpp | 24 +- glm/gtx/extended_min_max.inl | 24 +- glm/gtx/fast_exponential.hpp | 36 +-- glm/gtx/fast_exponential.inl | 46 ++-- glm/gtx/fast_square_root.hpp | 26 +- glm/gtx/fast_square_root.inl | 34 +-- glm/gtx/fast_trigonometry.hpp | 16 +- glm/gtx/fast_trigonometry.inl | 76 +++--- glm/gtx/float_notmalize.inl | 6 +- glm/gtx/gradient_paint.hpp | 4 +- glm/gtx/gradient_paint.inl | 4 +- glm/gtx/handed_coordinate_space.hpp | 4 +- glm/gtx/handed_coordinate_space.inl | 4 +- glm/gtx/hash.hpp | 30 +-- glm/gtx/hash.inl | 30 +-- glm/gtx/integer.hpp | 2 +- glm/gtx/integer.inl | 8 +- glm/gtx/intersect.hpp | 12 +- glm/gtx/intersect.inl | 12 +- glm/gtx/io.hpp | 52 ++-- glm/gtx/io.inl | 66 ++--- glm/gtx/log_base.hpp | 10 +- glm/gtx/log_base.inl | 6 +- glm/gtx/matrix_cross_product.hpp | 4 +- glm/gtx/matrix_cross_product.inl | 4 +- glm/gtx/matrix_decompose.hpp | 2 +- glm/gtx/matrix_decompose.inl | 6 +- glm/gtx/matrix_interpolation.hpp | 8 +- glm/gtx/matrix_interpolation.inl | 8 +- glm/gtx/matrix_major_storage.hpp | 24 +- glm/gtx/matrix_major_storage.inl | 24 +- glm/gtx/matrix_operation.hpp | 18 +- glm/gtx/matrix_operation.inl | 18 +- glm/gtx/matrix_query.hpp | 4 +- glm/gtx/matrix_query.inl | 4 +- glm/gtx/matrix_transform_2d.hpp | 10 +- glm/gtx/matrix_transform_2d.inl | 10 +- glm/gtx/mixed_product.hpp | 2 +- glm/gtx/mixed_product.inl | 2 +- glm/gtx/norm.hpp | 22 +- glm/gtx/norm.inl | 30 +-- glm/gtx/normal.hpp | 2 +- glm/gtx/normal.inl | 2 +- glm/gtx/normalize_dot.hpp | 8 +- glm/gtx/normalize_dot.inl | 8 +- glm/gtx/optimum_pow.hpp | 6 +- glm/gtx/optimum_pow.inl | 6 +- glm/gtx/orthonormalize.hpp | 4 +- glm/gtx/orthonormalize.inl | 4 +- glm/gtx/perpendicular.hpp | 2 +- glm/gtx/perpendicular.inl | 2 +- glm/gtx/polar_coordinates.hpp | 4 +- glm/gtx/polar_coordinates.inl | 4 +- glm/gtx/projection.hpp | 2 +- glm/gtx/projection.inl | 2 +- glm/gtx/quaternion.inl | 28 +- glm/gtx/range.hpp | 18 +- glm/gtx/rotate_normalized_axis.hpp | 4 +- glm/gtx/rotate_normalized_axis.inl | 4 +- glm/gtx/rotate_vector.hpp | 22 +- glm/gtx/rotate_vector.inl | 24 +- glm/gtx/scalar_multiplication.hpp | 8 +- glm/gtx/scalar_relational.inl | 12 +- glm/gtx/spline.hpp | 6 +- glm/gtx/spline.inl | 6 +- glm/gtx/string_cast.hpp | 2 +- glm/gtx/string_cast.inl | 74 +++--- glm/gtx/transform.hpp | 6 +- glm/gtx/transform.inl | 6 +- glm/gtx/transform2.hpp | 24 +- glm/gtx/transform2.inl | 22 +- glm/gtx/type_trait.hpp | 52 ++-- glm/gtx/vector_angle.hpp | 6 +- glm/gtx/vector_angle.inl | 12 +- glm/gtx/vector_query.hpp | 24 +- glm/gtx/vector_query.inl | 58 ++--- glm/gtx/wrap.hpp | 8 +- glm/gtx/wrap.inl | 38 +-- test/core/core_func_common.cpp | 16 +- test/core/core_func_integer.cpp | 86 +++---- test/core/core_func_matrix.cpp | 2 +- test/core/core_setup_message.cpp | 6 +- test/core/core_type_mat2x2.cpp | 2 +- test/core/core_type_mat2x3.cpp | 2 +- test/core/core_type_mat2x4.cpp | 2 +- test/core/core_type_mat3x2.cpp | 2 +- test/core/core_type_mat3x3.cpp | 2 +- test/core/core_type_mat3x4.cpp | 2 +- test/core/core_type_mat4x2.cpp | 2 +- test/core/core_type_mat4x3.cpp | 2 +- test/core/core_type_mat4x4.cpp | 4 +- test/core/core_type_vec4.cpp | 2 +- test/gtc/gtc_bitfield.cpp | 6 +- test/gtc/gtc_epsilon.cpp | 2 +- test/gtc/gtc_round.cpp | 12 +- test/gtx/gtx_common.cpp | 2 +- test/gtx/gtx_fast_trigonometry.cpp | 76 +++--- test/gtx/gtx_io.cpp | 10 +- test/gtx/gtx_type_aligned.cpp | 2 +- 217 files changed, 4724 insertions(+), 4799 deletions(-) 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