mirror of
https://github.com/g-truc/glm.git
synced 2026-06-08 02:23:48 +00:00
Remove GLM_HAS_STATIC_ASSERT C++11 workarounds
This commit is contained in:
@@ -87,7 +87,7 @@ $(function() {
|
||||
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>  {</div>
|
||||
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  GLM_FUNC_QUALIFIER GLM_CONSTEXPR <span class="keyword">static</span> genFIType call(genFIType x)</div>
|
||||
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  {</div>
|
||||
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  GLM_STATIC_ASSERT(</div>
|
||||
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  static_assert(</div>
|
||||
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  std::numeric_limits<genFIType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genFIType>::is_signed,</div>
|
||||
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  <span class="stringliteral">"'abs' only accept floating-point and integer scalar or vector inputs"</span>);</div>
|
||||
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  </div>
|
||||
@@ -112,7 +112,7 @@ $(function() {
|
||||
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  {</div>
|
||||
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  GLM_FUNC_QUALIFIER GLM_CONSTEXPR <span class="keyword">static</span> genFIType call(genFIType x)</div>
|
||||
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  {</div>
|
||||
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  GLM_STATIC_ASSERT(</div>
|
||||
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  static_assert(</div>
|
||||
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  (!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer),</div>
|
||||
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="stringliteral">"'abs' only accept floating-point and integer scalar or vector inputs"</span>);</div>
|
||||
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordflow">return</span> x;</div>
|
||||
|
||||
@@ -501,11 +501,11 @@ $(function() {
|
||||
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span> <span class="comment">// Static assert</span></div>
|
||||
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  </div>
|
||||
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span> <span class="preprocessor">#if GLM_HAS_STATIC_ASSERT</span></div>
|
||||
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span> <span class="preprocessor"># define GLM_STATIC_ASSERT(x, message) static_assert(x, message)</span></div>
|
||||
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span> <span class="preprocessor"># define static_assert(x, message) static_assert(x, message)</span></div>
|
||||
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span> <span class="preprocessor">#elif GLM_COMPILER & GLM_COMPILER_VC</span></div>
|
||||
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span> <span class="preprocessor"># define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]</span></div>
|
||||
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span> <span class="preprocessor"># define static_assert(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]</span></div>
|
||||
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span> <span class="preprocessor">#else</span></div>
|
||||
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span> <span class="preprocessor"># define GLM_STATIC_ASSERT(x, message) assert(x)</span></div>
|
||||
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span> <span class="preprocessor"># define static_assert(x, message) assert(x)</span></div>
|
||||
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span> <span class="preprocessor">#endif//GLM_LANG</span></div>
|
||||
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  </div>
|
||||
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span> <span class="comment">// Qualifiers</span></div>
|
||||
|
||||
@@ -97,19 +97,19 @@ $(function() {
|
||||
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  <span class="keyword">template</span><std::<span class="keywordtype">size_t</span> I,glm::length_t L,<span class="keyword">typename</span> T,glm::qualifier Q></div>
|
||||
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keyword">struct </span>tuple_element<I, glm::vec<L,T,Q>></div>
|
||||
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  {</div>
|
||||
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  GLM_STATIC_ASSERT(I < L,<span class="stringliteral">"Index out of bounds"</span>);</div>
|
||||
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  static_assert(I < L,<span class="stringliteral">"Index out of bounds"</span>);</div>
|
||||
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="keyword">typedef</span> T type;</div>
|
||||
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  };</div>
|
||||
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="keyword">template</span><std::<span class="keywordtype">size_t</span> I, glm::length_t C, glm::length_t R, <span class="keyword">typename</span> T, glm::qualifier Q></div>
|
||||
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keyword">struct </span>tuple_element<I, glm::mat<C,R, T, Q>></div>
|
||||
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  {</div>
|
||||
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  GLM_STATIC_ASSERT(I < C, <span class="stringliteral">"Index out of bounds"</span>);</div>
|
||||
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  static_assert(I < C, <span class="stringliteral">"Index out of bounds"</span>);</div>
|
||||
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keyword">typedef</span> glm::vec<R,T,Q> type;</div>
|
||||
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  };</div>
|
||||
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">template</span><std::<span class="keywordtype">size_t</span> I, <span class="keyword">typename</span> T, glm::qualifier Q></div>
|
||||
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keyword">struct </span>tuple_element<I, glm::qua<T, Q>></div>
|
||||
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  {</div>
|
||||
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  GLM_STATIC_ASSERT(I < 4, <span class="stringliteral">"Index out of bounds"</span>);</div>
|
||||
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  static_assert(I < 4, <span class="stringliteral">"Index out of bounds"</span>);</div>
|
||||
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keyword">typedef</span> T type;</div>
|
||||
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  };</div>
|
||||
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  </div>
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
static_assert(
|
||||
std::numeric_limits<genFIType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genFIType>::is_signed,
|
||||
"'abs' only accept floating-point and integer scalar or vector inputs");
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static genFIType call(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
static_assert(
|
||||
(!std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer),
|
||||
"'abs' only accept floating-point and integer scalar or vector inputs");
|
||||
return x;
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType min(genType x, genType y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genType>::is_integer, "'min' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genType>::is_integer, "'min' only accept floating-point or integer inputs");
|
||||
return (y < x) ? y : x;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType max(genType x, genType y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genType>::is_integer, "'max' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genType>::is_integer, "'max' only accept floating-point or integer inputs");
|
||||
|
||||
return (x < y) ? y : x;
|
||||
}
|
||||
@@ -89,7 +89,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, U, Q> const& a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
static_assert(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
|
||||
return vec<L, T, Q>(vec<L, U, Q>(x) * (static_cast<U>(1) - a) + vec<L, U, Q>(y) * a);
|
||||
}
|
||||
@@ -112,7 +112,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x, vec<L, T, Q> const& y, U const& a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
static_assert(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
|
||||
return vec<L, T, Q>(vec<L, U, Q>(x) * (static_cast<U>(1) - a) + vec<L, U, Q>(y) * a);
|
||||
}
|
||||
@@ -132,7 +132,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static T call(T const& x, T const& y, U const& a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
static_assert(std::numeric_limits<U>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'mix' only accept floating-point inputs for the interpolator a");
|
||||
|
||||
return static_cast<T>(static_cast<U>(x) * (static_cast<U>(1) - a) + static_cast<U>(y) * a);
|
||||
}
|
||||
@@ -220,7 +220,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'mod' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
|
||||
return a - b * floor(a / b);
|
||||
}
|
||||
};
|
||||
@@ -275,7 +275,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& edge0, vec<L, T, Q> const& edge1, vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
|
||||
vec<L, T, Q> 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);
|
||||
}
|
||||
@@ -349,7 +349,7 @@ namespace detail
|
||||
template<typename genFIType>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genFIType sign(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
static_assert(
|
||||
std::numeric_limits<genFIType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || (std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer),
|
||||
"'sign' only accept signed inputs");
|
||||
|
||||
@@ -360,7 +360,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> sign(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
static_assert(
|
||||
std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || (std::numeric_limits<T>::is_signed && std::numeric_limits<T>::is_integer),
|
||||
"'sign' only accept signed inputs");
|
||||
|
||||
@@ -372,21 +372,21 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> floor(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'floor' only accept floating-point inputs.");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'floor' only accept floating-point inputs.");
|
||||
return detail::compute_floor<L, T, Q, detail::is_aligned<Q>::value>::call(x);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> trunc(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'trunc' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'trunc' only accept floating-point inputs");
|
||||
return detail::compute_trunc<L, T, Q, detail::is_aligned<Q>::value>::call(x);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> round(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'round' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'round' only accept floating-point inputs");
|
||||
return detail::compute_round<L, T, Q, detail::is_aligned<Q>::value>::call(x);
|
||||
}
|
||||
|
||||
@@ -395,8 +395,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType roundEven(genType const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs");
|
||||
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs");
|
||||
return genType(int(x + genType(int(x) % 2)));
|
||||
}
|
||||
*/
|
||||
@@ -405,7 +404,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType roundEven(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs");
|
||||
|
||||
int Integer = static_cast<int>(x);
|
||||
genType IntegerPart = static_cast<genType>(Integer);
|
||||
@@ -436,7 +435,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> roundEven(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'roundEven' only accept floating-point inputs");
|
||||
return detail::functor1<vec, L, T, T, Q>::call(roundEven, x);
|
||||
}
|
||||
|
||||
@@ -445,7 +444,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> ceil(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceil' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceil' only accept floating-point inputs");
|
||||
return detail::compute_ceil<L, T, Q, detail::is_aligned<Q>::value>::call(x);
|
||||
}
|
||||
|
||||
@@ -459,7 +458,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> fract(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fract' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fract' only accept floating-point inputs");
|
||||
return detail::compute_fract<L, T, Q, detail::is_aligned<Q>::value>::call(x);
|
||||
}
|
||||
|
||||
@@ -547,7 +546,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType modf(genType x, genType & i)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'modf' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'modf' only accept floating-point inputs");
|
||||
return std::modf(x, &i);
|
||||
}
|
||||
|
||||
@@ -597,7 +596,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& a, T b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<T>::is_integer, "'min' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<T>::is_integer, "'min' only accept floating-point or integer inputs");
|
||||
return detail::compute_min_vector<L, T, Q, detail::is_aligned<Q>::value>::call(a, vec<L, T, Q>(b));
|
||||
}
|
||||
|
||||
@@ -611,7 +610,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& a, T b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<T>::is_integer, "'max' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<T>::is_integer, "'max' only accept floating-point or integer inputs");
|
||||
return detail::compute_max_vector<L, T, Q, detail::is_aligned<Q>::value>::call(a, vec<L, T, Q>(b));
|
||||
}
|
||||
|
||||
@@ -625,21 +624,21 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType clamp(genType x, genType minVal, genType maxVal)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genType>::is_integer, "'clamp' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<genType>::is_integer, "'clamp' only accept floating-point or integer inputs");
|
||||
return min(max(x, minVal), maxVal);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, T minVal, T maxVal)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
|
||||
return detail::compute_clamp_vector<L, T, Q, detail::is_aligned<Q>::value>::call(x, vec<L, T, Q>(minVal), vec<L, T, Q>(maxVal));
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> clamp(vec<L, T, Q> const& x, vec<L, T, Q> const& minVal, vec<L, T, Q> const& maxVal)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || std::numeric_limits<T>::is_integer, "'clamp' only accept floating-point or integer inputs");
|
||||
return detail::compute_clamp_vector<L, T, Q, detail::is_aligned<Q>::value>::call(x, minVal, maxVal);
|
||||
}
|
||||
|
||||
@@ -684,7 +683,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType smoothstep(genType edge0, genType edge1, genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'smoothstep' only accept floating-point inputs");
|
||||
|
||||
genType const tmp(clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1)));
|
||||
return tmp * tmp * (genType(3) - genType(2) * tmp);
|
||||
@@ -707,7 +706,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, Q> isnan(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isnan' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isnan' only accept floating-point inputs");
|
||||
|
||||
vec<L, bool, Q> Result(0);
|
||||
for (length_t l = 0; l < v.length(); ++l)
|
||||
@@ -720,7 +719,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, Q> isinf(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isinf' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isinf' only accept floating-point inputs");
|
||||
|
||||
vec<L, bool, Q> Result(0);
|
||||
for (length_t l = 0; l < v.length(); ++l)
|
||||
@@ -809,7 +808,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType frexp(genType x, int& exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'frexp' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'frexp' only accept floating-point inputs");
|
||||
|
||||
return std::frexp(x, &exp);
|
||||
}
|
||||
@@ -817,7 +816,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> frexp(vec<L, T, Q> const& v, vec<L, int, Q>& exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'frexp' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'frexp' only accept floating-point inputs");
|
||||
|
||||
vec<L, T, Q> Result(0);
|
||||
for (length_t l = 0; l < v.length(); ++l)
|
||||
@@ -828,7 +827,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType ldexp(genType const& x, int const& exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ldexp' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ldexp' only accept floating-point inputs");
|
||||
|
||||
return std::ldexp(x, exp);
|
||||
}
|
||||
@@ -836,7 +835,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> ldexp(vec<L, T, Q> const& v, vec<L, int, Q> const& exp)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ldexp' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ldexp' only accept floating-point inputs");
|
||||
|
||||
vec<L, T, Q> Result(0);
|
||||
for (length_t l = 0; l < v.length(); ++l)
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'log2' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'log2' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
|
||||
|
||||
return detail::functor1<vec, L, T, T, Q>::call(log2, v);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> sqrt(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sqrt' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sqrt' only accept floating-point inputs");
|
||||
return detail::compute_sqrt<L, T, Q, detail::is_aligned<Q>::value>::call(x);
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> inversesqrt(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'inversesqrt' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'inversesqrt' only accept floating-point inputs");
|
||||
return detail::compute_inversesqrt<L, T, Q, detail::is_aligned<Q>::value>::call(x);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<3, T, Q> call(vec<3, T, Q> const& x, vec<3, T, Q> const& y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'cross' accepts only floating-point inputs");
|
||||
|
||||
return vec<3, T, Q>(
|
||||
x.y * y.z - y.y * x.z,
|
||||
@@ -84,7 +84,7 @@ namespace detail
|
||||
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<4, T, Q> call(vec<4, T, Q> const& x, vec<4, T, Q> const& y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'cross' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'cross' accepts only floating-point inputs");
|
||||
|
||||
return vec<4, T, Q>(
|
||||
x.y * y.z - y.y * x.z,
|
||||
@@ -99,7 +99,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
|
||||
return v * inversesqrt(dot(v, v));
|
||||
}
|
||||
@@ -110,7 +110,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& N, vec<L, T, Q> const& I, vec<L, T, Q> const& Nref)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
|
||||
return dot(Nref, I) < static_cast<T>(0) ? N : -N;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType length(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'length' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559, "'length' accepts only floating-point inputs");
|
||||
|
||||
return abs(x);
|
||||
}
|
||||
@@ -151,7 +151,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER T length(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'length' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'length' accepts only floating-point inputs");
|
||||
|
||||
return detail::compute_length<L, T, Q, detail::is_aligned<Q>::value>::call(v);
|
||||
}
|
||||
@@ -160,7 +160,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType distance(genType const& p0, genType const& p1)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'distance' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559, "'distance' accepts only floating-point inputs");
|
||||
|
||||
return length(p1 - p0);
|
||||
}
|
||||
@@ -175,14 +175,14 @@ namespace detail
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(T x, T y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
|
||||
return x * y;
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'dot' accepts only floating-point inputs");
|
||||
return detail::compute_dot<vec<L, T, Q>, T, detail::is_aligned<Q>::value>::call(x, y);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType normalize(genType const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
|
||||
return x < genType(0) ? genType(-1) : genType(1);
|
||||
}
|
||||
@@ -205,7 +205,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> normalize(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'normalize' accepts only floating-point inputs");
|
||||
|
||||
return detail::compute_normalize<L, T, Q, detail::is_aligned<Q>::value>::call(x);
|
||||
}
|
||||
@@ -240,7 +240,7 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType refract(genType const& I, genType const& N, genType eta)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'refract' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559, "'refract' accepts only floating-point inputs");
|
||||
genType const dotValue(dot(N, I));
|
||||
genType const k(static_cast<genType>(1) - eta * eta * (static_cast<genType>(1) - dotValue * dotValue));
|
||||
return (eta * I - (eta * dotValue + sqrt(k)) * N) * static_cast<genType>(k >= static_cast<genType>(0));
|
||||
@@ -249,7 +249,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> refract(vec<L, T, Q> const& I, vec<L, T, Q> const& N, T eta)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'refract' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'refract' accepts only floating-point inputs");
|
||||
return detail::compute_refract<L, T, Q, detail::is_aligned<Q>::value>::call(I, N, eta);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
@@ -253,7 +253,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldExtract(vec<L, T, Q> const& Value, int Offset, int Bits)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldExtract' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'bitfieldExtract' only accept integer inputs");
|
||||
|
||||
return (Value >> static_cast<T>(Offset)) & static_cast<T>(detail::mask(Bits));
|
||||
}
|
||||
@@ -262,7 +262,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType bitfieldInsert(genIUType const& Base, genIUType const& Insert, int Offset, int Bits)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'bitfieldInsert' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'bitfieldInsert' only accept integer values");
|
||||
|
||||
return bitfieldInsert(vec<1, genIUType>(Base), vec<1, genIUType>(Insert), Offset, Bits).x;
|
||||
}
|
||||
@@ -270,7 +270,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldInsert(vec<L, T, Q> const& Base, vec<L, T, Q> const& Insert, int Offset, int Bits)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldInsert' only accept integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'bitfieldInsert' only accept integer values");
|
||||
|
||||
T const Mask = detail::mask(static_cast<T>(Bits)) << Offset;
|
||||
return (Base & ~Mask) | ((Insert << static_cast<T>(Offset)) & Mask);
|
||||
@@ -285,7 +285,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType bitfieldReverse(genIUType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'bitfieldReverse' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'bitfieldReverse' only accept integer values");
|
||||
|
||||
return bitfieldReverse(glm::vec<1, genIUType, glm::defaultp>(x)).x;
|
||||
}
|
||||
@@ -293,7 +293,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldReverse(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldReverse' only accept integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'bitfieldReverse' only accept integer values");
|
||||
|
||||
vec<L, T, Q> x(v);
|
||||
x = detail::compute_bitfieldReverseStep<L, T, Q, detail::is_aligned<Q>::value, sizeof(T) * 8>= 2>::call(x, static_cast<T>(0x5555555555555555ull), static_cast<T>( 1));
|
||||
@@ -313,7 +313,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER int bitCount(genIUType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'bitCount' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'bitCount' only accept integer values");
|
||||
|
||||
return bitCount(glm::vec<1, genIUType, glm::defaultp>(x)).x;
|
||||
}
|
||||
@@ -321,7 +321,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, int, Q> bitCount(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
|
||||
|
||||
# if GLM_COMPILER & GLM_COMPILER_VC
|
||||
# pragma warning(push)
|
||||
@@ -346,7 +346,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER int findLSB(genIUType Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
|
||||
|
||||
return detail::compute_findLSB<genIUType, sizeof(genIUType) * 8>::call(Value);
|
||||
}
|
||||
@@ -354,7 +354,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, int, Q> findLSB(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findLSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'findLSB' only accept integer values");
|
||||
|
||||
return detail::functor1<vec, L, int, T, Q>::call(findLSB, x);
|
||||
}
|
||||
@@ -363,7 +363,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER int findMSB(genIUType v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
|
||||
return findMSB(vec<1, genIUType>(v)).x;
|
||||
}
|
||||
@@ -371,7 +371,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, int, Q> findMSB(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findMSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'findMSB' only accept integer values");
|
||||
|
||||
return detail::compute_findMSB_vec<L, T, Q, static_cast<int>(sizeof(T) * 8)>::call(v);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace detail
|
||||
struct compute_matrixCompMult_type {
|
||||
GLM_FUNC_QUALIFIER static mat<C, R, T, Q> call(mat<C, R, T, Q> const& x, mat<C, R, T, Q> const& y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE,
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE,
|
||||
"'matrixCompMult' only accept floating-point inputs, include <glm/ext/matrix_integer.hpp> to discard this restriction.");
|
||||
return detail::compute_matrixCompMult<C, R, T, Q, detail::is_aligned<Q>::value>::call(x, y);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ namespace detail
|
||||
struct compute_outerProduct_type {
|
||||
GLM_FUNC_QUALIFIER static typename detail::outerProduct_trait<DA, DB, T, Q>::type call(vec<DA, T, Q> const& c, vec<DB, T, Q> const& r)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE,
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE,
|
||||
"'outerProduct' only accept floating-point inputs, include <glm/ext/matrix_integer.hpp> to discard this restriction.");
|
||||
|
||||
return detail::compute_outerProduct<DA, DB, T, Q>::call(c, r);
|
||||
@@ -231,7 +231,7 @@ namespace detail
|
||||
struct compute_transpose_type {
|
||||
GLM_FUNC_QUALIFIER static mat<R, C, T, Q> call(mat<C, R, T, Q> const& m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE,
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE,
|
||||
"'transpose' only accept floating-point inputs, include <glm/ext/matrix_integer.hpp> to discard this restriction.");
|
||||
return detail::compute_transpose<C, R, T, Q, detail::is_aligned<Q>::value>::call(m);
|
||||
}
|
||||
@@ -290,7 +290,7 @@ namespace detail
|
||||
|
||||
GLM_FUNC_QUALIFIER static T call(mat<C, R, T, Q> const& m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE,
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE,
|
||||
"'determinant' only accept floating-point inputs, include <glm/ext/matrix_integer.hpp> to discard this restriction.");
|
||||
return detail::compute_determinant<C, R, T, Q, detail::is_aligned<Q>::value>::call(m);
|
||||
}
|
||||
@@ -473,7 +473,7 @@ namespace detail
|
||||
template<length_t C, length_t R, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER mat<C, R, T, Q> inverse(mat<C, R, T, Q> const& m)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_GENTYPE, "'inverse' only accept floating-point inputs");
|
||||
return detail::compute_inverse<C, R, T, Q, detail::is_aligned<Q>::value>::call(m);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace detail
|
||||
template<qualifier Q>
|
||||
struct compute_matrixCompMult<4, 4, float, Q, true>
|
||||
{
|
||||
GLM_STATIC_ASSERT(detail::is_aligned<Q>::value, "Specialization requires aligned");
|
||||
static_assert(detail::is_aligned<Q>::value, "Specialization requires aligned");
|
||||
|
||||
GLM_FUNC_QUALIFIER static mat<4, 4, float, Q> call(mat<4, 4, float, Q> const& x, mat<4, 4, float, Q> const& y)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType radians(genType degrees)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'radians' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'radians' only accept floating-point input");
|
||||
|
||||
return degrees * static_cast<genType>(0.01745329251994329576923690768489);
|
||||
}
|
||||
@@ -23,7 +23,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType degrees(genType radians)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'degrees' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'degrees' only accept floating-point input");
|
||||
|
||||
return radians * static_cast<genType>(57.295779513082320876798154814105);
|
||||
}
|
||||
@@ -83,7 +83,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType atan(genType y, genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'atan' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'atan' only accept floating-point input");
|
||||
|
||||
return ::std::atan2(y, x);
|
||||
}
|
||||
|
||||
@@ -144,18 +144,6 @@
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Has of C++ features
|
||||
|
||||
// N1720
|
||||
#if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# define GLM_HAS_STATIC_ASSERT __has_feature(cxx_static_assert)
|
||||
#elif GLM_LANG & GLM_LANG_CXX11_FLAG
|
||||
# define GLM_HAS_STATIC_ASSERT 1
|
||||
#else
|
||||
# define GLM_HAS_STATIC_ASSERT ((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (\
|
||||
((GLM_COMPILER & GLM_COMPILER_CUDA)) || \
|
||||
((GLM_COMPILER & GLM_COMPILER_VC)) || \
|
||||
((GLM_COMPILER & GLM_COMPILER_HIP))))
|
||||
#endif
|
||||
|
||||
// N1988
|
||||
#if GLM_LANG & GLM_LANG_CXX11_FLAG
|
||||
# define GLM_HAS_EXTENDED_INTEGER_TYPE 1
|
||||
@@ -411,17 +399,6 @@
|
||||
# define GLM_NULLPTR 0
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Static assert
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
# define GLM_STATIC_ASSERT(x, message) static_assert(x, message)
|
||||
#elif GLM_COMPILER & GLM_COMPILER_VC
|
||||
# define GLM_STATIC_ASSERT(x, message) typedef char __CASSERT__##__LINE__[(x) ? 1 : -1]
|
||||
#else
|
||||
# define GLM_STATIC_ASSERT(x, message) assert(x)
|
||||
#endif//GLM_LANG
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Qualifiers
|
||||
|
||||
|
||||
@@ -122,25 +122,25 @@ namespace glm
|
||||
: value{col_type(x1, y1, z1, w1), col_type(x2, y2, z2, w2), col_type(x3, y3, z3, w3), col_type(x4, y4, z4, w4)}
|
||||
# endif
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X1>::is_iec559 || std::numeric_limits<X1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y1>::is_iec559 || std::numeric_limits<Y1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z1>::is_iec559 || std::numeric_limits<Z1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W1>::is_iec559 || std::numeric_limits<W1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<X1>::is_iec559 || std::numeric_limits<X1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
static_assert(std::numeric_limits<Y1>::is_iec559 || std::numeric_limits<Y1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
|
||||
static_assert(std::numeric_limits<Z1>::is_iec559 || std::numeric_limits<Z1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
|
||||
static_assert(std::numeric_limits<W1>::is_iec559 || std::numeric_limits<W1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
|
||||
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X2>::is_iec559 || std::numeric_limits<X2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y2>::is_iec559 || std::numeric_limits<Y2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z2>::is_iec559 || std::numeric_limits<Z2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W2>::is_iec559 || std::numeric_limits<W2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<X2>::is_iec559 || std::numeric_limits<X2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 5th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<Y2>::is_iec559 || std::numeric_limits<Y2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 6th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<Z2>::is_iec559 || std::numeric_limits<Z2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 7th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<W2>::is_iec559 || std::numeric_limits<W2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 8th parameter type invalid.");
|
||||
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X3>::is_iec559 || std::numeric_limits<X3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y3>::is_iec559 || std::numeric_limits<Y3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z3>::is_iec559 || std::numeric_limits<Z3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W3>::is_iec559 || std::numeric_limits<W3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<X3>::is_iec559 || std::numeric_limits<X3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 9th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<Y3>::is_iec559 || std::numeric_limits<Y3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 10th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<Z3>::is_iec559 || std::numeric_limits<Z3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 11th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<W3>::is_iec559 || std::numeric_limits<W3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 12th parameter type invalid.");
|
||||
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<X4>::is_iec559 || std::numeric_limits<X4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Y4>::is_iec559 || std::numeric_limits<Y4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<Z4>::is_iec559 || std::numeric_limits<Z4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<W4>::is_iec559 || std::numeric_limits<W4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<X4>::is_iec559 || std::numeric_limits<X4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 13th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<Y4>::is_iec559 || std::numeric_limits<Y4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 14th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<Z4>::is_iec559 || std::numeric_limits<Z4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 15th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<W4>::is_iec559 || std::numeric_limits<W4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 16th parameter type invalid.");
|
||||
|
||||
# if !GLM_HAS_INITIALIZER_LISTS
|
||||
this->value[0] = col_type(x1, y1, z1, w1);
|
||||
@@ -157,10 +157,10 @@ namespace glm
|
||||
: value{col_type(v1), col_type(v2), col_type(v3), col_type(v4)}
|
||||
# endif
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V2>::is_iec559 || std::numeric_limits<V2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V3>::is_iec559 || std::numeric_limits<V3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<V4>::is_iec559 || std::numeric_limits<V4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
|
||||
static_assert(std::numeric_limits<V1>::is_iec559 || std::numeric_limits<V1>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 1st parameter type invalid.");
|
||||
static_assert(std::numeric_limits<V2>::is_iec559 || std::numeric_limits<V2>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 2nd parameter type invalid.");
|
||||
static_assert(std::numeric_limits<V3>::is_iec559 || std::numeric_limits<V3>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 3rd parameter type invalid.");
|
||||
static_assert(std::numeric_limits<V4>::is_iec559 || std::numeric_limits<V4>::is_integer || GLM_CONFIG_UNRESTRICTED_GENTYPE, "*mat4x4 constructor only takes float and integer types, 4th parameter type invalid.");
|
||||
|
||||
# if !GLM_HAS_INITIALIZER_LISTS
|
||||
this->value[0] = col_type(v1);
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace glm
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q> mix(qua<T, Q> const& x, qua<T, Q> const& y, T a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'mix' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'mix' only accept floating-point inputs");
|
||||
|
||||
T const cosTheta = dot(x, y);
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace glm
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR qua<T, Q> lerp(qua<T, Q> const& x, qua<T, Q> const& y, T a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'lerp' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'lerp' only accept floating-point inputs");
|
||||
|
||||
// Lerp is only defined in [0, 1]
|
||||
assert(a >= static_cast<T>(0));
|
||||
@@ -40,7 +40,7 @@ namespace glm
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q> slerp(qua<T, Q> const& x, qua<T, Q> const& y, T a)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'slerp' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'slerp' only accept floating-point inputs");
|
||||
|
||||
qua<T, Q> z = y;
|
||||
|
||||
@@ -75,8 +75,8 @@ namespace glm
|
||||
template<typename T, typename S, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER qua<T, Q> slerp(qua<T, Q> const& x, qua<T, Q> const& y, T a, S k)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'slerp' only accept floating-point inputs");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<S>::is_integer, "'slerp' only accept integer for spin count");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'slerp' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<S>::is_integer, "'slerp' only accept integer for spin count");
|
||||
|
||||
qua<T, Q> z = y;
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace glm
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, Q> isnan(qua<T, Q> const& q)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isnan' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isnan' only accept floating-point inputs");
|
||||
|
||||
return vec<4, bool, Q>(isnan(q.x), isnan(q.y), isnan(q.z), isnan(q.w));
|
||||
}
|
||||
@@ -132,7 +132,7 @@ namespace glm
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<4, bool, Q> isinf(qua<T, Q> const& q)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isinf' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isinf' only accept floating-point inputs");
|
||||
|
||||
return vec<4, bool, Q>(isinf(q.x), isinf(q.y), isinf(q.z), isinf(q.w));
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ namespace glm
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR T dot(qua<T, Q> const& x, qua<T, Q> const& y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'dot' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'dot' accepts only floating-point inputs");
|
||||
return detail::compute_dot<qua<T, Q>, T, detail::is_aligned<Q>::value>::call(x, y);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T (fmin)(T a, T b, T c)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmin' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmin' only accept floating-point input");
|
||||
|
||||
if (isnan(a))
|
||||
return (fmin)(b, c);
|
||||
@@ -43,7 +43,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T (fmin)(T a, T b, T c, T d)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmin' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmin' only accept floating-point input");
|
||||
|
||||
if (isnan(a))
|
||||
return (fmin)(b, c, d);
|
||||
@@ -61,7 +61,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T (fmax)(T a, T b, T c)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmax' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmax' only accept floating-point input");
|
||||
|
||||
if (isnan(a))
|
||||
return (fmax)(b, c);
|
||||
@@ -75,7 +75,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T (fmax)(T a, T b, T c, T d)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmax' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fmax' only accept floating-point input");
|
||||
|
||||
if (isnan(a))
|
||||
return (fmax)(b, c, d);
|
||||
@@ -92,7 +92,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType fclamp(genType x, genType minVal, genType maxVal)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fclamp' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fclamp' only accept floating-point or integer inputs");
|
||||
return fmin((fmax)(x, minVal), maxVal);
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER int iround(genType const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'iround' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'iround' only accept floating-point inputs");
|
||||
assert(static_cast<genType>(0.0) <= x);
|
||||
|
||||
return static_cast<int>(x + static_cast<genType>(0.5));
|
||||
@@ -137,7 +137,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER uint uround(genType const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'uround' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'uround' only accept floating-point inputs");
|
||||
assert(static_cast<genType>(0.0) <= x);
|
||||
|
||||
return static_cast<uint>(x + static_cast<genType>(0.5));
|
||||
|
||||
@@ -5,14 +5,14 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType epsilon()
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'epsilon' only accepts floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'epsilon' only accepts floating-point inputs");
|
||||
return std::numeric_limits<genType>::epsilon();
|
||||
}
|
||||
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR genType pi()
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'pi' only accepts floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'pi' only accepts floating-point inputs");
|
||||
return static_cast<genType>(3.14159265358979323846264338327950288);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
|
||||
static_assert(!std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
|
||||
|
||||
vec<L, T, Q> const Sign(sign(x));
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vec<L, T, Q> call(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(!std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
|
||||
static_assert(!std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'ceilPowerOfTwo' only accept integer scalar or vector inputs");
|
||||
|
||||
vec<L, T, Q> v(x);
|
||||
|
||||
@@ -159,7 +159,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER bool isPowerOfTwo(genIUType Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'isPowerOfTwo' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'isPowerOfTwo' only accept integer inputs");
|
||||
|
||||
genIUType const Result = glm::abs(Value);
|
||||
return !(Result & (Result - 1));
|
||||
@@ -168,7 +168,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType nextPowerOfTwo(genIUType value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'nextPowerOfTwo' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'nextPowerOfTwo' only accept integer inputs");
|
||||
|
||||
return detail::compute_ceilPowerOfTwo<1, genIUType, defaultp, std::numeric_limits<genIUType>::is_signed>::call(vec<1, genIUType, defaultp>(value)).x;
|
||||
}
|
||||
@@ -176,7 +176,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType prevPowerOfTwo(genIUType value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'prevPowerOfTwo' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'prevPowerOfTwo' only accept integer inputs");
|
||||
|
||||
return isPowerOfTwo(value) ? value : static_cast<genIUType>(static_cast<genIUType>(1) << static_cast<genIUType>(findMSB(value)));
|
||||
}
|
||||
@@ -184,7 +184,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER bool isMultiple(genIUType Value, genIUType Multiple)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'isMultiple' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'isMultiple' only accept integer inputs");
|
||||
|
||||
return isMultiple(vec<1, genIUType>(Value), vec<1, genIUType>(Multiple)).x;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType nextMultiple(genIUType Source, genIUType Multiple)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'nextMultiple' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'nextMultiple' only accept integer inputs");
|
||||
|
||||
return detail::compute_ceilMultiple<std::numeric_limits<genIUType>::is_iec559, std::numeric_limits<genIUType>::is_signed>::call(Source, Multiple);
|
||||
}
|
||||
@@ -200,7 +200,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType prevMultiple(genIUType Source, genIUType Multiple)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'prevMultiple' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'prevMultiple' only accept integer inputs");
|
||||
|
||||
return detail::compute_floorMultiple<std::numeric_limits<genIUType>::is_iec559, std::numeric_limits<genIUType>::is_signed>::call(Source, Multiple);
|
||||
}
|
||||
@@ -208,7 +208,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER int findNSB(genIUType x, int significantBitCount)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findNSB' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'findNSB' only accept integer inputs");
|
||||
|
||||
if(bitCount(x) < significantBitCount)
|
||||
return -1;
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType sec(genType angle)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sec' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sec' only accept floating-point values");
|
||||
return genType(1) / glm::cos(angle);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType csc(genType angle)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csc' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csc' only accept floating-point values");
|
||||
return genType(1) / glm::sin(angle);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType cot(genType angle)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cot' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cot' only accept floating-point values");
|
||||
|
||||
genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0);
|
||||
return glm::tan(pi_over_2 - angle);
|
||||
@@ -35,7 +35,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType asec(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asec' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asec' only accept floating-point values");
|
||||
return acos(genType(1) / x);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType acsc(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsc' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsc' only accept floating-point values");
|
||||
return asin(genType(1) / x);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType acot(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acot' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acot' only accept floating-point values");
|
||||
|
||||
genType const pi_over_2 = genType(3.1415926535897932384626433832795 / 2.0);
|
||||
return pi_over_2 - atan(x);
|
||||
@@ -61,7 +61,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType sech(genType angle)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sech' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sech' only accept floating-point values");
|
||||
return genType(1) / glm::cosh(angle);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType csch(genType angle)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csch' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csch' only accept floating-point values");
|
||||
return genType(1) / glm::sinh(angle);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType coth(genType angle)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'coth' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'coth' only accept floating-point values");
|
||||
return glm::cosh(angle) / glm::sinh(angle);
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType asech(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asech' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asech' only accept floating-point values");
|
||||
return acosh(genType(1) / x);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType acsch(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsch' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsch' only accept floating-point values");
|
||||
return asinh(genType(1) / x);
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType acoth(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acoth' only accept floating-point values");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acoth' only accept floating-point values");
|
||||
return atanh(genType(1) / x);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
@@ -210,7 +210,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T nextFloat(T x, int ULPs)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'nextFloat' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'nextFloat' only accept floating-point input");
|
||||
assert(ULPs >= 0);
|
||||
|
||||
T temp = x;
|
||||
@@ -232,7 +232,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T prevFloat(T x, int ULPs)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'prevFloat' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'prevFloat' only accept floating-point input");
|
||||
assert(ULPs >= 0);
|
||||
|
||||
T temp = x;
|
||||
|
||||
@@ -5,84 +5,84 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& z)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'min' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'min' only accept floating-point or integer inputs");
|
||||
return glm::min(glm::min(x, y), z);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> min(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& z, vec<L, T, Q> const& w)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'min' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'min' only accept floating-point or integer inputs");
|
||||
return glm::min(glm::min(x, y), glm::min(z, w));
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& z)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'max' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'max' only accept floating-point or integer inputs");
|
||||
return glm::max(glm::max(x, y), z);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<L, T, Q> max(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& z, vec<L, T, Q> const& w)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'max' only accept floating-point or integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || std::numeric_limits<T>::is_integer, "'max' only accept floating-point or integer inputs");
|
||||
return glm::max(glm::max(x, y), glm::max(z, w));
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> fmin(vec<L, T, Q> const& a, T b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fmin' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'fmin' only accept floating-point inputs");
|
||||
return detail::functor2<vec, L, T, Q>::call(fmin, a, vec<L, T, Q>(b));
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> fmin(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fmin' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'fmin' only accept floating-point inputs");
|
||||
return detail::functor2<vec, L, T, Q>::call(fmin, a, b);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> fmin(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fmin' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'fmin' only accept floating-point inputs");
|
||||
return fmin(fmin(a, b), c);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> fmin(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c, vec<L, T, Q> const& d)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fmin' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'fmin' only accept floating-point inputs");
|
||||
return fmin(fmin(a, b), fmin(c, d));
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> fmax(vec<L, T, Q> const& a, T b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fmax' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'fmax' only accept floating-point inputs");
|
||||
return detail::functor2<vec, L, T, Q>::call(fmax, a, vec<L, T, Q>(b));
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> fmax(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fmax' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'fmax' only accept floating-point inputs");
|
||||
return detail::functor2<vec, L, T, Q>::call(fmax, a, b);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> fmax(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fmax' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'fmax' only accept floating-point inputs");
|
||||
return fmax(fmax(a, b), c);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> fmax(vec<L, T, Q> const& a, vec<L, T, Q> const& b, vec<L, T, Q> const& c, vec<L, T, Q> const& d)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'fmax' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'fmax' only accept floating-point inputs");
|
||||
return fmax(fmax(a, b), fmax(c, d));
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, int, Q> iround(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'iround' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'iround' only accept floating-point inputs");
|
||||
assert(all(lessThanEqual(vec<L, T, Q>(0), x)));
|
||||
|
||||
return vec<L, int, Q>(x + static_cast<T>(0.5));
|
||||
@@ -139,7 +139,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, uint, Q> uround(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'uround' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'uround' only accept floating-point inputs");
|
||||
assert(all(lessThanEqual(vec<L, T, Q>(0), x)));
|
||||
|
||||
return vec<L, uint, Q>(x + static_cast<T>(0.5));
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, Q> isPowerOfTwo(vec<L, T, Q> const& Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'isPowerOfTwo' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'isPowerOfTwo' only accept integer inputs");
|
||||
|
||||
vec<L, T, Q> const Result(abs(Value));
|
||||
return equal(Result & (Result - vec<L, T, Q>(1)), vec<L, T, Q>(0));
|
||||
@@ -14,7 +14,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> nextPowerOfTwo(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'nextPowerOfTwo' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'nextPowerOfTwo' only accept integer inputs");
|
||||
|
||||
return detail::compute_ceilPowerOfTwo<L, T, Q, std::numeric_limits<T>::is_signed>::call(v);
|
||||
}
|
||||
@@ -22,7 +22,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> prevPowerOfTwo(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'prevPowerOfTwo' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'prevPowerOfTwo' only accept integer inputs");
|
||||
|
||||
return detail::functor1<vec, L, T, T, Q>::call(prevPowerOfTwo, v);
|
||||
}
|
||||
@@ -30,7 +30,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, Q> isMultiple(vec<L, T, Q> const& Value, T Multiple)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'isMultiple' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'isMultiple' only accept integer inputs");
|
||||
|
||||
return equal(Value % Multiple, vec<L, T, Q>(0));
|
||||
}
|
||||
@@ -38,7 +38,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, Q> isMultiple(vec<L, T, Q> const& Value, vec<L, T, Q> const& Multiple)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'isMultiple' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'isMultiple' only accept integer inputs");
|
||||
|
||||
return equal(Value % Multiple, vec<L, T, Q>(0));
|
||||
}
|
||||
@@ -46,7 +46,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> nextMultiple(vec<L, T, Q> const& Source, T Multiple)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'nextMultiple' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'nextMultiple' only accept integer inputs");
|
||||
|
||||
return detail::functor2<vec, L, T, Q>::call(nextMultiple, Source, vec<L, T, Q>(Multiple));
|
||||
}
|
||||
@@ -54,7 +54,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> nextMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'nextMultiple' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'nextMultiple' only accept integer inputs");
|
||||
|
||||
return detail::functor2<vec, L, T, Q>::call(nextMultiple, Source, Multiple);
|
||||
}
|
||||
@@ -62,7 +62,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> prevMultiple(vec<L, T, Q> const& Source, T Multiple)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'prevMultiple' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'prevMultiple' only accept integer inputs");
|
||||
|
||||
return detail::functor2<vec, L, T, Q>::call(prevMultiple, Source, vec<L, T, Q>(Multiple));
|
||||
}
|
||||
@@ -70,7 +70,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> prevMultiple(vec<L, T, Q> const& Source, vec<L, T, Q> const& Multiple)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'prevMultiple' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'prevMultiple' only accept integer inputs");
|
||||
|
||||
return detail::functor2<vec, L, T, Q>::call(prevMultiple, Source, Multiple);
|
||||
}
|
||||
@@ -78,7 +78,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, int, Q> findNSB(vec<L, T, Q> const& Source, vec<L, int, Q> SignificantBitCount)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'findNSB' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'findNSB' only accept integer inputs");
|
||||
|
||||
return detail::functor2_vec_int<L, T, Q>::call(findNSB, Source, SignificantBitCount);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> sec(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sec' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sec' only accept floating-point inputs");
|
||||
return static_cast<T>(1) / detail::functor1<vec, L, T, T, Q>::call(cos, x);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> csc(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csc' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csc' only accept floating-point inputs");
|
||||
return static_cast<T>(1) / detail::functor1<vec, L, T, T, Q>::call(sin, x);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> cot(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cot' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cot' only accept floating-point inputs");
|
||||
T const pi_over_2 = static_cast<T>(3.1415926535897932384626433832795 / 2.0);
|
||||
return detail::functor1<vec, L, T, T, Q>::call(tan, pi_over_2 - x);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> asec(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asec' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asec' only accept floating-point inputs");
|
||||
return detail::functor1<vec, L, T, T, Q>::call(acos, static_cast<T>(1) / x);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> acsc(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsc' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsc' only accept floating-point inputs");
|
||||
return detail::functor1<vec, L, T, T, Q>::call(asin, static_cast<T>(1) / x);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> acot(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acot' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acot' only accept floating-point inputs");
|
||||
T const pi_over_2 = static_cast<T>(3.1415926535897932384626433832795 / 2.0);
|
||||
return pi_over_2 - detail::functor1<vec, L, T, T, Q>::call(atan, x);
|
||||
}
|
||||
@@ -59,7 +59,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> sech(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sech' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'sech' only accept floating-point inputs");
|
||||
return static_cast<T>(1) / detail::functor1<vec, L, T, T, Q>::call(cosh, x);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> csch(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csch' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'csch' only accept floating-point inputs");
|
||||
return static_cast<T>(1) / detail::functor1<vec, L, T, T, Q>::call(sinh, x);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> coth(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'coth' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'coth' only accept floating-point inputs");
|
||||
return glm::cosh(x) / glm::sinh(x);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> asech(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asech' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'asech' only accept floating-point inputs");
|
||||
return detail::functor1<vec, L, T, T, Q>::call(acosh, static_cast<T>(1) / x);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> acsch(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsch' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acsch' only accept floating-point inputs");
|
||||
return detail::functor1<vec, L, T, T, Q>::call(asinh, static_cast<T>(1) / x);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> acoth(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acoth' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'acoth' only accept floating-point inputs");
|
||||
return detail::functor1<vec, L, T, T, Q>::call(atanh, static_cast<T>(1) / x);
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
@@ -229,7 +229,7 @@ namespace detail
|
||||
template<typename genIUType>
|
||||
GLM_FUNC_QUALIFIER genIUType mask(genIUType Bits)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'mask' accepts only integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'mask' accepts only integer values");
|
||||
|
||||
return Bits >= static_cast<genIUType>(sizeof(genIUType) * 8) ? ~static_cast<genIUType>(0) : (static_cast<genIUType>(1) << Bits) - static_cast<genIUType>(1);
|
||||
}
|
||||
@@ -241,7 +241,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> mask(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'mask' accepts only integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'mask' accepts only integer values");
|
||||
|
||||
return detail::functor1<vec, L, T, T, Q>::call(mask, v);
|
||||
}
|
||||
@@ -249,7 +249,7 @@ namespace detail
|
||||
template<typename genIType>
|
||||
GLM_FUNC_QUALIFIER genIType bitfieldRotateRight(genIType In, int Shift)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateRight' accepts only integer values");
|
||||
static_assert(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateRight' accepts only integer values");
|
||||
|
||||
int const BitSize = static_cast<genIType>(sizeof(genIType) * 8);
|
||||
return (In << static_cast<genIType>(Shift)) | (In >> static_cast<genIType>(BitSize - Shift));
|
||||
@@ -258,7 +258,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldRotateRight(vec<L, T, Q> const& In, int Shift)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'bitfieldRotateRight' accepts only integer values");
|
||||
|
||||
int const BitSize = static_cast<int>(sizeof(T) * 8);
|
||||
return (In << static_cast<T>(Shift)) | (In >> static_cast<T>(BitSize - Shift));
|
||||
@@ -267,7 +267,7 @@ namespace detail
|
||||
template<typename genIType>
|
||||
GLM_FUNC_QUALIFIER genIType bitfieldRotateLeft(genIType In, int Shift)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
|
||||
static_assert(std::numeric_limits<genIType>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
|
||||
|
||||
int const BitSize = static_cast<genIType>(sizeof(genIType) * 8);
|
||||
return (In >> static_cast<genIType>(Shift)) | (In << static_cast<genIType>(BitSize - Shift));
|
||||
@@ -276,7 +276,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> bitfieldRotateLeft(vec<L, T, Q> const& In, int Shift)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'bitfieldRotateLeft' accepts only integer values");
|
||||
|
||||
int const BitSize = static_cast<int>(sizeof(T) * 8);
|
||||
return (In >> static_cast<T>(Shift)) | (In << static_cast<T>(BitSize - Shift));
|
||||
|
||||
@@ -685,8 +685,8 @@ namespace detail
|
||||
template<typename uintType, length_t L, typename floatType, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, uintType, Q> packUnorm(vec<L, floatType, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
static_assert(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
|
||||
static_assert(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
|
||||
return vec<L, uintType, Q>(round(clamp(v, static_cast<floatType>(0), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<uintType>::max())));
|
||||
}
|
||||
@@ -694,8 +694,8 @@ namespace detail
|
||||
template<typename floatType, length_t L, typename uintType, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, floatType, Q> unpackUnorm(vec<L, uintType, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
static_assert(std::numeric_limits<uintType>::is_integer, "uintType must be an integer type");
|
||||
static_assert(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
|
||||
return vec<L, floatType, Q>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<uintType>::max()));
|
||||
}
|
||||
@@ -703,8 +703,8 @@ namespace detail
|
||||
template<typename intType, length_t L, typename floatType, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, intType, Q> packSnorm(vec<L, floatType, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
static_assert(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||
static_assert(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
|
||||
return vec<L, intType, Q>(round(clamp(v , static_cast<floatType>(-1), static_cast<floatType>(1)) * static_cast<floatType>(std::numeric_limits<intType>::max())));
|
||||
}
|
||||
@@ -712,8 +712,8 @@ namespace detail
|
||||
template<typename floatType, length_t L, typename intType, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, floatType, Q> unpackSnorm(vec<L, intType, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
static_assert(std::numeric_limits<intType>::is_integer, "uintType must be an integer type");
|
||||
static_assert(std::numeric_limits<floatType>::is_iec559, "floatType must be a floating point type");
|
||||
|
||||
return clamp(vec<L, floatType, Q>(v) * (static_cast<floatType>(1) / static_cast<floatType>(std::numeric_limits<intType>::max())), static_cast<floatType>(-1), static_cast<floatType>(1));
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T next_float(T x, int ULPs)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'next_float' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'next_float' only accept floating-point input");
|
||||
assert(ULPs >= 0);
|
||||
|
||||
T temp = x;
|
||||
@@ -41,7 +41,7 @@ namespace glm
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T prev_float(T x, int ULPs)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'prev_float' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'prev_float' only accept floating-point input");
|
||||
assert(ULPs >= 0);
|
||||
|
||||
T temp = x;
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace detail
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER bool isdenormal(T const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
|
||||
return std::fpclassify(x) == FP_SUBNORMAL;
|
||||
}
|
||||
@@ -40,7 +40,7 @@ namespace detail
|
||||
vec<1, T, Q> const& x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
|
||||
return typename vec<1, T, Q>::bool_type(
|
||||
isdenormal(x.x));
|
||||
@@ -52,7 +52,7 @@ namespace detail
|
||||
vec<2, T, Q> const& x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
|
||||
return typename vec<2, T, Q>::bool_type(
|
||||
isdenormal(x.x),
|
||||
@@ -65,7 +65,7 @@ namespace detail
|
||||
vec<3, T, Q> const& x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
|
||||
return typename vec<3, T, Q>::bool_type(
|
||||
isdenormal(x.x),
|
||||
@@ -79,7 +79,7 @@ namespace detail
|
||||
vec<4, T, Q> const& x
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'isdenormal' only accept floating-point inputs");
|
||||
|
||||
return typename vec<4, T, Q>::bool_type(
|
||||
isdenormal(x.x),
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace detail
|
||||
template<typename floatType, length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, floatType, Q> compNormalize(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "'compNormalize' accepts only floating-point types for 'floatType' template parameter");
|
||||
static_assert(std::numeric_limits<floatType>::is_iec559, "'compNormalize' accepts only floating-point types for 'floatType' template parameter");
|
||||
|
||||
return detail::compute_compNormalize<L, T, floatType, Q, std::numeric_limits<T>::is_integer, std::numeric_limits<T>::is_signed>::call(v);
|
||||
}
|
||||
@@ -86,7 +86,7 @@ namespace detail
|
||||
template<typename T, length_t L, typename floatType, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, T, Q> compScale(vec<L, floatType, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<floatType>::is_iec559, "'compScale' accepts only floating-point types for 'floatType' template parameter");
|
||||
static_assert(std::numeric_limits<floatType>::is_iec559, "'compScale' accepts only floating-point types for 'floatType' template parameter");
|
||||
|
||||
return detail::compute_compScale<L, T, floatType, Q, std::numeric_limits<T>::is_integer, std::numeric_limits<T>::is_signed>::call(v);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace detail
|
||||
{
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR static T call(vec<2, T, Q> const& v, vec<2, T, Q> const& u)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cross' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'cross' accepts only floating-point inputs");
|
||||
|
||||
return v.x * u.y - u.x * v.y;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType fastSqrt(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fastSqrt' only accept floating-point input");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fastSqrt' only accept floating-point input");
|
||||
|
||||
return genType(1) / fastInverseSqrt(x);
|
||||
}
|
||||
@@ -34,7 +34,7 @@ namespace glm
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType fastLength(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fastLength' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fastLength' only accept floating-point inputs");
|
||||
|
||||
return abs(x);
|
||||
}
|
||||
@@ -42,7 +42,7 @@ namespace glm
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER T fastLength(vec<L, T, Q> const& x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fastLength' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'fastLength' only accept floating-point inputs");
|
||||
|
||||
return fastSqrt(dot(x, x));
|
||||
}
|
||||
|
||||
@@ -18,28 +18,28 @@ namespace detail
|
||||
template<typename genType>
|
||||
GLM_FUNC_QUALIFIER genType length2(genType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'length2' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'length2' accepts only floating-point inputs");
|
||||
return x * x;
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER T length2(vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'length2' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'length2' accepts only floating-point inputs");
|
||||
return detail::compute_length2<L, T, Q, detail::is_aligned<Q>::value>::call(v);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
GLM_FUNC_QUALIFIER T distance2(T p0, T p1)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'distance2' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'distance2' accepts only floating-point inputs");
|
||||
return length2(p1 - p0);
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER T distance2(vec<L, T, Q> const& p0, vec<L, T, Q> const& p1)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'distance2' accepts only floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'distance2' accepts only floating-point inputs");
|
||||
return length2(p1 - p0);
|
||||
}
|
||||
|
||||
|
||||
@@ -32,19 +32,19 @@ namespace std {
|
||||
template<std::size_t I,glm::length_t L,typename T,glm::qualifier Q>
|
||||
struct tuple_element<I, glm::vec<L,T,Q>>
|
||||
{
|
||||
GLM_STATIC_ASSERT(I < L,"Index out of bounds");
|
||||
static_assert(I < L,"Index out of bounds");
|
||||
typedef T type;
|
||||
};
|
||||
template<std::size_t I, glm::length_t C, glm::length_t R, typename T, glm::qualifier Q>
|
||||
struct tuple_element<I, glm::mat<C,R, T, Q>>
|
||||
{
|
||||
GLM_STATIC_ASSERT(I < C, "Index out of bounds");
|
||||
static_assert(I < C, "Index out of bounds");
|
||||
typedef glm::vec<R,T,Q> type;
|
||||
};
|
||||
template<std::size_t I, typename T, glm::qualifier Q>
|
||||
struct tuple_element<I, glm::qua<T, Q>>
|
||||
{
|
||||
GLM_STATIC_ASSERT(I < 4, "Index out of bounds");
|
||||
static_assert(I < 4, "Index out of bounds");
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,34 +2,34 @@ namespace glm
|
||||
{
|
||||
template<length_t I, length_t L, typename T, qualifier Q>
|
||||
GLM_CONSTEXPR T& get(vec<L, T, Q>& v) {
|
||||
GLM_STATIC_ASSERT(I < L, "Index out of bounds");
|
||||
static_assert(I < L, "Index out of bounds");
|
||||
return v[I];
|
||||
}
|
||||
template<length_t I, length_t L, typename T, qualifier Q>
|
||||
GLM_CONSTEXPR T const& get(vec<L, T, Q> const& v) {
|
||||
GLM_STATIC_ASSERT(I < L, "Index out of bounds");
|
||||
static_assert(I < L, "Index out of bounds");
|
||||
return v[I];
|
||||
}
|
||||
|
||||
template<length_t I, length_t C, length_t R, typename T, qualifier Q>
|
||||
GLM_CONSTEXPR vec<R, T, Q>& get(mat<C, R, T, Q>& m) {
|
||||
GLM_STATIC_ASSERT(I < C, "Index out of bounds");
|
||||
static_assert(I < C, "Index out of bounds");
|
||||
return m[I];
|
||||
}
|
||||
template<length_t I, length_t C, length_t R, typename T, qualifier Q>
|
||||
GLM_CONSTEXPR vec<R, T, Q> const& get(mat<C, R, T, Q> const& m) {
|
||||
GLM_STATIC_ASSERT(I < C, "Index out of bounds");
|
||||
static_assert(I < C, "Index out of bounds");
|
||||
return m[I];
|
||||
}
|
||||
|
||||
template<length_t I, typename T, qualifier Q>
|
||||
GLM_CONSTEXPR T& get(qua<T, Q>& q) {
|
||||
GLM_STATIC_ASSERT(I < 4, "Index out of bounds");
|
||||
static_assert(I < 4, "Index out of bounds");
|
||||
return q[I];
|
||||
}
|
||||
template<length_t I, typename T, qualifier Q>
|
||||
GLM_CONSTEXPR T const& get(qua<T, Q> const& q) {
|
||||
GLM_STATIC_ASSERT(I < 4, "Index out of bounds");
|
||||
static_assert(I < 4, "Index out of bounds");
|
||||
return q[I];
|
||||
}
|
||||
|
||||
@@ -37,17 +37,17 @@ namespace glm
|
||||
template<length_t I, length_t L, typename T, qualifier Q>
|
||||
GLM_CONSTEXPR T get(vec<L, T, Q> const&& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(I < L, "Index out of bounds");
|
||||
static_assert(I < L, "Index out of bounds");
|
||||
return v[I];
|
||||
}
|
||||
template<length_t I, length_t C, length_t R, typename T, qualifier Q>
|
||||
GLM_CONSTEXPR vec<R, T, Q> get(mat<C, R, T, Q> const&& m) {
|
||||
GLM_STATIC_ASSERT(I < C, "Index out of bounds");
|
||||
static_assert(I < C, "Index out of bounds");
|
||||
return m[I];
|
||||
}
|
||||
template<length_t I, typename T, qualifier Q>
|
||||
GLM_CONSTEXPR T get(qua<T, Q> const&& q) {
|
||||
GLM_STATIC_ASSERT(I < 4, "Index out of bounds");
|
||||
static_assert(I < 4, "Index out of bounds");
|
||||
return q[I];
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -9,21 +9,21 @@ namespace glm
|
||||
genType const& y
|
||||
)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559, "'angle' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<genType>::is_iec559, "'angle' only accept floating-point inputs");
|
||||
return acos(clamp(dot(x, y), genType(-1), genType(1)));
|
||||
}
|
||||
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER T angle(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'angle' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'angle' only accept floating-point inputs");
|
||||
return acos(clamp(dot(x, y), T(-1), T(1)));
|
||||
}
|
||||
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER T orientedAngle(vec<2, T, Q> const& x, vec<2, T, Q> const& y)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'orientedAngle' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'orientedAngle' only accept floating-point inputs");
|
||||
T const Angle(acos(clamp(dot(x, y), T(-1), T(1))));
|
||||
|
||||
T const partialCross = x.x * y.y - y.x * x.y;
|
||||
@@ -37,7 +37,7 @@ namespace glm
|
||||
template<typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER T orientedAngle(vec<3, T, Q> const& x, vec<3, T, Q> const& y, vec<3, T, Q> const& ref)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'orientedAngle' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559 || GLM_CONFIG_UNRESTRICTED_FLOAT, "'orientedAngle' only accept floating-point inputs");
|
||||
|
||||
T const Angle(acos(clamp(dot(x, y), T(-1), T(1))));
|
||||
return mix(Angle, -Angle, dot(ref, cross(x, y)) < T(0));
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER bool areCollinear(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'areCollinear' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'areCollinear' only accept floating-point inputs");
|
||||
|
||||
return detail::compute_areCollinear<L, T, Q>::call(v0, v1, epsilon);
|
||||
}
|
||||
@@ -87,7 +87,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER bool areOrthogonal(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'areOrthogonal' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'areOrthogonal' only accept floating-point inputs");
|
||||
|
||||
return abs(dot(v0, v1)) <= max(
|
||||
static_cast<T>(1),
|
||||
@@ -97,7 +97,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER bool isNormalized(vec<L, T, Q> const& v, T const& epsilon)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isNormalized' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'isNormalized' only accept floating-point inputs");
|
||||
|
||||
return abs(length(v) - static_cast<T>(1)) <= static_cast<T>(2) * epsilon;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER bool isNull(vec<L, T, Q> const& v, T const& epsilon)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isNull' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'isNull' only accept floating-point inputs");
|
||||
|
||||
return length(v) <= epsilon;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ namespace detail
|
||||
template<length_t L, typename T, qualifier Q>
|
||||
GLM_FUNC_QUALIFIER vec<L, bool, Q> isCompNull(vec<L, T, Q> const& v, T const& epsilon)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559, "'isCompNull' only accept floating-point inputs");
|
||||
static_assert(std::numeric_limits<T>::is_iec559, "'isCompNull' only accept floating-point inputs");
|
||||
|
||||
return detail::compute_isCompNull<L, T, Q>::call(v, epsilon);
|
||||
}
|
||||
|
||||
@@ -950,7 +950,7 @@ namespace sign
|
||||
template<typename genFIType>
|
||||
GLM_FUNC_QUALIFIER genFIType sign_if(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
static_assert(
|
||||
std::numeric_limits<genFIType>::is_iec559 ||
|
||||
(std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer), "'sign' only accept signed inputs");
|
||||
|
||||
@@ -972,7 +972,7 @@ namespace sign
|
||||
template<typename genFIType>
|
||||
GLM_FUNC_QUALIFIER genFIType sign_alu1(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
static_assert(
|
||||
std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
|
||||
"'sign' only accept integer inputs");
|
||||
|
||||
@@ -985,7 +985,7 @@ namespace sign
|
||||
|
||||
GLM_FUNC_QUALIFIER int sign_alu2(int x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<int>::is_signed && std::numeric_limits<int>::is_integer, "'sign' only accept integer inputs");
|
||||
static_assert(std::numeric_limits<int>::is_signed && std::numeric_limits<int>::is_integer, "'sign' only accept integer inputs");
|
||||
|
||||
# if GLM_COMPILER & GLM_COMPILER_VC
|
||||
# pragma warning(push)
|
||||
@@ -1002,7 +1002,7 @@ namespace sign
|
||||
template<typename genFIType>
|
||||
GLM_FUNC_QUALIFIER genFIType sign_sub(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
static_assert(
|
||||
std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
|
||||
"'sign' only accept integer inputs");
|
||||
|
||||
@@ -1012,7 +1012,7 @@ namespace sign
|
||||
template<typename genFIType>
|
||||
GLM_FUNC_QUALIFIER genFIType sign_cmp(genFIType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(
|
||||
static_assert(
|
||||
std::numeric_limits<genFIType>::is_signed && std::numeric_limits<genFIType>::is_integer,
|
||||
"'sign' only accept integer inputs");
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace bitfieldReverse
|
||||
template<glm::length_t L, typename T, glm::qualifier Q>
|
||||
GLM_FUNC_QUALIFIER glm::vec<L, T, Q> bitfieldReverseLoop(glm::vec<L, T, Q> const& v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitfieldReverse' only accept integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'bitfieldReverse' only accept integer values");
|
||||
|
||||
glm::vec<L, T, Q> Result(0);
|
||||
T const BitSize = static_cast<T>(sizeof(T) * 8);
|
||||
@@ -567,7 +567,7 @@ namespace findMSB
|
||||
template<typename genIUType>
|
||||
static int findMSB_intrinsic(genIUType Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
|
||||
if(Value == 0)
|
||||
return -1;
|
||||
@@ -582,7 +582,7 @@ namespace findMSB
|
||||
template<typename genIUType>
|
||||
static int findMSB_avx(genIUType Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
|
||||
if(Value == 0)
|
||||
return -1;
|
||||
@@ -594,7 +594,7 @@ namespace findMSB
|
||||
template<typename genIUType>
|
||||
static int findMSB_095(genIUType Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
|
||||
if(Value == genIUType(0) || Value == genIUType(-1))
|
||||
return -1;
|
||||
@@ -618,7 +618,7 @@ namespace findMSB
|
||||
template<typename genIUType>
|
||||
static int findMSB_nlz1(genIUType x)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'findMSB' only accept integer values");
|
||||
|
||||
if (x == 0)
|
||||
return -1;
|
||||
@@ -970,7 +970,7 @@ namespace findLSB
|
||||
template<typename genIUType>
|
||||
static int findLSB_intrinsic(genIUType Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
|
||||
|
||||
if(Value == 0)
|
||||
return -1;
|
||||
@@ -984,7 +984,7 @@ namespace findLSB
|
||||
template<typename genIUType>
|
||||
static int findLSB_095(genIUType Value)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
|
||||
static_assert(std::numeric_limits<genIUType>::is_integer, "'findLSB' only accept integer values");
|
||||
if(Value == 0)
|
||||
return -1;
|
||||
|
||||
@@ -1397,7 +1397,7 @@ namespace bitCount
|
||||
template<typename T>
|
||||
inline int bitCount_if(T v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
|
||||
|
||||
int Count(0);
|
||||
for(T i = 0, n = static_cast<T>(sizeof(T) * 8); i < n; ++i)
|
||||
@@ -1411,7 +1411,7 @@ namespace bitCount
|
||||
template<typename T>
|
||||
inline int bitCount_vec(T v)
|
||||
{
|
||||
GLM_STATIC_ASSERT(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
|
||||
static_assert(std::numeric_limits<T>::is_integer, "'bitCount' only accept integer values");
|
||||
|
||||
int Count(0);
|
||||
for(T i = 0, n = static_cast<T>(sizeof(T) * 8); i < n; ++i)
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_int2x2_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8mat2x2) == 4, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat2x2) == 8, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat2x2) == 16, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat2x2) == 32, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
static_assert(sizeof(glm::i8mat2x2) == 4, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat2x2) == 8, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat2x2) == 16, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat2x2) == 32, "int64 size isn't 8 bytes on this platform");
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_int2x3_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8mat2x3) == 6, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat2x3) == 12, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat2x3) == 24, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat2x3) == 48, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_int2x4_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8mat2x4) == 8, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat2x4) == 16, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat2x4) == 32, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat2x4) == 64, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_int3x2_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8mat3x2) == 6, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat3x2) == 12, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat3x2) == 24, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat3x2) == 48, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_int3x3_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8mat3x3) == 9, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat3x3) == 18, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat3x3) == 36, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat3x3) == 72, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_int3x4_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8mat3x4) == 12, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat3x4) == 24, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat3x4) == 48, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat3x4) == 96, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_int4x2_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8mat4x2) == 8, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat4x2) == 16, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat4x2) == 32, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat4x2) == 64, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_int4x3_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8mat4x3) == 12, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat4x3) == 24, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat4x3) == 48, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat4x3) == 96, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_int4x4_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8mat4x4) == 16, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16mat4x4) == 32, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32mat4x4) == 64, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64mat4x4) == 128, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_uint2x2_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8mat2x2) == 4, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat2x2) == 8, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat2x2) == 16, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat2x2) == 32, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
static_assert(sizeof(glm::u8mat2x2) == 4, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat2x2) == 8, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat2x2) == 16, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat2x2) == 32, "uint64 size isn't 8 bytes on this platform");
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_uint2x3_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8mat2x3) == 6, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat2x3) == 12, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat2x3) == 24, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat2x3) == 48, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_uint2x4_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8mat2x4) == 8, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat2x4) == 16, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat2x4) == 32, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat2x4) == 64, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_uint3x2_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8mat3x2) == 6, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat3x2) == 12, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat3x2) == 24, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat3x2) == 48, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_uint3x3_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8mat3x3) == 9, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat3x3) == 18, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat3x3) == 36, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat3x3) == 72, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_uint3x4_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8mat3x4) == 12, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat3x4) == 24, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat3x4) == 48, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat3x4) == 96, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_uint4x2_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8mat4x2) == 8, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat4x2) == 16, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat4x2) == 32, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat4x2) == 64, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_uint4x3_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8mat4x3) == 12, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat4x3) == 24, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat4x3) == 48, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat4x3) == 96, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/matrix_uint4x4_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8mat4x4) == 16, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16mat4x4) == 32, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32mat4x4) == 64, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64mat4x4) == 128, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_comp()
|
||||
{
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
#include <glm/ext/scalar_int_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform");
|
||||
static_assert(sizeof(glm::int16) == sizeof(short), "signed short size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::int32) == sizeof(int), "signed int size isn't 4 bytes on this platform");
|
||||
#endif
|
||||
static_assert(sizeof(glm::int8) == 1, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::int16) == 2, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::int32) == 4, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::int64) == 8, "int64 size isn't 8 bytes on this platform");
|
||||
static_assert(sizeof(glm::int16) == sizeof(short), "signed short size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::int32) == sizeof(int), "signed int size isn't 4 bytes on this platform");
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
#include <glm/ext/scalar_uint_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
|
||||
static_assert(sizeof(glm::uint16) == sizeof(unsigned short), "unsigned short size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::uint32) == sizeof(unsigned int), "unsigned int size isn't 4 bytes on this platform");
|
||||
#endif
|
||||
static_assert(sizeof(glm::uint8) == 1, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::uint16) == 2, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::uint32) == 4, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::uint64) == 8, "uint64 size isn't 8 bytes on this platform");
|
||||
static_assert(sizeof(glm::uint16) == sizeof(unsigned short), "unsigned short size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::uint32) == sizeof(unsigned int), "unsigned int size isn't 4 bytes on this platform");
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/vector_int1_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8vec1) == 1, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16vec1) == 2, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32vec1) == 4, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64vec1) == 8, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
static_assert(sizeof(glm::i8vec1) == 1, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16vec1) == 2, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32vec1) == 4, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64vec1) == 8, "int64 size isn't 8 bytes on this platform");
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/vector_int2_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8vec2) == 2, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16vec2) == 4, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32vec2) == 8, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64vec2) == 16, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
static_assert(sizeof(glm::i8vec2) == 2, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16vec2) == 4, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32vec2) == 8, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64vec2) == 16, "int64 size isn't 8 bytes on this platform");
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/vector_int3_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8vec3) == 3, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16vec3) == 6, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32vec3) == 12, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64vec3) == 24, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
static_assert(sizeof(glm::i8vec3) == 3, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16vec3) == 6, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32vec3) == 12, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64vec3) == 24, "int64 size isn't 8 bytes on this platform");
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/vector_int4_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::i8vec4) == 4, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::i16vec4) == 8, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::i32vec4) == 16, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::i64vec4) == 32, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/vector_uint1_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
static_assert(sizeof(glm::u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16vec1) == 2, "uint16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32vec1) == 4, "uint32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64vec1) == 8, "uint64 size isn't 8 bytes on this platform");
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/vector_uint2_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8vec2) == 2, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16vec2) == 4, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32vec2) == 8, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64vec2) == 16, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/vector_uint3_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8vec3) == 3, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16vec3) == 6, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32vec3) == 12, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64vec3) == 24, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
#include <glm/ext/vector_uint4_sized.hpp>
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::u8vec4) == 4, "int8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::u16vec4) == 8, "int16 size isn't 2 bytes on this platform");
|
||||
static_assert(sizeof(glm::u32vec4) == 16, "int32 size isn't 4 bytes on this platform");
|
||||
static_assert(sizeof(glm::u64vec4) == 32, "int64 size isn't 8 bytes on this platform");
|
||||
#endif
|
||||
|
||||
static int test_size()
|
||||
{
|
||||
|
||||
@@ -10,19 +10,19 @@
|
||||
#include <glm/ext/vector_relational.hpp>
|
||||
#include <glm/ext/matrix_relational.hpp>
|
||||
|
||||
GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_lowp>::value, "aligned_lowp is not aligned");
|
||||
GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_mediump>::value, "aligned_mediump is not aligned");
|
||||
GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_highp>::value, "aligned_highp is not aligned");
|
||||
GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_highp>::value, "packed_highp is aligned");
|
||||
GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_mediump>::value, "packed_mediump is aligned");
|
||||
GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_lowp>::value, "packed_lowp is aligned");
|
||||
static_assert(glm::detail::is_aligned<glm::aligned_lowp>::value, "aligned_lowp is not aligned");
|
||||
static_assert(glm::detail::is_aligned<glm::aligned_mediump>::value, "aligned_mediump is not aligned");
|
||||
static_assert(glm::detail::is_aligned<glm::aligned_highp>::value, "aligned_highp is not aligned");
|
||||
static_assert(!glm::detail::is_aligned<glm::packed_highp>::value, "packed_highp is aligned");
|
||||
static_assert(!glm::detail::is_aligned<glm::packed_mediump>::value, "packed_mediump is aligned");
|
||||
static_assert(!glm::detail::is_aligned<glm::packed_lowp>::value, "packed_lowp is aligned");
|
||||
|
||||
struct my_vec4_packed
|
||||
{
|
||||
glm::uint32 a;
|
||||
glm::vec4 b;
|
||||
};
|
||||
GLM_STATIC_ASSERT(sizeof(my_vec4_packed) == sizeof(glm::uint32) + sizeof(glm::vec4), "glm::vec4 packed is not correct");
|
||||
static_assert(sizeof(my_vec4_packed) == sizeof(glm::uint32) + sizeof(glm::vec4), "glm::vec4 packed is not correct");
|
||||
|
||||
#if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic push
|
||||
@@ -34,7 +34,7 @@ struct my_vec4_aligned
|
||||
glm::uint32 a;
|
||||
glm::aligned_vec4 b;
|
||||
};
|
||||
GLM_STATIC_ASSERT(sizeof(my_vec4_aligned) == sizeof(glm::aligned_vec4) * 2, "glm::vec4 aligned is not correct");
|
||||
static_assert(sizeof(my_vec4_aligned) == sizeof(glm::aligned_vec4) * 2, "glm::vec4 aligned is not correct");
|
||||
|
||||
#if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic pop
|
||||
@@ -45,14 +45,14 @@ struct my_dvec4_packed
|
||||
glm::uint64 a;
|
||||
glm::dvec4 b;
|
||||
};
|
||||
GLM_STATIC_ASSERT(sizeof(my_dvec4_packed) == sizeof(glm::uint64) + sizeof(glm::dvec4), "glm::dvec4 packed is not correct");
|
||||
static_assert(sizeof(my_dvec4_packed) == sizeof(glm::uint64) + sizeof(glm::dvec4), "glm::dvec4 packed is not correct");
|
||||
|
||||
struct my_dvec4_aligned
|
||||
{
|
||||
glm::uint64 a;
|
||||
glm::aligned_dvec4 b;
|
||||
};
|
||||
//GLM_STATIC_ASSERT(sizeof(my_dvec4_aligned) == sizeof(glm::aligned_dvec4) * 2, "glm::dvec4 aligned is not correct");
|
||||
//static_assert(sizeof(my_dvec4_aligned) == sizeof(glm::aligned_dvec4) * 2, "glm::dvec4 aligned is not correct");
|
||||
|
||||
#if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic push
|
||||
@@ -69,7 +69,7 @@ struct my_ivec4_packed
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
GLM_STATIC_ASSERT(sizeof(my_ivec4_packed) == sizeof(glm::uint32) + sizeof(glm::ivec4), "glm::ivec4 packed is not correct");
|
||||
static_assert(sizeof(my_ivec4_packed) == sizeof(glm::uint32) + sizeof(glm::ivec4), "glm::ivec4 packed is not correct");
|
||||
|
||||
#if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# pragma clang diagnostic push
|
||||
@@ -86,14 +86,14 @@ struct my_ivec4_aligned
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
GLM_STATIC_ASSERT(sizeof(my_ivec4_aligned) == sizeof(glm::aligned_ivec4) * 2, "glm::ivec4 aligned is not correct");
|
||||
static_assert(sizeof(my_ivec4_aligned) == sizeof(glm::aligned_ivec4) * 2, "glm::ivec4 aligned is not correct");
|
||||
|
||||
struct my_u8vec4_packed
|
||||
{
|
||||
glm::uint32 a;
|
||||
glm::u8vec4 b;
|
||||
};
|
||||
GLM_STATIC_ASSERT(sizeof(my_u8vec4_packed) == sizeof(glm::uint32) + sizeof(glm::u8vec4), "glm::u8vec4 packed is not correct");
|
||||
static_assert(sizeof(my_u8vec4_packed) == sizeof(glm::uint32) + sizeof(glm::u8vec4), "glm::u8vec4 packed is not correct");
|
||||
|
||||
static int test_copy_vec4()
|
||||
{
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
# include <omp.h>
|
||||
#endif
|
||||
|
||||
#if GLM_HAS_STATIC_ASSERT
|
||||
static_assert(sizeof(glm::lowp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::mediump_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
|
||||
static_assert(sizeof(glm::highp_u8vec1) == 1, "uint8 size isn't 1 byte on this platform");
|
||||
@@ -143,8 +142,6 @@ static_assert(sizeof(glm::lowp_u64vec4) == 32, "uint64 size isn't 8 bytes on thi
|
||||
static_assert(sizeof(glm::mediump_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform");
|
||||
static_assert(sizeof(glm::highp_u64vec4) == 32, "uint64 size isn't 8 bytes on this platform");
|
||||
|
||||
#endif
|
||||
|
||||
static int test_scalar_size()
|
||||
{
|
||||
int Error = 0;
|
||||
|
||||
Reference in New Issue
Block a user