From d825eb7cf0a80331a1d8c6e06cc45cfef63e63b5 Mon Sep 17 00:00:00 2001 From: Florian Born Date: Mon, 8 May 2023 20:04:38 +0200 Subject: [PATCH 1/8] Skinning weights i gltf were broken by PR#5003 (vertex remapping) --- code/AssetLib/glTF2/glTF2Importer.cpp | 70 +++++++++++++++------------ code/AssetLib/glTF2/glTF2Importer.h | 6 ++- 2 files changed, 44 insertions(+), 32 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index 394264a12..038a52b32 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -432,10 +432,10 @@ static inline bool CheckValidFacesIndices(aiFace *faces, unsigned nFaces, unsign #endif // ASSIMP_BUILD_DEBUG template -aiColor4D *GetVertexColorsForType(Ref input) { +aiColor4D *GetVertexColorsForType(Ref input, std::vector *vertexRemappingTable) { constexpr float max = std::numeric_limits::max(); aiColor4t *colors; - input->ExtractData(colors); + input->ExtractData(colors, vertexRemappingTable); auto output = new aiColor4D[input->count]; for (size_t i = 0; i < input->count; i++) { output[i] = aiColor4D( @@ -450,20 +450,26 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { ASSIMP_LOG_DEBUG("Importing ", r.meshes.Size(), " meshes"); std::vector> meshes; - unsigned int k = 0; meshOffsets.clear(); + meshOffsets.reserve(r.meshes.Size() + 1); + mVertexRemappingTables.clear(); + // Count the number of aiMeshes + unsigned int num_aiMeshes = 0; + for (unsigned int m = 0; m < r.meshes.Size(); ++m) { + meshOffsets.push_back(num_aiMeshes); + num_aiMeshes += unsigned(r.meshes[m].primitives.size()); + } + meshOffsets.push_back(num_aiMeshes); // add a last element so we can always do meshOffsets[n+1] - meshOffsets[n] - std::vector usedVertexIndices; std::vector reverseMappingIndices; std::vector indexBuffer; + meshes.reserve(num_aiMeshes); + mVertexRemappingTables.resize(num_aiMeshes); for (unsigned int m = 0; m < r.meshes.Size(); ++m) { Mesh &mesh = r.meshes[m]; - meshOffsets.push_back(k); - k += unsigned(mesh.primitives.size()); - for (unsigned int p = 0; p < mesh.primitives.size(); ++p) { Mesh::Primitive &prim = mesh.primitives[p]; @@ -477,14 +483,14 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { // Extract used vertices: bool useIndexBuffer = prim.indices; - std::vector* vertexRemappingTable = nullptr; + std::vector *vertexRemappingTable = nullptr; + if (useIndexBuffer) { size_t count = prim.indices->count; indexBuffer.resize(count); - usedVertexIndices.clear(); reverseMappingIndices.clear(); - usedVertexIndices.reserve(count / 3); // this is a very rough heuristic to reduce re-allocations - vertexRemappingTable = &usedVertexIndices; + vertexRemappingTable = &mVertexRemappingTables[meshes.size()]; + vertexRemappingTable->reserve(count / 3); // this is a very rough heuristic to reduce re-allocations Accessor::Indexer data = prim.indices->GetIndexer(); if (!data.IsValid()) { throw DeadlyImportError("GLTF: Invalid accessor without data in mesh ", getContextForErrorMessages(mesh.id, mesh.name)); @@ -504,8 +510,8 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { reverseMappingIndices.resize(index + 1, unusedIndex); } if (reverseMappingIndices[index] == unusedIndex) { - reverseMappingIndices[index] = static_cast(usedVertexIndices.size()); - usedVertexIndices.push_back(index); + reverseMappingIndices[index] = static_cast(vertexRemappingTable->size()); + vertexRemappingTable->push_back(index); } indexBuffer[i] = reverseMappingIndices[index]; } @@ -586,9 +592,9 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { attr.color[c]->ExtractData(aim->mColors[c], vertexRemappingTable); } else { if (componentType == glTF2::ComponentType_UNSIGNED_BYTE) { - aim->mColors[c] = GetVertexColorsForType(attr.color[c]); + aim->mColors[c] = GetVertexColorsForType(attr.color[c], vertexRemappingTable); } else if (componentType == glTF2::ComponentType_UNSIGNED_SHORT) { - aim->mColors[c] = GetVertexColorsForType(attr.color[c]); + aim->mColors[c] = GetVertexColorsForType(attr.color[c], vertexRemappingTable); } } } @@ -864,8 +870,6 @@ void glTF2Importer::ImportMeshes(glTF2::Asset &r) { } } - meshOffsets.push_back(k); - CopyVector(meshes, mScene->mMeshes, mScene->mNumMeshes); } @@ -998,7 +1002,8 @@ static void GetNodeTransform(aiMatrix4x4 &matrix, const glTF2::Node &node) { } } -static void BuildVertexWeightMapping(Mesh::Primitive &primitive, std::vector> &map) { +static void BuildVertexWeightMapping(Mesh::Primitive &primitive, std::vector> &map, std::vector* vertexRemappingTablePtr) { + Mesh::Primitive::Attributes &attr = primitive.attributes; if (attr.weight.empty() || attr.joint.empty()) { return; @@ -1007,14 +1012,14 @@ static void BuildVertexWeightMapping(Mesh::Primitive &primitive, std::vectorcount; + size_t num_vertices = 0; struct Weights { float values[4]; }; Weights **weights = new Weights*[attr.weight.size()]; for (size_t w = 0; w < attr.weight.size(); ++w) { - attr.weight[w]->ExtractData(weights[w]); + num_vertices = attr.weight[w]->ExtractData(weights[w], vertexRemappingTablePtr); } struct Indices8 { @@ -1028,12 +1033,12 @@ static void BuildVertexWeightMapping(Mesh::Primitive &primitive, std::vectorGetElementSize() == 4) { indices8 = new Indices8*[attr.joint.size()]; for (size_t j = 0; j < attr.joint.size(); ++j) { - attr.joint[j]->ExtractData(indices8[j]); + attr.joint[j]->ExtractData(indices8[j], vertexRemappingTablePtr); } } else { indices16 = new Indices16 *[attr.joint.size()]; for (size_t j = 0; j < attr.joint.size(); ++j) { - attr.joint[j]->ExtractData(indices16[j]); + attr.joint[j]->ExtractData(indices16[j], vertexRemappingTablePtr); } } // @@ -1100,7 +1105,7 @@ void ParseExtras(aiMetadata *metadata, const CustomExtension &extension) { } } -aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector &meshOffsets, glTF2::Ref &ptr) { +aiNode *glTF2Importer::ImportNode(glTF2::Asset &r, glTF2::Ref &ptr) { Node &node = *ptr; aiNode *ainode = new aiNode(GetNodeName(node)); @@ -1112,7 +1117,7 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector & std::fill(ainode->mChildren, ainode->mChildren + ainode->mNumChildren, nullptr); for (unsigned int i = 0; i < ainode->mNumChildren; ++i) { - aiNode *child = ImportNode(pScene, r, meshOffsets, node.children[i]); + aiNode *child = ImportNode(r, node.children[i]); child->mParent = ainode; ainode->mChildren[i] = child; } @@ -1145,11 +1150,13 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector & if (node.skin) { for (int primitiveNo = 0; primitiveNo < count; ++primitiveNo) { - aiMesh *mesh = pScene->mMeshes[meshOffsets[mesh_idx] + primitiveNo]; + unsigned int aiMeshIdx = meshOffsets[mesh_idx] + primitiveNo; + aiMesh *mesh = mScene->mMeshes[aiMeshIdx]; unsigned int numBones = static_cast(node.skin->jointNames.size()); + std::vector *vertexRemappingTablePtr = mVertexRemappingTables[aiMeshIdx].empty() ? nullptr : &mVertexRemappingTables[aiMeshIdx]; std::vector> weighting(numBones); - BuildVertexWeightMapping(node.meshes[0]->primitives[primitiveNo], weighting); + BuildVertexWeightMapping(node.meshes[0]->primitives[primitiveNo], weighting, vertexRemappingTablePtr); mesh->mNumBones = static_cast(numBones); mesh->mBones = new aiBone *[mesh->mNumBones]; @@ -1166,7 +1173,7 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector & // mapping which makes things doubly-slow. mat4 *pbindMatrices = nullptr; - node.skin->inverseBindMatrices->ExtractData(pbindMatrices); + node.skin->inverseBindMatrices->ExtractData(pbindMatrices, nullptr); for (uint32_t i = 0; i < numBones; ++i) { const std::vector &weights = weighting[i]; @@ -1212,11 +1219,11 @@ aiNode *ImportNode(aiScene *pScene, glTF2::Asset &r, std::vector & } if (node.camera) { - pScene->mCameras[node.camera.GetIndex()]->mName = ainode->mName; + mScene->mCameras[node.camera.GetIndex()]->mName = ainode->mName; } if (node.light) { - pScene->mLights[node.light.GetIndex()]->mName = ainode->mName; + mScene->mLights[node.light.GetIndex()]->mName = ainode->mName; // range is optional - see https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_lights_punctual // it is added to meta data of parent node, because there is no other place to put it @@ -1248,7 +1255,7 @@ void glTF2Importer::ImportNodes(glTF2::Asset &r) { // The root nodes unsigned int numRootNodes = unsigned(rootNodes.size()); if (numRootNodes == 1) { // a single root node: use it - mScene->mRootNode = ImportNode(mScene, r, meshOffsets, rootNodes[0]); + mScene->mRootNode = ImportNode(r, rootNodes[0]); } else if (numRootNodes > 1) { // more than one root node: create a fake root aiNode *root = mScene->mRootNode = new aiNode("ROOT"); @@ -1256,7 +1263,7 @@ void glTF2Importer::ImportNodes(glTF2::Asset &r) { std::fill(root->mChildren, root->mChildren + numRootNodes, nullptr); for (unsigned int i = 0; i < numRootNodes; ++i) { - aiNode *node = ImportNode(mScene, r, meshOffsets, rootNodes[i]); + aiNode *node = ImportNode(r, rootNodes[i]); node->mParent = root; root->mChildren[root->mNumChildren++] = node; } @@ -1657,6 +1664,7 @@ void glTF2Importer::InternReadFile(const std::string &pFile, aiScene *pScene, IO // clean all member arrays meshOffsets.clear(); + mVertexRemappingTables.clear(); mEmbeddedTexIdxs.clear(); this->mScene = pScene; diff --git a/code/AssetLib/glTF2/glTF2Importer.h b/code/AssetLib/glTF2/glTF2Importer.h index 80cf689dc..bc2234687 100644 --- a/code/AssetLib/glTF2/glTF2Importer.h +++ b/code/AssetLib/glTF2/glTF2Importer.h @@ -43,6 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #define AI_GLTF2IMPORTER_H_INC #include +#include struct aiNode; @@ -77,9 +78,12 @@ private: void ImportAnimations(glTF2::Asset &a); void ImportCommonMetadata(glTF2::Asset &a); -private: + aiNode *ImportNode(glTF2::Asset &r, glTF2::Ref &ptr); + + private: std::vector meshOffsets; std::vector mEmbeddedTexIdxs; + std::vector> mVertexRemappingTables; // for each converted aiMesh in the scene, it stores a list of vertices that are actually used aiScene *mScene; /// An instance of rapidjson::IRemoteSchemaDocumentProvider From e4621a31421f3ed89db9b3d491494993ae262db2 Mon Sep 17 00:00:00 2001 From: mosfet80 Date: Wed, 24 May 2023 17:29:29 +0200 Subject: [PATCH 2/8] Update cpp-pm / hunter Fix a lot of CVE vulnerabilities Update abseil to LTFS 20220623.1 by @butteredmonkey in #656 Fix Hunter on Windows MSVC CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE 'ARM64EC' by @ccmvn in #659 openssl: update openssl to the latest 1.1.1t by @res0nance in #660 ceres-solver: per default disable CUDA support by @NeroBurner in #665 update range-v3 to version 0.12.0 by @alex-tdrn in #670 Update 'pybind11' to 2.10.4 by @hjmallon in #667 cli11: update cli11 to 2.3.2 by @res0nance in #669 openssl: update to v3 as 1.1.1 is almost eol by @res0nance in #668 Fix Hunter on Windows MSVC CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE 'ARM64' by @ccmvn in #655 Boost: Fix building b2 (+ headers) on Apple tvOS with Xcode generator by @hjmallon in #647 assimp: add version 5.2.5 by @NovaSurfer in #640 SuiteSparse: update to v1.6.1 (SuiteSparse v5.4.0), with METIS and OpenBLAS by @NeroBurner in #642 OpenSSL: replace HUNTER_UWP_PLATFORM with CMAKE_SYSTEM_NAME check by @Dargun in #635 asio-grpc: Add version 2.3.0 by @Tradias in #636 Update OpenBLAS to v0.3.21 and add new BUILD_WITHOUT_LAPACK flag by @NeroBurner in #638 OpenBLAS: starting with 0.3.21 build with LAPACK support per default by @NeroBurner in #639 Update 'date' to v3.0.1 by @hjmallon in #615 Update 'SDL_net' package to v2.2.0-p0 by @drodin in #616 Update 'Jpeg' package to v9e-p0 by @drodin in #618 Update 'GTest' package to v1.12.1 by @drodin in #620 Update 'lcms' package to v2.13.1-p0 by @drodin in #621 Update 'giflib' package to v5.2.1-p0 by @drodin in #622 Update package 'WebP' to v1.2.4-p0 by @drodin in #623 Update 'Boost' to 1.80.0 by @tnixeu in #627 Update asio-grpc to 2.2.0 by @Tradias in #629 Update ZLIB to v1.2.13-p0 by @NeroBurner in #628 Add support for iOS simulator only builds by @hjmallon in #610 aws-sdk-cpp: Fix linking OpenSSL Crypto on Linux by @hjmallon in #630 and #631 OpenSSL: Fix build on universal windows platforms, add UWP job to global build matrix by @Dargun in #626 Update asio-grpc to v2.1.0 by @Tradias in #607 Update 'harfbuzz' package to v2.9.1-p0 by @drodin in #608 Update RocksDB to 7.5.3 by @twoentartian in #611 Fix CMAKE_IOS_INSTALL_COMBINED on Xcode 12+ by @hjmallon in #609 CI: Boost: update matrix.json to match general workflow by @NeroBurner in #612 Boost: update to v1.79.0 by @NeroBurner in #599 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 20c735c4c..e0f034390 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,8 +49,8 @@ option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF) IF(ASSIMP_HUNTER_ENABLED) include("cmake-modules/HunterGate.cmake") HunterGate( - URL "https://github.com/cpp-pm/hunter/archive/v0.24.0.tar.gz" - SHA1 "a3d7f4372b1dcd52faa6ff4a3bd5358e1d0e5efd" + URL "https://github.com/cpp-pm/hunter/archive/v0.24.16.tar.gz" + SHA1 "aefcc56d2ad0021aa5bd5df72890151c" ) add_definitions(-DASSIMP_USE_HUNTER) From 1f5c7da82218819681f01a8a1c83cda65bee89bf Mon Sep 17 00:00:00 2001 From: mosfet80 Date: Tue, 30 May 2023 16:23:57 +0200 Subject: [PATCH 3/8] Update CMakeLists.txt --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0f034390..5a6c0a433 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,8 +49,8 @@ option(ASSIMP_HUNTER_ENABLED "Enable Hunter package manager support" OFF) IF(ASSIMP_HUNTER_ENABLED) include("cmake-modules/HunterGate.cmake") HunterGate( - URL "https://github.com/cpp-pm/hunter/archive/v0.24.16.tar.gz" - SHA1 "aefcc56d2ad0021aa5bd5df72890151c" + URL "https://github.com/cpp-pm/hunter/archive/v0.24.17.tar.gz" + SHA1 "d9a9de341c9341b7d42d7374340f1871" ) add_definitions(-DASSIMP_USE_HUNTER) From 462755e5ba4e769b08cf8cf8f438543c2ce7ecda Mon Sep 17 00:00:00 2001 From: mosfet80 Date: Tue, 30 May 2023 16:26:30 +0200 Subject: [PATCH 4/8] Update CMakeLists.txt fix sha1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a6c0a433..46c2a591c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ IF(ASSIMP_HUNTER_ENABLED) include("cmake-modules/HunterGate.cmake") HunterGate( URL "https://github.com/cpp-pm/hunter/archive/v0.24.17.tar.gz" - SHA1 "d9a9de341c9341b7d42d7374340f1871" + SHA1 "e6396699e414120e32557fe92db097b7655b760b" ) add_definitions(-DASSIMP_USE_HUNTER) From 5cc4a61d66cf234cfa59d7a1914ab4462bcb583a Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 31 May 2023 06:28:03 +0000 Subject: [PATCH 5/8] Fix Heap-buffer-overflow READ in Assimp::MD5::MD5MeshParser::MD5MeshParser --- code/AssetLib/MD5/MD5Parser.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/code/AssetLib/MD5/MD5Parser.cpp b/code/AssetLib/MD5/MD5Parser.cpp index dce4c5732..97dedab71 100644 --- a/code/AssetLib/MD5/MD5Parser.cpp +++ b/code/AssetLib/MD5/MD5Parser.cpp @@ -228,15 +228,20 @@ bool MD5Parser::ParseSection(Section &out) { out.data[out.length] = '\0'; // parse a string, enclosed in quotation marks -#define AI_MD5_PARSE_STRING_IN_QUOTATION(out) \ - while ('\"' != *sz) \ - ++sz; \ - const char *szStart = ++sz; \ - while ('\"' != *sz) \ - ++sz; \ - const char *szEnd = (sz++); \ - out.length = (ai_uint32)(szEnd - szStart); \ - ::memcpy(out.data, szStart, out.length); \ +#define AI_MD5_PARSE_STRING_IN_QUOTATION(out) \ + out.length = 0; \ + while ('\"' != *sz && '\0' != *sz) \ + ++sz; \ + if ('\0' != *sz) { \ + const char *szStart = ++sz; \ + while ('\"' != *sz && '\0' != *sz) \ + ++sz; \ + if ('\0' != *sz) { \ + const char *szEnd = (sz++); \ + out.length = (ai_uint32)(szEnd - szStart); \ + ::memcpy(out.data, szStart, out.length); \ + } \ + } \ out.data[out.length] = '\0'; // ------------------------------------------------------------------------------------------------ // .MD5MESH parsing function From cb8602915399545f0a7cb7dd4fddc1fef2ad954c Mon Sep 17 00:00:00 2001 From: Kristjan Skutta Date: Tue, 6 Jun 2023 06:16:26 +0200 Subject: [PATCH 6/8] Fixed missing config property lookup for removal of empty bones. --- code/PostProcessing/LimitBoneWeightsProcess.cpp | 7 ++++--- code/PostProcessing/LimitBoneWeightsProcess.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/PostProcessing/LimitBoneWeightsProcess.cpp b/code/PostProcessing/LimitBoneWeightsProcess.cpp index 7047ec0f1..16b32143e 100644 --- a/code/PostProcessing/LimitBoneWeightsProcess.cpp +++ b/code/PostProcessing/LimitBoneWeightsProcess.cpp @@ -81,6 +81,7 @@ void LimitBoneWeightsProcess::Execute( aiScene* pScene) { // Executes the post processing step on the given imported data. void LimitBoneWeightsProcess::SetupProperties(const Importer* pImp) { this->mMaxWeights = pImp->GetPropertyInteger(AI_CONFIG_PP_LBW_MAX_WEIGHTS,AI_LMW_MAX_WEIGHTS); + this->mRemoveEmptyBones = pImp->GetPropertyInteger(AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES, 1) != 0; } // ------------------------------------------------------------------------------------------------ @@ -172,9 +173,9 @@ void LimitBoneWeightsProcess::ProcessMesh(aiMesh* pMesh) { } // remove empty bones -#ifdef AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES - pMesh->mNumBones = removeEmptyBones(pMesh); -#endif // AI_CONFIG_IMPORT_REMOVE_EMPTY_BONES + if (mRemoveEmptyBones) { + pMesh->mNumBones = removeEmptyBones(pMesh); + } if (!DefaultLogger::isNullLogger()) { ASSIMP_LOG_INFO("Removed ", removed, " weights. Input bones: ", old_bones, ". Output bones: ", pMesh->mNumBones); diff --git a/code/PostProcessing/LimitBoneWeightsProcess.h b/code/PostProcessing/LimitBoneWeightsProcess.h index b19d536cf..8e5ebd80d 100644 --- a/code/PostProcessing/LimitBoneWeightsProcess.h +++ b/code/PostProcessing/LimitBoneWeightsProcess.h @@ -133,6 +133,7 @@ public: /** Maximum number of bones influencing any single vertex. */ unsigned int mMaxWeights; + bool mRemoveEmptyBones; }; } // end of namespace Assimp From 1ab4161cd7a89f6f1fea9442ec149ab7d0990b7a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 8 Jun 2023 20:55:48 +0200 Subject: [PATCH 7/8] Update glTF2Importer.cpp --- code/AssetLib/glTF2/glTF2Importer.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Importer.cpp b/code/AssetLib/glTF2/glTF2Importer.cpp index 226a04e95..942c63c85 100644 --- a/code/AssetLib/glTF2/glTF2Importer.cpp +++ b/code/AssetLib/glTF2/glTF2Importer.cpp @@ -100,8 +100,6 @@ glTF2Importer::glTF2Importer() : // empty } -glTF2Importer::~glTF2Importer() = default; - const aiImporterDesc *glTF2Importer::GetInfo() const { return &desc; } From bef66deedaf7cb08b59fa291c64a3b720bd54009 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 8 Jun 2023 20:56:14 +0200 Subject: [PATCH 8/8] Update glTF2Importer.h --- code/AssetLib/glTF2/glTF2Importer.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/AssetLib/glTF2/glTF2Importer.h b/code/AssetLib/glTF2/glTF2Importer.h index bc2234687..2be42126c 100644 --- a/code/AssetLib/glTF2/glTF2Importer.h +++ b/code/AssetLib/glTF2/glTF2Importer.h @@ -60,7 +60,7 @@ namespace Assimp { class glTF2Importer : public BaseImporter { public: glTF2Importer(); - ~glTF2Importer() override; + ~glTF2Importer() override = default; bool CanRead(const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const override; protected: @@ -77,10 +77,9 @@ private: void ImportNodes(glTF2::Asset &a); void ImportAnimations(glTF2::Asset &a); void ImportCommonMetadata(glTF2::Asset &a); - aiNode *ImportNode(glTF2::Asset &r, glTF2::Ref &ptr); - private: +private: std::vector meshOffsets; std::vector mEmbeddedTexIdxs; std::vector> mVertexRemappingTables; // for each converted aiMesh in the scene, it stores a list of vertices that are actually used