mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-26 10:03:48 +00:00
update assimp lib
This commit is contained in:
parent
03a348deb7
commit
d3f8fee74e
1725 changed files with 196314 additions and 62009 deletions
|
|
@ -2,7 +2,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2022, assimp team
|
||||
Copyright (c) 2006-2024, assimp team
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
|
@ -63,6 +63,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <assimp/scene.h>
|
||||
#include <stdio.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
|
|
@ -78,7 +79,7 @@ inline void PrefixString(aiString &string, const char *prefix, unsigned int len)
|
|||
if (string.length >= 1 && string.data[0] == '$')
|
||||
return;
|
||||
|
||||
if (len + string.length >= MAXLEN - 1) {
|
||||
if (len + string.length >= AI_MAXLEN - 1) {
|
||||
ASSIMP_LOG_VERBOSE_DEBUG("Can't add an unique prefix because the string is too long");
|
||||
ai_assert(false);
|
||||
return;
|
||||
|
|
@ -252,6 +253,14 @@ void SceneCombiner::AttachToGraph(aiScene *master, std::vector<NodeAttachmentInf
|
|||
// ------------------------------------------------------------------------------------------------
|
||||
void SceneCombiner::MergeScenes(aiScene **_dest, aiScene *master, std::vector<AttachmentInfo> &srcList, unsigned int flags) {
|
||||
if (nullptr == _dest) {
|
||||
std::unordered_set<aiScene *> uniqueScenes;
|
||||
uniqueScenes.insert(master);
|
||||
for (const auto &item : srcList) {
|
||||
uniqueScenes.insert(item.scene);
|
||||
}
|
||||
for (const auto &item : uniqueScenes) {
|
||||
delete item;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -259,6 +268,7 @@ void SceneCombiner::MergeScenes(aiScene **_dest, aiScene *master, std::vector<At
|
|||
if (srcList.empty()) {
|
||||
if (*_dest) {
|
||||
SceneCombiner::CopySceneFlat(_dest, master);
|
||||
delete master;
|
||||
} else
|
||||
*_dest = master;
|
||||
return;
|
||||
|
|
@ -306,15 +316,6 @@ void SceneCombiner::MergeScenes(aiScene **_dest, aiScene *master, std::vector<At
|
|||
boost::variate_generator<boost::mt19937&, boost::uniform_int<> > rndGen(rng, dist);
|
||||
#endif
|
||||
for (unsigned int i = 1; i < src.size(); ++i) {
|
||||
//if (i != duplicates[i])
|
||||
//{
|
||||
// // duplicate scenes share the same UID
|
||||
// ::strcpy( src[i].id, src[duplicates[i]].id );
|
||||
// src[i].idlen = src[duplicates[i]].idlen;
|
||||
|
||||
// continue;
|
||||
//}
|
||||
|
||||
src[i].idlen = ai_snprintf(src[i].id, 32, "$%.6X$_", i);
|
||||
|
||||
if (flags & AI_INT_MERGE_SCENE_GEN_UNIQUE_NAMES_IF_NECESSARY) {
|
||||
|
|
@ -408,7 +409,7 @@ void SceneCombiner::MergeScenes(aiScene **_dest, aiScene *master, std::vector<At
|
|||
// where n is the index of the texture.
|
||||
// Copy here because we overwrite the string data in-place and the buffer inside of aiString
|
||||
// will be a lie if we just reinterpret from prop->mData. The size of mData is not guaranteed to be
|
||||
// MAXLEN in size.
|
||||
// AI_MAXLEN in size.
|
||||
aiString s(*(aiString *)prop->mData);
|
||||
if ('*' == s.data[0]) {
|
||||
// Offset the index and write it back ..
|
||||
|
|
@ -1057,7 +1058,7 @@ void SceneCombiner::CopyScene(aiScene **_dest, const aiScene *src, bool allocate
|
|||
dest->mFlags = src->mFlags;
|
||||
|
||||
// source private data might be nullptr if the scene is user-allocated (i.e. for use with the export API)
|
||||
if (dest->mPrivate != nullptr) {
|
||||
if (src->mPrivate != nullptr) {
|
||||
ScenePriv(dest)->mPPStepsApplied = ScenePriv(src) ? ScenePriv(src)->mPPStepsApplied : 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -1349,6 +1350,9 @@ void SceneCombiner::Copy(aiMetadata **_dest, const aiMetadata *src) {
|
|||
case AI_AIVECTOR3D:
|
||||
out.mData = new aiVector3D(*static_cast<aiVector3D *>(in.mData));
|
||||
break;
|
||||
case AI_AIMETADATA:
|
||||
out.mData = new aiMetadata(*static_cast<aiMetadata *>(in.mData));
|
||||
break;
|
||||
default:
|
||||
ai_assert(false);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue