diff --git a/Engine/source/ts/assimp/assimpAppNode.cpp b/Engine/source/ts/assimp/assimpAppNode.cpp index 3e82e8311..ac1802468 100644 --- a/Engine/source/ts/assimp/assimpAppNode.cpp +++ b/Engine/source/ts/assimp/assimpAppNode.cpp @@ -71,8 +71,6 @@ MatrixF AssimpAppNode::getTransform(F32 time) // no parent (ie. root level) => scale by global shape mLastTransform.identity(); mLastTransform.scale(ColladaUtils::getOptions().unit * ColladaUtils::getOptions().formatScaleFactor); - /*if (!isBounds()) - convertMat(mLastTransform);*/ } // If this node is animated in the active sequence, fetch the animated transform @@ -254,41 +252,6 @@ void AssimpAppNode::assimpToTorqueMat(const aiMatrix4x4& inAssimpMat, MatrixF& o (F32)inAssimpMat.d3, (F32)inAssimpMat.d4)); } -void AssimpAppNode::convertMat(MatrixF& outMat) -{ - MatrixF rot(true); - - switch (ColladaUtils::getOptions().upAxis) - { - case UPAXISTYPE_X_UP: - // rotate 90 around Y-axis, then 90 around Z-axis - rot(0, 0) = 0.0f; rot(1, 0) = 1.0f; - rot(1, 1) = 0.0f; rot(2, 1) = 1.0f; - rot(0, 2) = 1.0f; rot(2, 2) = 0.0f; - - // pre-multiply the transform by the rotation matrix - outMat.mulL(rot); - break; - - case UPAXISTYPE_Y_UP: - // rotate 180 around Y-axis, then 90 around X-axis - rot(0, 0) = 1.0f; - rot(1, 1) = 0.0f; - rot(1, 2) = -1.0f; - rot(2, 1) = 1.0f; - rot(2, 2) = 0.0f; - - // pre-multiply the transform by the rotation matrix - outMat.mulL(rot); - break; - - case UPAXISTYPE_Z_UP: - default: - // nothing to do - break; - } -} - aiNode* AssimpAppNode::findChildNodeByName(const char* nodeName, aiNode* rootNode) { aiNode* retNode = NULL; diff --git a/Engine/source/ts/assimp/assimpAppNode.h b/Engine/source/ts/assimp/assimpAppNode.h index aba3aa765..db5e18a81 100644 --- a/Engine/source/ts/assimp/assimpAppNode.h +++ b/Engine/source/ts/assimp/assimpAppNode.h @@ -114,7 +114,6 @@ public: bool isParentRoot() override { return (appParent == NULL); } static void assimpToTorqueMat(const aiMatrix4x4& inAssimpMat, MatrixF& outMat); - static void convertMat(MatrixF& outMat); static aiNode* findChildNodeByName(const char* nodeName, aiNode* rootNode); void addChild(AssimpAppNode* child); diff --git a/Engine/source/ts/assimp/assimpShapeLoader.cpp b/Engine/source/ts/assimp/assimpShapeLoader.cpp index 03ba43df8..19162ac82 100644 --- a/Engine/source/ts/assimp/assimpShapeLoader.cpp +++ b/Engine/source/ts/assimp/assimpShapeLoader.cpp @@ -128,15 +128,6 @@ void applyTransformation(aiNode* node, const aiMatrix4x4& transform) { node->mTransformation = transform * node->mTransformation; // Apply transformation to the node } -void applyRootTransformation(aiNode* node, const aiMatrix4x4& transform) { - node->mTransformation = transform * node->mTransformation; // Apply transformation to the node - - // Recursively apply to all child nodes - for (unsigned int i = 0; i < node->mNumChildren; ++i) { - applyRootTransformation(node->mChildren[i], transform); - } -} - void scaleScene(const aiScene* scene, F32 scaleFactor) { aiMatrix4x4 scaleMatrix; scaleMatrix = aiMatrix4x4::Scaling(aiVector3D(scaleFactor, scaleFactor, scaleFactor), scaleMatrix); @@ -263,9 +254,6 @@ void AssimpShapeLoader::enumerateScene() } } - if (fileExt == String::ToString("glb")) - ColladaUtils::getOptions().upAxis = UPAXISTYPE_X_UP; - for (U32 i = 0; i < mScene->mNumTextures; ++i) { extractTexture(i, mScene->mTextures[i]); } @@ -330,11 +318,6 @@ void AssimpShapeLoader::configureImportUnits() { } options.unit = static_cast(unitScaleFactor); } - - int upAxis = UPAXISTYPE_Z_UP; - if (getMetaInt("UpAxis", upAxis)) { - options.upAxis = static_cast(upAxis); - } } void AssimpShapeLoader::processAssimpNode(const aiNode* node, const aiScene* scene, AssimpAppNode* parentNode)