mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Upgrade to Assimp 5.0
This commit is contained in:
parent
d8cc73f5a1
commit
c2018ad3de
662 changed files with 106518 additions and 21818 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue