Upgrade to Assimp 5.0

This commit is contained in:
Marc Chapman 2019-11-10 14:40:50 +00:00
parent d8cc73f5a1
commit c2018ad3de
662 changed files with 106518 additions and 21818 deletions

View file

@ -39,22 +39,28 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
---------------------------------------------------------------------------
*/
#pragma once
#ifdef __GNUC__
# pragma GCC system_header
#endif
/** @file MathFunctions.h
* @brief Implementation of the math functions (gcd and lcm)
* @brief Implementation of math utility functions.
*
* Copied from BoostWorkaround/math
*/
*/
#include <limits>
namespace Assimp {
namespace Math {
// TODO: use binary GCD for unsigned integers ....
template < typename IntegerType >
IntegerType gcd( IntegerType a, IntegerType b )
{
inline
IntegerType gcd( IntegerType a, IntegerType b ) {
const IntegerType zero = (IntegerType)0;
while ( true )
{
while ( true ) {
if ( a == zero )
return b;
b %= a;
@ -66,12 +72,19 @@ IntegerType gcd( IntegerType a, IntegerType b )
}
template < typename IntegerType >
IntegerType lcm( IntegerType a, IntegerType b )
{
inline
IntegerType lcm( IntegerType a, IntegerType b ) {
const IntegerType t = gcd (a,b);
if (!t)return t;
if (!t)
return t;
return a / t * b;
}
template<class T>
inline
T getEpsilon() {
return std::numeric_limits<T>::epsilon();
}
}
}