diff --git a/glm/detail/dummy.cpp b/glm/detail/dummy.cpp index fb1daf38..3311fbef 100644 --- a/glm/detail/dummy.cpp +++ b/glm/detail/dummy.cpp @@ -165,27 +165,6 @@ glm::vec3 lighting } */ -/* -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) -{ - return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); -} - -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)); -} -*/ int main() { /* diff --git a/glm/detail/func_common.hpp b/glm/detail/func_common.hpp index d3c98fb4..4cf8f581 100644 --- a/glm/detail/func_common.hpp +++ b/glm/detail/func_common.hpp @@ -29,24 +29,34 @@ namespace glm template GLM_FUNC_DECL genType abs(genType x); + /// Returns x if x >= 0; otherwise, it returns -x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or signed integer scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL abs man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template GLM_FUNC_DECL vec abs(vec const& x); /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision + /// /// @see GLSL sign man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template GLM_FUNC_DECL vec sign(vec const& x); /// Returns a value equal to the nearest integer that is less then or equal to x. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision + /// /// @see GLSL floor man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template @@ -54,10 +64,11 @@ namespace glm /// Returns a value equal to the nearest integer to x /// whose absolute value is not larger than the absolute value of x. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision + /// /// @see GLSL trunc man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template @@ -68,10 +79,11 @@ namespace glm /// implementation, presumably the direction that is fastest. /// This includes the possibility that round(x) returns the /// same value as roundEven(x) for all values of x. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision + /// /// @see GLSL round man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template @@ -80,10 +92,11 @@ namespace glm /// Returns a value equal to the nearest integer to x. /// A fractional part of 0.5 will round toward the nearest even /// integer. (Both 3.5 and 4.5 for x will return 4.0.) - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. - /// + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision + /// /// @see GLSL roundEven man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// @see New round to even technique @@ -92,9 +105,10 @@ namespace glm /// Returns a value equal to the nearest integer /// that is greater than or equal to x. - /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL ceil man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions @@ -110,6 +124,14 @@ namespace glm template GLM_FUNC_DECL genType fract(genType x); + /// Return x - floor(x). + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL fract man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template GLM_FUNC_DECL vec fract(vec const& x); @@ -123,11 +145,29 @@ namespace glm template GLM_FUNC_DECL genType mod(genType x, genType y); + /// Modulus. Returns x - y * floor(x / y) + /// for each component in x using the floating point value y. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL mod man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec mod(vec const & x, T y); + GLM_FUNC_DECL vec mod(vec const& x, T y); + /// Modulus. Returns x - y * floor(x / y) + /// for each component in x using the floating point value y. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL mod man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec mod(vec const & x, vec const & y); + GLM_FUNC_DECL vec mod(vec const& x, vec const& y); /// Returns the fractional part of x and sets i to the integer /// part (as a whole number floating point value). Both the @@ -139,7 +179,7 @@ namespace glm /// @see GLSL modf man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL genType modf(genType x, genType & i); + GLM_FUNC_DECL genType modf(genType x, genType& i); /// Returns y if y < x; otherwise, it returns x. /// @@ -150,9 +190,25 @@ namespace glm template GLM_FUNC_DECL genType min(genType x, genType y); + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template GLM_FUNC_DECL vec min(vec const& x, T y); + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template GLM_FUNC_DECL vec min(vec const& x, vec const& y); @@ -165,9 +221,25 @@ namespace glm template GLM_FUNC_DECL genType max(genType x, genType y); + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template GLM_FUNC_DECL vec max(vec const& x, T y); + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template GLM_FUNC_DECL vec max(vec const& x, vec const& y); @@ -181,9 +253,27 @@ namespace glm template GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template GLM_FUNC_DECL vec clamp(vec const & x, T minVal, T maxVal); + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point or integer scalar types + /// @tparam P Enumeration value precision + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template GLM_FUNC_DECL vec clamp(vec const& x, vec const& minVal, vec const& maxVal); @@ -247,8 +337,9 @@ namespace glm /// Returns 0.0 if x < edge, otherwise it returns 1.0. /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL step man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions @@ -257,8 +348,9 @@ namespace glm /// Returns 0.0 if x < edge, otherwise it returns 1.0. /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL step man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions @@ -296,8 +388,9 @@ namespace glm /// /// /!\ When using compiler fast math, this function may fail. /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL isnan man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions @@ -310,8 +403,9 @@ namespace glm /// otherwise, including for implementations with no infinity /// representations. /// - /// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. - /// @tparam T Floating-point scalar types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL isinf man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions @@ -330,10 +424,13 @@ namespace glm /// the encoding of a floating-point value. The floatingpoint /// value's bit-level representation is preserved. /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam P Enumeration value precision + /// /// @see GLSL floatBitsToInt man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - GLM_FUNC_DECL vec floatBitsToInt(vec const & v); + GLM_FUNC_DECL vec floatBitsToInt(vec const& v); /// Returns a unsigned integer value representing /// the encoding of a floating-point value. The floatingpoint @@ -346,7 +443,10 @@ namespace glm /// Returns a unsigned integer value representing /// the encoding of a floating-point value. The floatingpoint /// value's bit-level representation is preserved. - /// + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam P Enumeration value precision + /// /// @see GLSL floatBitsToUint man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template @@ -368,6 +468,9 @@ namespace glm /// resulting floating point value is unspecified. Otherwise, /// the bit-level representation is preserved. /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam P Enumeration value precision + /// /// @see GLSL intBitsToFloat man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template @@ -389,6 +492,9 @@ namespace glm /// resulting floating point value is unspecified. Otherwise, /// the bit-level representation is preserved. /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam P Enumeration value precision + /// /// @see GLSL uintBitsToFloat man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template diff --git a/glm/detail/func_trigonometric.hpp b/glm/detail/func_trigonometric.hpp index 91d86f90..99b626b7 100644 --- a/glm/detail/func_trigonometric.hpp +++ b/glm/detail/func_trigonometric.hpp @@ -24,50 +24,60 @@ namespace glm /// Converts degrees to radians and returns the result. /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL radians man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL GLM_CONSTEXPR vecType radians(vecType const & degrees); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec radians(vec const& degrees); /// Converts radians to degrees and returns the result. /// - /// @tparam vecType Floating-point scalar or vector types. - /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision + /// /// @see GLSL degrees man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL GLM_CONSTEXPR vecType degrees(vecType const & radians); + template + GLM_FUNC_DECL GLM_CONSTEXPR vec degrees(vec const& radians); /// The standard trigonometric sine function. /// The values returned by this function will range from [-1, 1]. - /// - /// @tparam vecType Floating-point scalar or vector types. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL sin man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType sin(vecType const & angle); + template + GLM_FUNC_DECL vec sin(vec const& angle); /// The standard trigonometric cosine function. /// The values returned by this function will range from [-1, 1]. - /// - /// @tparam vecType Floating-point scalar or vector types. + /// + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL cos man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType cos(vecType const & angle); + template + GLM_FUNC_DECL vec cos(vec const& angle); /// The standard trigonometric tangent function. /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL tan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType tan(vecType const & angle); + template + GLM_FUNC_DECL vec tan(vec const& angle); /// Arc sine. Returns an angle whose sine is x. /// The range of values returned by this function is [-PI/2, PI/2]. @@ -77,19 +87,21 @@ namespace glm /// /// @see GLSL asin man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType asin(vecType const & x); + template + GLM_FUNC_DECL vec asin(vec const& x); /// Arc cosine. Returns an angle whose sine is x. /// The range of values returned by this function is [0, PI]. /// Results are undefined if |x| > 1. /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL acos man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType acos(vecType const & x); + template + GLM_FUNC_DECL vec acos(vec const& x); /// Arc tangent. Returns an angle whose tangent is y/x. /// The signs of x and y are used to determine what @@ -97,78 +109,94 @@ namespace glm /// by this function is [-PI, PI]. Results are undefined /// if x and y are both 0. /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL atan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType atan(vecType const & y, vecType const & x); + template + GLM_FUNC_DECL vec atan(vec const& y, vec const& x); /// Arc tangent. Returns an angle whose tangent is y_over_x. /// The range of values returned by this function is [-PI/2, PI/2]. /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL atan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType atan(vecType const & y_over_x); + template + GLM_FUNC_DECL vec atan(vec const& y_over_x); /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL sinh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType sinh(vecType const & angle); + template + GLM_FUNC_DECL vec sinh(vec const& angle); /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL cosh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType cosh(vecType const & angle); + template + GLM_FUNC_DECL vec cosh(vec const& angle); /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL tanh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType tanh(vecType const & angle); + template + GLM_FUNC_DECL vec tanh(vec const& angle); /// Arc hyperbolic sine; returns the inverse of sinh. /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL asinh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType asinh(vecType const & x); + template + GLM_FUNC_DECL vec asinh(vec const& x); /// Arc hyperbolic cosine; returns the non-negative inverse /// of cosh. Results are undefined if x < 1. /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL acosh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType acosh(vecType const & x); + template + GLM_FUNC_DECL vec acosh(vec const& x); /// Arc hyperbolic tangent; returns the inverse of tanh. /// Results are undefined if abs(x) >= 1. /// - /// @tparam vecType Floating-point scalar or vector types. + /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector + /// @tparam T Floating-point scalar types + /// @tparam P Enumeration value precision /// /// @see GLSL atanh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions - template class vecType> - GLM_FUNC_DECL vecType atanh(vecType const & x); + template + GLM_FUNC_DECL vec atanh(vec const& x); /// @} }//namespace glm diff --git a/glm/detail/func_trigonometric.inl b/glm/detail/func_trigonometric.inl index 952273dc..460b98de 100644 --- a/glm/detail/func_trigonometric.inl +++ b/glm/detail/func_trigonometric.inl @@ -16,8 +16,8 @@ namespace glm return degrees * static_cast(0.01745329251994329576923690768489); } - template class vecType> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType radians(vecType const & v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec radians(vec const& v) { return detail::functor1::call(radians, v); } @@ -31,8 +31,8 @@ namespace glm return radians * static_cast(57.295779513082320876798154814105); } - template class vecType> - GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType degrees(vecType const & v) + template + GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec degrees(vec const& v) { return detail::functor1::call(degrees, v); } @@ -40,8 +40,8 @@ namespace glm // sin using ::std::sin; - template class vecType> - GLM_FUNC_QUALIFIER vecType sin(vecType const & v) + template + GLM_FUNC_QUALIFIER vec sin(vec const& v) { return detail::functor1::call(sin, v); } @@ -49,8 +49,8 @@ namespace glm // cos using std::cos; - template class vecType> - GLM_FUNC_QUALIFIER vecType cos(vecType const & v) + template + GLM_FUNC_QUALIFIER vec cos(vec const& v) { return detail::functor1::call(cos, v); } @@ -58,8 +58,8 @@ namespace glm // tan using std::tan; - template class vecType> - GLM_FUNC_QUALIFIER vecType tan(vecType const & v) + template + GLM_FUNC_QUALIFIER vec tan(vec const& v) { return detail::functor1::call(tan, v); } @@ -67,8 +67,8 @@ namespace glm // asin using std::asin; - template class vecType> - GLM_FUNC_QUALIFIER vecType asin(vecType const & v) + template + GLM_FUNC_QUALIFIER vec asin(vec const& v) { return detail::functor1::call(asin, v); } @@ -76,8 +76,8 @@ namespace glm // acos using std::acos; - template class vecType> - GLM_FUNC_QUALIFIER vecType acos(vecType const & v) + template + GLM_FUNC_QUALIFIER vec acos(vec const& v) { return detail::functor1::call(acos, v); } @@ -91,16 +91,16 @@ namespace glm return ::std::atan2(y, x); } - template class vecType> - GLM_FUNC_QUALIFIER vecType atan(vecType const & a, vecType const & b) + template + GLM_FUNC_QUALIFIER vec atan(vec const& a, vec const& b) { return detail::functor2::call(::std::atan2, a, b); } using std::atan; - template class vecType> - GLM_FUNC_QUALIFIER vecType atan(vecType const & v) + template + GLM_FUNC_QUALIFIER vec atan(vec const& v) { return detail::functor1::call(atan, v); } @@ -108,8 +108,8 @@ namespace glm // sinh using std::sinh; - template class vecType> - GLM_FUNC_QUALIFIER vecType sinh(vecType const & v) + template + GLM_FUNC_QUALIFIER vec sinh(vec const& v) { return detail::functor1::call(sinh, v); } @@ -117,8 +117,8 @@ namespace glm // cosh using std::cosh; - template class vecType> - GLM_FUNC_QUALIFIER vecType cosh(vecType const & v) + template + GLM_FUNC_QUALIFIER vec cosh(vec const& v) { return detail::functor1::call(cosh, v); } @@ -126,8 +126,8 @@ namespace glm // tanh using std::tanh; - template class vecType> - GLM_FUNC_QUALIFIER vecType tanh(vecType const & v) + template + GLM_FUNC_QUALIFIER vec tanh(vec const& v) { return detail::functor1::call(tanh, v); } @@ -145,8 +145,8 @@ namespace glm } # endif - template class vecType> - GLM_FUNC_QUALIFIER vecType asinh(vecType const & v) + template + GLM_FUNC_QUALIFIER vec asinh(vec const& v) { return detail::functor1::call(asinh, v); } @@ -166,8 +166,8 @@ namespace glm } # endif - template class vecType> - GLM_FUNC_QUALIFIER vecType acosh(vecType const & v) + template + GLM_FUNC_QUALIFIER vec acosh(vec const& v) { return detail::functor1::call(acosh, v); } @@ -187,8 +187,8 @@ namespace glm } # endif - template class vecType> - GLM_FUNC_QUALIFIER vecType atanh(vecType const & v) + template + GLM_FUNC_QUALIFIER vec atanh(vec const& v) { return detail::functor1::call(atanh, v); } diff --git a/test/core/core_func_integer.cpp b/test/core/core_func_integer.cpp index 6ffe2267..021da834 100644 --- a/test/core/core_func_integer.cpp +++ b/test/core/core_func_integer.cpp @@ -151,17 +151,17 @@ namespace bitfieldReverse return Result; } */ - template class vecType> - GLM_FUNC_QUALIFIER vecType bitfieldReverseLoop(vecType const & v) + template + GLM_FUNC_QUALIFIER glm::vec bitfieldReverseLoop(glm::vec const& v) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); - vecType Result(0); + glm::vec Result(0); T const BitSize = static_cast(sizeof(T) * 8); for(T i = 0; i < BitSize; ++i) { - vecType const BitSet(v & (static_cast(1) << i)); - vecType const BitFirst(BitSet >> i); + glm::vec const BitSet(v & (static_cast(1) << i)); + glm::vec const BitFirst(BitSet >> i); Result |= BitFirst << (BitSize - 1 - i); } return Result; @@ -197,8 +197,8 @@ namespace bitfieldReverse template struct compute_bitfieldReverseStep { - template class vecType> - GLM_FUNC_QUALIFIER static vecType call(vecType const & v, T, T) + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const & v, T, T) { return v; } @@ -207,17 +207,17 @@ namespace bitfieldReverse template<> struct compute_bitfieldReverseStep { - template class vecType> - GLM_FUNC_QUALIFIER static vecType call(vecType const & v, T Mask, T Shift) + template + GLM_FUNC_QUALIFIER static glm::vec call(glm::vec const & v, T Mask, T Shift) { return (v & Mask) << Shift | (v & (~Mask)) >> Shift; } }; - template class vecType> - GLM_FUNC_QUALIFIER vecType bitfieldReverseOps(vecType const & v) + template + GLM_FUNC_QUALIFIER glm::vec bitfieldReverseOps(glm::vec const & v) { - vecType x(v); + glm::vec x(v); x = compute_bitfieldReverseStep= 2>::call(x, T(0x5555555555555555ull), static_cast( 1)); x = compute_bitfieldReverseStep= 4>::call(x, T(0x3333333333333333ull), static_cast( 2)); x = compute_bitfieldReverseStep= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast( 4)); diff --git a/test/gtc/gtc_integer.cpp b/test/gtc/gtc_integer.cpp index b8296941..1e56bfa9 100644 --- a/test/gtc/gtc_integer.cpp +++ b/test/gtc/gtc_integer.cpp @@ -169,7 +169,7 @@ namespace log2_ std::clock_t Begin = clock(); for(int i = 0; i < static_cast(Count); ++i) - Result[i] = glm::log2(glm::vec4(i)); + Result[i] = glm::log2(glm::vec4(static_cast(i))); std::clock_t End = clock();