|
|
|
@ -54,23 +54,26 @@ namespace glm |
|
|
|
|
template <typename genType> |
|
|
|
|
GLM_FUNC_DECL genType abs(genType x); |
|
|
|
|
|
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
|
GLM_FUNC_DECL vecType<T, P> abs(vecType<T, P> const & x); |
|
|
|
|
|
|
|
|
|
/// 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
|
|
|
|
template <typename genType> |
|
|
|
|
GLM_FUNC_DECL genType sign(genType x); |
|
|
|
|
|
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
|
GLM_FUNC_DECL vecType<T, P> sign(vecType<T, P> const & 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/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
|
|
|
|
template <typename genType> |
|
|
|
|
GLM_FUNC_DECL genType floor(genType x); |
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
|
GLM_FUNC_DECL vecType<T, P> floor(vecType<T, P> const & x); |
|
|
|
|
|
|
|
|
|
/// Returns a value equal to the nearest integer to x
|
|
|
|
|
/// whose absolute value is not larger than the absolute value of x.
|
|
|
|
@ -79,8 +82,8 @@ namespace glm |
|
|
|
|
///
|
|
|
|
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
|
|
|
|
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
|
|
|
|
template <typename genType> |
|
|
|
|
GLM_FUNC_DECL genType trunc(genType x); |
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
|
GLM_FUNC_DECL vecType<T, P> trunc(vecType<T, P> const & x); |
|
|
|
|
|
|
|
|
|
/// Returns a value equal to the nearest integer to x.
|
|
|
|
|
/// The fraction 0.5 will round in a direction chosen by the
|
|
|
|
@ -92,9 +95,9 @@ namespace glm |
|
|
|
|
///
|
|
|
|
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
|
|
|
|
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
|
|
|
|
template <typename genType> |
|
|
|
|
GLM_FUNC_DECL genType round(genType x); |
|
|
|
|
|
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
|
GLM_FUNC_DECL vecType<T, P> round(vecType<T, P> const & x); |
|
|
|
|
|
|
|
|
|
/// Returns a value equal to the nearest integer to x.
|
|
|
|
|
/// A fractional part of 0.5 will round toward the nearest even
|
|
|
|
|
/// integer. (Both 3.5 and 4.5 for x will return 4.0.)
|
|
|
|
@ -104,8 +107,8 @@ namespace glm |
|
|
|
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
|
|
|
|
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
|
|
|
|
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
|
|
|
|
|
template <typename genType> |
|
|
|
|
GLM_FUNC_DECL genType roundEven(genType x); |
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
|
GLM_FUNC_DECL vecType<T, P> roundEven(vecType<T, P> const & x); |
|
|
|
|
|
|
|
|
|
/// Returns a value equal to the nearest integer
|
|
|
|
|
/// that is greater than or equal to x.
|
|
|
|
@ -114,8 +117,8 @@ namespace glm |
|
|
|
|
///
|
|
|
|
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
|
|
|
|
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
|
|
|
|
template <typename genType> |
|
|
|
|
GLM_FUNC_DECL genType ceil(genType x); |
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
|
GLM_FUNC_DECL vecType<T, P> ceil(vecType<T, P> const & x); |
|
|
|
|
|
|
|
|
|
/// Return x - floor(x).
|
|
|
|
|
///
|
|
|
|
@ -126,6 +129,9 @@ namespace glm |
|
|
|
|
template <typename genType> |
|
|
|
|
GLM_FUNC_DECL genType fract(genType x); |
|
|
|
|
|
|
|
|
|
template <typename T, precision P, template <typename, precision> class vecType> |
|
|
|
|
GLM_FUNC_DECL vecType<T, P> fract(vecType<T, P> const & x); |
|
|
|
|
|
|
|
|
|
/// Modulus. Returns x - y * floor(x / y)
|
|
|
|
|
/// for each component in x using the floating point value y.
|
|
|
|
|
///
|
|
|
|
|