Merge branch '0.9.3' into swizzle

This commit is contained in:
Christophe Riccio 2011-10-14 17:43:51 +01:00
commit 560512f270
9 changed files with 440 additions and 247 deletions

View File

@ -44,72 +44,90 @@ namespace glm
/// @{ /// @{
/// Returns x if x >= 0; otherwise, it returns -x. /// Returns x if x >= 0; otherwise, it returns -x.
///
/// @tparam genType floating-point or signed integer; scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/abs.xml">GLSL abs man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genFIType> template <typename genType>
genFIType abs(genFIType const & x); genType abs(genType 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 genType Floating-point or signed integer; scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genFIType> template <typename genType>
genFIType sign(genFIType const & x); genType sign(genType 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
genType floor(genType const & x); genType floor(genType const & x);
//! 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
genType trunc(genType const & x); genType trunc(genType const & x);
//! Returns a value equal to the nearest integer to x. /// Returns a value equal to the nearest integer to x.
//! The fraction 0.5 will round in a direction chosen by the /// The fraction 0.5 will round in a direction chosen by the
//! 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
genType round(genType const & x); genType round(genType const & x);
//! 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
genType roundEven(genType const & x); genType roundEven(genType const & x);
//! 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
genType ceil(genType const & x); genType ceil(genType const & x);
//! Return x - floor(x). /// Return x - floor(x).
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
genType fract(genType const & x); genType fract(genType const & x);
//! Modulus. Returns x - y * floor(x / y) /// Modulus. Returns x - y * floor(x / y)
//! for each component in x using the floating point value y. /// for each component in x using the floating point value y.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
@ -117,9 +135,11 @@ namespace glm
genType const & x, genType const & x,
genType const & y); genType const & y);
//! Modulus. Returns x - y * floor(x / y) /// Modulus. Returns x - y * floor(x / y)
//! for each component in x using the floating point value y. /// for each component in x using the floating point value y.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
@ -127,11 +147,13 @@ namespace glm
genType const & x, genType const & x,
typename genType::value_type const & y); typename genType::value_type 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
//! return value and the output parameter will have the same /// return value and the output parameter will have the same
//! sign as x. /// sign as x.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
@ -140,6 +162,8 @@ namespace glm
genType & i); genType & i);
/// Returns y if y < x; otherwise, it returns x. /// Returns y if y < x; otherwise, it returns x.
///
/// @tparam genType Floating-point or integer; scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
@ -154,6 +178,8 @@ namespace glm
typename genType::value_type const & y); typename genType::value_type const & y);
/// Returns y if x < y; otherwise, it returns x. /// Returns y if x < y; otherwise, it returns x.
///
/// @tparam genType Floating-point or integer; scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
@ -167,9 +193,11 @@ namespace glm
genType const & x, genType const & x,
typename genType::value_type const & y); typename genType::value_type const & y);
//! Returns min(max(x, minVal), maxVal) for each component in x /// Returns min(max(x, minVal), maxVal) for each component in x
//! using the floating-point values minVal and maxVal. /// using the floating-point values minVal and maxVal.
//! ///
/// @tparam genType Floating-point or integer; scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
@ -243,16 +271,18 @@ namespace glm
typename genType::value_type const & edge, typename genType::value_type const & edge,
genType const & x); genType const & x);
//! Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and /// Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and
//! performs smooth Hermite interpolation between 0 and 1 /// performs smooth Hermite interpolation between 0 and 1
//! when edge0 < x < edge1. This is useful in cases where /// when edge0 < x < edge1. This is useful in cases where
//! you would want a threshold function with a smooth /// you would want a threshold function with a smooth
//! transition. This is equivalent to: /// transition. This is equivalent to:
//! genType t; /// genType t;
//! t = clamp ((x edge0) / (edge1 edge0), 0, 1); /// t = clamp ((x edge0) / (edge1 edge0), 0, 1);
//! return t * t * (3 2 * t); /// return t * t * (3 2 * t);
//! Results are undefined if edge0 >= edge1. /// Results are undefined if edge0 >= edge1.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
@ -267,97 +297,123 @@ namespace glm
typename genType::value_type const & edge1, typename genType::value_type const & edge1,
genType const & x); genType const & x);
//! Returns true if x holds a NaN (not a number) /// Returns true if x holds a NaN (not a number)
//! representation in the underlying implementation's set of /// representation in the underlying implementation's set of
//! floating point representations. Returns false otherwise, /// floating point representations. Returns false otherwise,
//! including for implementations with no NaN /// including for implementations with no NaN
//! representations. /// representations.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
typename genType::bool_type isnan(genType const & x); typename genType::bool_type isnan(genType const & x);
//! Returns true if x holds a positive infinity or negative /// Returns true if x holds a positive infinity or negative
//! infinity representation in the underlying implementation's /// infinity representation in the underlying implementation's
//! set of floating point representations. Returns false /// set of floating point representations. Returns false
//! otherwise, including for implementations with no infinity /// otherwise, including for implementations with no infinity
//! representations. /// representations.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
typename genType::bool_type isinf(genType const & x); typename genType::bool_type isinf(genType const & x);
//! Returns a signed integer value representing /// Returns a signed integer value representing
//! the encoding of a floating-point value. The floatingpoint /// the encoding of a floating-point value. The floatingpoint
//! value's bit-level representation is preserved. /// value's bit-level representation is preserved.
//! ///
/// @tparam genType Single-precision floating-point scalar or vector types.
/// @tparam genIType Signed integer scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genIType> template <typename genType, typename genIType>
genIType floatBitsToInt(genType const & value); genIType floatBitsToInt(genType const & value);
//! 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 genType Single-precision floating-point scalar or vector types.
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genUType> template <typename genType, typename genUType>
genUType floatBitsToUint(genType const & value); genUType floatBitsToUint(genType const & value);
//! Returns a floating-point value corresponding to a signed /// Returns a floating-point value corresponding to a signed
//! integer encoding of a floating-point value. /// integer encoding of a floating-point value.
//! If an inf or NaN is passed in, it will not signal, and the /// If an inf or NaN is passed in, it will not signal, and the
//! 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 genType Single-precision floating-point scalar or vector types.
/// @tparam genIType Signed integer scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
///
/// @todo - Clarify this declaration, we don't need to actually specify the return type
template <typename genType, typename genIType> template <typename genType, typename genIType>
genType intBitsToFloat(genIType const & value); genType intBitsToFloat(genIType const & value);
//! Returns a floating-point value corresponding to a /// Returns a floating-point value corresponding to a
//! unsigned integer encoding of a floating-point value. /// unsigned integer encoding of a floating-point value.
//! If an inf or NaN is passed in, it will not signal, and the /// If an inf or NaN is passed in, it will not signal, and the
//! 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 genType Single-precision floating-point scalar or vector types.
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
///
/// @todo - Clarify this declaration, we don't need to actually specify the return type
template <typename genType, typename genUType> template <typename genType, typename genUType>
genType uintBitsToFloat(genUType const & value); genType uintBitsToFloat(genUType const & value);
//! Computes and returns a * b + c. /// Computes and returns a * b + c.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType> template <typename genType>
genType fma(genType const & a, genType const & b, genType const & c); genType fma(genType const & a, genType const & b, genType const & c);
//! Splits x into a floating-point significand in the range /// Splits x into a floating-point significand in the range
//! [0.5, 1.0) and an integral exponent of two, such that: /// [0.5, 1.0) and an integral exponent of two, such that:
//! x = significand * exp(2, exponent) /// x = significand * exp(2, exponent)
//! ///
//! The significand is returned by the function and the /// The significand is returned by the function and the
//! exponent is returned in the parameter exp. For a /// exponent is returned in the parameter exp. For a
//! floating-point value of zero, the significant and exponent /// floating-point value of zero, the significant and exponent
//! are both zero. For a floating-point value that is an /// are both zero. For a floating-point value that is an
//! infinity or is not a number, the results are undefined. /// infinity or is not a number, the results are undefined.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/frexp.xml">GLSL frexp man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genIType> template <typename genType, typename genIType>
genType frexp(genType const & x, genIType & exp); genType frexp(genType const & x, genIType & exp);
//! Builds a floating-point number from x and the /// Builds a floating-point number from x and the
//! corresponding integral exponent of two in exp, returning: /// corresponding integral exponent of two in exp, returning:
//! significand * exp(2, exponent) /// significand * exp(2, exponent)
//! ///
//! If this product is too large to be represented in the /// If this product is too large to be represented in the
//! floating-point type, the result is undefined. /// floating-point type, the result is undefined.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>; /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ldexp.xml">GLSL ldexp man page</a>;
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3</a>
template <typename genType, typename genIType> template <typename genType, typename genIType>

