From a074ca58b339172274c63dbf3bb652bc7ba55c6c Mon Sep 17 00:00:00 2001 From: AndrzejKozik Date: Fri, 4 Nov 2016 08:48:14 +0100 Subject: [PATCH 1/2] Keys interpolation fix In line 3073 there was an unproper scope of cast to double. --- code/FBXConverter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 1f6274d8f..4de880640 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -3070,7 +3070,7 @@ void Converter::InterpolateKeys( aiVectorKey* valOut, const KeyTimeList& keys, c // do the actual interpolation in double-precision arithmetics // because it is a bit sensitive to rounding errors. - const double factor = timeB == timeA ? 0. : static_cast( ( time - timeA ) / ( timeB - timeA ) ); + const double factor = timeB == timeA ? 0. : static_cast( ( time - timeA ) ) / ( timeB - timeA ); const ai_real interpValue = static_cast( valueA + ( valueB - valueA ) * factor ); result[ std::get<2>(kfl) ] = interpValue; From dcb74787853a3925a4433bfadf6124349c8550f1 Mon Sep 17 00:00:00 2001 From: AndrzejKozik Date: Fri, 4 Nov 2016 09:20:04 +0100 Subject: [PATCH 2/2] Update FBXConverter.cpp --- code/FBXConverter.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/code/FBXConverter.cpp b/code/FBXConverter.cpp index 4de880640..365d7fe65 100644 --- a/code/FBXConverter.cpp +++ b/code/FBXConverter.cpp @@ -3068,9 +3068,7 @@ void Converter::InterpolateKeys( aiVectorKey* valOut, const KeyTimeList& keys, c const KeyTimeList::value_type timeA = std::get<0>(kfl)->at( id0 ); const KeyTimeList::value_type timeB = std::get<0>(kfl)->at( id1 ); - // do the actual interpolation in double-precision arithmetics - // because it is a bit sensitive to rounding errors. - const double factor = timeB == timeA ? 0. : static_cast( ( time - timeA ) ) / ( timeB - timeA ); + const ai_real factor = timeB == timeA ? 0. : static_cast( ( time - timeA ) ) / ( timeB - timeA ); const ai_real interpValue = static_cast( valueA + ( valueB - valueA ) * factor ); result[ std::get<2>(kfl) ] = interpValue;