|
|
@@ -11,7 +11,7 @@
|
|
|
namespace glm
|
|
|
{
|
|
|
// min
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType min(genType x, genType y)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point or integer inputs");
|
|
|
@@ -19,7 +19,7 @@ namespace glm
|
|
|
}
|
|
|
|
|
|
// max
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType max(genType x, genType y)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point or integer inputs");
|
|
|
@@ -28,7 +28,7 @@ namespace glm
|
|
|
}
|
|
|
|
|
|
// abs
|
|
|
- template <>
|
|
|
+ template<>
|
|
|
GLM_FUNC_QUALIFIER int32 abs(int32 x)
|
|
|
{
|
|
|
int32 const y = x >> 31;
|
|
|
@@ -39,7 +39,7 @@ namespace glm
|
|
|
# if GLM_HAS_CXX11_STL
|
|
|
using ::std::round;
|
|
|
# else
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType round(genType x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'round' only accept floating-point inputs");
|
|
|
@@ -52,7 +52,7 @@ namespace glm
|
|
|
# if GLM_HAS_CXX11_STL
|
|
|
using ::std::trunc;
|
|
|
# else
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType trunc(genType x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'trunc' only accept floating-point inputs");
|
|
|
@@ -66,11 +66,11 @@ namespace glm
|
|
|
namespace glm{
|
|
|
namespace detail
|
|
|
{
|
|
|
- template <typename genFIType, bool /*signed*/>
|
|
|
+ template<typename genFIType, bool /*signed*/>
|
|
|
struct compute_abs
|
|
|
{};
|
|
|
|
|
|
- template <typename genFIType>
|
|
|
+ template<typename genFIType>
|
|
|
struct compute_abs<genFIType, true>
|
|
|
{
|
|
|
GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
|
|
|
@@ -85,7 +85,7 @@ namespace detail
|
|
|
};
|
|
|
|
|
|
#if GLM_COMPILER & GLM_COMPILER_CUDA
|
|
|
- template <>
|
|
|
+ template<>
|
|
|
struct compute_abs<float, true>
|
|
|
{
|
|
|
GLM_FUNC_QUALIFIER static float call(float x)
|
|
|
@@ -95,7 +95,7 @@ namespace detail
|
|
|
};
|
|
|
#endif
|
|
|
|
|
|
- template <typename genFIType>
|
|
|
+ template<typename genFIType>
|
|
|
struct compute_abs<genFIType, false>
|
|
|
{
|
|
|
GLM_FUNC_QUALIFIER static genFIType call(genFIType x)
|
|
|
@@ -107,59 +107,59 @@ namespace detail
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_abs_vector
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::functor1<D, T, T, P>::call(abs, x);
|
|
|
+ return detail::functor1<L, T, T, P>::call(abs, x);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_mix_vector
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y, vecType<D, U, P> const & a)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y, vecType<L, U, P> const & a)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
|
|
|
|
|
- return vecType<D, T, P>(vecType<D, U, P>(x) + a * vecType<D, U, P>(y - x));
|
|
|
+ return vecType<L, T, P>(vecType<L, U, P>(x) + a * vecType<L, U, P>(y - x));
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
- struct compute_mix_vector<D, T, bool, P, vecType, Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
+ struct compute_mix_vector<L, T, bool, P, vecType, Aligned>
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y, vecType<D, bool, P> const & a)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y, vecType<L, bool, P> const & a)
|
|
|
{
|
|
|
- vecType<D, T, P> Result(uninitialize);
|
|
|
+ vecType<L, T, P> Result(uninitialize);
|
|
|
for(length_t i = 0; i < x.length(); ++i)
|
|
|
Result[i] = a[i] ? y[i] : x[i];
|
|
|
return Result;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_mix_scalar
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y, U const & a)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y, U const & a)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
|
|
|
|
|
- return vecType<D, T, P>(vecType<D, U, P>(x) + a * vecType<D, U, P>(y - x));
|
|
|
+ return vecType<L, T, P>(vecType<L, U, P>(x) + a * vecType<L, U, P>(y - x));
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
- struct compute_mix_scalar<D, T, bool, P, vecType, Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
+ struct compute_mix_scalar<L, T, bool, P, vecType, Aligned>
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y, bool const & a)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y, bool const & a)
|
|
|
{
|
|
|
return a ? y : x;
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <typename T, typename U>
|
|
|
+ template<typename T, typename U>
|
|
|
struct compute_mix
|
|
|
{
|
|
|
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, U const & a)
|
|
|
@@ -170,7 +170,7 @@ namespace detail
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <typename T>
|
|
|
+ template<typename T>
|
|
|
struct compute_mix<T, bool>
|
|
|
{
|
|
|
GLM_FUNC_QUALIFIER static T call(T const & x, T const & y, bool const & a)
|
|
|
@@ -179,147 +179,147 @@ namespace detail
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool isFloat, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool isFloat, bool Aligned>
|
|
|
struct compute_sign
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return vecType<D, T, P>(glm::lessThan(vecType<D, T, P>(0), x)) - vecType<D, T, P>(glm::lessThan(x, vecType<D, T, P>(0)));
|
|
|
+ return vecType<L, T, P>(glm::lessThan(vecType<L, T, P>(0), x)) - vecType<L, T, P>(glm::lessThan(x, vecType<L, T, P>(0)));
|
|
|
}
|
|
|
};
|
|
|
|
|
|
# if GLM_ARCH == GLM_ARCH_X86
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_sign<T, P, vecType, false, Aligned>
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
T const Shift(static_cast<T>(sizeof(T) * 8 - 1));
|
|
|
- vecType<D, T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
|
|
|
+ vecType<L, T, P> const y(vecType<typename make_unsigned<T>::type, P>(-x) >> typename make_unsigned<T>::type(Shift));
|
|
|
|
|
|
return (x >> Shift) | y;
|
|
|
}
|
|
|
};
|
|
|
# endif
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_floor
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::functor1<D, T, T, P>::call(std::floor, x);
|
|
|
+ return detail::functor1<L, T, T, P>::call(std::floor, x);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_ceil
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::functor1<D, T, T, P>::call(std::ceil, x);
|
|
|
+ return detail::functor1<L, T, T, P>::call(std::ceil, x);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_fract
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
return x - floor(x);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_trunc
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::functor1<D, T, T, P>::call(trunc, x);
|
|
|
+ return detail::functor1<L, T, T, P>::call(trunc, x);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_round
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::functor1<D, T, T, P>::call(round, x);
|
|
|
+ return detail::functor1<L, T, T, P>::call(round, x);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_mod
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & a, vecType<D, T, P> const & b)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & a, vecType<L, T, P> const & b)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
|
|
|
return a - b * floor(a / b);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_min_vector
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
|
|
|
{
|
|
|
- return detail::functor2<D, T, P>::call(min, x, y);
|
|
|
+ return detail::functor2<L, T, P>::call(min, x, y);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_max_vector
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & y)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
|
|
|
{
|
|
|
- return detail::functor2<D, T, P>::call(max, x, y);
|
|
|
+ return detail::functor2<L, T, P>::call(max, x, y);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_clamp_vector
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & x, vecType<D, T, P> const & minVal, vecType<D, T, P> const & maxVal)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & x, vecType<L, T, P> const & minVal, vecType<L, T, P> const & maxVal)
|
|
|
{
|
|
|
return min(max(x, minVal), maxVal);
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_step_vector
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & edge, vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & edge, vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return mix(vecType<D, T, P>(1), vecType<D, T, P>(0), glm::lessThan(x, edge));
|
|
|
+ return mix(vecType<L, T, P>(1), vecType<L, T, P>(0), glm::lessThan(x, edge));
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType, bool Aligned>
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType, bool Aligned>
|
|
|
struct compute_smoothstep_vector
|
|
|
{
|
|
|
- GLM_FUNC_QUALIFIER static vecType<D, T, P> call(vecType<D, T, P> const & edge0, vecType<D, T, P> const & edge1, vecType<D, T, P> const & x)
|
|
|
+ GLM_FUNC_QUALIFIER static vecType<L, T, P> call(vecType<L, T, P> const & edge0, vecType<L, T, P> const & edge1, vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'step' only accept floating-point inputs");
|
|
|
- vecType<D, T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)));
|
|
|
+ vecType<L, T, P> const tmp(clamp((x - edge0) / (edge1 - edge0), static_cast<T>(0), static_cast<T>(1)));
|
|
|
return tmp * tmp * (static_cast<T>(3) - static_cast<T>(2) * tmp);
|
|
|
}
|
|
|
};
|
|
|
}//namespace detail
|
|
|
|
|
|
- template <typename genFIType>
|
|
|
+ template<typename genFIType>
|
|
|
GLM_FUNC_QUALIFIER genFIType abs(genFIType x)
|
|
|
{
|
|
|
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> abs(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> abs(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::compute_abs_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
+ return detail::compute_abs_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
}
|
|
|
|
|
|
// sign
|
|
|
// fast and works for any type
|
|
|
- template <typename genFIType>
|
|
|
+ template<typename genFIType>
|
|
|
GLM_FUNC_QUALIFIER genFIType sign(genFIType x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(
|
|
|
@@ -329,42 +329,42 @@ namespace detail
|
|
|
return detail::compute_sign<1, genFIType, defaultp, vec, std::numeric_limits<genFIType>::is_iec559, highp>::call(vec<1, genFIType>(x)).x;
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> sign(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> sign(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(
|
|
|
std::numeric_limits<T>::is_iec559 || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer),
|
|
|
"'sign' only accept signed inputs");
|
|
|
|
|
|
- return detail::compute_sign<D, T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
|
|
|
+ return detail::compute_sign<L, T, P, vecType, std::numeric_limits<T>::is_iec559, detail::is_aligned<P>::value>::call(x);
|
|
|
}
|
|
|
|
|
|
// floor
|
|
|
using ::std::floor;
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> floor(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> floor(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'floor' only accept floating-point inputs.");
|
|
|
- return detail::compute_floor<D, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
+ return detail::compute_floor<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> trunc(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> trunc(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'trunc' only accept floating-point inputs");
|
|
|
- return detail::compute_trunc<D, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
+ return detail::compute_trunc<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> round(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> round(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'round' only accept floating-point inputs");
|
|
|
- return detail::compute_round<D, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
+ return detail::compute_round<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
}
|
|
|
|
|
|
/*
|
|
|
// roundEven
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType roundEven(genType const& x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs");
|
|
|
@@ -374,7 +374,7 @@ namespace detail
|
|
|
*/
|
|
|
|
|
|
// roundEven
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType roundEven(genType x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs");
|
|
|
@@ -405,38 +405,38 @@ namespace detail
|
|
|
//}
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> roundEven(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> roundEven(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'roundEven' only accept floating-point inputs");
|
|
|
- return detail::functor1<D, T, T, P>::call(roundEven, x);
|
|
|
+ return detail::functor1<L, T, T, P>::call(roundEven, x);
|
|
|
}
|
|
|
|
|
|
// ceil
|
|
|
using ::std::ceil;
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> ceil(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> ceil(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ceil' only accept floating-point inputs");
|
|
|
- return detail::compute_ceil<D, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
+ return detail::compute_ceil<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
}
|
|
|
|
|
|
// fract
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType fract(genType x)
|
|
|
{
|
|
|
return fract(vec<1, genType>(x)).x;
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> fract(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> fract(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fract' only accept floating-point inputs");
|
|
|
- return detail::compute_fract<D, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
+ return detail::compute_fract<L, T, P, vecType, detail::is_aligned<P>::value>::call(x);
|
|
|
}
|
|
|
|
|
|
// mod
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType mod(genType x, genType y)
|
|
|
{
|
|
|
# if GLM_COMPILER & GLM_COMPILER_CUDA
|
|
|
@@ -448,34 +448,34 @@ namespace detail
|
|
|
# endif
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> mod(vecType<D, T, P> const & x, T y)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> mod(vecType<L, T, P> const & x, T y)
|
|
|
{
|
|
|
- return detail::compute_mod<D, T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<D, T, P>(y));
|
|
|
+ return detail::compute_mod<L, T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<L, T, P>(y));
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> mod(vecType<D, T, P> const & x, vecType<D, T, P> const & y)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> mod(vecType<L, T, P> const & x, vecType<L, T, P> const & y)
|
|
|
{
|
|
|
- return detail::compute_mod<D, T, P, vecType, detail::is_aligned<P>::value>::call(x, y);
|
|
|
+ return detail::compute_mod<L, T, P, vecType, detail::is_aligned<P>::value>::call(x, y);
|
|
|
}
|
|
|
|
|
|
// modf
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType modf(genType x, genType & i)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'modf' only accept floating-point inputs");
|
|
|
return std::modf(x, &i);
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<1, T, P> modf(vec<1, T, P> const & x, vec<1, T, P> & i)
|
|
|
{
|
|
|
return vec<1, T, P>(
|
|
|
modf(x.x, i.x));
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<2, T, P> modf(vec<2, T, P> const & x, vec<2, T, P> & i)
|
|
|
{
|
|
|
return vec<2, T, P>(
|
|
|
@@ -483,7 +483,7 @@ namespace detail
|
|
|
modf(x.y, i.y));
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<3, T, P> modf(vec<3, T, P> const & x, vec<3, T, P> & i)
|
|
|
{
|
|
|
return vec<3, T, P>(
|
|
|
@@ -492,7 +492,7 @@ namespace detail
|
|
|
modf(x.z, i.z));
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<4, T, P> modf(vec<4, T, P> const & x, vec<4, T, P> & i)
|
|
|
{
|
|
|
return vec<4, T, P>(
|
|
|
@@ -511,94 +511,94 @@ namespace detail
|
|
|
//CHAR_BIT - 1)));
|
|
|
|
|
|
// min
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> min(vecType<D, T, P> const & a, T b)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> min(vecType<L, T, P> const & a, T b)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'min' only accept floating-point inputs for the interpolator a");
|
|
|
- return detail::compute_min_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<D, T, P>(b));
|
|
|
+ return detail::compute_min_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<L, T, P>(b));
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> min(vecType<D, T, P> const & a, vecType<D, T, P> const & b)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> min(vecType<L, T, P> const & a, vecType<L, T, P> const & b)
|
|
|
{
|
|
|
- return detail::compute_min_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(a, b);
|
|
|
+ return detail::compute_min_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(a, b);
|
|
|
}
|
|
|
|
|
|
// max
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> max(vecType<D, T, P> const & a, T b)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> max(vecType<L, T, P> const & a, T b)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'max' only accept floating-point inputs for the interpolator a");
|
|
|
- return detail::compute_max_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<D, T, P>(b));
|
|
|
+ return detail::compute_max_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(a, vecType<L, T, P>(b));
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> max(vecType<D, T, P> const & a, vecType<D, T, P> const & b)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> max(vecType<L, T, P> const & a, vecType<L, T, P> const & b)
|
|
|
{
|
|
|
- return detail::compute_max_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(a, b);
|
|
|
+ return detail::compute_max_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(a, b);
|
|
|
}
|
|
|
|
|
|
// clamp
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType clamp(genType x, genType minVal, genType maxVal)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
|
|
|
return min(max(x, minVal), maxVal);
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> clamp(vecType<D, T, P> const & x, T minVal, T maxVal)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> clamp(vecType<L, T, P> const & x, T minVal, T maxVal)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
|
|
|
- return detail::compute_clamp_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<D, T, P>(minVal), vecType<D, T, P>(maxVal));
|
|
|
+ return detail::compute_clamp_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(x, vecType<L, T, P>(minVal), vecType<L, T, P>(maxVal));
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> clamp(vecType<D, T, P> const & x, vecType<D, T, P> const & minVal, vecType<D, T, P> const & maxVal)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> clamp(vecType<L, T, P> const & x, vecType<L, T, P> const & minVal, vecType<L, T, P> const & maxVal)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer || GLM_UNRESTRICTED_GENTYPE, "'clamp' only accept floating-point or integer inputs");
|
|
|
- return detail::compute_clamp_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(x, minVal, maxVal);
|
|
|
+ return detail::compute_clamp_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(x, minVal, maxVal);
|
|
|
}
|
|
|
|
|
|
- template <typename genTypeT, typename genTypeU>
|
|
|
+ template<typename genTypeT, typename genTypeU>
|
|
|
GLM_FUNC_QUALIFIER genTypeT mix(genTypeT x, genTypeT y, genTypeU a)
|
|
|
{
|
|
|
return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a);
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> mix(vecType<D, T, P> const & x, vecType<D, T, P> const & y, U a)
|
|
|
+ template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> mix(vecType<L, T, P> const & x, vecType<L, T, P> const & y, U a)
|
|
|
{
|
|
|
- return detail::compute_mix_scalar<D, T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
|
|
|
+ return detail::compute_mix_scalar<L, T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, typename U, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> mix(vecType<D, T, P> const & x, vecType<D, T, P> const & y, vecType<D, U, P> const & a)
|
|
|
+ template<length_t L, typename T, typename U, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> mix(vecType<L, T, P> const & x, vecType<L, T, P> const & y, vecType<L, U, P> const & a)
|
|
|
{
|
|
|
- return detail::compute_mix_vector<D, T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
|
|
|
+ return detail::compute_mix_vector<L, T, U, P, vecType, detail::is_aligned<P>::value>::call(x, y, a);
|
|
|
}
|
|
|
|
|
|
// step
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType step(genType edge, genType x)
|
|
|
{
|
|
|
return mix(static_cast<genType>(1), static_cast<genType>(0), glm::lessThan(x, edge));
|
|
|
}
|
|
|
|
|
|
- template <template <int, typename, precision> class vecType, int D, typename T, precision P>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> step(T edge, vecType<D, T, P> const & x)
|
|
|
+ template<template<length_t, typename, precision> class vecType, length_t L, typename T, precision P>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> step(T edge, vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::compute_step_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(vecType<D, T, P>(edge), x);
|
|
|
+ return detail::compute_step_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(vecType<L, T, P>(edge), x);
|
|
|
}
|
|
|
|
|
|
- template <template <int, typename, precision> class vecType, int D, typename T, precision P>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> step(vecType<D, T, P> const & edge, vecType<D, T, P> const & x)
|
|
|
+ template<template<length_t, typename, precision> class vecType, length_t L, typename T, precision P>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> step(vecType<L, T, P> const & edge, vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::compute_step_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(edge, x);
|
|
|
+ return detail::compute_step_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(edge, x);
|
|
|
}
|
|
|
|
|
|
// smoothstep
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
|
|
|
@@ -607,22 +607,22 @@ namespace detail
|
|
|
return tmp * tmp * (genType(3) - genType(2) * tmp);
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> smoothstep(T edge0, T edge1, vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> smoothstep(T edge0, T edge1, vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::compute_smoothstep_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(vecType<D, T, P>(edge0), vecType<D, T, P>(edge1), x);
|
|
|
+ return detail::compute_smoothstep_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(vecType<L, T, P>(edge0), vecType<L, T, P>(edge1), x);
|
|
|
}
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, T, P> smoothstep(vecType<D, T, P> const & edge0, vecType<D, T, P> const & edge1, vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, T, P> smoothstep(vecType<L, T, P> const & edge0, vecType<L, T, P> const & edge1, vecType<L, T, P> const & x)
|
|
|
{
|
|
|
- return detail::compute_smoothstep_vector<D, T, P, vecType, detail::is_aligned<P>::value>::call(edge0, edge1, x);
|
|
|
+ return detail::compute_smoothstep_vector<L, T, P, vecType, detail::is_aligned<P>::value>::call(edge0, edge1, x);
|
|
|
}
|
|
|
|
|
|
# if GLM_HAS_CXX11_STL
|
|
|
using std::isnan;
|
|
|
# else
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER bool isnan(genType x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isnan' only accept floating-point inputs");
|
|
|
@@ -647,18 +647,18 @@ namespace detail
|
|
|
}
|
|
|
# endif
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, bool, P> isnan(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, bool, P> isnan(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
|
|
|
|
|
|
- return detail::functor1<D, bool, T, P>::call(isnan, x);
|
|
|
+ return detail::functor1<L, bool, T, P>::call(isnan, x);
|
|
|
}
|
|
|
|
|
|
# if GLM_HAS_CXX11_STL
|
|
|
using std::isinf;
|
|
|
# else
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER bool isinf(genType x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isinf' only accept floating-point inputs");
|
|
|
@@ -686,12 +686,12 @@ namespace detail
|
|
|
}
|
|
|
# endif
|
|
|
|
|
|
- template <int D, typename T, precision P, template <int, typename, precision> class vecType>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, bool, P> isinf(vecType<D, T, P> const & x)
|
|
|
+ template<length_t L, typename T, precision P, template<length_t, typename, precision> class vecType>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, bool, P> isinf(vecType<L, T, P> const & x)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
|
|
|
|
|
|
- return detail::functor1<D, bool, T, P>::call(isinf, x);
|
|
|
+ return detail::functor1<L, bool, T, P>::call(isinf, x);
|
|
|
}
|
|
|
|
|
|
GLM_FUNC_QUALIFIER int floatBitsToInt(float const & v)
|
|
|
@@ -699,10 +699,10 @@ namespace detail
|
|
|
return reinterpret_cast<int&>(const_cast<float&>(v));
|
|
|
}
|
|
|
|
|
|
- template <template <int, typename, precision> class vecType, int D, precision P>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, int, P> floatBitsToInt(vecType<D, float, P> const & v)
|
|
|
+ template<template<length_t, typename, precision> class vecType, length_t L, precision P>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, int, P> floatBitsToInt(vecType<L, float, P> const & v)
|
|
|
{
|
|
|
- return reinterpret_cast<vecType<D, int, P>&>(const_cast<vecType<D, float, P>&>(v));
|
|
|
+ return reinterpret_cast<vecType<L, int, P>&>(const_cast<vecType<L, float, P>&>(v));
|
|
|
}
|
|
|
|
|
|
GLM_FUNC_QUALIFIER uint floatBitsToUint(float const & v)
|
|
|
@@ -710,10 +710,10 @@ namespace detail
|
|
|
return reinterpret_cast<uint&>(const_cast<float&>(v));
|
|
|
}
|
|
|
|
|
|
- template <template <int, typename, precision> class vecType, int D, precision P>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, uint, P> floatBitsToUint(vecType<D, float, P> const & v)
|
|
|
+ template<template<length_t, typename, precision> class vecType, length_t L, precision P>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, uint, P> floatBitsToUint(vecType<L, float, P> const & v)
|
|
|
{
|
|
|
- return reinterpret_cast<vecType<D, uint, P>&>(const_cast<vecType<D, float, P>&>(v));
|
|
|
+ return reinterpret_cast<vecType<L, uint, P>&>(const_cast<vecType<L, float, P>&>(v));
|
|
|
}
|
|
|
|
|
|
GLM_FUNC_QUALIFIER float intBitsToFloat(int const & v)
|
|
|
@@ -721,10 +721,10 @@ namespace detail
|
|
|
return reinterpret_cast<float&>(const_cast<int&>(v));
|
|
|
}
|
|
|
|
|
|
- template <template <int, typename, precision> class vecType, int D, precision P>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, float, P> intBitsToFloat(vecType<D, int, P> const & v)
|
|
|
+ template<template<length_t, typename, precision> class vecType, length_t L, precision P>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, float, P> intBitsToFloat(vecType<L, int, P> const & v)
|
|
|
{
|
|
|
- return reinterpret_cast<vecType<D, float, P>&>(const_cast<vecType<D, int, P>&>(v));
|
|
|
+ return reinterpret_cast<vecType<L, float, P>&>(const_cast<vecType<L, int, P>&>(v));
|
|
|
}
|
|
|
|
|
|
GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & v)
|
|
|
@@ -732,19 +732,19 @@ namespace detail
|
|
|
return reinterpret_cast<float&>(const_cast<uint&>(v));
|
|
|
}
|
|
|
|
|
|
- template <template <int, typename, precision> class vecType, int D, precision P>
|
|
|
- GLM_FUNC_QUALIFIER vecType<D, float, P> uintBitsToFloat(vecType<D, uint, P> const & v)
|
|
|
+ template<template<length_t, typename, precision> class vecType, length_t L, precision P>
|
|
|
+ GLM_FUNC_QUALIFIER vecType<L, float, P> uintBitsToFloat(vecType<L, uint, P> const & v)
|
|
|
{
|
|
|
- return reinterpret_cast<vecType<D, float, P>&>(const_cast<vecType<D, uint, P>&>(v));
|
|
|
+ return reinterpret_cast<vecType<L, float, P>&>(const_cast<vecType<L, uint, P>&>(v));
|
|
|
}
|
|
|
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType fma(genType const & a, genType const & b, genType const & c)
|
|
|
{
|
|
|
return a * b + c;
|
|
|
}
|
|
|
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType frexp(genType x, int & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
|
|
@@ -752,7 +752,7 @@ namespace detail
|
|
|
return std::frexp(x, &exp);
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<1, T, P> frexp(vec<1, T, P> const & x, vec<1, int, P> & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
|
|
@@ -760,7 +760,7 @@ namespace detail
|
|
|
return vec<1, T, P>(std::frexp(x.x, &exp.x));
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<2, T, P> frexp(vec<2, T, P> const & x, vec<2, int, P> & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
|
|
@@ -770,7 +770,7 @@ namespace detail
|
|
|
frexp(x.y, exp.y));
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<3, T, P> frexp(vec<3, T, P> const & x, vec<3, int, P> & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
|
|
@@ -781,7 +781,7 @@ namespace detail
|
|
|
frexp(x.z, exp.z));
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<4, T, P> frexp(vec<4, T, P> const & x, vec<4, int, P> & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'frexp' only accept floating-point inputs");
|
|
|
@@ -793,7 +793,7 @@ namespace detail
|
|
|
frexp(x.w, exp.w));
|
|
|
}
|
|
|
|
|
|
- template <typename genType>
|
|
|
+ template<typename genType>
|
|
|
GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|
|
|
@@ -801,7 +801,7 @@ namespace detail
|
|
|
return std::ldexp(x, exp);
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<1, T, P> ldexp(vec<1, T, P> const & x, vec<1, int, P> const & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|
|
|
@@ -810,7 +810,7 @@ namespace detail
|
|
|
ldexp(x.x, exp.x));
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<2, T, P> ldexp(vec<2, T, P> const & x, vec<2, int, P> const & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|
|
|
@@ -820,7 +820,7 @@ namespace detail
|
|
|
ldexp(x.y, exp.y));
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<3, T, P> ldexp(vec<3, T, P> const & x, vec<3, int, P> const & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|
|
|
@@ -831,7 +831,7 @@ namespace detail
|
|
|
ldexp(x.z, exp.z));
|
|
|
}
|
|
|
|
|
|
- template <typename T, precision P>
|
|
|
+ template<typename T, precision P>
|
|
|
GLM_FUNC_QUALIFIER vec<4, T, P> ldexp(vec<4, T, P> const & x, vec<4, int, P> const & exp)
|
|
|
{
|
|
|
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_UNRESTRICTED_GENTYPE, "'ldexp' only accept floating-point inputs");
|