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.
|
||||
|
|
@ -48,11 +47,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||
|
||||
// internal headers
|
||||
#include "NFFLoader.h"
|
||||
#include <assimp/ParsingUtils.h>
|
||||
#include <assimp/StandardShapes.h>
|
||||
#include <assimp/qnan.h>
|
||||
#include <assimp/fast_atof.h>
|
||||
#include <assimp/RemoveComments.h>
|
||||
#include "ParsingUtils.h"
|
||||
#include "StandardShapes.h"
|
||||
#include "qnan.h"
|
||||
#include "fast_atof.h"
|
||||
#include "RemoveComments.h"
|
||||
#include <assimp/IOSystem.hpp>
|
||||
#include <assimp/DefaultLogger.hpp>
|
||||
#include <assimp/scene.h>
|
||||
|
|
@ -125,14 +124,14 @@ const aiImporterDesc* NFFImporter::GetInfo () const
|
|||
do \
|
||||
{ \
|
||||
if (!GetNextLine(buffer,line)) \
|
||||
{ASSIMP_LOG_WARN("NFF2: Unexpected EOF, can't read next token");break;} \
|
||||
{DefaultLogger::get()->warn("NFF2: Unexpected EOF, can't read next token");break;} \
|
||||
SkipSpaces(line,&sz); \
|
||||
} \
|
||||
while(IsLineEnd(*sz))
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Loads the material table for the NFF2 file format from an external file
|
||||
// Loads the materail table for the NFF2 file format from an external file
|
||||
void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
|
||||
const std::string& path, IOSystem* pIOHandler)
|
||||
{
|
||||
|
|
@ -140,7 +139,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
|
|||
|
||||
// Check whether we can read from the file
|
||||
if( !file.get()) {
|
||||
ASSIMP_LOG_ERROR("NFF2: Unable to open material library " + path + ".");
|
||||
DefaultLogger::get()->error("NFF2: Unable to open material library " + path + ".");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -158,7 +157,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
|
|||
|
||||
// The file should start with the magic sequence "mat"
|
||||
if (!TokenMatch(buffer,"mat",3)) {
|
||||
ASSIMP_LOG_ERROR_F("NFF2: Not a valid material library ", path, ".");
|
||||
DefaultLogger::get()->error("NFF2: Not a valid material library " + path + ".");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -174,7 +173,7 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
|
|||
// 'version' defines the version of the file format
|
||||
if (TokenMatch(sz,"version",7))
|
||||
{
|
||||
ASSIMP_LOG_INFO_F("NFF (Sense8) material library file format: ", std::string(sz));
|
||||
DefaultLogger::get()->info("NFF (Sense8) material library file format: " + std::string(sz));
|
||||
}
|
||||
// 'matdef' starts a new material in the file
|
||||
else if (TokenMatch(sz,"matdef",6))
|
||||
|
|
@ -192,7 +191,8 @@ void NFFImporter::LoadNFF2MaterialTable(std::vector<ShadingInfo>& output,
|
|||
{
|
||||
if (!curShader)
|
||||
{
|
||||
ASSIMP_LOG_ERROR_F("NFF2 material library: Found element ", sz, "but there is no active material");
|
||||
DefaultLogger::get()->error(std::string("NFF2 material library: Found element ") +
|
||||
sz + "but there is no active material");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
|
@ -271,7 +271,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
|
||||
ShadingInfo s; // current material info
|
||||
|
||||
// degree of tessellation
|
||||
// degree of tesselation
|
||||
unsigned int iTesselation = 4;
|
||||
|
||||
// some temporary variables we need to parse the file
|
||||
|
|
@ -307,7 +307,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
SkipSpaces(line,&sz);
|
||||
if (TokenMatch(sz,"version",7))
|
||||
{
|
||||
ASSIMP_LOG_INFO_F("NFF (Sense8) file format: ", sz );
|
||||
DefaultLogger::get()->info("NFF (Sense8) file format: " + std::string(sz));
|
||||
}
|
||||
else if (TokenMatch(sz,"viewpos",7))
|
||||
{
|
||||
|
|
@ -345,7 +345,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
sz3 = sz;
|
||||
while (!IsSpaceOrNewLine(*sz))++sz;
|
||||
const unsigned int diff = (unsigned int)(sz-sz3);
|
||||
if (!diff)ASSIMP_LOG_WARN("NFF2: Found empty mtable token");
|
||||
if (!diff)DefaultLogger::get()->warn("NFF2: Found empty mtable token");
|
||||
else
|
||||
{
|
||||
// The material table has the file extension .mat.
|
||||
|
|
@ -470,7 +470,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
unsigned int m = ::strtoul10(sz,&sz);
|
||||
if (m >= (unsigned int)tempPositions.size())
|
||||
{
|
||||
ASSIMP_LOG_ERROR("NFF2: Vertex index overflow");
|
||||
DefaultLogger::get()->error("NFF2: Vertex index overflow");
|
||||
m= 0;
|
||||
}
|
||||
// mesh.vertices.push_back (tempPositions[idx]);
|
||||
|
|
@ -550,11 +550,11 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
case 'u':
|
||||
case 'U':
|
||||
|
||||
ASSIMP_LOG_WARN("Unsupported NFF2 texture attribute: trans");
|
||||
DefaultLogger::get()->warn("Unsupported NFF2 texture attribute: trans");
|
||||
};
|
||||
if (!sz[1] || '_' != sz[2])
|
||||
{
|
||||
ASSIMP_LOG_WARN("NFF2: Expected underscore after texture attributes");
|
||||
DefaultLogger::get()->warn("NFF2: Expected underscore after texture attributes");
|
||||
continue;
|
||||
}
|
||||
const char* sz2 = sz+3;
|
||||
|
|
@ -576,7 +576,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
matIdx = ::strtoul10(sz,&sz);
|
||||
if (matIdx >= materialTable.size())
|
||||
{
|
||||
ASSIMP_LOG_ERROR("NFF2: Material index overflow.");
|
||||
DefaultLogger::get()->error("NFF2: Material index overflow.");
|
||||
matIdx = 0;
|
||||
}
|
||||
|
||||
|
|
@ -749,7 +749,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
{
|
||||
if(!GetNextLine(buffer,line))
|
||||
{
|
||||
ASSIMP_LOG_ERROR("NFF: Unexpected EOF was encountered. Patch definition incomplete");
|
||||
DefaultLogger::get()->error("NFF: Unexpected EOF was encountered. Patch definition incomplete");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -942,7 +942,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
|
||||
if(!GetNextLine(buffer,line))
|
||||
{
|
||||
ASSIMP_LOG_ERROR("NFF: Unexpected end of file (cone definition not complete)");
|
||||
DefaultLogger::get()->error("NFF: Unexpected end of file (cone definition not complete)");
|
||||
break;
|
||||
}
|
||||
sz = line;
|
||||
|
|
@ -954,7 +954,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
|
||||
if(!GetNextLine(buffer,line))
|
||||
{
|
||||
ASSIMP_LOG_ERROR("NFF: Unexpected end of file (cone definition not complete)");
|
||||
DefaultLogger::get()->error("NFF: Unexpected end of file (cone definition not complete)");
|
||||
break;
|
||||
}
|
||||
sz = line;
|
||||
|
|
@ -970,7 +970,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
float f;
|
||||
if (( f = currentMesh.dir.Length()) < 10e-3f )
|
||||
{
|
||||
ASSIMP_LOG_ERROR("NFF: Cone height is close to zero");
|
||||
DefaultLogger::get()->error("NFF: Cone height is close to zero");
|
||||
continue;
|
||||
}
|
||||
currentMesh.dir /= f; // normalize
|
||||
|
|
@ -988,7 +988,7 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
::ai_snprintf(currentMesh.name,128,"cone_%i",cone++);
|
||||
else ::ai_snprintf(currentMesh.name,128,"cylinder_%i",cylinder++);
|
||||
}
|
||||
// 'tess' - tessellation
|
||||
// 'tess' - tesselation
|
||||
else if (TokenMatch(sz,"tess",4))
|
||||
{
|
||||
SkipSpaces(&sz);
|
||||
|
|
@ -1028,20 +1028,18 @@ void NFFImporter::InternReadFile( const std::string& pFile,
|
|||
// 'pb' - bezier patch. Not supported yet
|
||||
else if (TokenMatch(sz,"pb",2))
|
||||
{
|
||||
ASSIMP_LOG_ERROR("NFF: Encountered unsupported ID: bezier patch");
|
||||
DefaultLogger::get()->error("NFF: Encountered unsupported ID: bezier patch");
|
||||
}
|
||||
// 'pn' - NURBS. Not supported yet
|
||||
else if (TokenMatch(sz,"pn",2) || TokenMatch(sz,"pnn",3))
|
||||
{
|
||||
ASSIMP_LOG_ERROR("NFF: Encountered unsupported ID: NURBS");
|
||||
DefaultLogger::get()->error("NFF: Encountered unsupported ID: NURBS");
|
||||
}
|
||||
// '' - comment
|
||||
else if ('#' == line[0])
|
||||
{
|
||||
const char* sz;SkipSpaces(&line[1],&sz);
|
||||
if (!IsLineEnd(*sz)) {
|
||||
ASSIMP_LOG_INFO(sz);
|
||||
}
|
||||
if (!IsLineEnd(*sz))DefaultLogger::get()->info(sz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue