|
|
@ -69,24 +69,32 @@ 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.)
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
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.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
genType ceil(genType const & x); |
|
|
|
genType ceil(genType const & x); |
|
|
|
|
|
|
|
|
|
|
|
//! Return x - floor(x).
|
|
|
|
//! Return x - floor(x).
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fract.xml">GLSL fract man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
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.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
genType mod( |
|
|
|
genType mod( |
|
|
|
genType const & x,
|
|
|
|
genType const & x,
|
|
|
@ -94,7 +102,9 @@ namespace glm |
|
|
|
|
|
|
|
|
|
|
|
//! 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.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mod.xml">GLSL mod man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
genType mod( |
|
|
|
genType mod( |
|
|
|
genType const & x,
|
|
|
|
genType const & x,
|
|
|
@ -104,14 +114,18 @@ namespace glm |
|
|
|
//! 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.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/modf.xml">GLSL modf man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
genType modf( |
|
|
|
genType modf( |
|
|
|
genType const & x,
|
|
|
|
genType const & x,
|
|
|
|
genType & i); |
|
|
|
genType & i); |
|
|
|
|
|
|
|
|
|
|
|
//! Returns y if y < x; otherwise, it returns x.
|
|
|
|
//! Returns y if y < x; otherwise, it returns x.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/min.xml">GLSL min man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
genType min( |
|
|
|
genType min( |
|
|
|
genType const & x,
|
|
|
|
genType const & x,
|
|
|
@ -123,7 +137,9 @@ 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.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/max.xml">GLSL max man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
genType max( |
|
|
|
genType max( |
|
|
|
genType const & x,
|
|
|
|
genType const & x,
|
|
|
@ -136,7 +152,9 @@ namespace glm |
|
|
|
|
|
|
|
|
|
|
|
//! 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.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/clamp.xml">GLSL clamp man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
genType clamp( |
|
|
|
genType clamp( |
|
|
|
genType const & x,
|
|
|
|
genType const & x,
|
|
|
@ -166,7 +184,8 @@ namespace glm |
|
|
|
//! genType mix(genType x, genType y, genType(a))
|
|
|
|
//! genType mix(genType x, genType y, genType(a))
|
|
|
|
//! where a is a Boolean vector.
|
|
|
|
//! where a is a Boolean vector.
|
|
|
|
//!
|
|
|
|
//!
|
|
|
|
//! From GLSL 1.30.08 specification, section 8.3
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/mix.xml">GLSL mix man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
//!
|
|
|
|
//!
|
|
|
|
//! \param[in] x Floating point scalar or vector.
|
|
|
|
//! \param[in] x Floating point scalar or vector.
|
|
|
|
//! \param[in] y Floating point scalar or vector.
|
|
|
|
//! \param[in] y Floating point scalar or vector.
|
|
|
@ -177,7 +196,9 @@ namespace glm |
|
|
|
genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a); |
|
|
|
genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a); |
|
|
|
|
|
|
|
|
|
|
|
//! Returns 0.0 if x < edge, otherwise it returns 1.0.
|
|
|
|
//! Returns 0.0 if x < edge, otherwise it returns 1.0.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/step.xml">GLSL step man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
genType step( |
|
|
|
genType step( |
|
|
|
genType const & edge,
|
|
|
|
genType const & edge,
|
|
|
@ -197,7 +218,9 @@ namespace glm |
|
|
|
//! 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.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/smoothstep.xml">GLSL smoothstep man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
genType smoothstep( |
|
|
|
genType smoothstep( |
|
|
|
genType const & edge0,
|
|
|
|
genType const & edge0,
|
|
|
@ -215,7 +238,9 @@ namespace glm |
|
|
|
//! 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.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isnan.xml">GLSL isnan man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
template <typename genType>
|
|
|
|
template <typename genType>
|
|
|
|
typename genType::bool_type isnan(genType const & x); |
|
|
|
typename genType::bool_type isnan(genType const & x); |
|
|
|
|
|
|
|
|
|
|
@ -224,35 +249,56 @@ namespace glm |
|
|
|
//! 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.
|
|
|
|
//! (From GLSL 1.30.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/isinf.xml">GLSL isinf man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 1.30.08 specification, section 8.3
|
|
|
|
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 or unsigned 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.
|
|
|
|
//! (From GLSL 4.00.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToInt.xml">GLSL floatBitsToInt man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 4.00.08 specification, section 8.3
|
|
|
|
template <typename genType, typename genIType> |
|
|
|
template <typename genType, typename genIType> |
|
|
|
genIType floatBitsToInt(genType const & value); |
|
|
|
genIType floatBitsToInt(genType const & value); |
|
|
|
|
|
|
|
|
|
|
|
//! Returns a signed or 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.
|
|
|
|
//! (From GLSL 4.00.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floatBitsToUint.xml">GLSL floatBitsToUint man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 4.00.08 specification, section 8.3
|
|
|
|
template <typename genType, typename genUType> |
|
|
|
template <typename genType, typename genUType> |
|
|
|
genUType floatBitsToInt(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
|
|
|
|
//! or unsigned 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.
|
|
|
|
//! (From GLSL 4.00.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
template <typename genType, typename genIUType> |
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/intBitsToFloat.xml">GLSL intBitsToFloat man page</a>
|
|
|
|
genType intBitsToFloat(genIUType const & value); |
|
|
|
//! \li GLSL 4.00.08 specification, section 8.3
|
|
|
|
|
|
|
|
template <typename genType, typename genIType> |
|
|
|
|
|
|
|
genType intBitsToFloat(genIType const & value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//! Returns a floating-point value corresponding to a
|
|
|
|
|
|
|
|
//! unsigned integer encoding of a floating-point value.
|
|
|
|
|
|
|
|
//! If an inf or NaN is passed in, it will not signal, and the
|
|
|
|
|
|
|
|
//! resulting floating point value is unspecified. Otherwise,
|
|
|
|
|
|
|
|
//! the bit-level representation is preserved.
|
|
|
|
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/uintBitsToFloat.xml">GLSL uintBitsToFloat man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 4.00.08 specification, section 8.3
|
|
|
|
|
|
|
|
template <typename genType, typename genUType> |
|
|
|
|
|
|
|
genType uintBitsToFloat(genUType const & value); |
|
|
|
|
|
|
|
|
|
|
|
//! Computes and returns a * b + c.
|
|
|
|
//! Computes and returns a * b + c.
|
|
|
|
//! (From GLSL 4.00.08 specification, section 8.3)
|
|
|
|
//!
|
|
|
|
|
|
|
|
//! \li <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/fma.xml">GLSL fma man page</a>
|
|
|
|
|
|
|
|
//! \li GLSL 4.00.08 specification, section 8.3
|
|
|
|
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); |
|
|
|
|
|
|
|
|
|
|
|