View File

@ -42,6 +42,9 @@ namespace glm
/// @{ /// @{
/// Returns x raised to the y power. /// Returns x raised to the y power.
///
/// @param x pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/pow.xml">GLSL pow man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
@ -49,6 +52,9 @@ namespace glm
genType pow(genType const & x, genType const & y); genType pow(genType const & x, genType const & y);
/// Returns the natural exponentiation of x, i.e., e^x. /// Returns the natural exponentiation of x, i.e., e^x.
///
/// @param x exp function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp.xml">GLSL exp man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
@ -58,6 +64,9 @@ namespace glm
/// Returns the natural logarithm of x, i.e., /// Returns the natural logarithm of x, i.e.,
/// returns the value y which satisfies the equation x = e^y. /// returns the value y which satisfies the equation x = e^y.
/// Results are undefined if x <= 0. /// Results are undefined if x <= 0.
///
/// @param x log function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log.xml">GLSL log man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
@ -65,6 +74,9 @@ namespace glm
genType log(genType const & x); genType log(genType const & x);
/// Returns 2 raised to the x power. /// Returns 2 raised to the x power.
///
/// @param x exp2 function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/exp2.xml">GLSL exp2 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
@ -74,6 +86,9 @@ namespace glm
/// Returns the base 2 log of x, i.e., returns the value y, /// Returns the base 2 log of x, i.e., returns the value y,
/// which satisfies the equation x = 2 ^ y. /// which satisfies the equation x = 2 ^ y.
/// ///
/// @param x log2 function is defined for input values of x defined in the range (0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/log2.xml">GLSL log2 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType> template <typename genType>
@ -81,6 +96,9 @@ namespace glm
/// Returns the positive square root of x. /// Returns the positive square root of x.
/// ///
/// @param x sqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sqrt.xml">GLSL sqrt man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType> template <typename genType>
@ -88,6 +106,9 @@ namespace glm
/// Returns the reciprocal of the positive square root of x. /// Returns the reciprocal of the positive square root of x.
/// ///
/// @param x inversesqrt function is defined for input values of x defined in the range [0, inf+) in the limit of the type precision.
/// @tparam genType Floating-point scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inversesqrt.xml">GLSL inversesqrt man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.2</a>
template <typename genType> template <typename genType>

