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:
aramis_acg
2009-09-30 17:55:21 +00:00
parent 8b19981ce9
commit cc1ff304df
5 changed files with 63 additions and 16 deletions

View File

@@ -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);
}
}
// ------------------------------------------------------------------------------------------------