From 067c5d9ec4fff4b7779bf54bfa9dc44efd9cc64a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Wed, 16 Feb 2022 00:17:26 +0100 Subject: [PATCH] Refactoring: add usage of ai_epsilon to fbx. --- code/AssetLib/FBX/FBXCommon.h | 2 ++ code/AssetLib/FBX/FBXConverter.cpp | 3 ++- include/assimp/defs.h | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/code/AssetLib/FBX/FBXCommon.h b/code/AssetLib/FBX/FBXCommon.h index 54e2e9e50..ec7459c9e 100644 --- a/code/AssetLib/FBX/FBXCommon.h +++ b/code/AssetLib/FBX/FBXCommon.h @@ -80,8 +80,10 @@ enum TransformInheritance { TransformInheritance_MAX // end-of-enum sentinel }; + } // namespace FBX } // namespace Assimp + #endif // ASSIMP_BUILD_NO_FBX_EXPORTER #endif // AI_FBXCOMMON_H_INC diff --git a/code/AssetLib/FBX/FBXConverter.cpp b/code/AssetLib/FBX/FBXConverter.cpp index 3cefed023..d7b7e0ef3 100644 --- a/code/AssetLib/FBX/FBXConverter.cpp +++ b/code/AssetLib/FBX/FBXConverter.cpp @@ -3187,7 +3187,8 @@ aiNodeAnim* FBXConverter::GenerateSimpleNodeAnim(const std::string& name, } bool ok = false; - const float zero_epsilon = 1e-6f; + + const float zero_epsilon = ai_epsilon; const aiVector3D& preRotation = PropertyGet(props, "PreRotation", ok); if (ok && preRotation.SquareLength() > zero_epsilon) { diff --git a/include/assimp/defs.h b/include/assimp/defs.h index 9c4422584..b85f14b7e 100644 --- a/include/assimp/defs.h +++ b/include/assimp/defs.h @@ -283,7 +283,7 @@ typedef unsigned int ai_uint; #define AI_RAD_TO_DEG(x) ((x) * (ai_real)57.2957795) /* Numerical limits */ -static const ai_real ai_epsilon = (ai_real)0.00001; +static const ai_real ai_epsilon = (ai_real) 1e-6; /* Support for big-endian builds */ #if defined(__BYTE_ORDER__)