View File

@ -43,6 +43,8 @@ namespace glm
/// Returns the length of x, i.e., sqrt(x * x). /// Returns the length of x, i.e., sqrt(x * x).
/// ///
/// @tparam genType Floating-point vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/length.xml">GLSL length man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename genType> template <typename genType>
@ -50,6 +52,8 @@ namespace glm
genType const & x); genType const & x);
/// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1).
///
/// @tparam genType Floating-point vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/distance.xml">GLSL distance man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
@ -59,6 +63,8 @@ namespace glm
genType const & p1); genType const & p1);
/// Returns the dot product of x and y, i.e., result = x * y. /// Returns the dot product of x and y, i.e., result = x * y.
///
/// @tparam genType Floating-point vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/dot.xml">GLSL dot man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
@ -68,13 +74,15 @@ namespace glm
genType const & y); genType const & y);
/// Returns the cross product of x and y. /// Returns the cross product of x and y.
///
/// @tparam valType Floating-point scalar types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/cross.xml">GLSL cross man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
template <typename T> template <typename valType>
detail::tvec3<T> cross( detail::tvec3<valType> cross(
detail::tvec3<T> const & x, detail::tvec3<valType> const & x,
detail::tvec3<T> const & y); detail::tvec3<valType> const & y);
/// Returns a vector in the same direction as x but with length of 1. /// Returns a vector in the same direction as x but with length of 1.
/// ///
@ -85,6 +93,8 @@ namespace glm
genType const & x); genType const & x);
/// If dot(Nref, I) < 0.0, return N, otherwise, return -N. /// If dot(Nref, I) < 0.0, return N, otherwise, return -N.
///
/// @tparam genType Floating-point vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/faceforward.xml">GLSL faceforward man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
@ -96,6 +106,8 @@ namespace glm
/// For the incident vector I and surface orientation N, /// For the incident vector I and surface orientation N,
/// returns the reflection direction : result = I - 2.0 * dot(N, I) * N. /// returns the reflection direction : result = I - 2.0 * dot(N, I) * N.
///
/// @tparam genType Floating-point vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/reflect.xml">GLSL reflect man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>
@ -107,6 +119,8 @@ namespace glm
/// For the incident vector I and surface normal N, /// For the incident vector I and surface normal N,
/// and the ratio of indices of refraction eta, /// and the ratio of indices of refraction eta,
/// return the refraction vector. /// return the refraction vector.
///
/// @tparam genType Floating-point vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/refract.xml">GLSL refract man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.5</a>

