GLM  0.9.5
func_common.hpp
1 
36 #ifndef GLM_FUNC_COMMON_INCLUDED
37 #define GLM_FUNC_COMMON_INCLUDED
38 
39 #include "setup.hpp"
40 #include "_fixes.hpp"
41 
42 namespace glm
43 {
46 
53  template <typename genType>
54  GLM_FUNC_DECL genType abs(genType const & x);
55 
62  template <typename genType>
63  GLM_FUNC_DECL genType sign(genType const & x);
64 
71  template <typename genType>
72  GLM_FUNC_DECL genType floor(genType const & x);
73 
81  template <typename genType>
82  GLM_FUNC_DECL genType trunc(genType const & x);
83 
94  template <typename genType>
95  GLM_FUNC_DECL genType round(genType const & x);
96 
106  template <typename genType>
107  GLM_FUNC_DECL genType roundEven(genType const & x);
108 
116  template <typename genType>
117  GLM_FUNC_DECL genType ceil(genType const & x);
118 
125  template <typename genType>
126  GLM_FUNC_DECL genType fract(genType const & x);
127 
135  template <typename genType>
136  GLM_FUNC_DECL genType mod(
137  genType const & x,
138  genType const & y);
139 
147  template <typename genType>
148  GLM_FUNC_DECL genType mod(
149  genType const & x,
150  typename genType::value_type const & y);
151 
161  template <typename genType>
162  GLM_FUNC_DECL genType modf(
163  genType const & x,
164  genType & i);
165 
172  template <typename genType>
173  GLM_FUNC_DECL genType min(
174  genType const & x,
175  genType const & y);
176 
177  template <typename genType>
178  GLM_FUNC_DECL genType min(
179  genType const & x,
180  typename genType::value_type const & y);
181 
188  template <typename genType>
189  GLM_FUNC_DECL genType max(
190  genType const & x,
191  genType const & y);
192 
193  template <typename genType>
194  GLM_FUNC_DECL genType max(
195  genType const & x,
196  typename genType::value_type const & y);
197 
205  template <typename genType>
206  GLM_FUNC_DECL genType clamp(
207  genType const & x,
208  genType const & minVal,
209  genType const & maxVal);
210 
211  template <typename genType, precision P>
212  GLM_FUNC_DECL genType clamp(
213  genType const & x,
214  typename genType::value_type const & minVal,
215  typename genType::value_type const & maxVal);
216 
259  template <typename genTypeT, typename genTypeU>
260  GLM_FUNC_DECL genTypeT mix(
261  genTypeT const & x,
262  genTypeT const & y,
263  genTypeU const & a);
264 
269  template <typename genType>
270  GLM_FUNC_DECL genType step(
271  genType const & edge,
272  genType const & x);
273 
278  template <template <typename, precision> class vecType, typename T, precision P>
279  GLM_FUNC_DECL vecType<T, P> step(
280  T const & edge,
281  vecType<T, P> const & x);
282 
297  template <typename genType>
298  GLM_FUNC_DECL genType smoothstep(
299  genType const & edge0,
300  genType const & edge1,
301  genType const & x);
302 
303  template <typename genType>
304  GLM_FUNC_DECL genType smoothstep(
305  typename genType::value_type const & edge0,
306  typename genType::value_type const & edge1,
307  genType const & x);
308 
321  template <typename genType>
322  GLM_FUNC_DECL typename genType::bool_type isnan(genType const & x);
323 
334  template <typename genType>
335  GLM_FUNC_DECL typename genType::bool_type isinf(genType const & x);
336 
343  GLM_FUNC_DECL int floatBitsToInt(float const & v);
344 
351  template <template <typename, precision> class vecType, precision P>
352  GLM_FUNC_DECL vecType<int, P> floatBitsToInt(vecType<float, P> const & v);
353 
360  GLM_FUNC_DECL uint floatBitsToUint(float const & v);
361 
368  template <template <typename, precision> class vecType, precision P>
369  GLM_FUNC_DECL vecType<uint, P> floatBitsToUint(vecType<float, P> const & v);
370 
379  GLM_FUNC_DECL float intBitsToFloat(int const & v);
380 
389  template <template <typename, precision> class vecType, precision P>
390  GLM_FUNC_DECL vecType<float, P> intBitsToFloat(vecType<int, P> const & v);
391 
400  GLM_FUNC_DECL float uintBitsToFloat(uint const & v);
401 
410  template <template <typename, precision> class vecType, precision P>
411  GLM_FUNC_DECL vecType<float, P> uintBitsToFloat(vecType<uint, P> const & v);
412 
419  template <typename genType>
420  GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c);
421 
436  template <typename genType, typename genIType>
437  GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp);
438 
450  template <typename genType, typename genIType>
451  GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp);
452 
454 }//namespace glm
455 
456 #include "func_common.inl"
457 
458 #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.
Definition: type_int.hpp:171
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&#39;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 &lt; 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 &gt;= 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 &lt;= edge0 and 1.0 if x &gt;= 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 &lt; y; otherwise, it returns x.
GLM_FUNC_DECL genType sign(genType const &x)
Returns 1.0 if x &gt; 0, 0.0 if x == 0, or -1.0 if x &lt; 0.
GLM_FUNC_DECL genType min(genType const &x, genType const &y)
Returns y if y &lt; 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...