FEATURE: Adding format auto-detection to OBJ loader basing on some distinct keywords.
FEATURE: PretransformVertices step is now optionally able to normalize meshes (-1...1 range). git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@488 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
@@ -77,10 +77,17 @@ ObjFileImporter::~ObjFileImporter()
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
// Returns true, fi file is an obj file
|
||||
bool ObjFileImporter::CanRead( const std::string& pFile, IOSystem* /* pIOHandler */, bool /*checkSig */) const
|
||||
bool ObjFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler , bool checkSig ) const
|
||||
{
|
||||
// fixme: auto detection
|
||||
return SimpleExtensionCheck( pFile,"obj" );
|
||||
if(!checkSig) //Check File Extension
|
||||
{
|
||||
return SimpleExtensionCheck(pFile,"obj");
|
||||
}
|
||||
else //Check file Header
|
||||
{
|
||||
const char* tokens[] = {"mtllib","usemtl","vt ","vn ","o "};
|
||||
return BaseImporter::SearchFileHeaderForToken(pIOHandler, pFile, tokens, 5);
|
||||
}
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user