mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 19:53:48 +00:00
Just the functional assimp lib rather than the entire assimp repository unnecessarily.
This commit is contained in:
parent
bf170ffbca
commit
25ce4477ce
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.
|
||||
|
|
@ -51,8 +50,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
// internal headers
|
||||
#include "ASELoader.h"
|
||||
#include <assimp/StringComparison.h>
|
||||
#include <assimp/SkeletonMeshBuilder.h>
|
||||
#include "StringComparison.h"
|
||||
#include "SkeletonMeshBuilder.h"
|
||||
#include "TargetAnimation.h"
|
||||
#include <assimp/Importer.hpp>
|
||||
#include <assimp/IOSystem.hpp>
|
||||
|
|
@ -63,7 +62,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <memory>
|
||||
|
||||
// utilities
|
||||
#include <assimp/fast_atof.h>
|
||||
#include "fast_atof.h"
|
||||
|
||||
using namespace Assimp;
|
||||
using namespace Assimp::ASE;
|
||||
|
|
@ -84,11 +83,11 @@ static const aiImporterDesc desc = {
|
|||
// ------------------------------------------------------------------------------------------------
|
||||
// Constructor to be privately used by Importer
|
||||
ASEImporter::ASEImporter()
|
||||
: mParser()
|
||||
, mBuffer()
|
||||
, pcScene()
|
||||
, configRecomputeNormals()
|
||||
, noSkeletonMesh()
|
||||
: mParser(),
|
||||
mBuffer(),
|
||||
pcScene(),
|
||||
configRecomputeNormals(),
|
||||
noSkeletonMesh()
|
||||
{}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
|
@ -200,7 +199,7 @@ void ASEImporter::InternReadFile( const std::string& pFile,
|
|||
ConvertMeshes(*i,avOutMeshes);
|
||||
}
|
||||
if (tookNormals) {
|
||||
ASSIMP_LOG_DEBUG("ASE: Taking normals from the file. Use "
|
||||
DefaultLogger::get()->debug("ASE: Taking normals from the file. Use "
|
||||
"the AI_CONFIG_IMPORT_ASE_RECONSTRUCT_NORMALS setting if you "
|
||||
"experience problems");
|
||||
}
|
||||
|
|
@ -277,13 +276,14 @@ void ASEImporter::GenerateDefaultMaterial()
|
|||
}
|
||||
if (bHas || mParser->m_vMaterials.empty()) {
|
||||
// add a simple material without submaterials to the parser's list
|
||||
mParser->m_vMaterials.push_back ( ASE::Material(AI_DEFAULT_MATERIAL_NAME) );
|
||||
mParser->m_vMaterials.push_back ( ASE::Material() );
|
||||
ASE::Material& mat = mParser->m_vMaterials.back();
|
||||
|
||||
mat.mDiffuse = aiColor3D(0.6f,0.6f,0.6f);
|
||||
mat.mSpecular = aiColor3D(1.0f,1.0f,1.0f);
|
||||
mat.mAmbient = aiColor3D(0.05f,0.05f,0.05f);
|
||||
mat.mShading = Discreet3DS::Gouraud;
|
||||
mat.mName = AI_DEFAULT_MATERIAL_NAME;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -297,15 +297,15 @@ void ASEImporter::BuildAnimations(const std::vector<BaseNode*>& nodes)
|
|||
|
||||
// TODO: Implement Bezier & TCB support
|
||||
if ((*i)->mAnim.mPositionType != ASE::Animation::TRACK) {
|
||||
ASSIMP_LOG_WARN("ASE: Position controller uses Bezier/TCB keys. "
|
||||
DefaultLogger::get()->warn("ASE: Position controller uses Bezier/TCB keys. "
|
||||
"This is not supported.");
|
||||
}
|
||||
if ((*i)->mAnim.mRotationType != ASE::Animation::TRACK) {
|
||||
ASSIMP_LOG_WARN("ASE: Rotation controller uses Bezier/TCB keys. "
|
||||
DefaultLogger::get()->warn("ASE: Rotation controller uses Bezier/TCB keys. "
|
||||
"This is not supported.");
|
||||
}
|
||||
if ((*i)->mAnim.mScalingType != ASE::Animation::TRACK) {
|
||||
ASSIMP_LOG_WARN("ASE: Position controller uses Bezier/TCB keys. "
|
||||
DefaultLogger::get()->warn("ASE: Position controller uses Bezier/TCB keys. "
|
||||
"This is not supported.");
|
||||
}
|
||||
|
||||
|
|
@ -583,7 +583,7 @@ void ASEImporter::AddNodes (const std::vector<BaseNode*>& nodes,
|
|||
node->mTransformation = mParentAdjust*snode->mTransform;
|
||||
|
||||
// Add sub nodes - prevent stack overflow due to recursive parenting
|
||||
if (node->mName != node->mParent->mName && node->mName != node->mParent->mParent->mName ) {
|
||||
if (node->mName != node->mParent->mName) {
|
||||
AddNodes(nodes,node,node->mName.data,snode->mTransform);
|
||||
}
|
||||
|
||||
|
|
@ -624,7 +624,7 @@ void ASEImporter::AddNodes (const std::vector<BaseNode*>& nodes,
|
|||
node->mNumChildren++;
|
||||
|
||||
// What we did is so great, it is at least worth a debug message
|
||||
ASSIMP_LOG_DEBUG("ASE: Generating separate target node ("+snode->mName+")");
|
||||
DefaultLogger::get()->debug("ASE: Generating separate target node ("+snode->mName+")");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -947,7 +947,7 @@ void ASEImporter::ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOutMesh
|
|||
// validate the material index of the mesh
|
||||
if (mesh.iMaterialIndex >= mParser->m_vMaterials.size()) {
|
||||
mesh.iMaterialIndex = (unsigned int)mParser->m_vMaterials.size()-1;
|
||||
ASSIMP_LOG_WARN("Material index is out of range");
|
||||
DefaultLogger::get()->warn("Material index is out of range");
|
||||
}
|
||||
|
||||
// If the material the mesh is assigned to is consisting of submeshes, split it
|
||||
|
|
@ -957,11 +957,11 @@ void ASEImporter::ConvertMeshes(ASE::Mesh& mesh, std::vector<aiMesh*>& avOutMesh
|
|||
|
||||
std::vector<unsigned int>* aiSplit = new std::vector<unsigned int>[vSubMaterials.size()];
|
||||
|
||||
// build a list of all faces per sub-material
|
||||
// build a list of all faces per submaterial
|
||||
for (unsigned int i = 0; i < mesh.mFaces.size();++i) {
|
||||
// check range
|
||||
if (mesh.mFaces[i].iMaterial >= vSubMaterials.size()) {
|
||||
ASSIMP_LOG_WARN("Submaterial index is out of range");
|
||||
DefaultLogger::get()->warn("Submaterial index is out of range");
|
||||
|
||||
// use the last material instead
|
||||
aiSplit[vSubMaterials.size()-1].push_back(i);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue