@ -131,23 +131,21 @@ namespace detail
// abs
// abs
template <typename genFIType>
template <typename genFIType>
GLM_FUNC_QUALIFIER genFIType abs
GLM_FUNC_QUALIFIER genFIType abs(genFIType x)
(
genFIType const & x
)
{
{
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
return detail::compute_abs<genFIType, std::numeric_limits<genFIType>::is_signed>::call(x);
}
}
VECTORIZE_VEC(abs)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> abs(vecType<T, P> const & x)
{
return detail::functor1<T, P, vecType>::call(abs, x);
}
// sign
// sign
//Try something like based on x >> 31 to get the sign bit
//Try something like based on x >> 31 to get the sign bit
template <typename genFIType>
template <typename genFIType>
GLM_FUNC_QUALIFIER genFIType sign
GLM_FUNC_QUALIFIER genFIType sign(genFIType x)
(
genFIType const & x
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(
std::numeric_limits<genFIType>::is_iec559 ||
std::numeric_limits<genFIType>::is_iec559 ||
@ -163,48 +161,58 @@ namespace detail
return result;
return result;
}
}
VECTORIZE_VEC(sign)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> sign(vecType<T, P> const & x)
{
return detail::functor1<T, P, vecType>::call(sign, x);
}
// floor
// floor
template <typename genType>
using ::std::floor;
GLM_FUNC_QUALIFIER genType floor(genType const & x)
{
GLM_STATIC_ASSERT(
std::numeric_limits<genType>::is_iec559,
"'floor' only accept floating-point inputs");
return ::std::floor(x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> floor(vecType<T, P> const & x)
{
return detail::functor1<T, P, vecType>::call(::std::floor, x);
}
}
VECTORIZE_VEC(floor)
// trunc
// trunc
# if GLM_LANG & GLM_LANG_CXX0X_FLAG
using ::std::trunc;
# else
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType trunc(genType const & x)
GLM_FUNC_QUALIFIER genType trunc(genType x)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'trunc' only accept floating-point inputs");
std::numeric_limits<genType>::is_iec559,
"'trunc' only accept floating-point inputs");
// TODO, add C++11 std::trunk
return x < static_cast<genType>(0) ? -floor(-x) : floor(x);
return x < 0 ? -floor(-x) : floor(x);
}
}
# endif
VECTORIZE_VEC(trunc)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> trunc(vecType<T, P> const & x)
{
return detail::functor1<T, P, vecType>::call(::std::trunc, x);
}
// round
// round
# if GLM_LANG & GLM_LANG_CXX0X_FLAG
using ::std::round;
# else
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType round(genType const& x)
GLM_FUNC_QUALIFIER genType round(genType x)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'round' only accept floating-point inputs");
std::numeric_limits<genType>::is_iec559,
"'round' only accept floating-point inputs");
// TODO, add C++11 std::round
return x < static_cast<genType>(0) ? static_cast<genType>(int(x - static_cast<genType>(0.5))) : static_cast<genType>(int(x + static_cast<genType>(0.5)));
return x < 0 ? genType(int(x - genType(0.5))) : genType(int(x + genType(0.5)));
}
}
# endif
VECTORIZE_VEC(round)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> round(vecType<T, P> const & x)
{
return detail::functor1<T, P, vecType>::call(::std::round, x);
}
/*
/*
// roundEven
// roundEven
@ -219,11 +227,9 @@ namespace detail
// roundEven
// roundEven
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType roundEven(genType const & x)
GLM_FUNC_QUALIFIER genType roundEven(genType x)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'roundEven' only accept floating-point inputs");
std::numeric_limits<genType>::is_iec559,
"'roundEven' only accept floating-point inputs");
int Integer = static_cast<int>(x);
int Integer = static_cast<int>(x);
genType IntegerPart = static_cast<genType>(Integer);
genType IntegerPart = static_cast<genType>(Integer);
@ -251,60 +257,56 @@ namespace detail
//}
//}
}
}
VECTORIZE_VEC(roundEven)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> roundEven(vecType<T, P> const & x)
{
return detail::functor1<T, P, vecType>::call(roundEven, x);
}
// ceil
// ceil
using std::ceil;
using ::std::ceil;
/*
template <typename genType>
GLM_FUNC_QUALIFIER genType ceil(genType const & x)
{
GLM_STATIC_ASSERT(
std::numeric_limits<genType>::is_iec559,
"'ceil' only accept floating-point inputs");
return ::std::ceil(x);
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> ceil(vecType<T, P> const & x)
{
return detail::functor1<T, P, vecType>::call(::std::ceil, x);
}
}
*/
VECTORIZE_VEC(ceil)
// fract
// fract
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType fract
GLM_FUNC_QUALIFIER genType fract(genType x)
(
genType const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'fract' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'fract' only accept floating-point inputs");
return x - floor(x);
return x - floor(x);
}
}
VECTORIZE_VEC(fract)
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> fract(vecType<T, P> const & x)
{
return detail::functor1<T, P, vecType>::call(fract, x);
}
// mod
// mod
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType mod
GLM_FUNC_QUALIFIER genType mod(genType x, genType y)
(
genType const & x,
genType const & y
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'mod' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'mod' only accept floating-point inputs");
return x - y * floor(x / y);
return x - y * floor(x / y);
}
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> mod(vecType<T, P> const & a, vecType<T, P> const & b)
{
return detail::functor2<T, P, vecType>::call(mod, a, b);
}
VECTORIZE_VEC_SCA(mod)
VECTORIZE_VEC_SCA(mod)
VECTORIZE_VEC_VEC(mod)
// modf
// modf
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType modf
GLM_FUNC_QUALIFIER genType modf(genType const & x, genType & i)
(
genType const & x,
genType & i
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'modf' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'modf' only accept floating-point inputs");
@ -312,22 +314,14 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> modf
GLM_FUNC_QUALIFIER tvec1<T, P> modf(tvec1<T, P> const & x, tvec1<T, P> & i)
(
tvec1<T, P> const & x,
tvec1<T, P> & i
)
{
{
return tvec1<T, P>(
return tvec1<T, P>(
modf(x.x, i.x));
modf(x.x, i.x));
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> modf
GLM_FUNC_QUALIFIER tvec2<T, P> modf(tvec2<T, P> const & x, tvec2<T, P> & i)
(
tvec2<T, P> const & x,
tvec2<T, P> & i
)
{
{
return tvec2<T, P>(
return tvec2<T, P>(
modf(x.x, i.x),
modf(x.x, i.x),
@ -335,11 +329,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> modf
GLM_FUNC_QUALIFIER tvec3<T, P> modf(tvec3<T, P> const & x, tvec3<T, P> & i)
(
tvec3<T, P> const & x,
tvec3<T, P> & i
)
{
{
return tvec3<T, P>(
return tvec3<T, P>(
modf(x.x, i.x),
modf(x.x, i.x),
@ -348,11 +338,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> modf
GLM_FUNC_QUALIFIER tvec4<T, P> modf(tvec4<T, P> const & x, tvec4<T, P> & i)
(
tvec4<T, P> const & x,
tvec4<T, P> & i
)
{
{
return tvec4<T, P>(
return tvec4<T, P>(
modf(x.x, i.x),
modf(x.x, i.x),
@ -371,67 +357,51 @@ namespace detail
// min
// min
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType min
GLM_FUNC_QUALIFIER genType min(genType x, genType y)
(
genType const & x,
genType const & y
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'min' only accept floating-point or integer inputs");
std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer,
"'min' only accept floating-point or integer inputs");
return x < y ? x : y;
return x < y ? x : y;
}
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> min(vecType<T, P> const & a, vecType<T, P> const & b)
{
return detail::functor2<T, P, vecType>::call(min, a, b);
}
VECTORIZE_VEC_SCA(min)
VECTORIZE_VEC_SCA(min)
VECTORIZE_VEC_VEC(min)
// max
// max
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType max
GLM_FUNC_QUALIFIER genType max(genType x, genType y)
(
genType const & x,
genType const & y
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'max' only accept floating-point or integer inputs");
std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer,
"'max' only accept floating-point or integer inputs");
return x > y ? x : y;
return x > y ? x : y;
}
}
template <typename T, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> max(vecType<T, P> const & a, vecType<T, P> const & b)
{
return detail::functor2<T, P, vecType>::call(max, a, b);
}
VECTORIZE_VEC_SCA(max)
VECTORIZE_VEC_SCA(max)
VECTORIZE_VEC_VEC(max)
// clamp
// clamp
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType clamp
GLM_FUNC_QUALIFIER genType clamp(genType const & x, genType const & minVal, genType const & maxVal)
(
genType const & x,
genType const & minVal,
genType const & maxVal
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer, "'clamp' only accept floating-point or integer inputs");
std::numeric_limits<genType>::is_iec559 || std::numeric_limits<genType>::is_integer,
"'clamp' only accept floating-point or integer inputs");
return min(maxVal, max(minVal, x));
return min(maxVal, max(minVal, x));
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> clamp
GLM_FUNC_QUALIFIER tvec2<T, P> clamp(tvec2<T, P> const & x, T const & minVal, T const & maxVal)
(
tvec2<T, P> const & x,
T const & minVal,
T const & maxVal
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
"'clamp' only accept floating-point or integer inputs");
return tvec2<T, P>(
return tvec2<T, P>(
clamp(x.x, minVal, maxVal),
clamp(x.x, minVal, maxVal),
@ -439,16 +409,9 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> clamp
GLM_FUNC_QUALIFIER tvec3<T, P> clamp(tvec3<T, P> const & x, T const & minVal, T const & maxVal)
(
tvec3<T, P> const & x,
T const & minVal,
T const & maxVal
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
"'clamp' only accept floating-point or integer inputs");
return tvec3<T, P>(
return tvec3<T, P>(
clamp(x.x, minVal, maxVal),
clamp(x.x, minVal, maxVal),
@ -457,16 +420,9 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> clamp
GLM_FUNC_QUALIFIER tvec4<T, P> clamp(tvec4<T, P> const & x, T const & minVal, T const & maxVal)
(
tvec4<T, P> const & x,
T const & minVal,
T const & maxVal
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
"'clamp' only accept floating-point or integer inputs");
return tvec4<T, P>(
return tvec4<T, P>(
clamp(x.x, minVal, maxVal),
clamp(x.x, minVal, maxVal),
@ -476,16 +432,9 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> clamp
GLM_FUNC_QUALIFIER tvec2<T, P> clamp(tvec2<T, P> const & x, tvec2<T, P> const & minVal, tvec2<T, P> const & maxVal)
(
tvec2<T, P> const & x,
tvec2<T, P> const & minVal,
tvec2<T, P> const & maxVal
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
"'clamp' only accept floating-point or integer inputs");
return tvec2<T, P>(
return tvec2<T, P>(
clamp(x.x, minVal.x, maxVal.x),
clamp(x.x, minVal.x, maxVal.x),
@ -493,16 +442,9 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> clamp
GLM_FUNC_QUALIFIER tvec3<T, P> clamp(tvec3<T, P> const & x, tvec3<T, P> const & minVal, tvec3<T, P> const & maxVal)
(
tvec3<T, P> const & x,
tvec3<T, P> const & minVal,
tvec3<T, P> const & maxVal
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
"'clamp' only accept floating-point or integer inputs");
return tvec3<T, P>(
return tvec3<T, P>(
clamp(x.x, minVal.x, maxVal.x),
clamp(x.x, minVal.x, maxVal.x),
@ -511,16 +453,9 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> clamp
GLM_FUNC_QUALIFIER tvec4<T, P> clamp(tvec4<T, P> const & x, tvec4<T, P> const & minVal, tvec4<T, P> const & maxVal)
(
tvec4<T, P> const & x,
tvec4<T, P> const & minVal,
tvec4<T, P> const & maxVal
)
{
{
GLM_STATIC_ASSERT(
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer,
"'clamp' only accept floating-point or integer inputs");
return tvec4<T, P>(
return tvec4<T, P>(
clamp(x.x, minVal.x, maxVal.x),
clamp(x.x, minVal.x, maxVal.x),
@ -530,55 +465,32 @@ namespace detail
}
}
template <typename T, typename U, precision P, template <typename, precision> class vecType>
template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> mix
GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, vecType<U, P> const & a)
(
vecType<T, P> const & x,
vecType<T, P> const & y,
vecType<U, P> const & a
)
{
{
return detail::compute_mix_vector<T, U, P, vecType>::call(x, y, a);
return detail::compute_mix_vector<T, U, P, vecType>::call(x, y, a);
}
}
template <typename T, typename U, precision P, template <typename, precision> class vecType>
template <typename T, typename U, precision P, template <typename, precision> class vecType>
GLM_FUNC_QUALIFIER vecType<T, P> mix
GLM_FUNC_QUALIFIER vecType<T, P> mix(vecType<T, P> const & x, vecType<T, P> const & y, U const & a)
(
vecType<T, P> const & x,
vecType<T, P> const & y,
U const & a
)
{
{
return detail::compute_mix_scalar<T, U, P, vecType>::call(x, y, a);
return detail::compute_mix_scalar<T, U, P, vecType>::call(x, y, a);
}
}
template <typename genTypeT, typename genTypeU>
template <typename genTypeT, typename genTypeU>
GLM_FUNC_QUALIFIER genTypeT mix
GLM_FUNC_QUALIFIER genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a)
(
genTypeT const & x,
genTypeT const & y,
genTypeU const & a
)
{
{
return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a);
return detail::compute_mix<genTypeT, genTypeU>::call(x, y, a);
}
}
// step
// step
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType step
GLM_FUNC_QUALIFIER genType step(genType const & edge, genType const & x)
(
genType const & edge,
genType const & x
)
{
{
return mix(genType(1), genType(0), glm::lessThan(x, edge));
return mix(genType(1), genType(0), glm::lessThan(x, edge));
}
}
template <template <typename, precision> class vecType, typename T, precision P>
template <template <typename, precision> class vecType, typename T, precision P>
GLM_FUNC_QUALIFIER vecType<T, P> step
GLM_FUNC_QUALIFIER vecType<T, P> step(T const & edge, vecType<T, P> const & x)
(
T const & edge,
vecType<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'step' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'step' only accept floating-point inputs");
@ -587,12 +499,7 @@ namespace detail
// smoothstep
// smoothstep
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType smoothstep
GLM_FUNC_QUALIFIER genType smoothstep(genType const & edge0, genType const & edge1, genType const & x)
(
genType const & edge0,
genType const & edge1,
genType const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'smoothstep' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -601,12 +508,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> smoothstep
GLM_FUNC_QUALIFIER tvec2<T, P> smoothstep(T const & edge0, T const & edge1, tvec2<T, P> const & x)
(
T const & edge0,
T const & edge1,
tvec2<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -616,12 +518,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> smoothstep
GLM_FUNC_QUALIFIER tvec3<T, P> smoothstep(T const & edge0, T const & edge1, tvec3<T, P> const & x)
(
T const & edge0,
T const & edge1,
tvec3<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -632,12 +529,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> smoothstep
GLM_FUNC_QUALIFIER tvec4<T, P> smoothstep(T const & edge0, T const & edge1, tvec4<T, P> const & x)
(
T const & edge0,
T const & edge1,
tvec4<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -649,12 +541,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> smoothstep
GLM_FUNC_QUALIFIER tvec2<T, P> smoothstep(tvec2<T, P> const & edge0, tvec2<T, P> const & edge1, tvec2<T, P> const & x)
(
tvec2<T, P> const & edge0,
tvec2<T, P> const & edge1,
tvec2<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -664,12 +551,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> smoothstep
GLM_FUNC_QUALIFIER tvec3<T, P> smoothstep(tvec3<T, P> const & edge0, tvec3<T, P> const & edge1, tvec3<T, P> const & x)
(
tvec3<T, P> const & edge0,
tvec3<T, P> const & edge1,
tvec3<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -680,12 +562,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> smoothstep
GLM_FUNC_QUALIFIER tvec4<T, P> smoothstep(tvec4<T, P> const & edge0, tvec4<T, P> const & edge1, tvec4<T, P> const & x)
(
tvec4<T, P> const & edge0,
tvec4<T, P> const & edge1,
tvec4<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'smoothstep' only accept floating-point inputs");
@ -720,10 +597,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tvec1<T, P>::bool_type isnan
GLM_FUNC_QUALIFIER typename tvec1<T, P>::bool_type isnan(tvec1<T, P> const & x)
(
tvec1<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
@ -732,10 +606,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type isnan
GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type isnan(tvec2<T, P> const & x)
(
tvec2<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
@ -745,10 +616,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type isnan
GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type isnan(tvec3<T, P> const & x)
(
tvec3<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
@ -759,10 +627,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type isnan
GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type isnan(tvec4<T, P> const & x)
(
tvec4<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isnan' only accept floating-point inputs");
@ -774,8 +639,7 @@ namespace detail
}
}
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER bool isinf(
GLM_FUNC_QUALIFIER bool isinf(genType const & x)
genType const & x)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isinf' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'isinf' only accept floating-point inputs");
@ -798,10 +662,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tvec1<T, P>::bool_type isinf
GLM_FUNC_QUALIFIER typename tvec1<T, P>::bool_type isinf(tvec1<T, P> const & x)
(
tvec1<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
@ -810,10 +671,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type isinf
GLM_FUNC_QUALIFIER typename tvec2<T, P>::bool_type isinf(tvec2<T, P> const & x)
(
tvec2<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
@ -823,10 +681,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type isinf
GLM_FUNC_QUALIFIER typename tvec3<T, P>::bool_type isinf(tvec3<T, P> const & x)
(
tvec3<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
@ -837,10 +692,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type isinf
GLM_FUNC_QUALIFIER typename tvec4<T, P>::bool_type isinf(tvec4<T, P> const & x)
(
tvec4<T, P> const & x
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isinf' only accept floating-point inputs");
@ -896,22 +748,13 @@ namespace detail
}
}
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType fma
GLM_FUNC_QUALIFIER genType fma(genType const & a, genType const & b, genType const & c)
(
genType const & a,
genType const & b,
genType const & c
)
{
{
return a * b + c;
return a * b + c;
}
}
template <typename genType>
template <typename genType>
GLM_FUNC_QUALIFIER genType frexp
GLM_FUNC_QUALIFIER genType frexp(genType const & x, int & exp)
(
genType const & x,
int & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'frexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'frexp' only accept floating-point inputs");
@ -919,11 +762,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> frexp
GLM_FUNC_QUALIFIER tvec1<T, P> frexp(tvec1<T, P> const & x, tvec1<int, P> & exp)
(
tvec1<T, P> const & x,
tvec1<int, P> & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
@ -931,11 +770,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> frexp
GLM_FUNC_QUALIFIER tvec2<T, P> frexp(tvec2<T, P> const & x, tvec2<int, P> & exp)
(
tvec2<T, P> const & x,
tvec2<int, P> & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
@ -945,11 +780,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> frexp
GLM_FUNC_QUALIFIER tvec3<T, P> frexp(tvec3<T, P> const & x, tvec3<int, P> & exp)
(
tvec3<T, P> const & x,
tvec3<int, P> & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
@ -960,11 +791,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> frexp
GLM_FUNC_QUALIFIER tvec4<T, P> frexp(tvec4<T, P> const & x, tvec4<int, P> & exp)
(
tvec4<T, P> const & x,
tvec4<int, P> & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'frexp' only accept floating-point inputs");
@ -976,11 +803,7 @@ namespace detail
}
}
template <typename genType, precision P>
template <typename genType, precision P>
GLM_FUNC_QUALIFIER genType ldexp
GLM_FUNC_QUALIFIER genType ldexp(genType const & x, int const & exp)
(
genType const & x,
int const & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'ldexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'ldexp' only accept floating-point inputs");
@ -988,11 +811,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec1<T, P> ldexp
GLM_FUNC_QUALIFIER tvec1<T, P> ldexp(tvec1<T, P> const & x, tvec1<int, P> const & exp)
(
tvec1<T, P> const & x,
tvec1<int, P> const & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
@ -1001,11 +820,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec2<T, P> ldexp
GLM_FUNC_QUALIFIER tvec2<T, P> ldexp(tvec2<T, P> const & x, tvec2<int, P> const & exp)
(
tvec2<T, P> const & x,
tvec2<int, P> const & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
@ -1015,11 +830,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec3<T, P> ldexp
GLM_FUNC_QUALIFIER tvec3<T, P> ldexp(tvec3<T, P> const & x, tvec3<int, P> const & exps)
(
tvec3<T, P> const & x,
tvec3<int, P> const & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
@ -1030,11 +841,7 @@ namespace detail
}
}
template <typename T, precision P>
template <typename T, precision P>
GLM_FUNC_QUALIFIER tvec4<T, P> ldexp
GLM_FUNC_QUALIFIER tvec4<T, P> ldexp(tvec4<T, P> const & x, tvec4<int, P> const & exp)
(
tvec4<T, P> const & x,
tvec4<int, P> const & exp
)
{
{
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'ldexp' only accept floating-point inputs");
@ -1044,5 +851,4 @@ namespace detail
ldexp(x.z, exp.z),
ldexp(x.z, exp.z),
ldexp(x.w, exp.w));
ldexp(x.w, exp.w));
}
}
}//namespace glm
}//namespace glm