mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
update assimp lib
This commit is contained in:
parent
03a348deb7
commit
d3f8fee74e
1725 changed files with 196314 additions and 62009 deletions
|
|
@ -2,8 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
All rights reserved.
|
||||
|
||||
|
|
@ -40,9 +39,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file Implementation of the SplitLargeMeshes postprocessing step
|
||||
*/
|
||||
/// @file Implementation of the SplitLargeMeshes postprocessing step
|
||||
|
||||
// internal headers of the post-processing framework
|
||||
#include "SplitLargeMeshes.h"
|
||||
|
|
@ -55,9 +52,6 @@ SplitLargeMeshesProcess_Triangle::SplitLargeMeshesProcess_Triangle() {
|
|||
LIMIT = AI_SLM_DEFAULT_MAX_TRIANGLES;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SplitLargeMeshesProcess_Triangle::~SplitLargeMeshesProcess_Triangle() = default;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Returns whether the processing step is present in the given flag field.
|
||||
bool SplitLargeMeshesProcess_Triangle::IsActive( unsigned int pFlags) const {
|
||||
|
|
@ -78,22 +72,22 @@ void SplitLargeMeshesProcess_Triangle::Execute( aiScene* pScene) {
|
|||
this->SplitMesh(a, pScene->mMeshes[a],avList);
|
||||
}
|
||||
|
||||
if (avList.size() != pScene->mNumMeshes) {
|
||||
// it seems something has been split. rebuild the mesh list
|
||||
delete[] pScene->mMeshes;
|
||||
pScene->mNumMeshes = (unsigned int)avList.size();
|
||||
pScene->mMeshes = new aiMesh*[avList.size()];
|
||||
|
||||
for (unsigned int i = 0; i < avList.size();++i) {
|
||||
pScene->mMeshes[i] = avList[i].first;
|
||||
}
|
||||
|
||||
// now we need to update all nodes
|
||||
this->UpdateNode(pScene->mRootNode,avList);
|
||||
ASSIMP_LOG_INFO("SplitLargeMeshesProcess_Triangle finished. Meshes have been split");
|
||||
} else {
|
||||
if (avList.size() == pScene->mNumMeshes) {
|
||||
ASSIMP_LOG_DEBUG("SplitLargeMeshesProcess_Triangle finished. There was nothing to do");
|
||||
}
|
||||
|
||||
// it seems something has been split. rebuild the mesh list
|
||||
delete[] pScene->mMeshes;
|
||||
pScene->mNumMeshes = (unsigned int)avList.size();
|
||||
pScene->mMeshes = new aiMesh*[avList.size()];
|
||||
|
||||
for (unsigned int i = 0; i < avList.size();++i) {
|
||||
pScene->mMeshes[i] = avList[i].first;
|
||||
}
|
||||
|
||||
// now we need to update all nodes
|
||||
this->UpdateNode(pScene->mRootNode,avList);
|
||||
ASSIMP_LOG_INFO("SplitLargeMeshesProcess_Triangle finished. Meshes have been split");
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
@ -105,8 +99,12 @@ void SplitLargeMeshesProcess_Triangle::SetupProperties( const Importer* pImp) {
|
|||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Update a node after some meshes have been split
|
||||
void SplitLargeMeshesProcess_Triangle::UpdateNode(aiNode* pcNode,
|
||||
const std::vector<std::pair<aiMesh*, unsigned int> >& avList) {
|
||||
void SplitLargeMeshesProcess_Triangle::UpdateNode(aiNode* pcNode, const std::vector<std::pair<aiMesh*, unsigned int> >& avList) {
|
||||
if (pcNode == nullptr) {
|
||||
ASSIMP_LOG_WARN("UpdateNode skipped, nullptr detected.");
|
||||
return;
|
||||
}
|
||||
|
||||
// for every index in out list build a new entry
|
||||
std::vector<unsigned int> aiEntries;
|
||||
aiEntries.reserve(pcNode->mNumMeshes + 1);
|
||||
|
|
@ -329,9 +327,6 @@ SplitLargeMeshesProcess_Vertex::SplitLargeMeshesProcess_Vertex() {
|
|||
LIMIT = AI_SLM_DEFAULT_MAX_VERTICES;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
SplitLargeMeshesProcess_Vertex::~SplitLargeMeshesProcess_Vertex() = default;
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Returns whether the processing step is present in the given flag field.
|
||||
bool SplitLargeMeshesProcess_Vertex::IsActive( unsigned int pFlags) const {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue