From 7c3fd351d3e84dd10cdefd2ac10ceee61bc7ead1 Mon Sep 17 00:00:00 2001 From: "chenmou.cm" Date: Fri, 20 Mar 2020 17:19:27 +0800 Subject: [PATCH] fix no preservePivots bug --- code/FBX/FBXConverter.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/code/FBX/FBXConverter.cpp b/code/FBX/FBXConverter.cpp index 22616a480..971f8f684 100644 --- a/code/FBX/FBXConverter.cpp +++ b/code/FBX/FBXConverter.cpp @@ -883,10 +883,12 @@ namespace Assimp { // name passed to the method is already unique nd->mName.Set(name); - for (const auto &transform : chain) { - nd->mTransformation = nd->mTransformation * transform; - } - return false; + // for (const auto &transform : chain) { + // skip inverse chain for no preservePivots + for (unsigned int i = TransformationComp_Translation; i < TransformationComp_MAXIMUM; i++) { + nd->mTransformation = nd->mTransformation * chain[i]; + } + return false; } void FBXConverter::SetupNodeMetadata(const Model& model, aiNode& nd)