View File

@ -43,10 +43,12 @@ namespace glm
/// @addtogroup core_func_integer /// @addtogroup core_func_integer
/// @{ /// @{
//! Adds 32-bit unsigned integer x and y, returning the sum /// Adds 32-bit unsigned integer x and y, returning the sum
//! modulo pow(2, 32). The value carry is set to 0 if the sum was /// modulo pow(2, 32). The value carry is set to 0 if the sum was
//! less than pow(2, 32), or to 1 otherwise. /// less than pow(2, 32), or to 1 otherwise.
//! ///
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uaddCarry.xml">GLSL uaddCarry man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genUType> template <typename genUType>
@ -55,10 +57,12 @@ namespace glm
genUType const & y, genUType const & y,
genUType & carry); genUType & carry);
//! Subtracts the 32-bit unsigned integer y from x, returning /// Subtracts the 32-bit unsigned integer y from x, returning
//! the difference if non-negative, or pow(2, 32) plus the difference /// the difference if non-negative, or pow(2, 32) plus the difference
//! otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise. /// otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise.
//! ///
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/usubBorrow.xml">GLSL usubBorrow man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genUType> template <typename genUType>
@ -67,10 +71,12 @@ namespace glm
genUType const & y, genUType const & y,
genUType & borrow); genUType & borrow);
//! Multiplies 32-bit integers x and y, producing a 64-bit /// Multiplies 32-bit integers x and y, producing a 64-bit
//! result. The 32 least-significant bits are returned in lsb. /// result. The 32 least-significant bits are returned in lsb.
//! The 32 most-significant bits are returned in msb. /// The 32 most-significant bits are returned in msb.
//! ///
/// @tparam genUType Unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/umulExtended.xml">GLSL umulExtended man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genUType> template <typename genUType>
@ -80,10 +86,12 @@ namespace glm
genUType & msb, genUType & msb,
genUType & lsb); genUType & lsb);
//! Multiplies 32-bit integers x and y, producing a 64-bit /// Multiplies 32-bit integers x and y, producing a 64-bit
//! result. The 32 least-significant bits are returned in lsb. /// result. The 32 least-significant bits are returned in lsb.
//! The 32 most-significant bits are returned in msb. /// The 32 most-significant bits are returned in msb.
//! ///
/// @tparam genIType Signed integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/imulExtended.xml">GLSL imulExtended man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIType> template <typename genIType>
@ -93,17 +101,19 @@ namespace glm
genIType & msb, genIType & msb,
genIType & lsb); genIType & lsb);
//! Extracts bits [offset, offset + bits - 1] from value, /// Extracts bits [offset, offset + bits - 1] from value,
//! returning them in the least significant bits of the result. /// returning them in the least significant bits of the result.
//! For unsigned data types, the most significant bits of the /// For unsigned data types, the most significant bits of the
//! result will be set to zero. For signed data types, the /// result will be set to zero. For signed data types, the
//! most significant bits will be set to the value of bit offset + base 1. /// most significant bits will be set to the value of bit offset + base 1.
//! ///
//! If bits is zero, the result will be zero. The result will be /// If bits is zero, the result will be zero. The result will be
//! undefined if offset or bits is negative, or if the sum of /// undefined if offset or bits is negative, or if the sum of
//! offset and bits is greater than the number of bits used /// offset and bits is greater than the number of bits used
//! to store the operand. /// to store the operand.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldExtract.xml">GLSL bitfieldExtract man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIUType> template <typename genIUType>
@ -112,16 +122,18 @@ namespace glm
int const & Offset, int const & Offset,
int const & Bits); int const & Bits);
//! Returns the insertion the bits least-significant bits of insert into base. /// Returns the insertion the bits least-significant bits of insert into base.
//! ///
//! The result will have bits [offset, offset + bits - 1] taken /// The result will have bits [offset, offset + bits - 1] taken
//! from bits [0, bits 1] of insert, and all other bits taken /// from bits [0, bits 1] of insert, and all other bits taken
//! directly from the corresponding bits of base. If bits is /// directly from the corresponding bits of base. If bits is
//! zero, the result will simply be base. The result will be /// zero, the result will simply be base. The result will be
//! undefined if offset or bits is negative, or if the sum of /// undefined if offset or bits is negative, or if the sum of
//! offset and bits is greater than the number of bits used to /// offset and bits is greater than the number of bits used to
//! store the operand. /// store the operand.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldInsert.xml">GLSL bitfieldInsert man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIUType> template <typename genIUType>
@ -131,40 +143,54 @@ namespace glm
int const & Offset, int const & Offset,
int const & Bits); int const & Bits);
//! Returns the reversal of the bits of value. /// Returns the reversal of the bits of value.
//! The bit numbered n of the result will be taken from bit (bits - 1) - n of value, /// The bit numbered n of the result will be taken from bit (bits - 1) - n of value,
//! where bits is the total number of bits used to represent value. /// where bits is the total number of bits used to represent value.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitfieldReverse.xml">GLSL bitfieldReverse man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename genIUType> template <typename genIUType>
genIUType bitfieldReverse(genIUType const & value); genIUType bitfieldReverse(genIUType const & value);
//! Returns the number of bits set to 1 in the binary representation of value. /// Returns the number of bits set to 1 in the binary representation of value.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/bitCount.xml">GLSL bitCount man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename T, template <typename> class C> ///
typename C<T>::signed_type bitCount(C<T> const & Value); /// @todo Clarify the declaration to specify that scalars are suported.
template <typename T, template <typename> class genIUType>
typename genIUType<T>::signed_type bitCount(genIUType<T> const & Value);
//! Returns the bit number of the least significant bit set to /// Returns the bit number of the least significant bit set to
//! 1 in the binary representation of value. /// 1 in the binary representation of value.
//! If value is zero, -1 will be returned. /// If value is zero, -1 will be returned.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findLSB.xml">GLSL findLSB man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename T, template <typename> class C> ///
typename C<T>::signed_type findLSB(C<T> const & Value); /// @todo Clarify the declaration to specify that scalars are suported.
template <typename T, template <typename> class genIUType>
typename genIUType<T>::signed_type findLSB(genIUType<T> const & Value);
//! Returns the bit number of the most significant bit in the binary representation of value. /// Returns the bit number of the most significant bit in the binary representation of value.
//! For positive integers, the result will be the bit number of the most significant bit set to 1. /// For positive integers, the result will be the bit number of the most significant bit set to 1.
//! For negative integers, the result will be the bit number of the most significant /// For negative integers, the result will be the bit number of the most significant
//! bit set to 0. For a value of zero or negative one, -1 will be returned. /// bit set to 0. For a value of zero or negative one, -1 will be returned.
//! ///
/// @tparam genIUType Signed or unsigned integer scalar or vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/findMSB.xml">GLSL findMSB man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.8</a>
template <typename T, template <typename> class C> ///
typename C<T>::signed_type findMSB(C<T> const & Value); /// @todo Clarify the declaration to specify that scalars are suported.
template <typename T, template <typename> class genIUType>
typename genIUType<T>::signed_type findMSB(genIUType<T> const & Value);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -47,6 +47,8 @@ namespace glm
/// Multiply matrix x by matrix y component-wise, i.e., /// Multiply matrix x by matrix y component-wise, i.e.,
/// result[i][j] is the scalar product of x[i][j] and y[i][j]. /// result[i][j] is the scalar product of x[i][j] and y[i][j].
///
/// @tparam matType Floating-point matrix types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/matrixCompMult.xml">GLSL matrixCompMult man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
@ -58,15 +60,21 @@ namespace glm
/// Treats the first parameter c as a column vector /// Treats the first parameter c as a column vector
/// and the second parameter r as a row vector /// and the second parameter r as a row vector
/// and does a linear algebraic matrix multiply c * r. /// and does a linear algebraic matrix multiply c * r.
///
/// @tparam matType Floating-point matrix types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/outerProduct.xml">GLSL outerProduct man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
///
/// @todo Clarify the declaration to specify that matType doesn't have to be provided when used.
template <typename vecType, typename matType> template <typename vecType, typename matType>
matType outerProduct( matType outerProduct(
vecType const & c, vecType const & c,
vecType const & r); vecType const & r);
/// Returns the transposed matrix of x /// Returns the transposed matrix of x
///
/// @tparam matType Floating-point matrix types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/transpose.xml">GLSL transpose man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
@ -75,52 +83,64 @@ namespace glm
matType const & x); matType const & x);
/// Return the determinant of a mat2 matrix. /// Return the determinant of a mat2 matrix.
///
/// @tparam valType Floating-point scalar types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T> template <typename valType>
typename detail::tmat2x2<T>::value_type determinant( typename detail::tmat2x2<valType>::value_type determinant(
detail::tmat2x2<T> const & m); detail::tmat2x2<valType> const & m);
/// Return the determinant of a mat3 matrix. /// Return the determinant of a mat3 matrix.
///
/// @tparam valType Floating-point scalar types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T> template <typename valType>
typename detail::tmat3x3<T>::value_type determinant( typename detail::tmat3x3<valType>::value_type determinant(
detail::tmat3x3<T> const & m); detail::tmat3x3<valType> const & m);
/// Return the determinant of a mat4 matrix. /// Return the determinant of a mat4 matrix.
///
/// @tparam valType Floating-point scalar types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/determinant.xml">GLSL determinant man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T> template <typename valType>
typename detail::tmat4x4<T>::value_type determinant( typename detail::tmat4x4<valType>::value_type determinant(
detail::tmat4x4<T> const & m); detail::tmat4x4<valType> const & m);
/// Return the inverse of a mat2 matrix. /// Return the inverse of a mat2 matrix.
///
/// @tparam valType Floating-point scalar types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T> template <typename valType>
detail::tmat2x2<T> inverse( detail::tmat2x2<valType> inverse(
detail::tmat2x2<T> const & m); detail::tmat2x2<valType> const & m);
/// Return the inverse of a mat3 matrix. /// Return the inverse of a mat3 matrix.
///
/// @tparam valType Floating-point scalar types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T> template <typename valType>
detail::tmat3x3<T> inverse( detail::tmat3x3<valType> inverse(
detail::tmat3x3<T> const & m); detail::tmat3x3<valType> const & m);
/// Return the inverse of a mat4 matrix. /// Return the inverse of a mat4 matrix.
///
/// @tparam valType Floating-point scalar types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/inverse.xml">GLSL inverse man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.6</a>
template <typename T> template <typename valType>
detail::tmat4x4<T> inverse( detail::tmat4x4<valType> inverse(
detail::tmat4x4<T> const & m); detail::tmat4x4<valType> const & m);
/// @} /// @}
}//namespace glm }//namespace glm

