mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-16 13:13:53 +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.
|
||||
|
|
@ -48,11 +47,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "ObjFileMtlImporter.h"
|
||||
#include "ObjTools.h"
|
||||
#include "ObjFileData.h"
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include "fast_atof.h"
|
||||
#include "ParsingUtils.h"
|
||||
#include <assimp/material.h>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
|
||||
|
||||
namespace Assimp {
|
||||
|
||||
// Material specific token (case insensitive compare)
|
||||
|
|
@ -84,6 +84,8 @@ static const std::string BumpOption = "-bm";
|
|||
static const std::string ChannelOption = "-imfchan";
|
||||
static const std::string TypeOption = "-type";
|
||||
|
||||
|
||||
|
||||
// -------------------------------------------------------------------
|
||||
// Constructor
|
||||
ObjFileMtlImporter::ObjFileMtlImporter( std::vector<char> &buffer,
|
||||
|
|
@ -301,12 +303,11 @@ void ObjFileMtlImporter::createMaterial()
|
|||
// New Material created
|
||||
m_pModel->m_pCurrentMaterial = new ObjFile::Material();
|
||||
m_pModel->m_pCurrentMaterial->MaterialName.Set( name );
|
||||
m_pModel->m_MaterialLib.push_back( name );
|
||||
m_pModel->m_MaterialMap[ name ] = m_pModel->m_pCurrentMaterial;
|
||||
|
||||
if (m_pModel->m_pCurrentMesh) {
|
||||
m_pModel->m_pCurrentMesh->m_uiMaterialIndex = static_cast<unsigned int>(m_pModel->m_MaterialLib.size() - 1);
|
||||
}
|
||||
m_pModel->m_MaterialLib.push_back( name );
|
||||
m_pModel->m_MaterialMap[ name ] = m_pModel->m_pCurrentMaterial;
|
||||
} else {
|
||||
// Use older material
|
||||
m_pModel->m_pCurrentMaterial = (*it).second;
|
||||
|
|
@ -332,11 +333,6 @@ void ObjFileMtlImporter::getTexture() {
|
|||
// Specular texture
|
||||
out = & m_pModel->m_pCurrentMaterial->textureSpecular;
|
||||
clampIndex = ObjFile::Material::TextureSpecularType;
|
||||
} else if ( !ASSIMP_strincmp( pPtr, DisplacementTexture1.c_str(), static_cast<unsigned int>(DisplacementTexture1.size()) ) ||
|
||||
!ASSIMP_strincmp( pPtr, DisplacementTexture2.c_str(), static_cast<unsigned int>(DisplacementTexture2.size()) ) ) {
|
||||
// Displacement texture
|
||||
out = &m_pModel->m_pCurrentMaterial->textureDisp;
|
||||
clampIndex = ObjFile::Material::TextureDispType;
|
||||
} else if ( !ASSIMP_strincmp( pPtr, OpacityTexture.c_str(), static_cast<unsigned int>(OpacityTexture.size()) ) ) {
|
||||
// Opacity texture
|
||||
out = & m_pModel->m_pCurrentMaterial->textureOpacity;
|
||||
|
|
@ -359,12 +355,17 @@ void ObjFileMtlImporter::getTexture() {
|
|||
// Reflection texture(s)
|
||||
//Do nothing here
|
||||
return;
|
||||
} else if ( !ASSIMP_strincmp( pPtr, DisplacementTexture1.c_str(), static_cast<unsigned int>(DisplacementTexture1.size()) ) ||
|
||||
!ASSIMP_strincmp( pPtr, DisplacementTexture2.c_str(), static_cast<unsigned int>(DisplacementTexture2.size()) ) ) {
|
||||
// Displacement texture
|
||||
out = &m_pModel->m_pCurrentMaterial->textureDisp;
|
||||
clampIndex = ObjFile::Material::TextureDispType;
|
||||
} else if ( !ASSIMP_strincmp( pPtr, SpecularityTexture.c_str(), static_cast<unsigned int>(SpecularityTexture.size()) ) ) {
|
||||
// Specularity scaling (glossiness)
|
||||
out = & m_pModel->m_pCurrentMaterial->textureSpecularity;
|
||||
clampIndex = ObjFile::Material::TextureSpecularityType;
|
||||
} else {
|
||||
ASSIMP_LOG_ERROR("OBJ/MTL: Encountered unknown texture type");
|
||||
DefaultLogger::get()->error("OBJ/MTL: Encountered unknown texture type");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue