1.0.0 API documentation
Functions
GLM_EXT_vector_common

Functions

template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > clamp (vec< L, T, Q > const &Texcoord)
 Simulate GL_CLAMP OpenGL wrap mode. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fclamp (vec< L, T, Q > const &x, T minVal, T maxVal)
 Returns min(max(x, minVal), maxVal) for each component in x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fclamp (vec< L, T, Q > const &x, vec< L, T, Q > const &minVal, vec< L, T, Q > const &maxVal)
 Returns min(max(x, minVal), maxVal) for each component in x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fmax (vec< L, T, Q > const &a, T b)
 Returns y if x < y; otherwise, it returns x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fmax (vec< L, T, Q > const &a, vec< L, T, Q > const &b)
 Returns y if x < y; otherwise, it returns x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fmax (vec< L, T, Q > const &a, vec< L, T, Q > const &b, vec< L, T, Q > const &c)
 Returns y if x < y; otherwise, it returns x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fmax (vec< L, T, Q > const &a, vec< L, T, Q > const &b, vec< L, T, Q > const &c, vec< L, T, Q > const &d)
 Returns y if x < y; otherwise, it returns x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fmin (vec< L, T, Q > const &a, vec< L, T, Q > const &b, vec< L, T, Q > const &c)
 Returns y if y < x; otherwise, it returns x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fmin (vec< L, T, Q > const &a, vec< L, T, Q > const &b, vec< L, T, Q > const &c, vec< L, T, Q > const &d)
 Returns y if y < x; otherwise, it returns x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fmin (vec< L, T, Q > const &x, T y)
 Returns y if y < x; otherwise, it returns x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > fmin (vec< L, T, Q > const &x, vec< L, T, Q > const &y)
 Returns y if y < x; otherwise, it returns x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, int, Q > iround (vec< L, T, Q > const &x)
 Returns a value equal to the nearest integer to x. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > max (vec< L, T, Q > const &x, vec< L, T, Q > const &y, vec< L, T, Q > const &z)
 Return the maximum component-wise values of 3 inputs. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > max (vec< L, T, Q > const &x, vec< L, T, Q > const &y, vec< L, T, Q > const &z, vec< L, T, Q > const &w)
 Return the maximum component-wise values of 4 inputs. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > min (vec< L, T, Q > const &a, vec< L, T, Q > const &b, vec< L, T, Q > const &c)
 Return the minimum component-wise values of 3 inputs. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL GLM_CONSTEXPR vec< L, T, Q > min (vec< L, T, Q > const &a, vec< L, T, Q > const &b, vec< L, T, Q > const &c, vec< L, T, Q > const &d)
 Return the minimum component-wise values of 4 inputs. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > mirrorClamp (vec< L, T, Q > const &Texcoord)
 Simulate GL_MIRRORED_REPEAT OpenGL wrap mode. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > mirrorRepeat (vec< L, T, Q > const &Texcoord)
 Simulate GL_MIRROR_REPEAT OpenGL wrap mode. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, T, Q > repeat (vec< L, T, Q > const &Texcoord)
 Simulate GL_REPEAT OpenGL wrap mode. More...
 
template<length_t L, typename T , qualifier Q>
GLM_FUNC_DECL vec< L, uint, Q > uround (vec< L, T, Q > const &x)
 Returns a value equal to the nearest integer to x. More...
 

Detailed Description

Exposes min and max functions for 3 to 4 vector parameters.

Include <glm/ext/vector_common.hpp> to use the features of this extension.

See also
core_common
GLM_EXT_scalar_common

Function Documentation

◆ clamp()

GLM_FUNC_DECL vec<L, T, Q> glm::clamp ( vec< L, T, Q > const &  Texcoord)

Simulate GL_CLAMP OpenGL wrap mode.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
GLM_EXT_vector_common extension.

◆ fclamp() [1/2]

GLM_FUNC_DECL vec<L, T, Q> glm::fclamp ( vec< L, T, Q > const &  x,
minVal,
maxVal 
)

Returns min(max(x, minVal), maxVal) for each component in x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
GLM_EXT_vector_common

◆ fclamp() [2/2]

GLM_FUNC_DECL vec<L, T, Q> glm::fclamp ( vec< L, T, Q > const &  x,
vec< L, T, Q > const &  minVal,
vec< L, T, Q > const &  maxVal 
)

Returns min(max(x, minVal), maxVal) for each component in x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
GLM_EXT_vector_common

◆ fmax() [1/4]

GLM_FUNC_DECL vec<L, T, Q> glm::fmax ( vec< L, T, Q > const &  a,
b 
)

Returns y if x < y; otherwise, it returns x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
std::fmax documentation

◆ fmax() [2/4]

GLM_FUNC_DECL vec<L, T, Q> glm::fmax ( vec< L, T, Q > const &  a,
vec< L, T, Q > const &  b 
)

Returns y if x < y; otherwise, it returns x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
std::fmax documentation

◆ fmax() [3/4]

GLM_FUNC_DECL vec<L, T, Q> glm::fmax ( vec< L, T, Q > const &  a,
vec< L, T, Q > const &  b,
vec< L, T, Q > const &  c 
)

Returns y if x < y; otherwise, it returns x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
std::fmax documentation

◆ fmax() [4/4]

GLM_FUNC_DECL vec<L, T, Q> glm::fmax ( vec< L, T, Q > const &  a,
vec< L, T, Q > const &  b,
vec< L, T, Q > const &  c,
vec< L, T, Q > const &  d 
)

Returns y if x < y; otherwise, it returns x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
std::fmax documentation

◆ fmin() [1/4]

GLM_FUNC_DECL vec<L, T, Q> glm::fmin ( vec< L, T, Q > const &  a,
vec< L, T, Q > const &  b,
vec< L, T, Q > const &  c 
)

Returns y if y < x; otherwise, it returns x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
std::fmin documentation

◆ fmin() [2/4]

GLM_FUNC_DECL vec<L, T, Q> glm::fmin ( vec< L, T, Q > const &  a,
vec< L, T, Q > const &  b,
vec< L, T, Q > const &  c,
vec< L, T, Q > const &  d 
)

Returns y if y < x; otherwise, it returns x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
std::fmin documentation

◆ fmin() [3/4]

GLM_FUNC_DECL vec<L, T, Q> glm::fmin ( vec< L, T, Q > const &  x,
y 
)

Returns y if y < x; otherwise, it returns x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
std::fmin documentation

◆ fmin() [4/4]

GLM_FUNC_DECL vec<L, T, Q> glm::fmin ( vec< L, T, Q > const &  x,
vec< L, T, Q > const &  y 
)

Returns y if y < x; otherwise, it returns x.

If one of the two arguments is NaN, the value of the other argument is returned.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
std::fmin documentation

◆ iround()

GLM_FUNC_DECL vec<L, int, Q> glm::iround ( vec< L, T, Q > const &  x)

Returns a value equal to the nearest integer to x.

The fraction 0.5 will round in a direction chosen by the implementation, presumably the direction that is fastest.

Parameters
xThe values of the argument must be greater or equal to zero.
Template Parameters
Tfloating point scalar types.
See also
GLSL round man page
GLM_EXT_vector_common extension.

◆ max() [1/2]

GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> glm::max ( vec< L, T, Q > const &  x,
vec< L, T, Q > const &  y,
vec< L, T, Q > const &  z 
)

Return the maximum component-wise values of 3 inputs.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point or integer scalar types
QValue from qualifier enum

◆ max() [2/2]

GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> glm::max ( vec< L, T, Q > const &  x,
vec< L, T, Q > const &  y,
vec< L, T, Q > const &  z,
vec< L, T, Q > const &  w 
)

Return the maximum component-wise values of 4 inputs.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point or integer scalar types
QValue from qualifier enum

◆ min() [1/2]

GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> glm::min ( vec< L, T, Q > const &  a,
vec< L, T, Q > const &  b,
vec< L, T, Q > const &  c 
)

Return the minimum component-wise values of 3 inputs.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point or integer scalar types
QValue from qualifier enum

◆ min() [2/2]

GLM_FUNC_DECL GLM_CONSTEXPR vec<L, T, Q> glm::min ( vec< L, T, Q > const &  a,
vec< L, T, Q > const &  b,
vec< L, T, Q > const &  c,
vec< L, T, Q > const &  d 
)

Return the minimum component-wise values of 4 inputs.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point or integer scalar types
QValue from qualifier enum

◆ mirrorClamp()

GLM_FUNC_DECL vec<L, T, Q> glm::mirrorClamp ( vec< L, T, Q > const &  Texcoord)

Simulate GL_MIRRORED_REPEAT OpenGL wrap mode.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
GLM_EXT_vector_common extension.

◆ mirrorRepeat()

GLM_FUNC_DECL vec<L, T, Q> glm::mirrorRepeat ( vec< L, T, Q > const &  Texcoord)

Simulate GL_MIRROR_REPEAT OpenGL wrap mode.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
GLM_EXT_vector_common extension.

◆ repeat()

GLM_FUNC_DECL vec<L, T, Q> glm::repeat ( vec< L, T, Q > const &  Texcoord)

Simulate GL_REPEAT OpenGL wrap mode.

Template Parameters
LInteger between 1 and 4 included that qualify the dimension of the vector
TFloating-point scalar types
QValue from qualifier enum
See also
GLM_EXT_vector_common extension.

◆ uround()

GLM_FUNC_DECL vec<L, uint, Q> glm::uround ( vec< L, T, Q > const &  x)

Returns a value equal to the nearest integer to x.

The fraction 0.5 will round in a direction chosen by the implementation, presumably the direction that is fastest.

Parameters
xThe values of the argument must be greater or equal to zero.
Template Parameters
Tfloating point scalar types.
See also
GLSL round man page
GLM_EXT_vector_common extension.