View File

@ -44,6 +44,8 @@ namespace glm
/// @{ /// @{
/// Returns a 1D noise value based on the input value x. /// Returns a 1D noise value based on the input value x.
///
/// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise1.xml">GLSL noise1 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a>
@ -51,6 +53,8 @@ namespace glm
typename genType::value_type noise1(genType const & x); typename genType::value_type noise1(genType const & x);
/// Returns a 2D noise value based on the input value x. /// Returns a 2D noise value based on the input value x.
///
/// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise2.xml">GLSL noise2 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a>
@ -58,6 +62,8 @@ namespace glm
detail::tvec2<typename genType::value_type> noise2(genType const & x); detail::tvec2<typename genType::value_type> noise2(genType const & x);
/// Returns a 3D noise value based on the input value x. /// Returns a 3D noise value based on the input value x.
///
/// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise3.xml">GLSL noise3 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a>
@ -65,6 +71,8 @@ namespace glm
detail::tvec3<typename genType::value_type> noise3(genType const & x); detail::tvec3<typename genType::value_type> noise3(genType const & x);
/// Returns a 4D noise value based on the input value x. /// Returns a 4D noise value based on the input value x.
///
/// @tparam genType Floating-point scalar or vector types.
/// ///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/noise4.xml">GLSL noise4 man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.13</a>

View File

@ -45,119 +45,149 @@ namespace glm
/// @addtogroup core_func_trigonometric /// @addtogroup core_func_trigonometric
/// @{ /// @{
//! Converts degrees to radians and returns the result. /// Converts degrees to radians and returns the result.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType radians(genType const & degrees); genType radians(genType const & degrees);
//! Converts radians to degrees and returns the result. /// Converts radians to degrees and returns the result.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType degrees(genType const & radians); genType degrees(genType 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType sin(genType const & angle); genType sin(genType 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType cos(genType const & angle); genType cos(genType const & angle);
//! The standard trigonometric tangent function. /// The standard trigonometric tangent function.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType tan(genType const & angle); genType tan(genType 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].
//! Results are undefined if |x| > 1. /// Results are undefined if |x| > 1.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType asin(genType const & x); genType asin(genType 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType acos(genType const & x); genType acos(genType 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
//! quadrant the angle is in. The range of values returned /// quadrant the angle is in. The range of values returned
//! 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType atan(genType const & y, genType const & x); genType atan(genType const & y, genType 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType atan(genType const & y_over_x); genType atan(genType 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType sinh(genType const & angle); genType sinh(genType const & angle);
//! Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType cosh(genType const & angle); genType cosh(genType const & angle);
//! Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType tanh(genType const & angle); genType tanh(genType const & angle);
//! Arc hyperbolic sine; returns the inverse of sinh. /// Arc hyperbolic sine; returns the inverse of sinh.
//! ///
/// @tparam genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType asinh(genType const & x); genType asinh(genType 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>
genType acosh(genType const & x); genType acosh(genType 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 genType Floating-point scalar or vector types.
///
/// @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</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.1</a>
template <typename genType> template <typename genType>

View File

@ -48,65 +48,83 @@ namespace glm
/// @addtogroup core_func_vector_relational /// @addtogroup core_func_vector_relational
/// @{ /// @{
//! Returns the component-wise comparison result of x < y. /// Returns the component-wise comparison result of x < y.
//! ///
/// @tparam vecType Floating-point or integer vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
//template <typename T, template <typename> class vecType> template <typename vecType>
//GLM_FUNC_QUALIFIER typename vecType<T>::bool_type lessThan(vecType<T> const & x, vecType<T> const & y); GLM_FUNC_QUALIFIER typename vecType::bool_type lessThan(vecType const & x, vecType const & y);
//! Returns the component-wise comparison of result x <= y. /// Returns the component-wise comparison of result x <= y.
//! ///
/// @tparam vecType Floating-point or integer vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <typename T, template <typename> class vecType> template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type lessThanEqual(vecType<T> const & x, vecType<T> const & y); GLM_FUNC_QUALIFIER typename vecType<T>::bool_type lessThanEqual(vecType<T> const & x, vecType<T> const & y);
//! Returns the component-wise comparison of result x > y. /// Returns the component-wise comparison of result x > y.
//! ///
/// @tparam vecType Floating-point or integer vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <typename T, template <typename> class vecType> template <typename T, template <typename> class vecType>
GLM_FUNC_QUALIFIER typename vecType<T>::bool_type greaterThan(vecType<T> const & x, vecType<T> const & y); GLM_FUNC_QUALIFIER typename vecType<T>::bool_type greaterThan(vecType<T> const & x, vecType<T> const & y);
//! Returns the component-wise comparison of result x >= y. /// Returns the component-wise comparison of result x >= y.
//! ///
/// @tparam vecType Floating-point or integer vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <typename T, template <typename> class vecType> template <typename T, template <typename> class vecType>
typename vecType<T>::bool_type greaterThanEqual(vecType<T> const & x, vecType<T> const & y); typename vecType<T>::bool_type greaterThanEqual(vecType<T> const & x, vecType<T> const & y);
//! Returns the component-wise comparison of result x == y. /// Returns the component-wise comparison of result x == y.
//! ///
/// @tparam vecType Floating-point, integer or boolean vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
//template <typename T, template <typename> class vecType> template <typename T, template <typename> class vecType>
//GLM_FUNC_QUALIFIER typename vecType<T>::bool_type equal(vecType<T> const & x, vecType<T> const & y); GLM_FUNC_QUALIFIER typename vecType<T>::bool_type equal(vecType<T> const & x, vecType<T> const & y);
//! Returns the component-wise comparison of result x != y. /// Returns the component-wise comparison of result x != y.
//! ///
/// @tparam vecType Floating-point, integer or boolean vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <typename T, template <typename> class vecType> template <typename T, template <typename> class vecType>
typename vecType<T>::bool_type notEqual(vecType<T> const & x, vecType<T> const & y); typename vecType<T>::bool_type notEqual(vecType<T> const & x, vecType<T> const & y);
//! Returns true if any component of x is true. /// Returns true if any component of x is true.
//! ///
/// @tparam vecType Boolean vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <template <typename> class vecType> template <template <typename> class vecType>
bool any(vecType<bool> const & v); bool any(vecType<bool> const & v);
//! Returns true if all components of x are true. /// Returns true if all components of x are true.
//! ///
/// @tparam vecType Boolean vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <template <typename> class vecType> template <template <typename> class vecType>
bool all(vecType<bool> const & v); bool all(vecType<bool> const & v);
//! Returns the component-wise logical complement of x. /// Returns the component-wise logical complement of x.
//! /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
//! ///
/// @tparam vecType Boolean vector types.
///
/// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a> /// @see - <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a>
/// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a> /// @see - <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7</a>
template <template <typename> class vecType> template <template <typename> class vecType>

View File

@ -62,7 +62,7 @@ namespace glm
//! Faster than the common pow function but less accurate. //! Faster than the common pow function but less accurate.
//! From GLM_GTX_fast_exponential extension. //! From GLM_GTX_fast_exponential extension.
template <typename genTypeT, typename genTypeU> template <typename genTypeT, typename genTypeU>
genType fastPow( genTypeT fastPow(
genTypeT const & x, genTypeT const & x,
genTypeU const & y); genTypeU const & y);