mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-16 21:23:46 +00:00
Just the functional assimp lib rather than the entire assimp repository unnecessarily.
This commit is contained in:
parent
0f7641a282
commit
e9ea38eda3
1747 changed files with 9012 additions and 925008 deletions
|
|
@ -3,8 +3,7 @@
|
|||
Open Asset Import Library (assimp)
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
Copyright (c) 2006-2018, assimp team
|
||||
|
||||
Copyright (c) 2006-2017, assimp team
|
||||
|
||||
|
||||
All rights reserved.
|
||||
|
|
@ -49,11 +48,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#ifndef ASSIMP_BUILD_NO_MD5_IMPORTER
|
||||
|
||||
// internal headers
|
||||
#include <assimp/RemoveComments.h>
|
||||
#include "RemoveComments.h"
|
||||
#include "MD5Loader.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/SkeletonMeshBuilder.h>
|
||||
#include "StringComparison.h"
|
||||
#include "fast_atof.h"
|
||||
#include "SkeletonMeshBuilder.h"
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/scene.h>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
|
|
@ -359,7 +358,7 @@ void MD5Importer::LoadMD5MeshFile ()
|
|||
|
||||
// Check whether we can read from the file
|
||||
if( file.get() == NULL || !file->FileSize()) {
|
||||
ASSIMP_LOG_WARN("Failed to access MD5MESH file: " + pFile);
|
||||
DefaultLogger::get()->warn("Failed to access MD5MESH file: " + pFile);
|
||||
return;
|
||||
}
|
||||
bHadMD5Mesh = true;
|
||||
|
|
@ -420,9 +419,6 @@ void MD5Importer::LoadMD5MeshFile ()
|
|||
// generate unique vertices in our internal verbose format
|
||||
MakeDataUnique(meshSrc);
|
||||
|
||||
std::string name( meshSrc.mShader.C_Str() );
|
||||
name += ".msh";
|
||||
mesh->mName = name;
|
||||
mesh->mNumVertices = (unsigned int) meshSrc.mVertices.size();
|
||||
mesh->mVertices = new aiVector3D[mesh->mNumVertices];
|
||||
mesh->mTextureCoords[0] = new aiVector3D[mesh->mNumVertices];
|
||||
|
|
@ -474,6 +470,7 @@ void MD5Importer::LoadMD5MeshFile ()
|
|||
MD5::ConvertQuaternion( boneSrc.mRotationQuat, boneSrc.mRotationQuatConverted );
|
||||
}
|
||||
|
||||
//unsigned int g = 0;
|
||||
pv = mesh->mVertices;
|
||||
for (MD5::VertexList::const_iterator iter = meshSrc.mVertices.begin();iter != meshSrc.mVertices.end();++iter,++pv) {
|
||||
// compute the final vertex position from all single weights
|
||||
|
|
@ -484,7 +481,7 @@ void MD5Importer::LoadMD5MeshFile ()
|
|||
for (unsigned int jub = (*iter).mFirstWeight, w = jub; w < jub + (*iter).mNumWeights;++w)
|
||||
fSum += meshSrc.mWeights[w].mWeight;
|
||||
if (!fSum) {
|
||||
ASSIMP_LOG_ERROR("MD5MESH: The sum of all vertex bone weights is 0");
|
||||
DefaultLogger::get()->error("MD5MESH: The sum of all vertex bone weights is 0");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -561,9 +558,7 @@ void MD5Importer::LoadMD5MeshFile ()
|
|||
// set this also as material name
|
||||
mat->AddProperty(&meshSrc.mShader,AI_MATKEY_NAME);
|
||||
}
|
||||
else {
|
||||
mat->AddProperty(&meshSrc.mShader, AI_MATKEY_TEXTURE_DIFFUSE(0));
|
||||
}
|
||||
else mat->AddProperty(&meshSrc.mShader,AI_MATKEY_TEXTURE_DIFFUSE(0));
|
||||
mesh->mMaterialIndex = n++;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -578,7 +573,7 @@ void MD5Importer::LoadMD5AnimFile ()
|
|||
|
||||
// Check whether we can read from the file
|
||||
if( !file.get() || !file->FileSize()) {
|
||||
ASSIMP_LOG_WARN("Failed to read MD5ANIM file: " + pFile);
|
||||
DefaultLogger::get()->warn("Failed to read MD5ANIM file: " + pFile);
|
||||
return;
|
||||
}
|
||||
LoadFileIntoMemory(file.get());
|
||||
|
|
@ -592,7 +587,8 @@ void MD5Importer::LoadMD5AnimFile ()
|
|||
// generate and fill the output animation
|
||||
if (animParser.mAnimatedBones.empty() || animParser.mFrames.empty() ||
|
||||
animParser.mBaseFrames.size() != animParser.mAnimatedBones.size()) {
|
||||
ASSIMP_LOG_ERROR("MD5ANIM: No frames or animated bones loaded");
|
||||
|
||||
DefaultLogger::get()->error("MD5ANIM: No frames or animated bones loaded");
|
||||
}
|
||||
else {
|
||||
bHadMD5Anim = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue