36 #ifndef GLM_FUNC_COMMON_INCLUDED
37 #define GLM_FUNC_COMMON_INCLUDED
40 #include "precision.hpp"
41 #include "type_int.hpp"
55 template <
typename genType>
56 GLM_FUNC_DECL genType
abs(genType
const & x);
64 template <
typename genType>
65 GLM_FUNC_DECL genType
sign(genType
const & x);
73 template <
typename genType>
74 GLM_FUNC_DECL genType
floor(genType
const & x);
83 template <
typename genType>
84 GLM_FUNC_DECL genType
trunc(genType
const & x);
96 template <
typename genType>
97 GLM_FUNC_DECL genType
round(genType
const & x);
108 template <
typename genType>
109 GLM_FUNC_DECL genType
roundEven(genType
const & x);
118 template <
typename genType>
119 GLM_FUNC_DECL genType
ceil(genType
const & x);
127 template <
typename genType>
128 GLM_FUNC_DECL genType
fract(genType
const & x);
137 template <
typename genType>
138 GLM_FUNC_DECL genType
mod(
149 template <
typename genType>
150 GLM_FUNC_DECL genType
mod(
152 typename genType::value_type
const & y);
163 template <
typename genType>
164 GLM_FUNC_DECL genType
modf(
174 template <
typename genType>
175 GLM_FUNC_DECL genType
min(
179 template <
typename genType>
180 GLM_FUNC_DECL genType
min(
182 typename genType::value_type
const & y);
190 template <
typename genType>
191 GLM_FUNC_DECL genType
max(
195 template <
typename genType>
196 GLM_FUNC_DECL genType
max(
198 typename genType::value_type
const & y);
207 template <
typename genType>
208 GLM_FUNC_DECL genType
clamp(
210 genType
const & minVal,
211 genType
const & maxVal);
213 template <
typename genType, precision P>
214 GLM_FUNC_DECL genType
clamp(
216 typename genType::value_type
const & minVal,
217 typename genType::value_type
const & maxVal);
261 template <
typename genTypeT,
typename genTypeU>
262 GLM_FUNC_DECL genTypeT
mix(
271 template <
typename genType>
272 GLM_FUNC_DECL genType
step(
273 genType
const & edge,
280 template <
template <
typename, precision>
class vecType,
typename T, precision P>
281 GLM_FUNC_DECL vecType<T, P>
step(
283 vecType<T, P>
const & x);
299 template <
typename genType>
301 genType
const & edge0,
302 genType
const & edge1,
305 template <
typename genType>
307 typename genType::value_type
const & edge0,
308 typename genType::value_type
const & edge1,
323 template <
typename genType>
324 GLM_FUNC_DECL
typename genType::bool_type
isnan(genType
const & x);
336 template <
typename genType>
337 GLM_FUNC_DECL
typename genType::bool_type
isinf(genType
const & x);
353 template <
template <
typename, precision>
class vecType, precision P>
354 GLM_FUNC_DECL vecType<int, P>
floatBitsToInt(vecType<float, P>
const & v);
370 template <
template <
typename, precision>
class vecType, precision P>
371 GLM_FUNC_DECL vecType<uint, P>
floatBitsToUint(vecType<float, P>
const & v);
391 template <
template <
typename, precision>
class vecType, precision P>
392 GLM_FUNC_DECL vecType<float, P>
intBitsToFloat(vecType<int, P>
const & v);
412 template <
template <
typename, precision>
class vecType, precision P>
413 GLM_FUNC_DECL vecType<float, P>
uintBitsToFloat(vecType<uint, P>
const & v);
421 template <
typename genType>
422 GLM_FUNC_DECL genType
fma(genType
const & a, genType
const & b, genType
const & c);
438 template <
typename genType,
typename genIType>
439 GLM_FUNC_DECL genType
frexp(genType
const & x, genIType &
exp);
452 template <
typename genType,
typename genIType>
453 GLM_FUNC_DECL genType
ldexp(genType
const & x, genIType
const &
exp);
458 #include "func_common.inl"
460 #endif//GLM_FUNC_COMMON_INCLUDED
GLM_FUNC_DECL genType floor(genType const &x)
Returns a value equal to the nearest integer that is less then or equal to x.
GLM_FUNC_DECL genTypeT mix(genTypeT const &x, genTypeT const &y, genTypeU const &a)
If genTypeU is a floating scalar or vector: Returns x * (1.0 - a) + y * a, i.e., the linear blend of ...
unsigned int uint
Unsigned integer type.
GLM_FUNC_DECL genType mod(genType const &x, genType const &y)
Modulus.
GLM_FUNC_DECL genType modf(genType const &x, genType &i)
Returns the fractional part of x and sets i to the integer part (as a whole number floating point val...
GLM_FUNC_DECL genType exp(genType const &x)
Returns the natural exponentiation of x, i.e., e^x.
GLM_FUNC_DECL genType fract(genType const &x)
Return x - floor(x).
GLM_FUNC_DECL genType ceil(genType const &x)
Returns a value equal to the nearest integer that is greater than or equal to x.
GLM_FUNC_DECL genType::bool_type isnan(genType const &x)
Returns true if x holds a NaN (not a number) representation in the underlying implementation's set of...
GLM_FUNC_DECL genType fma(genType const &a, genType const &b, genType const &c)
Computes and returns a * b + c.
GLM_FUNC_DECL float intBitsToFloat(int const &v)
Returns a floating-point value corresponding to a signed integer encoding of a floating-point value...
GLM_FUNC_DECL genType step(genType const &edge, genType const &x)
Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType.
GLM_FUNC_DECL int floatBitsToInt(float const &v)
Returns a signed integer value representing the encoding of a floating-point value.
GLM_FUNC_DECL genType trunc(genType const &x)
Returns a value equal to the nearest integer to x whose absolute value is not larger than the absolut...
GLM_FUNC_DECL genType roundEven(genType const &x)
Returns a value equal to the nearest integer to x.
GLM_FUNC_DECL genType round(genType const &x)
Returns a value equal to the nearest integer to x.
GLM_FUNC_DECL float uintBitsToFloat(uint const &v)
Returns a floating-point value corresponding to a unsigned integer encoding of a floating-point value...
GLM_FUNC_DECL uint floatBitsToUint(float const &v)
Returns a unsigned integer value representing the encoding of a floating-point value.
GLM_FUNC_DECL genType abs(genType const &x)
Returns x if x >= 0; otherwise, it returns -x.
GLM_FUNC_DECL genType::bool_type isinf(genType const &x)
Returns true if x holds a positive infinity or negative infinity representation in the underlying imp...
GLM_FUNC_DECL genType ldexp(genType const &x, genIType const &exp)
Builds a floating-point number from x and the corresponding integral exponent of two in exp...
GLM_FUNC_DECL genType smoothstep(genType const &edge0, genType const &edge1, genType const &x)
Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and performs smooth Hermite interpolation between 0 a...
GLM_FUNC_DECL genType clamp(genType const &x, genType const &minVal, genType const &maxVal)
Returns min(max(x, minVal), maxVal) for each component in x using the floating-point values minVal an...
GLM_FUNC_DECL genType max(genType const &x, genType const &y)
Returns y if x < y; otherwise, it returns x.
GLM_FUNC_DECL genType sign(genType const &x)
Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
GLM_FUNC_DECL genType min(genType const &x, genType const &y)
Returns y if y < x; otherwise, it returns x.
GLM_FUNC_DECL genType frexp(genType const &x, genIType &exp)
Splits x into a floating-point significand in the range [0.5, 1.0) and an integral exponent of two...