mirror of
https://github.com/g-truc/glm.git
synced 2024-11-16 06:44:35 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
57310708e5
@ -97,7 +97,7 @@
|
|||||||
# own custom ConfigVersion.cmake file instead of using this macro.
|
# own custom ConfigVersion.cmake file instead of using this macro.
|
||||||
#
|
#
|
||||||
# Internally, this macro executes configure_file() to create the resulting
|
# Internally, this macro executes configure_file() to create the resulting
|
||||||
# version file. Depending on the COMPATIBLITY, either the file
|
# version file. Depending on the COMPATIBILITY, either the file
|
||||||
# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in
|
# BasicConfigVersion-SameMajorVersion.cmake.in or BasicConfigVersion-AnyNewerVersion.cmake.in
|
||||||
# is used. Please note that these two files are internal to CMake and you should
|
# is used. Please note that these two files are internal to CMake and you should
|
||||||
# not call configure_file() on them yourself, but they can be used as starting
|
# not call configure_file() on them yourself, but they can be used as starting
|
||||||
|
@ -7,7 +7,7 @@ a) The Happy Bunny License, or b) the MIT License.
|
|||||||
================================================================================
|
================================================================================
|
||||||
The Happy Bunny License (Modified MIT License)
|
The Happy Bunny License (Modified MIT License)
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Copyright (c) 2005 - 2015 G-Truc Creation
|
Copyright (c) 2005 - 2016 G-Truc Creation
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -33,7 +33,7 @@ THE SOFTWARE.
|
|||||||
================================================================================
|
================================================================================
|
||||||
The MIT License
|
The MIT License
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
Copyright (c) 2005 - 2015 G-Truc Creation
|
Copyright (c) 2005 - 2016 G-Truc Creation
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -75,7 +75,7 @@
|
|||||||
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div>
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||||
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="preprocessor">#include "common.inl"</span></div>
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="preprocessor">#include "common.inl"</span></div>
|
||||||
<div class="ttc" id="a00190_html_ga74aa7c7462245d83bd5a9edf9c6c2d91"><div class="ttname"><a href="a00190.html#ga74aa7c7462245d83bd5a9edf9c6c2d91">glm::isdenormal</a></div><div class="ttdeci">GLM_FUNC_DECL genType::bool_type isdenormal(genType const &x)</div><div class="ttdoc">Returns true if x is a denormalized number Numbers whose absolute value is too small to be represente...</div></div>
|
<div class="ttc" id="a00190_html_ga74aa7c7462245d83bd5a9edf9c6c2d91"><div class="ttname"><a href="a00190.html#ga74aa7c7462245d83bd5a9edf9c6c2d91">glm::isdenormal</a></div><div class="ttdeci">GLM_FUNC_DECL genType::bool_type isdenormal(genType const &x)</div><div class="ttdoc">Returns true if x is a denormalized number Numbers whose absolute value is too small to be represente...</div></div>
|
||||||
<div class="ttc" id="a00190_html_ga2580f50d4064557d62f4a533dfc6c7e3"><div class="ttname"><a href="a00190.html#ga2580f50d4064557d62f4a533dfc6c7e3">glm::fmod</a></div><div class="ttdeci">GLM_FUNC_DECL vecType< T, P > fmod(vecType< T, P > const &v)</div><div class="ttdoc">Similiar to 'mod' but with a different rounding and integer support. </div></div>
|
<div class="ttc" id="a00190_html_ga2580f50d4064557d62f4a533dfc6c7e3"><div class="ttname"><a href="a00190.html#ga2580f50d4064557d62f4a533dfc6c7e3">glm::fmod</a></div><div class="ttdeci">GLM_FUNC_DECL vecType< T, P > fmod(vecType< T, P > const &v)</div><div class="ttdoc">Similar to 'mod' but with a different rounding and integer support. </div></div>
|
||||||
<div class="ttc" id="a00146_html"><div class="ttname"><a href="a00146.html">glm</a></div><div class="ttdef"><b>Definition:</b> <a href="a00003_source.html#l00040">_noise.hpp:40</a></div></div>
|
<div class="ttc" id="a00146_html"><div class="ttname"><a href="a00146.html">glm</a></div><div class="ttdef"><b>Definition:</b> <a href="a00003_source.html#l00040">_noise.hpp:40</a></div></div>
|
||||||
</div><!-- fragment --></div><!-- contents -->
|
</div><!-- fragment --></div><!-- contents -->
|
||||||
<!-- start footer part -->
|
<!-- start footer part -->
|
||||||
|
@ -501,7 +501,7 @@
|
|||||||
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span> <span class="preprocessor"># define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG)</span></div>
|
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span> <span class="preprocessor"># define GLM_LANG (GLM_LANG_CXX | GLM_LANG_CXXMS_FLAG)</span></div>
|
||||||
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span> <span class="preprocessor"># endif</span></div>
|
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span> <span class="preprocessor"># endif</span></div>
|
||||||
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span> <span class="preprocessor"># endif</span></div>
|
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span> <span class="preprocessor"># endif</span></div>
|
||||||
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span> <span class="preprocessor"># else // Unkown compiler</span></div>
|
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span> <span class="preprocessor"># else // Unknown compiler</span></div>
|
||||||
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span> <span class="preprocessor"># if __cplusplus >= 201402L</span></div>
|
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span> <span class="preprocessor"># if __cplusplus >= 201402L</span></div>
|
||||||
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span> <span class="preprocessor"># define GLM_LANG GLM_LANG_CXX14</span></div>
|
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span> <span class="preprocessor"># define GLM_LANG GLM_LANG_CXX14</span></div>
|
||||||
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span> <span class="preprocessor"># elif __cplusplus >= 201103L</span></div>
|
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span> <span class="preprocessor"># elif __cplusplus >= 201103L</span></div>
|
||||||
|
@ -275,7 +275,7 @@
|
|||||||
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span> <span class="preprocessor">#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))</span></div>
|
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span> <span class="preprocessor">#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))</span></div>
|
||||||
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <span class="keyword">typedef</span> lowp_int int_t;</div>
|
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <span class="keyword">typedef</span> lowp_int int_t;</div>
|
||||||
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span> <span class="preprocessor">#else</span></div>
|
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span> <span class="preprocessor">#else</span></div>
|
||||||
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span> <span class="preprocessor"># error "GLM error: multiple default precision requested for signed interger types"</span></div>
|
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span> <span class="preprocessor"># error "GLM error: multiple default precision requested for signed integer types"</span></div>
|
||||||
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span> <span class="preprocessor">#endif</span></div>
|
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span> <span class="preprocessor">#endif</span></div>
|
||||||
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div>
|
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div>
|
||||||
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span> <span class="preprocessor">#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))</span></div>
|
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span> <span class="preprocessor">#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))</span></div>
|
||||||
@ -287,7 +287,7 @@
|
|||||||
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span> <span class="preprocessor">#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))</span></div>
|
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span> <span class="preprocessor">#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))</span></div>
|
||||||
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keyword">typedef</span> lowp_uint uint_t;</div>
|
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keyword">typedef</span> lowp_uint uint_t;</div>
|
||||||
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span> <span class="preprocessor">#else</span></div>
|
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span> <span class="preprocessor">#else</span></div>
|
||||||
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span> <span class="preprocessor"># error "GLM error: multiple default precision requested for unsigned interger types"</span></div>
|
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span> <span class="preprocessor"># error "GLM error: multiple default precision requested for unsigned integer types"</span></div>
|
||||||
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span> <span class="preprocessor">#endif</span></div>
|
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span> <span class="preprocessor">#endif</span></div>
|
||||||
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span> </div>
|
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span> </div>
|
||||||
<div class="line"><a name="l00308"></a><span class="lineno"><a class="line" href="a00164.html#ga91ad9478d81a7aaf2593e8d9c3d06a14"> 308</a></span>  <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="a00164.html#ga91ad9478d81a7aaf2593e8d9c3d06a14">uint</a>;</div>
|
<div class="line"><a name="l00308"></a><span class="lineno"><a class="line" href="a00164.html#ga91ad9478d81a7aaf2593e8d9c3d06a14"> 308</a></span>  <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="a00164.html#ga91ad9478d81a7aaf2593e8d9c3d06a14">uint</a>;</div>
|
||||||
|
@ -132,7 +132,7 @@ Typedefs</h2></td></tr>
|
|||||||
</table>
|
</table>
|
||||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||||
<p>The standard types defined by the specification. </p>
|
<p>The standard types defined by the specification. </p>
|
||||||
<p>These types are all typedefs of more generalized, template types. To see the definiton of these template types, go to <a class="el" href="a00165.html">Template types</a>. </p>
|
<p>These types are all typedefs of more generalized, template types. To see the definition of these template types, go to <a class="el" href="a00165.html">Template types</a>. </p>
|
||||||
<h2 class="groupheader">Typedef Documentation</h2>
|
<h2 class="groupheader">Typedef Documentation</h2>
|
||||||
<a class="anchor" id="ga0e46aaaccc5e713eac5bfbc8d6885a60"></a>
|
<a class="anchor" id="ga0e46aaaccc5e713eac5bfbc8d6885a60"></a>
|
||||||
<div class="memitem">
|
<div class="memitem">
|
||||||
|
@ -70,7 +70,7 @@ Functions</h2></td></tr>
|
|||||||
</table>
|
</table>
|
||||||
</div><div class="memdoc">
|
</div><div class="memdoc">
|
||||||
|
|
||||||
<p>Similiar to 'mod' but with a different rounding and integer support. </p>
|
<p>Similar to 'mod' but with a different rounding and integer support. </p>
|
||||||
<p>Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)'</p>
|
<p>Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)'</p>
|
||||||
<dl class="section see"><dt>See also</dt><dd><a href="http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod">GLSL mod vs HLSL fmod</a> </dd>
|
<dl class="section see"><dt>See also</dt><dd><a href="http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod">GLSL mod vs HLSL fmod</a> </dd>
|
||||||
<dd>
|
<dd>
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
<li>Any conform C++98 compiler</li>
|
<li>Any conform C++98 compiler</li>
|
||||||
</ul>
|
</ul>
|
||||||
<dl class="section note"><dt>Note</dt><dd>The Doxygen-generated documentation will often state that a type or function is defined in a namespace that is a child of the <a class="el" href="">glm </a> namespace. Please ignore this; All publicly available types and functions can be accessed as a direct children of the glm namespace.</dd></dl>
|
<dl class="section note"><dt>Note</dt><dd>The Doxygen-generated documentation will often state that a type or function is defined in a namespace that is a child of the <a class="el" href="">glm </a> namespace. Please ignore this; All publicly available types and functions can be accessed as a direct children of the glm namespace.</dd></dl>
|
||||||
<p>The source code is licenced under the <a href="http://glm.g-truc.net/copying.txt">Happy Bunny License (Modified MIT)</a> and <a href="http://glm.g-truc.net/copying.txt">MIT license</a>.</p>
|
<p>The source code is licensed under the <a href="http://glm.g-truc.net/copying.txt">Happy Bunny License (Modified MIT)</a> and <a href="http://glm.g-truc.net/copying.txt">MIT license</a>.</p>
|
||||||
<p>These pages are the API reference only. For more information about how to use GLM, please have a look at <a href="http://glm.g-truc.net/glm.pdf">the manual</a>.</p>
|
<p>These pages are the API reference only. For more information about how to use GLM, please have a look at <a href="http://glm.g-truc.net/glm.pdf">the manual</a>.</p>
|
||||||
<p>Thanks for contributing to the project by <a href="https://github.com/g-truc/glm/issues">submitting tickets for bug reports and feature requests</a>. Any feedback is welcome at <a href="#" onclick="location.href='mai'+'lto:'+'glm'+'@g'+'-tr'+'uc'+'.ne'+'t'; return false;">glm@g<span style="display: none;">.nosp@m.</span>-tru<span style="display: none;">.nosp@m.</span>c.net</a>. </p>
|
<p>Thanks for contributing to the project by <a href="https://github.com/g-truc/glm/issues">submitting tickets for bug reports and feature requests</a>. Any feedback is welcome at <a href="#" onclick="location.href='mai'+'lto:'+'glm'+'@g'+'-tr'+'uc'+'.ne'+'t'; return false;">glm@g<span style="display: none;">.nosp@m.</span>-tru<span style="display: none;">.nosp@m.</span>c.net</a>. </p>
|
||||||
</div></div><!-- contents -->
|
</div></div><!-- contents -->
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
Please ignore this; All publicly available types and functions can be accessed as a direct children
|
Please ignore this; All publicly available types and functions can be accessed as a direct children
|
||||||
of the glm namespace.
|
of the glm namespace.
|
||||||
|
|
||||||
The source code is licenced under the <a href="http://glm.g-truc.net/copying.txt">Happy Bunny License (Modified MIT)</a> and <a href="http://glm.g-truc.net/copying.txt">MIT license</a>.
|
The source code is licensed under the <a href="http://glm.g-truc.net/copying.txt">Happy Bunny License (Modified MIT)</a> and <a href="http://glm.g-truc.net/copying.txt">MIT license</a>.
|
||||||
|
|
||||||
These pages are the API reference only. For more information about how to use GLM, please have a look at <a href="http://glm.g-truc.net/glm.pdf">the manual</a>.
|
These pages are the API reference only. For more information about how to use GLM, please have a look at <a href="http://glm.g-truc.net/glm.pdf">the manual</a>.
|
||||||
|
|
||||||
|
@ -208,7 +208,7 @@ namespace detail
|
|||||||
{
|
{
|
||||||
uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
|
uint64 const Value64(static_cast<uint64>(x) + static_cast<uint64>(y));
|
||||||
uint64 const Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
|
uint64 const Max32((static_cast<uint64>(1) << static_cast<uint64>(32)) - static_cast<uint64>(1));
|
||||||
Carry = Value64 > Max32 ? 1 : 0;
|
Carry = Value64 > Max32 ? 1u : 0u;
|
||||||
return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
|
return static_cast<uint32>(Value64 % (Max32 + static_cast<uint64>(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,7 +597,7 @@
|
|||||||
# else
|
# else
|
||||||
# define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT)
|
# define GLM_LANG (GLM_LANG_CXX | GLM_MSC_EXT)
|
||||||
# endif
|
# endif
|
||||||
# else // Unkown compiler
|
# else // Unknown compiler
|
||||||
# if __cplusplus >= 201402L
|
# if __cplusplus >= 201402L
|
||||||
# define GLM_LANG GLM_LANG_CXX14
|
# define GLM_LANG GLM_LANG_CXX14
|
||||||
# elif __cplusplus >= 201103L
|
# elif __cplusplus >= 201103L
|
||||||
|
@ -287,7 +287,7 @@ namespace detail
|
|||||||
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
|
#elif(!defined(GLM_PRECISION_HIGHP_INT) && !defined(GLM_PRECISION_MEDIUMP_INT) && defined(GLM_PRECISION_LOWP_INT))
|
||||||
typedef lowp_int int_t;
|
typedef lowp_int int_t;
|
||||||
#else
|
#else
|
||||||
# error "GLM error: multiple default precision requested for signed interger types"
|
# error "GLM error: multiple default precision requested for signed integer types"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
|
#if(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && !defined(GLM_PRECISION_LOWP_UINT))
|
||||||
@ -299,7 +299,7 @@ namespace detail
|
|||||||
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
|
#elif(!defined(GLM_PRECISION_HIGHP_UINT) && !defined(GLM_PRECISION_MEDIUMP_UINT) && defined(GLM_PRECISION_LOWP_UINT))
|
||||||
typedef lowp_uint uint_t;
|
typedef lowp_uint uint_t;
|
||||||
#else
|
#else
|
||||||
# error "GLM error: multiple default precision requested for unsigned interger types"
|
# error "GLM error: multiple default precision requested for unsigned integer types"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Unsigned integer type.
|
/// Unsigned integer type.
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
///
|
///
|
||||||
/// @brief The standard types defined by the specification.
|
/// @brief The standard types defined by the specification.
|
||||||
///
|
///
|
||||||
/// These types are all typedefs of more generalized, template types. To see the definiton
|
/// These types are all typedefs of more generalized, template types. To see the definition
|
||||||
/// of these template types, go to @ref core_template.
|
/// of these template types, go to @ref core_template.
|
||||||
///
|
///
|
||||||
/// @ingroup core
|
/// @ingroup core
|
||||||
|
@ -30,8 +30,9 @@
|
|||||||
/// @author Christophe Riccio
|
/// @author Christophe Riccio
|
||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
namespace glm
|
#include "../detail/func_integer.hpp"
|
||||||
{
|
|
||||||
|
namespace glm{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template <typename T, precision P, template <typename, precision> class vecType, bool compute = false>
|
template <typename T, precision P, template <typename, precision> class vecType, bool compute = false>
|
||||||
@ -275,7 +276,7 @@ namespace detail
|
|||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value)
|
GLM_FUNC_QUALIFIER genType floorPowerOfTwo(genType value)
|
||||||
{
|
{
|
||||||
return isPowerOfTwo(value) ? value : highestBitValue(value);
|
return isPowerOfTwo(value) ? value : static_cast<genType>(1) << findMSB(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T, precision P, template <typename, precision> class vecType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
@ -293,8 +294,8 @@ namespace detail
|
|||||||
if(isPowerOfTwo(value))
|
if(isPowerOfTwo(value))
|
||||||
return value;
|
return value;
|
||||||
|
|
||||||
genIUType const prev = highestBitValue(value);
|
genIUType const prev = static_cast<genIUType>(1) << findMSB(value);
|
||||||
genIUType const next = prev << 1;
|
genIUType const next = prev << static_cast<genIUType>(1);
|
||||||
return (next - value) < (value - prev) ? next : prev;
|
return (next - value) < (value - prev) ? next : prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ namespace glm
|
|||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x);
|
GLM_FUNC_DECL typename genType::bool_type isdenormal(genType const & x);
|
||||||
|
|
||||||
/// Similiar to 'mod' but with a different rounding and integer support.
|
/// Similar to 'mod' but with a different rounding and integer support.
|
||||||
/// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)'
|
/// Returns 'x - y * trunc(x/y)' instead of 'x - y * floor(x/y)'
|
||||||
///
|
///
|
||||||
/// @see <a href="http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod">GLSL mod vs HLSL fmod</a>
|
/// @see <a href="http://stackoverflow.com/questions/7610631/glsl-mod-vs-hlsl-fmod">GLSL mod vs HLSL fmod</a>
|
||||||
|
@ -76,6 +76,11 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
|
|||||||
##### Deprecation:
|
##### Deprecation:
|
||||||
- Removed GLM_FORCE_SIZE_FUNC define
|
- Removed GLM_FORCE_SIZE_FUNC define
|
||||||
|
|
||||||
|
#### [GLM 0.9.7.5](https://github.com/g-truc/glm/tree/0.9.7) - 2016-0X-XX
|
||||||
|
##### Fixes:
|
||||||
|
- Fixed uaddCarry warning #497
|
||||||
|
- Fixed roundPowerOfTwo and floorPowerOfTwo #503
|
||||||
|
|
||||||
#### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19
|
#### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19
|
||||||
##### Fixes:
|
##### Fixes:
|
||||||
- Fixed asinh and atanh warning with C++98 STL #484
|
- Fixed asinh and atanh warning with C++98 STL #484
|
||||||
@ -205,7 +210,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
|
|||||||
##### Fixes:
|
##### Fixes:
|
||||||
- Fixed scalar uaddCarry build error with Cuda #276
|
- Fixed scalar uaddCarry build error with Cuda #276
|
||||||
- Fixed C++11 explicit conversion operators detection #282
|
- Fixed C++11 explicit conversion operators detection #282
|
||||||
- Fixed missing explicit convertion when using integer log2 with *vec1 types
|
- Fixed missing explicit conversion when using integer log2 with *vec1 types
|
||||||
- Fixed 64 bits integer GTX_string_cast to_string on VC 32 bit compiler
|
- Fixed 64 bits integer GTX_string_cast to_string on VC 32 bit compiler
|
||||||
- Fixed Android build issue, STL C++11 is not supported by the NDK #284
|
- Fixed Android build issue, STL C++11 is not supported by the NDK #284
|
||||||
- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10
|
- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10
|
||||||
@ -526,7 +531,7 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
|
|||||||
- Promoted GLM_GTC_noise extension: simplex, perlin, periodic noise functions
|
- Promoted GLM_GTC_noise extension: simplex, perlin, periodic noise functions
|
||||||
- Promoted GLM_GTC_random extension: linear, gaussian and various random number
|
- Promoted GLM_GTC_random extension: linear, gaussian and various random number
|
||||||
generation distribution
|
generation distribution
|
||||||
- Added GLM_GTX_constants: provides usefull constants
|
- Added GLM_GTX_constants: provides useful constants
|
||||||
- Added extension versioning
|
- Added extension versioning
|
||||||
- Removed many unused namespaces
|
- Removed many unused namespaces
|
||||||
- Fixed half based type contructors
|
- Fixed half based type contructors
|
||||||
|
@ -174,7 +174,7 @@ namespace isPowerOfTwo
|
|||||||
}
|
}
|
||||||
}//isPowerOfTwo
|
}//isPowerOfTwo
|
||||||
|
|
||||||
namespace ceilPowerOfTwo
|
namespace ceilPowerOfTwo_advanced
|
||||||
{
|
{
|
||||||
template <typename genIUType>
|
template <typename genIUType>
|
||||||
GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value)
|
GLM_FUNC_QUALIFIER genIUType highestBitValue(genIUType Value)
|
||||||
@ -290,6 +290,72 @@ namespace ceilPowerOfTwo
|
|||||||
Error += test_int32();
|
Error += test_int32();
|
||||||
Error += test_uint32();
|
Error += test_uint32();
|
||||||
|
|
||||||
|
return Error;
|
||||||
|
}
|
||||||
|
}//namespace ceilPowerOfTwo_advanced
|
||||||
|
|
||||||
|
namespace roundPowerOfTwo
|
||||||
|
{
|
||||||
|
int test()
|
||||||
|
{
|
||||||
|
int Error = 0;
|
||||||
|
|
||||||
|
glm::uint32 const A = glm::roundPowerOfTwo(7u);
|
||||||
|
Error += A == 8u ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint32 const B = glm::roundPowerOfTwo(15u);
|
||||||
|
Error += B == 16u ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint32 const C = glm::roundPowerOfTwo(31u);
|
||||||
|
Error += C == 32u ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint32 const D = glm::roundPowerOfTwo(9u);
|
||||||
|
Error += D == 8u ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint32 const E = glm::roundPowerOfTwo(17u);
|
||||||
|
Error += E == 16u ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint32 const F = glm::roundPowerOfTwo(33u);
|
||||||
|
Error += F == 32u ? 0 : 1;
|
||||||
|
|
||||||
|
return Error;
|
||||||
|
}
|
||||||
|
}//namespace roundPowerOfTwo
|
||||||
|
|
||||||
|
namespace floorPowerOfTwo
|
||||||
|
{
|
||||||
|
int test()
|
||||||
|
{
|
||||||
|
int Error = 0;
|
||||||
|
|
||||||
|
glm::uint32 const A = glm::floorPowerOfTwo(7u);
|
||||||
|
Error += A == 4u ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint32 const B = glm::floorPowerOfTwo(15u);
|
||||||
|
Error += B == 8u ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint32 const C = glm::floorPowerOfTwo(31u);
|
||||||
|
Error += C == 16u ? 0 : 1;
|
||||||
|
|
||||||
|
return Error;
|
||||||
|
}
|
||||||
|
}//namespace floorPowerOfTwo
|
||||||
|
|
||||||
|
namespace ceilPowerOfTwo
|
||||||
|
{
|
||||||
|
int test()
|
||||||
|
{
|
||||||
|
int Error = 0;
|
||||||
|
|
||||||
|
glm::uint32 const A = glm::ceilPowerOfTwo(7u);
|
||||||
|
Error += A == 8u ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint32 const B = glm::ceilPowerOfTwo(15u);
|
||||||
|
Error += B == 16u ? 0 : 1;
|
||||||
|
|
||||||
|
glm::uint32 const C = glm::ceilPowerOfTwo(31u);
|
||||||
|
Error += C == 32u ? 0 : 1;
|
||||||
|
|
||||||
return Error;
|
return Error;
|
||||||
}
|
}
|
||||||
}//namespace ceilPowerOfTwo
|
}//namespace ceilPowerOfTwo
|
||||||
@ -406,7 +472,10 @@ int main()
|
|||||||
int Error(0);
|
int Error(0);
|
||||||
|
|
||||||
Error += isPowerOfTwo::test();
|
Error += isPowerOfTwo::test();
|
||||||
|
Error += floorPowerOfTwo::test();
|
||||||
|
Error += roundPowerOfTwo::test();
|
||||||
Error += ceilPowerOfTwo::test();
|
Error += ceilPowerOfTwo::test();
|
||||||
|
Error += ceilPowerOfTwo_advanced::test();
|
||||||
|
|
||||||
# ifdef NDEBUG
|
# ifdef NDEBUG
|
||||||
Error += ceilPowerOfTwo::perf();
|
Error += ceilPowerOfTwo::perf();
|
||||||
|
Loading…
Reference in New Issue
Block a user