Replaced vecType by vec

master
Christophe Riccio ago%!(EXTRA string=8 years)
parent 8a9582cc5e
commit da84db5481
  1. 21
      glm/detail/dummy.cpp
  2. 178
      glm/detail/func_common.hpp
  3. 122
      glm/detail/func_trigonometric.hpp
  4. 60
      glm/detail/func_trigonometric.inl
  5. 24
      test/core/core_func_integer.cpp
  6. 2
      test/gtc/gtc_integer.cpp

@ -165,27 +165,6 @@ glm::vec3 lighting
} }
*/ */
/*
template<typename T, glm::precision P, template<typename, glm::precision> class vecType>
T normalizeDotA(vecType<L, T, P> const & x, vecType<L, T, P> 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<typename, glm::precision> class
template<GLM_TEMPLATE_GENTYPE vecType>
T normalizeDotB(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
{
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
}
template<typename vecType>
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() int main()
{ {
/* /*

@ -29,24 +29,34 @@ namespace glm
template<typename genType> template<typename genType>
GLM_FUNC_DECL genType abs(genType x); 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> abs(vec<L, T, P> const& x); GLM_FUNC_DECL vec<L, T, P> abs(vec<L, T, P> const& x);
/// 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.
/// ///
/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// /// @tparam P Enumeration value precision
///
/// @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<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> sign(vec<L, T, P> const& x); GLM_FUNC_DECL vec<L, T, P> sign(vec<L, T, P> const& x);
/// 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.
/// ///
/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// /// @tparam P Enumeration value precision
///
/// @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<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
@ -54,10 +64,11 @@ namespace glm
/// 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.
/// ///
/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// /// @tparam P Enumeration value precision
///
/// @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<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
@ -68,10 +79,11 @@ namespace glm
/// implementation, presumably the direction that is fastest. /// implementation, presumably the direction that is fastest.
/// This includes the possibility that round(x) returns the /// This includes the possibility that round(x) returns the
/// same value as roundEven(x) for all values of x. /// 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 L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// /// @tparam P Enumeration value precision
///
/// @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<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
@ -80,10 +92,11 @@ namespace glm
/// 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
/// integer. (Both 3.5 and 4.5 for x will return 4.0.) /// 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 L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// /// @tparam P Enumeration value precision
///
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a> /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven 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>
/// @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>
@ -92,9 +105,10 @@ namespace glm
/// 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.
/// ///
/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// @tparam P Enumeration value precision
/// ///
/// @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>
@ -110,6 +124,14 @@ namespace glm
template<typename genType> template<typename genType>
GLM_FUNC_DECL genType fract(genType x); 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> fract(vec<L, T, P> const& x); GLM_FUNC_DECL vec<L, T, P> fract(vec<L, T, P> const& x);
@ -123,11 +145,29 @@ namespace glm
template<typename genType> template<typename genType>
GLM_FUNC_DECL genType mod(genType x, genType y); 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> mod(vec<L, T, P> const & x, T y); GLM_FUNC_DECL vec<L, T, P> mod(vec<L, T, P> 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> mod(vec<L, T, P> const & x, vec<L, T, P> const & y); GLM_FUNC_DECL vec<L, T, P> mod(vec<L, T, P> const& x, vec<L, T, P> const& y);
/// 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
@ -139,7 +179,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);
/// Returns y if y < x; otherwise, it returns x. /// Returns y if y < x; otherwise, it returns x.
/// ///
@ -150,9 +190,25 @@ namespace glm
template<typename genType> template<typename genType>
GLM_FUNC_DECL genType min(genType x, genType y); 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> min(vec<L, T, P> const& x, T y); GLM_FUNC_DECL vec<L, T, P> min(vec<L, T, P> 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> min(vec<L, T, P> const& x, vec<L, T, P> const& y); GLM_FUNC_DECL vec<L, T, P> min(vec<L, T, P> const& x, vec<L, T, P> const& y);
@ -165,9 +221,25 @@ namespace glm
template<typename genType> template<typename genType>
GLM_FUNC_DECL genType max(genType x, genType y); 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> max(vec<L, T, P> const& x, T y); GLM_FUNC_DECL vec<L, T, P> max(vec<L, T, P> 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> max(vec<L, T, P> const& x, vec<L, T, P> const& y); GLM_FUNC_DECL vec<L, T, P> max(vec<L, T, P> const& x, vec<L, T, P> const& y);
@ -181,9 +253,27 @@ namespace glm
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);
/// 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> clamp(vec<L, T, P> const & x, T minVal, T maxVal); GLM_FUNC_DECL vec<L, T, P> clamp(vec<L, T, P> 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 <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>
template<length_t L, typename T, precision P> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vec<L, T, P> clamp(vec<L, T, P> const& x, vec<L, T, P> const& minVal, vec<L, T, P> const& maxVal); GLM_FUNC_DECL vec<L, T, P> clamp(vec<L, T, P> const& x, vec<L, T, P> const& minVal, vec<L, T, P> const& maxVal);
@ -247,8 +337,9 @@ namespace glm
/// Returns 0.0 if x < edge, otherwise it returns 1.0. /// 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 L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// @tparam P Enumeration value precision
/// ///
/// @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>
@ -257,8 +348,9 @@ namespace glm
/// Returns 0.0 if x < edge, otherwise it returns 1.0. /// 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 L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// @tparam P Enumeration value precision
/// ///
/// @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>
@ -296,8 +388,9 @@ namespace glm
/// ///
/// /!\ When using compiler fast math, this function may fail. /// /!\ 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 L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// @tparam P Enumeration value precision
/// ///
/// @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>
@ -310,8 +403,9 @@ namespace glm
/// otherwise, including for implementations with no infinity /// otherwise, including for implementations with no infinity
/// representations. /// representations.
/// ///
/// @tparam L An integer between 1 and 4 included that qualify the dimension of the vector. /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
/// @tparam T Floating-point scalar types. /// @tparam T Floating-point scalar types
/// @tparam P Enumeration value precision
/// ///
/// @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>
@ -330,10 +424,13 @@ namespace glm
/// the encoding of a floating-point value. The floatingpoint /// the encoding of a floating-point value. The floatingpoint
/// value's bit-level representation is preserved. /// 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 <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<length_t L, precision P> template<length_t L, precision P>
GLM_FUNC_DECL vec<L, int, P> floatBitsToInt(vec<L, float, P> const & v); GLM_FUNC_DECL vec<L, int, P> floatBitsToInt(vec<L, float, P> const& v);
/// 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
@ -346,7 +443,10 @@ namespace glm
/// 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
/// value's bit-level representation is preserved. /// 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 <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<length_t L, precision P> template<length_t L, precision P>
@ -368,6 +468,9 @@ namespace glm
/// resulting floating point value is unspecified. Otherwise, /// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved. /// 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 <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<length_t L, precision P> template<length_t L, precision P>
@ -389,6 +492,9 @@ namespace glm
/// resulting floating point value is unspecified. Otherwise, /// resulting floating point value is unspecified. Otherwise,
/// the bit-level representation is preserved. /// 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 <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<length_t L, precision P> template<length_t L, precision P>

@ -24,50 +24,60 @@ namespace glm
/// Converts degrees to radians and returns the result. /// 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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL GLM_CONSTEXPR vecType<L, T, P> radians(vecType<L, T, P> const & degrees); GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, P> radians(vec<L, T, P> const& degrees);
/// Converts radians to degrees and returns the result. /// 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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL GLM_CONSTEXPR vecType<L, T, P> degrees(vecType<L, T, P> const & radians); GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, P> degrees(vec<L, T, P> const& radians);
/// 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].
/// ///
/// @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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> sin(vecType<L, T, P> const & angle); GLM_FUNC_DECL vec<L, T, P> sin(vec<L, T, P> const& angle);
/// 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].
/// ///
/// @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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> cos(vecType<L, T, P> const & angle); GLM_FUNC_DECL vec<L, T, P> cos(vec<L, T, P> const& angle);
/// The standard trigonometric tangent function. /// 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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> tan(vecType<L, T, P> const & angle); GLM_FUNC_DECL vec<L, T, P> tan(vec<L, T, P> const& angle);
/// 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].
@ -77,19 +87,21 @@ 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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> asin(vecType<L, T, P> const & x); GLM_FUNC_DECL vec<L, T, P> asin(vec<L, T, P> const& x);
/// 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].
/// Results are undefined if |x| > 1. /// 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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> acos(vecType<L, T, P> const & x); GLM_FUNC_DECL vec<L, T, P> acos(vec<L, T, P> const& x);
/// 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
@ -97,78 +109,94 @@ namespace glm
/// by this function is [-PI, PI]. Results are undefined /// by this function is [-PI, PI]. Results are undefined
/// if x and y are both 0. /// 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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> atan(vecType<L, T, P> const & y, vecType<L, T, P> const & x); GLM_FUNC_DECL vec<L, T, P> atan(vec<L, T, P> const& y, vec<L, T, P> const& x);
/// 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].
/// ///
/// @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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> atan(vecType<L, T, P> const & y_over_x); GLM_FUNC_DECL vec<L, T, P> atan(vec<L, T, P> const& y_over_x);
/// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 /// 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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> sinh(vecType<L, T, P> const & angle); GLM_FUNC_DECL vec<L, T, P> sinh(vec<L, T, P> const& angle);
/// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 /// 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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> cosh(vecType<L, T, P> const & angle); GLM_FUNC_DECL vec<L, T, P> cosh(vec<L, T, P> const& angle);
/// Returns the hyperbolic tangent function, sinh(angle) / cosh(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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> tanh(vecType<L, T, P> const & angle); GLM_FUNC_DECL vec<L, T, P> tanh(vec<L, T, P> const& angle);
/// Arc hyperbolic sine; returns the inverse of sinh. /// 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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> asinh(vecType<L, T, P> const & x); GLM_FUNC_DECL vec<L, T, P> asinh(vec<L, T, P> const& x);
/// 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.
/// ///
/// @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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> acosh(vecType<L, T, P> const & x); GLM_FUNC_DECL vec<L, T, P> acosh(vec<L, T, P> const& x);
/// 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.
/// ///
/// @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 <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<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_DECL vecType<L, T, P> atanh(vecType<L, T, P> const & x); GLM_FUNC_DECL vec<L, T, P> atanh(vec<L, T, P> const& x);
/// @} /// @}
}//namespace glm }//namespace glm

@ -16,8 +16,8 @@ namespace glm
return degrees * static_cast<genType>(0.01745329251994329576923690768489); return degrees * static_cast<genType>(0.01745329251994329576923690768489);
} }
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<L, T, P> radians(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, P> radians(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(radians, v); return detail::functor1<L, T, T, P>::call(radians, v);
} }
@ -31,8 +31,8 @@ namespace glm
return radians * static_cast<genType>(57.295779513082320876798154814105); return radians * static_cast<genType>(57.295779513082320876798154814105);
} }
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vecType<L, T, P> degrees(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, P> degrees(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(degrees, v); return detail::functor1<L, T, T, P>::call(degrees, v);
} }
@ -40,8 +40,8 @@ namespace glm
// sin // sin
using ::std::sin; using ::std::sin;
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> sin(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> sin(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(sin, v); return detail::functor1<L, T, T, P>::call(sin, v);
} }
@ -49,8 +49,8 @@ namespace glm
// cos // cos
using std::cos; using std::cos;
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> cos(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> cos(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(cos, v); return detail::functor1<L, T, T, P>::call(cos, v);
} }
@ -58,8 +58,8 @@ namespace glm
// tan // tan
using std::tan; using std::tan;
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> tan(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> tan(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(tan, v); return detail::functor1<L, T, T, P>::call(tan, v);
} }
@ -67,8 +67,8 @@ namespace glm
// asin // asin
using std::asin; using std::asin;
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> asin(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> asin(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(asin, v); return detail::functor1<L, T, T, P>::call(asin, v);
} }
@ -76,8 +76,8 @@ namespace glm
// acos // acos
using std::acos; using std::acos;
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> acos(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> acos(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(acos, v); return detail::functor1<L, T, T, P>::call(acos, v);
} }
@ -91,16 +91,16 @@ namespace glm
return ::std::atan2(y, x); return ::std::atan2(y, x);
} }
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> atan(vecType<L, T, P> const & a, vecType<L, T, P> const & b) GLM_FUNC_QUALIFIER vec<L, T, P> atan(vec<L, T, P> const& a, vec<L, T, P> const& b)
{ {
return detail::functor2<L, T, P>::call(::std::atan2, a, b); return detail::functor2<L, T, P>::call(::std::atan2, a, b);
} }
using std::atan; using std::atan;
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> atan(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> atan(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(atan, v); return detail::functor1<L, T, T, P>::call(atan, v);
} }
@ -108,8 +108,8 @@ namespace glm
// sinh // sinh
using std::sinh; using std::sinh;
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> sinh(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> sinh(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(sinh, v); return detail::functor1<L, T, T, P>::call(sinh, v);
} }
@ -117,8 +117,8 @@ namespace glm
// cosh // cosh
using std::cosh; using std::cosh;
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> cosh(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> cosh(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(cosh, v); return detail::functor1<L, T, T, P>::call(cosh, v);
} }
@ -126,8 +126,8 @@ namespace glm
// tanh // tanh
using std::tanh; using std::tanh;
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> tanh(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> tanh(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(tanh, v); return detail::functor1<L, T, T, P>::call(tanh, v);
} }
@ -145,8 +145,8 @@ namespace glm
} }
# endif # endif
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> asinh(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> asinh(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(asinh, v); return detail::functor1<L, T, T, P>::call(asinh, v);
} }
@ -166,8 +166,8 @@ namespace glm
} }
# endif # endif
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> acosh(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> acosh(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(acosh, v); return detail::functor1<L, T, T, P>::call(acosh, v);
} }
@ -187,8 +187,8 @@ namespace glm
} }
# endif # endif
template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType> template<length_t L, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> atanh(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER vec<L, T, P> atanh(vec<L, T, P> const& v)
{ {
return detail::functor1<L, T, T, P>::call(atanh, v); return detail::functor1<L, T, T, P>::call(atanh, v);
} }

@ -151,17 +151,17 @@ namespace bitfieldReverse
return Result; return Result;
} }
*/ */
template<glm::length_t L, typename T, glm::precision P, template<glm::length_t, typename, glm::precision> class vecType> template<glm::length_t L, typename T, glm::precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> bitfieldReverseLoop(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER glm::vec<L, T, P> bitfieldReverseLoop(glm::vec<L, T, P> const& v)
{ {
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldReverse' only accept integer values"); GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldReverse' only accept integer values");
vecType<L, T, P> Result(0); glm::vec<L, T, P> Result(0);
T const BitSize = static_cast<T>(sizeof(T) * 8); T const BitSize = static_cast<T>(sizeof(T) * 8);
for(T i = 0; i < BitSize; ++i) for(T i = 0; i < BitSize; ++i)
{ {
vecType<L, T, P> const BitSet(v & (static_cast<T>(1) << i)); glm::vec<L, T, P> const BitSet(v & (static_cast<T>(1) << i));
vecType<L, T, P> const BitFirst(BitSet >> i); glm::vec<L, T, P> const BitFirst(BitSet >> i);
Result |= BitFirst << (BitSize - 1 - i); Result |= BitFirst << (BitSize - 1 - i);
} }
return Result; return Result;
@ -197,8 +197,8 @@ namespace bitfieldReverse
template<bool EXEC = false> template<bool EXEC = false>
struct compute_bitfieldReverseStep struct compute_bitfieldReverseStep
{ {
template<glm::length_t L, typename T, glm::precision P, template<glm::length_t, typename, glm::precision> class vecType> template<glm::length_t L, typename T, glm::precision P>
GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & v, T, T) GLM_FUNC_QUALIFIER static glm::vec<L, T, P> call(glm::vec<L, T, P> const & v, T, T)
{ {
return v; return v;
} }
@ -207,17 +207,17 @@ namespace bitfieldReverse
template<> template<>
struct compute_bitfieldReverseStep<true> struct compute_bitfieldReverseStep<true>
{ {
template<glm::length_t L, typename T, glm::precision P, template<glm::length_t, typename, glm::precision> class vecType> template<glm::length_t L, typename T, glm::precision P>
GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & v, T Mask, T Shift) GLM_FUNC_QUALIFIER static glm::vec<L, T, P> call(glm::vec<L, T, P> const & v, T Mask, T Shift)
{ {
return (v & Mask) << Shift | (v & (~Mask)) >> Shift; return (v & Mask) << Shift | (v & (~Mask)) >> Shift;
} }
}; };
template<glm::length_t L, typename T, glm::precision P, template<glm::length_t, typename, glm::precision> class vecType> template<glm::length_t L, typename T, glm::precision P>
GLM_FUNC_QUALIFIER vecType<L, T, P> bitfieldReverseOps(vecType<L, T, P> const & v) GLM_FUNC_QUALIFIER glm::vec<L, T, P> bitfieldReverseOps(glm::vec<L, T, P> const & v)
{ {
vecType<L, T, P> x(v); glm::vec<L, T, P> x(v);
x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 2>::call(x, T(0x5555555555555555ull), static_cast<T>( 1)); x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 2>::call(x, T(0x5555555555555555ull), static_cast<T>( 1));
x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 4>::call(x, T(0x3333333333333333ull), static_cast<T>( 2)); x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 4>::call(x, T(0x3333333333333333ull), static_cast<T>( 2));
x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4)); x = compute_bitfieldReverseStep<sizeof(T) * 8 >= 8>::call(x, T(0x0F0F0F0F0F0F0F0Full), static_cast<T>( 4));

@ -169,7 +169,7 @@ namespace log2_
std::clock_t Begin = clock(); std::clock_t Begin = clock();
for(int i = 0; i < static_cast<int>(Count); ++i) for(int i = 0; i < static_cast<int>(Count); ++i)
Result[i] = glm::log2(glm::vec4(i)); Result[i] = glm::log2(glm::vec4(static_cast<float>(i)));
std::clock_t End = clock(); std::clock_t End = clock();

Loading…
Cancel
Save