Lines Matching refs:x
15 GLM_FUNC_QUALIFIER genType min(genType x, genType y) argument
18 return x < y ? x : y;
23 GLM_FUNC_QUALIFIER genType max(genType x, genType y) argument
27 return x > y ? x : y;
32 GLM_FUNC_QUALIFIER int32 abs(int32 x) argument
34 int32 const y = x >> 31;
35 return (x ^ y) - y;
43 GLM_FUNC_QUALIFIER genType round(genType x) argument
47 …return x < static_cast<genType>(0) ? static_cast<genType>(int(x - static_cast<genType>(0.5))) : st…
56 GLM_FUNC_QUALIFIER genType trunc(genType x) argument
60 return x < static_cast<genType>(0) ? -std::floor(-x) : std::floor(x);
76 GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
82 return x >= genFIType(0) ? x : -x;
83 // TODO, perf comp with: *(((int *) &x) + 1) &= 0x7fffffff;
91 GLM_FUNC_QUALIFIER static float call(float x)
93 return fabsf(x);
101 GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
106 return x;
113 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
115 return detail::functor1<T, T, P, vecType>::call(abs, x);
122 …GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vec…
126 return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x));
133 …GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, vec…
136 for(length_t i = 0; i < x.length(); ++i)
137 Result[i] = a[i] ? y[i] : x[i];
145 …GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, U c…
149 return vecType<T, P>(vecType<U, P>(x) + a * vecType<U, P>(y - x));
156 …GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y, boo…
158 return a ? y : x;
165 GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a)
169 return static_cast<T>(static_cast<U>(x) + a * static_cast<U>(y - x));
176 GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a)
178 return a ? y : x;
185 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
187 …return vecType<T, P>(glm::lessThan(vecType<T, P>(0), x)) - vecType<T, P>(glm::lessThan(x, vecType<…
195 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
198 …vecType<T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>…
200 return (x >> Shift) | y;
208 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
210 return detail::functor1<T, T, P, vecType>::call(std::floor, x);
217 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
219 return detail::functor1<T, T, P, vecType>::call(std::ceil, x);
226 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
228 return x - floor(x);
235 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
237 return detail::functor1<T, T, P, vecType>::call(trunc, x);
244 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x)
246 return detail::functor1<T, T, P, vecType>::call(round, x);
263 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y)
265 return detail::functor2<T, P, vecType>::call(min, x, y);
272 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & y)
274 return detail::functor2<T, P, vecType>::call(max, x, y);
281 …GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & x, vecType<T, P> const & minVal…
283 return min(max(x, minVal), maxVal);
290 GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const & edge, vecType<T, P> const & x)
292 return mix(vecType<T, P>(1), vecType<T, P>(0), glm::lessThan(x, edge));
299 …cType<T, P> call(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x)
302 …vecType<T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1))…
309 GLM_FUNC_QUALIFIER genFIType abs(genFIType x) argument
311 return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
315 GLM_FUNC_QUALIFIER vecType<T, P> abs(vecType<T, P> const & x) argument
317 return detail::compute_abs_vector<T, P, vecType, detail::is_aligned<P>::value>::call(x);
323 GLM_FUNC_QUALIFIER genFIType sign(genFIType x) argument
329 …e, defaultp, tvec1, std::numeric_limits<genFIType>::is_iec559, highp>::call(tvec1<genFIType>(x)).x;
333 GLM_FUNC_QUALIFIER vecType<T, P> sign(vecType<T, P> const & x) argument
339 …pute_sign<T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
345 GLM_FUNC_QUALIFIER vecType<T, P> floor(vecType<T, P> const & x) argument
348 return detail::compute_floor<T, P, vecType, detail::is_aligned<P>::value>::call(x);
352 GLM_FUNC_QUALIFIER vecType<T, P> trunc(vecType<T, P> const & x) argument
355 return detail::compute_trunc<T, P, vecType, detail::is_aligned<P>::value>::call(x);
359 GLM_FUNC_QUALIFIER vecType<T, P> round(vecType<T, P> const & x) argument
362 return detail::compute_round<T, P, vecType, detail::is_aligned<P>::value>::call(x);
368 GLM_FUNC_QUALIFIER genType roundEven(genType const& x)
372 return genType(int(x + genType(int(x) % 2)));
378 GLM_FUNC_QUALIFIER genType roundEven(genType x) argument
382 int Integer = static_cast<int>(x);
384 genType FractionalPart = fract(x);
388 return round(x);
394 else if(x <= static_cast<genType>(0)) // Work around...
404 // return mix(IntegerPart + genType(-1), IntegerPart + genType(1), x <= genType(0));
409 GLM_FUNC_QUALIFIER vecType<T, P> roundEven(vecType<T, P> const & x) argument
412 return detail::functor1<T, T, P, vecType>::call(roundEven, x);
418 GLM_FUNC_QUALIFIER vecType<T, P> ceil(vecType<T, P> const & x) argument
421 return detail::compute_ceil<T, P, vecType, detail::is_aligned<P>::value>::call(x);
426 GLM_FUNC_QUALIFIER genType fract(genType x) argument
428 return fract(tvec1<genType>(x)).x;
432 GLM_FUNC_QUALIFIER vecType<T, P> fract(vecType<T, P> const & x) argument
435 return detail::compute_fract<T, P, vecType, detail::is_aligned<P>::value>::call(x);
440 GLM_FUNC_QUALIFIER genType mod(genType x, genType y) argument
444 tvec1<genType, defaultp> Result(mod(tvec1<genType, defaultp>(x), y));
445 return Result.x;
447 return mod(tvec1<genType, defaultp>(x), y).x;
452 GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, T y) argument
454 …return detail::compute_mod<T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<T, P>(y));
458 GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & x, vecType<T, P> const & y) argument
460 return detail::compute_mod<T, P, vecType, detail::is_aligned<P>::value>::call(x, y);
465 GLM_FUNC_QUALIFIER genType modf(genType x, genType & i) argument
468 return std::modf(x, &i);
472 GLM_FUNC_QUALIFIER tvec1<T, P> modf(tvec1<T, P> const & x, tvec1<T, P> & i) argument
475 modf(x.x, i.x));
479 GLM_FUNC_QUALIFIER tvec2<T, P> modf(tvec2<T, P> const & x, tvec2<T, P> & i) argument
482 modf(x.x, i.x),
483 modf(x.y, i.y));
487 GLM_FUNC_QUALIFIER tvec3<T, P> modf(tvec3<T, P> const & x, tvec3<T, P> & i) argument
490 modf(x.x, i.x),
491 modf(x.y, i.y),
492 modf(x.z, i.z));
496 GLM_FUNC_QUALIFIER tvec4<T, P> modf(tvec4<T, P> const & x, tvec4<T, P> & i) argument
499 modf(x.x, i.x),
500 modf(x.y, i.y),
501 modf(x.z, i.z),
502 modf(x.w, i.w));
505 //// Only valid if (INT_MIN <= x-y <= INT_MAX)
506 //// min(x,y)
507 //r = y + ((x - y) & ((x - y) >> (sizeof(int) *
509 //// max(x,y)
510 //r = x - ((x - y) & ((x - y) >> (sizeof(int) *
543 GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal) argument
546 return min(max(x, minVal), maxVal);
550 GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, T minVal, T maxVal) argument
553 …return detail::compute_clamp_vector<T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<…
557 …GLM_FUNC_QUALIFIER vecType<T, P> clamp(vecType<T, P> const & x, vecType<T, P> const & minVal, vecT… argument
560 …return detail::compute_clamp_vector<T, P, vecType, detail::is_aligned<P>::value>::call(x, minVal, …
564 GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a) argument
566 return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a);
570 GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U a) argument
572 return detail::compute_mix_scalar<T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
576 …GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, … argument
578 return detail::compute_mix_vector<T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
583 GLM_FUNC_QUALIFIER genType step(genType edge, genType x) argument
585 return mix(static_cast<genType>(1), static_cast<genType>(0), glm::lessThan(x, edge));
589 GLM_FUNC_QUALIFIER vecType<T, P> step(T edge, vecType<T, P> const & x) argument
591 …il::compute_step_vector<T, P, vecType, detail::is_aligned<P>::value>::call(vecType<T, P>(edge), x);
595 GLM_FUNC_QUALIFIER vecType<T, P> step(vecType<T, P> const & edge, vecType<T, P> const & x) argument
597 return detail::compute_step_vector<T, P, vecType, detail::is_aligned<P>::value>::call(edge, x);
602 GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x) argument
606 genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1)));
611 GLM_FUNC_QUALIFIER vecType<T, P> smoothstep(T edge0, T edge1, vecType<T, P> const & x) argument
613 …<T, P, vecType, detail::is_aligned<P>::value>::call(vecType<T, P>(edge0), vecType<T, P>(edge1), x);
617 …T, P> smoothstep(vecType<T, P> const & edge0, vecType<T, P> const & edge1, vecType<T, P> const & x) argument
619 …ail::compute_smoothstep_vector<T, P, vecType, detail::is_aligned<P>::value>::call(edge0, edge1, x);
626 GLM_FUNC_QUALIFIER bool isnan(genType x) argument
631 return std::isnan(x);
633 return _isnan(x) != 0;
636 return _isnan(x) != 0;
638 return ::isnan(x) != 0;
641 return _isnan(x) != 0;
643 return isnan(x) != 0;
645 return std::isnan(x);
651 GLM_FUNC_QUALIFIER vecType<bool, P> isnan(vecType<T, P> const & x) argument
655 return detail::functor1<bool, T, P, vecType>::call(isnan, x);
662 GLM_FUNC_QUALIFIER bool isinf(genType x) argument
667 return std::isinf(x);
670 return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF;
672 return ::isinf(x);
676 return _isinf(x) != 0;
678 return std::isinf(x);
682 return isinf(double(x)) != 0;
684 return std::isinf(x);
690 GLM_FUNC_QUALIFIER vecType<bool, P> isinf(vecType<T, P> const & x) argument
694 return detail::functor1<bool, T, P, vecType>::call(isinf, x);
748 GLM_FUNC_QUALIFIER genType frexp(genType x, int & exp) argument
752 return std::frexp(x, &exp);
756 GLM_FUNC_QUALIFIER tvec1<T, P> frexp(tvec1<T, P> const & x, tvec1<int, P> & exp) argument
760 return tvec1<T, P>(std::frexp(x.x, &exp.x));
764 GLM_FUNC_QUALIFIER tvec2<T, P> frexp(tvec2<T, P> const & x, tvec2<int, P> & exp) argument
769 frexp(x.x, exp.x),
770 frexp(x.y, exp.y));
774 GLM_FUNC_QUALIFIER tvec3<T, P> frexp(tvec3<T, P> const & x, tvec3<int, P> & exp) argument
779 frexp(x.x, exp.x),
780 frexp(x.y, exp.y),
781 frexp(x.z, exp.z));
785 GLM_FUNC_QUALIFIER tvec4<T, P> frexp(tvec4<T, P> const & x, tvec4<int, P> & exp) argument
790 frexp(x.x, exp.x),
791 frexp(x.y, exp.y),
792 frexp(x.z, exp.z),
793 frexp(x.w, exp.w));
797 GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp) argument
801 return std::ldexp(x, exp);
805 GLM_FUNC_QUALIFIER tvec1<T, P> ldexp(tvec1<T, P> const & x, tvec1<int, P> const & exp) argument
810 ldexp(x.x, exp.x));
814 GLM_FUNC_QUALIFIER tvec2<T, P> ldexp(tvec2<T, P> const & x, tvec2<int, P> const & exp) argument
819 ldexp(x.x, exp.x),
820 ldexp(x.y, exp.y));
824 GLM_FUNC_QUALIFIER tvec3<T, P> ldexp(tvec3<T, P> const & x, tvec3<int, P> const & exp) argument
829 ldexp(x.x, exp.x),
830 ldexp(x.y, exp.y),
831 ldexp(x.z, exp.z));
835 GLM_FUNC_QUALIFIER tvec4<T, P> ldexp(tvec4<T, P> const & x, tvec4<int, P> const & exp) argument
840 ldexp(x.x, exp.x),
841 ldexp(x.y, exp.y),
842 ldexp(x.z, exp.z),
843 ldexp(x.w, exp.w));