- add mFileExtensions field to aiImporterDesc, BaseImporter::GetExtensionList is now longer virtual since this would be redundant.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1234 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/5/head
parent
93c3723da5
commit
5a81b42ebe
|
@ -52,6 +52,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "3DSLoader.h"
|
#include "3DSLoader.h"
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Discreet 3DS Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"Limited animation support",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"3ds prj"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Begins a new parsing block
|
// Begins a new parsing block
|
||||||
|
@ -108,11 +122,10 @@ bool Discreet3DSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of all extension supported by this loader
|
// Loader registry entry
|
||||||
void Discreet3DSImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* Discreet3DSImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("3ds");
|
return &desc;
|
||||||
extensions.insert("prj");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -85,10 +85,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -54,6 +54,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"AC3D Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ac acc ac3d"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// skip to the next token
|
// skip to the next token
|
||||||
|
@ -136,12 +148,10 @@ bool AC3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of file extensions handled by this loader
|
// Loader meta information
|
||||||
void AC3DImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* AC3DImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ac");
|
return &desc;
|
||||||
extensions.insert("acc");
|
|
||||||
extensions.insert("ac3d");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -183,9 +183,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details */
|
* See #BaseImporter::GetInfo for the details */
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -58,6 +58,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::ASE;
|
using namespace Assimp::ASE;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"ASE Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"Similar to 3DS but text-encoded",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ase ask"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
ASEImporter::ASEImporter()
|
ASEImporter::ASEImporter()
|
||||||
|
@ -86,10 +99,10 @@ bool ASEImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void ASEImporter::GetExtensionList(std::set<std::string>& extensions)
|
// Loader meta information
|
||||||
|
const aiImporterDesc* ASEImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ase");
|
return &desc;
|
||||||
extensions.insert("ask");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -75,10 +75,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -54,6 +54,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"BlitzBasic 3D Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.blitzbasic.com/",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"b3d"
|
||||||
|
};
|
||||||
|
|
||||||
// (fixme, Aramis) quick workaround to get rid of all those signed to unsigned warnings
|
// (fixme, Aramis) quick workaround to get rid of all those signed to unsigned warnings
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# pragma warning (disable: 4018)
|
# pragma warning (disable: 4018)
|
||||||
|
@ -74,8 +87,10 @@ bool B3DImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void B3DImporter::GetExtensionList( std::set<std::string>& extensions ){
|
// Loader meta information
|
||||||
extensions.insert("b3d");
|
const aiImporterDesc* B3DImporter::GetInfo () const
|
||||||
|
{
|
||||||
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_B3D
|
#ifdef DEBUG_B3D
|
||||||
|
|
|
@ -60,7 +60,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
virtual void GetExtensionList(std::set<std::string>& extensions);
|
virtual const aiImporterDesc* GetInfo () const;
|
||||||
virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -49,6 +49,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"BVH Importer (MoCap)",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"bvh"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
BVHLoader::BVHLoader()
|
BVHLoader::BVHLoader()
|
||||||
|
@ -76,6 +89,13 @@ bool BVHLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Loader meta information
|
||||||
|
const aiImporterDesc* BVHLoader::GetInfo () const
|
||||||
|
{
|
||||||
|
return &desc;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Imports the given file into the given scene structure.
|
// Imports the given file into the given scene structure.
|
||||||
void BVHLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
|
void BVHLoader::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
|
||||||
|
|
|
@ -94,14 +94,10 @@ public:
|
||||||
* See BaseImporter::CanRead() for details. */
|
* See BaseImporter::CanRead() for details. */
|
||||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const;
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool cs) const;
|
||||||
|
|
||||||
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
|
||||||
* See BaseImporter::GetExtensionList() for details
|
|
||||||
*/
|
|
||||||
void GetExtensionList(std::set<std::string>& extensions)
|
|
||||||
{
|
|
||||||
extensions.insert("bvh");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
* See BaseImporter::InternReadFile() for details
|
* See BaseImporter::InternReadFile() for details
|
||||||
|
|
|
@ -105,6 +105,25 @@ void BaseImporter::SetupProperties(const Importer* /*pImp*/)
|
||||||
// the default implementation does nothing
|
// the default implementation does nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
|
||||||
|
{
|
||||||
|
const aiImporterDesc* desc = GetInfo();
|
||||||
|
ai_assert(desc != NULL);
|
||||||
|
|
||||||
|
const char* ext = desc->mFileExtensions;
|
||||||
|
ai_assert(ext != NULL);
|
||||||
|
|
||||||
|
const char* last = ext;
|
||||||
|
do {
|
||||||
|
if (!*ext || *ext == ' ') {
|
||||||
|
extensions.insert(std::string(last,ext-last));
|
||||||
|
last = ext+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
while(*ext++);
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
/*static*/ bool BaseImporter::SearchFileHeaderForToken(IOSystem* pIOHandler,
|
/*static*/ bool BaseImporter::SearchFileHeaderForToken(IOSystem* pIOHandler,
|
||||||
const std::string& pFile,
|
const std::string& pFile,
|
||||||
|
|
|
@ -187,26 +187,22 @@ public:
|
||||||
const Importer* pImp
|
const Importer* pImp
|
||||||
);
|
);
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by #Importer::GetImporterInfo to get a description of
|
/** Called by #Importer::GetImporterInfo to get a description of
|
||||||
* some loader features. Importer need not provide this structure,
|
* some loader features. Importers must provide this information. */
|
||||||
* but it is highly recommended. */
|
virtual const aiImporterDesc* GetInfo() const = 0;
|
||||||
virtual const aiImporterDesc* GetInfo() {
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by #Importer::GetExtensionList for each loaded importer.
|
/** Called by #Importer::GetExtensionList for each loaded importer.
|
||||||
* Implementations are expected to insert() all file extensions
|
* Take the extension list contained in the structure returned by
|
||||||
* handled by them into the extension set. A loader capable of
|
* #GetInfo and insert all file extensions into the given set.
|
||||||
* reading certain files with the extension BLA would place the
|
* @param extension set to collect file extensions in*/
|
||||||
* string bla (lower-case!) in the output set.
|
void GetExtensionList(std::set<std::string>& extensions);
|
||||||
* @param extensions Output set. */
|
|
||||||
virtual void GetExtensionList(
|
protected:
|
||||||
std::set<std::string>& extensions
|
|
||||||
) = 0;
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure. The
|
/** Imports the given file into the given scene structure. The
|
||||||
|
|
|
@ -75,12 +75,13 @@ static const aiImporterDesc blenderDesc = {
|
||||||
"Blender 3D Importer \nhttp://www.blender3d.org",
|
"Blender 3D Importer \nhttp://www.blender3d.org",
|
||||||
"",
|
"",
|
||||||
"",
|
"",
|
||||||
"",
|
"No animation support yet",
|
||||||
aiImporterFlags_SupportBinaryFlavour,
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
0,
|
0,
|
||||||
0,
|
0,
|
||||||
2,
|
2,
|
||||||
50
|
50,
|
||||||
|
"blend"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,20 @@ static const float units[] = {
|
||||||
1.f/1609.344f
|
1.f/1609.344f
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"TrueSpace Object Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"little-endian files only",
|
||||||
|
aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"cob scn"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
COBImporter::COBImporter()
|
COBImporter::COBImporter()
|
||||||
|
@ -99,11 +113,10 @@ bool COBImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// List all extensions handled by this loader
|
// Loader meta information
|
||||||
void COBImporter::GetExtensionList(std::set<std::string>& app)
|
const aiImporterDesc* COBImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
app.insert("cob");
|
return &desc;
|
||||||
app.insert("scn");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -82,7 +82,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void GetExtensionList(std::set<std::string>& app);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp);
|
||||||
|
|
|
@ -54,6 +54,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"CharacterStudio Motion Importer (MoCap)",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"csm"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
CSMImporter::CSMImporter()
|
CSMImporter::CSMImporter()
|
||||||
|
@ -83,9 +97,9 @@ bool CSMImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Build a string of all file extensions supported
|
// Build a string of all file extensions supported
|
||||||
void CSMImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* CSMImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("csm");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -69,7 +69,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp);
|
||||||
|
|
|
@ -56,6 +56,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Collada Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://collada.org",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
5,
|
||||||
|
"dae"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
ColladaLoader::ColladaLoader()
|
ColladaLoader::ColladaLoader()
|
||||||
|
@ -91,9 +105,9 @@ bool ColladaLoader::CanRead( const std::string& pFile, IOSystem* pIOHandler, boo
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get file extension list
|
// Get file extension list
|
||||||
void ColladaLoader::GetExtensionList( std::set<std::string>& extensions )
|
const aiImporterDesc* ColladaLoader::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("dae");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -89,10 +89,10 @@ public:
|
||||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList( std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
* See BaseImporter::InternReadFile() for details
|
* See BaseImporter::InternReadFile() for details
|
||||||
|
|
|
@ -86,6 +86,20 @@ static aiColor4D g_aclrDxfIndexColors[] =
|
||||||
#define AI_DXF_NUM_INDEX_COLORS (sizeof(g_aclrDxfIndexColors)/sizeof(g_aclrDxfIndexColors[0]))
|
#define AI_DXF_NUM_INDEX_COLORS (sizeof(g_aclrDxfIndexColors)/sizeof(g_aclrDxfIndexColors[0]))
|
||||||
#define AI_DXF_ENTITIES_MAGIC_BLOCK "$ASSIMP_ENTITIES_MAGIC"
|
#define AI_DXF_ENTITIES_MAGIC_BLOCK "$ASSIMP_ENTITIES_MAGIC"
|
||||||
|
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Drawing Interchange Format (DXF) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour | aiImporterFlags_LimitedSupport,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"dxf"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
DXFImporter::DXFImporter()
|
DXFImporter::DXFImporter()
|
||||||
|
@ -105,9 +119,9 @@ bool DXFImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all supported file extensions
|
// Get a list of all supported file extensions
|
||||||
void DXFImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* DXFImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("dxf");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -82,9 +82,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details*/
|
* See #BaseImporter::GetInfo for the details*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -50,6 +50,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"3D GameStudio Heightmap (HMP) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"hmp"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
HMPImporter::HMPImporter()
|
HMPImporter::HMPImporter()
|
||||||
|
@ -85,9 +98,9 @@ bool HMPImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of all file extensions that are handled by this loader
|
// Get list of all file extensions that are handled by this loader
|
||||||
void HMPImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* HMPImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("hmp");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -80,10 +80,10 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -93,6 +93,20 @@ void ConvertUnit(const EXPRESS::DataType& dt,ConversionData& conv);
|
||||||
|
|
||||||
} // anon
|
} // anon
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Industry Foundation Classes (IFC) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ifc"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
IFCImporter::IFCImporter()
|
IFCImporter::IFCImporter()
|
||||||
|
@ -125,9 +139,9 @@ bool IFCImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// List all extensions handled by this loader
|
// List all extensions handled by this loader
|
||||||
void IFCImporter::GetExtensionList(std::set<std::string>& app)
|
const aiImporterDesc* IFCImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
app.insert("ifc");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void GetExtensionList(std::set<std::string>& app);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// --------------------
|
// --------------------
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp);
|
||||||
|
|
|
@ -61,6 +61,18 @@ using namespace Assimp;
|
||||||
using namespace irr;
|
using namespace irr;
|
||||||
using namespace irr::io;
|
using namespace irr::io;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Irrlicht Scene Reader",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://irrlicht.sourceforge.net/",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"irr xml"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
|
@ -98,10 +110,9 @@ bool IRRImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void IRRImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* IRRImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("irr");
|
return &desc;
|
||||||
extensions.insert("xml");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -80,7 +80,7 @@ protected:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -51,6 +51,19 @@ using namespace Assimp;
|
||||||
using namespace irr;
|
using namespace irr;
|
||||||
using namespace irr::io;
|
using namespace irr::io;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Irrlicht Mesh Reader",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://irrlicht.sourceforge.net/",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"xml irrmesh"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
IRRMeshImporter::IRRMeshImporter()
|
IRRMeshImporter::IRRMeshImporter()
|
||||||
|
@ -88,10 +101,9 @@ bool IRRMeshImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, b
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all file extensions which are handled by this class
|
// Get a list of all file extensions which are handled by this class
|
||||||
void IRRMeshImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* IRRMeshImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("xml");
|
return &desc;
|
||||||
extensions.insert("irrmesh");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -76,10 +76,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -56,6 +56,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"LightWave/Modo Object Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.newtek.com/lightwave.html\nhttp://www.luxology.com/modo/",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"lwo lxo"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
LWOImporter::LWOImporter()
|
LWOImporter::LWOImporter()
|
||||||
|
@ -71,8 +84,9 @@ LWOImporter::~LWOImporter()
|
||||||
bool LWOImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
|
bool LWOImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const
|
||||||
{
|
{
|
||||||
const std::string extension = GetExtension(pFile);
|
const std::string extension = GetExtension(pFile);
|
||||||
if (extension == "lwo" || extension == "lxo")
|
if (extension == "lwo" || extension == "lxo") {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
// if check for extension is not enough, check for the magic tokens
|
// if check for extension is not enough, check for the magic tokens
|
||||||
if (!extension.length() || checkSig) {
|
if (!extension.length() || checkSig) {
|
||||||
|
@ -94,6 +108,13 @@ void LWOImporter::SetupProperties(const Importer* pImp)
|
||||||
configLayerName = pImp->GetPropertyString (AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY,"");
|
configLayerName = pImp->GetPropertyString (AI_CONFIG_IMPORT_LWO_ONE_LAYER_ONLY,"");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
// Get list of file extensions
|
||||||
|
const aiImporterDesc* LWOImporter::GetInfo () const
|
||||||
|
{
|
||||||
|
return &desc;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Imports the given file into the given scene structure.
|
// Imports the given file into the given scene structure.
|
||||||
void LWOImporter::InternReadFile( const std::string& pFile,
|
void LWOImporter::InternReadFile( const std::string& pFile,
|
||||||
|
|
|
@ -91,14 +91,8 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
// Get list of supported extensions
|
||||||
* See BaseImporter::GetExtensionList() for details
|
const aiImporterDesc* GetInfo () const;
|
||||||
*/
|
|
||||||
void GetExtensionList(std::set<std::string>& extensions)
|
|
||||||
{
|
|
||||||
extensions.insert("lxo");
|
|
||||||
extensions.insert("lwo");
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -57,6 +57,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"LightWave Scene Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.newtek.com/lightwave.html=",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"lws mot"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Recursive parsing of LWS files
|
// Recursive parsing of LWS files
|
||||||
void LWS::Element::Parse (const char*& buffer)
|
void LWS::Element::Parse (const char*& buffer)
|
||||||
|
@ -141,10 +154,9 @@ bool LWSImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler,bool c
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of file extensions
|
// Get list of file extensions
|
||||||
void LWSImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* LWSImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("lws");
|
return &desc;
|
||||||
extensions.insert("mot");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -184,7 +184,7 @@ protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Get list of supported extensions
|
// Get list of supported extensions
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
// Import file into given scene data structure
|
// Import file into given scene data structure
|
||||||
|
|
|
@ -47,7 +47,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
namespace M3 {
|
namespace M3 {
|
||||||
|
|
||||||
static const std::string M3Extension = "m3";
|
static const aiImporterDesc desc = {
|
||||||
|
"StarCraft M3 Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"m3"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor.
|
// Constructor.
|
||||||
|
@ -72,16 +83,16 @@ M3Importer::~M3Importer()
|
||||||
bool M3Importer::CanRead( const std::string &rFile, IOSystem* /*pIOHandler*/, bool checkSig ) const
|
bool M3Importer::CanRead( const std::string &rFile, IOSystem* /*pIOHandler*/, bool checkSig ) const
|
||||||
{
|
{
|
||||||
if ( !checkSig ) {
|
if ( !checkSig ) {
|
||||||
return SimpleExtensionCheck( rFile, M3Extension.c_str() );
|
return SimpleExtensionCheck( rFile, "m3" );
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void M3Importer::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* M3Importer::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert( M3Extension );
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -694,7 +694,7 @@ public:
|
||||||
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig ) const;
|
bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig ) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void GetExtensionList( std::set<std::string>& extensions );
|
const aiImporterDesc* GetInfo () const;
|
||||||
void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler );
|
void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler );
|
||||||
void convertToAssimp( const std::string& pFile, aiScene* pScene, DIV *pViews, Region *pRegions, uint16 *pFaces,
|
void convertToAssimp( const std::string& pFile, aiScene* pScene, DIV *pViews, Region *pRegions, uint16 *pFaces,
|
||||||
const std::vector<aiVector3D> &vertices, const std::vector<aiVector3D> &uvCoords, const std::vector<aiVector3D> &normals );
|
const std::vector<aiVector3D> &vertices, const std::vector<aiVector3D> &uvCoords, const std::vector<aiVector3D> &normals );
|
||||||
|
|
|
@ -56,6 +56,19 @@ using namespace Assimp::MD2;
|
||||||
# define ARRAYSIZE(_array) (int(sizeof(_array) / sizeof(_array[0])))
|
# define ARRAYSIZE(_array) (int(sizeof(_array) / sizeof(_array[0])))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quake II Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"md2"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Helper function to lookup a normal in Quake 2's precalculated table
|
// Helper function to lookup a normal in Quake 2's precalculated table
|
||||||
void MD2::LookupNormalIndex(uint8_t iNormalIndex,aiVector3D& vOut)
|
void MD2::LookupNormalIndex(uint8_t iNormalIndex,aiVector3D& vOut)
|
||||||
|
@ -98,9 +111,9 @@ bool MD2Importer::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all extensions supported by this loader
|
// Get a list of all extensions supported by this loader
|
||||||
void MD2Importer::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MD2Importer::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("md2");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -84,10 +84,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -61,6 +61,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quake III Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"md3"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Convert a Q3 shader blend function to the appropriate enum value
|
// Convert a Q3 shader blend function to the appropriate enum value
|
||||||
Q3Shader::BlendFunc StringToBlendFunc(const std::string& m)
|
Q3Shader::BlendFunc StringToBlendFunc(const std::string& m)
|
||||||
|
@ -420,9 +433,9 @@ void MD3Importer::ValidateSurfaceHeaderOffsets(const MD3::Surface* pcSurf)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void MD3Importer::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MD3Importer::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("md3");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -235,10 +235,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -58,6 +58,20 @@ using namespace Assimp;
|
||||||
// Minimum weight value. Weights inside [-n ... n] are ignored
|
// Minimum weight value. Weights inside [-n ... n] are ignored
|
||||||
#define AI_MD5_WEIGHT_EPSILON 1e-5f
|
#define AI_MD5_WEIGHT_EPSILON 1e-5f
|
||||||
|
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Doom 3 / MD5 Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"md5mesh md5camera md5anim"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
MD5Importer::MD5Importer()
|
MD5Importer::MD5Importer()
|
||||||
|
@ -90,11 +104,9 @@ bool MD5Importer::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get list of all supported extensions
|
// Get list of all supported extensions
|
||||||
void MD5Importer::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MD5Importer::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("md5anim");
|
return &desc;
|
||||||
extensions.insert("md5mesh");
|
|
||||||
extensions.insert("md5camera");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -78,10 +78,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called prior to ReadFile().
|
/** Called prior to ReadFile().
|
||||||
|
|
|
@ -52,6 +52,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
using namespace Assimp::MDC;
|
using namespace Assimp::MDC;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Return To Castle Wolfenstein Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"mdc"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void MDC::BuildVertex(const Frame& frame,
|
void MDC::BuildVertex(const Frame& frame,
|
||||||
|
@ -103,9 +115,9 @@ bool MDCImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void MDCImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MDCImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("mdc");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -81,10 +81,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -54,6 +54,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quake Mesh / 3D GameStudio Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
7,
|
||||||
|
0,
|
||||||
|
"mdl"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Ugly stuff ... nevermind
|
// Ugly stuff ... nevermind
|
||||||
#define _AI_MDL7_ACCESS(_data, _index, _limit, _type) \
|
#define _AI_MDL7_ACCESS(_data, _index, _limit, _type) \
|
||||||
|
@ -116,9 +129,9 @@ void MDLImporter::SetupProperties(const Importer* pImp)
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all supported extensions
|
// Get a list of all supported extensions
|
||||||
void MDLImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MDLImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert( "mdl" );
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -107,10 +107,10 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -52,6 +52,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "StreamReader.h"
|
#include "StreamReader.h"
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Milkshape 3D Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://chumbalum.swissquake.ch/",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ms3d"
|
||||||
|
};
|
||||||
|
|
||||||
// ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH
|
// ASSIMP_BUILD_MS3D_ONE_NODE_PER_MESH
|
||||||
// (enable old code path, which generates extra nodes per mesh while
|
// (enable old code path, which generates extra nodes per mesh while
|
||||||
// the newer code uses aiMesh::mName to express the name of the
|
// the newer code uses aiMesh::mName to express the name of the
|
||||||
|
@ -89,9 +102,9 @@ bool MS3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void MS3DImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* MS3DImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ms3d");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -70,9 +70,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details */
|
* See #BaseImporter::GetInfo for the details */
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -50,6 +50,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
#define for_each BOOST_FOREACH
|
#define for_each BOOST_FOREACH
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Nendo Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.izware.com/nendo/index.htm",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ndo"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
NDOImporter::NDOImporter()
|
NDOImporter::NDOImporter()
|
||||||
|
@ -79,9 +92,9 @@ bool NDOImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Build a string of all file extensions supported
|
// Build a string of all file extensions supported
|
||||||
void NDOImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* NDOImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ndo");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -97,7 +97,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void SetupProperties(const Importer* pImp);
|
void SetupProperties(const Importer* pImp);
|
||||||
|
|
|
@ -53,6 +53,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Neutral File Format Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"enff nff"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
NFFImporter::NFFImporter()
|
NFFImporter::NFFImporter()
|
||||||
|
@ -72,10 +85,9 @@ bool NFFImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get the list of all supported file extensions
|
// Get the list of all supported file extensions
|
||||||
void NFFImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* NFFImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("enff");
|
return &desc;
|
||||||
extensions.insert("nff");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -77,10 +77,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -54,6 +54,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"OFF Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"off"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
OFFImporter::OFFImporter()
|
OFFImporter::OFFImporter()
|
||||||
|
@ -82,9 +95,9 @@ bool OFFImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void OFFImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* OFFImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("off");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -71,10 +71,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -47,6 +47,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "ObjFileParser.h"
|
#include "ObjFileParser.h"
|
||||||
#include "ObjFileData.h"
|
#include "ObjFileData.h"
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Wavefront Object Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"surfaces not supported",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"obj"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
namespace Assimp {
|
namespace Assimp {
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -89,6 +103,12 @@ bool ObjFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler ,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
const aiImporterDesc* ObjFileImporter::GetInfo () const
|
||||||
|
{
|
||||||
|
return &desc;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Obj-file import implementation
|
// Obj-file import implementation
|
||||||
void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
|
void ObjFileImporter::InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler)
|
||||||
|
|
|
@ -78,7 +78,7 @@ public:
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//! \brief Appends the supported extention.
|
//! \brief Appends the supported extention.
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
//! \brief File import implementation.
|
//! \brief File import implementation.
|
||||||
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
||||||
|
@ -119,13 +119,6 @@ private:
|
||||||
std::string m_strAbsPath;
|
std::string m_strAbsPath;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
|
||||||
//
|
|
||||||
inline void ObjFileImporter::GetExtensionList(std::set<std::string>& extensions)
|
|
||||||
{
|
|
||||||
extensions.insert("obj");
|
|
||||||
}
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
} // Namespace Assimp
|
} // Namespace Assimp
|
||||||
|
|
|
@ -52,6 +52,19 @@ using namespace std;
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
#include "irrXMLWrapper.h"
|
#include "irrXMLWrapper.h"
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Ogre XML Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"mesh.xml"
|
||||||
|
};
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
namespace Ogre
|
namespace Ogre
|
||||||
|
@ -222,9 +235,9 @@ void OgreImporter::InternReadFile(const std::string &pFile, aiScene *pScene, Ass
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void OgreImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* OgreImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("mesh.xml");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,8 @@ class OgreImporter : public BaseImporter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
|
virtual bool CanRead( const std::string& pFile, IOSystem* pIOHandler, bool checkSig) const;
|
||||||
virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
virtual void InternReadFile( const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
||||||
virtual void GetExtensionList(std::set<std::string>& extensions);
|
virtual const aiImporterDesc* GetInfo () const;
|
||||||
virtual void SetupProperties(const Importer* pImp);
|
virtual void SetupProperties(const Importer* pImp);
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
1014
code/OgreMesh.cpp
1014
code/OgreMesh.cpp
File diff suppressed because it is too large
Load Diff
|
@ -1,455 +1,455 @@
|
||||||
/*
|
/*
|
||||||
Open Asset Import Library (assimp)
|
Open Asset Import Library (assimp)
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
Copyright (c) 2006-2012, assimp team
|
Copyright (c) 2006-2012, assimp team
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use of this software in source and binary forms,
|
Redistribution and use of this software in source and binary forms,
|
||||||
with or without modification, are permitted provided that the
|
with or without modification, are permitted provided that the
|
||||||
following conditions are met:
|
following conditions are met:
|
||||||
|
|
||||||
* Redistributions of source code must retain the above
|
* Redistributions of source code must retain the above
|
||||||
copyright notice, this list of conditions and the
|
copyright notice, this list of conditions and the
|
||||||
following disclaimer.
|
following disclaimer.
|
||||||
|
|
||||||
* Redistributions in binary form must reproduce the above
|
* Redistributions in binary form must reproduce the above
|
||||||
copyright notice, this list of conditions and the
|
copyright notice, this list of conditions and the
|
||||||
following disclaimer in the documentation and/or other
|
following disclaimer in the documentation and/or other
|
||||||
materials provided with the distribution.
|
materials provided with the distribution.
|
||||||
|
|
||||||
* Neither the name of the assimp team, nor the names of its
|
* Neither the name of the assimp team, nor the names of its
|
||||||
contributors may be used to endorse or promote products
|
contributors may be used to endorse or promote products
|
||||||
derived from this software without specific prior
|
derived from this software without specific prior
|
||||||
written permission of the assimp team.
|
written permission of the assimp team.
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "AssimpPCH.h"
|
#include "AssimpPCH.h"
|
||||||
|
|
||||||
#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
|
#ifndef ASSIMP_BUILD_NO_OGRE_IMPORTER
|
||||||
|
|
||||||
#include "OgreImporter.hpp"
|
#include "OgreImporter.hpp"
|
||||||
#include "TinyFormatter.h"
|
#include "TinyFormatter.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
namespace Ogre
|
namespace Ogre
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void OgreImporter::LoadSkeleton(std::string FileName, vector<Bone> &Bones, vector<Animation> &Animations) const
|
void OgreImporter::LoadSkeleton(std::string FileName, vector<Bone> &Bones, vector<Animation> &Animations) const
|
||||||
{
|
{
|
||||||
const aiScene* const m_CurrentScene=this->m_CurrentScene;//make sure, that we can access but not change the scene
|
const aiScene* const m_CurrentScene=this->m_CurrentScene;//make sure, that we can access but not change the scene
|
||||||
(void)m_CurrentScene;
|
(void)m_CurrentScene;
|
||||||
|
|
||||||
|
|
||||||
//most likely the skeleton file will only end with .skeleton
|
//most likely the skeleton file will only end with .skeleton
|
||||||
//But this is a xml reader, so we need: .skeleton.xml
|
//But this is a xml reader, so we need: .skeleton.xml
|
||||||
FileName+=".xml";
|
FileName+=".xml";
|
||||||
|
|
||||||
DefaultLogger::get()->debug(string("Loading Skeleton: ")+FileName);
|
DefaultLogger::get()->debug(string("Loading Skeleton: ")+FileName);
|
||||||
|
|
||||||
//Open the File:
|
//Open the File:
|
||||||
boost::scoped_ptr<IOStream> File(m_CurrentIOHandler->Open(FileName));
|
boost::scoped_ptr<IOStream> File(m_CurrentIOHandler->Open(FileName));
|
||||||
if(NULL==File.get())
|
if(NULL==File.get())
|
||||||
throw DeadlyImportError("Failed to open skeleton file "+FileName+".");
|
throw DeadlyImportError("Failed to open skeleton file "+FileName+".");
|
||||||
|
|
||||||
//Read the Mesh File:
|
//Read the Mesh File:
|
||||||
boost::scoped_ptr<CIrrXML_IOStreamReader> mIOWrapper(new CIrrXML_IOStreamReader(File.get()));
|
boost::scoped_ptr<CIrrXML_IOStreamReader> mIOWrapper(new CIrrXML_IOStreamReader(File.get()));
|
||||||
XmlReader* SkeletonFile = irr::io::createIrrXMLReader(mIOWrapper.get());
|
XmlReader* SkeletonFile = irr::io::createIrrXMLReader(mIOWrapper.get());
|
||||||
if(!SkeletonFile)
|
if(!SkeletonFile)
|
||||||
throw DeadlyImportError(string("Failed to create XML Reader for ")+FileName);
|
throw DeadlyImportError(string("Failed to create XML Reader for ")+FileName);
|
||||||
|
|
||||||
//Quick note: Whoever read this should know this one thing: irrXml fucking sucks!!!
|
//Quick note: Whoever read this should know this one thing: irrXml fucking sucks!!!
|
||||||
|
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
if(string("skeleton")!=SkeletonFile->getNodeName())
|
if(string("skeleton")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("No <skeleton> node in SkeletonFile: "+FileName);
|
throw DeadlyImportError("No <skeleton> node in SkeletonFile: "+FileName);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------load bones-----------------------------------------
|
//------------------------------------load bones-----------------------------------------
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
if(string("bones")!=SkeletonFile->getNodeName())
|
if(string("bones")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("No bones node in skeleton "+FileName);
|
throw DeadlyImportError("No bones node in skeleton "+FileName);
|
||||||
|
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
|
|
||||||
while(string("bone")==SkeletonFile->getNodeName())
|
while(string("bone")==SkeletonFile->getNodeName())
|
||||||
{
|
{
|
||||||
//TODO: Maybe we can have bone ids for the errrors, but normaly, they should never appear, so what....
|
//TODO: Maybe we can have bone ids for the errrors, but normaly, they should never appear, so what....
|
||||||
|
|
||||||
//read a new bone:
|
//read a new bone:
|
||||||
Bone NewBone;
|
Bone NewBone;
|
||||||
NewBone.Id=GetAttribute<int>(SkeletonFile, "id");
|
NewBone.Id=GetAttribute<int>(SkeletonFile, "id");
|
||||||
NewBone.Name=GetAttribute<string>(SkeletonFile, "name");
|
NewBone.Name=GetAttribute<string>(SkeletonFile, "name");
|
||||||
|
|
||||||
//load the position:
|
//load the position:
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
if(string("position")!=SkeletonFile->getNodeName())
|
if(string("position")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("Position is not first node in Bone!");
|
throw DeadlyImportError("Position is not first node in Bone!");
|
||||||
NewBone.Position.x=GetAttribute<float>(SkeletonFile, "x");
|
NewBone.Position.x=GetAttribute<float>(SkeletonFile, "x");
|
||||||
NewBone.Position.y=GetAttribute<float>(SkeletonFile, "y");
|
NewBone.Position.y=GetAttribute<float>(SkeletonFile, "y");
|
||||||
NewBone.Position.z=GetAttribute<float>(SkeletonFile, "z");
|
NewBone.Position.z=GetAttribute<float>(SkeletonFile, "z");
|
||||||
|
|
||||||
//Rotation:
|
//Rotation:
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
if(string("rotation")!=SkeletonFile->getNodeName())
|
if(string("rotation")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("Rotation is not the second node in Bone!");
|
throw DeadlyImportError("Rotation is not the second node in Bone!");
|
||||||
NewBone.RotationAngle=GetAttribute<float>(SkeletonFile, "angle");
|
NewBone.RotationAngle=GetAttribute<float>(SkeletonFile, "angle");
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
if(string("axis")!=SkeletonFile->getNodeName())
|
if(string("axis")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("No axis specified for bone rotation!");
|
throw DeadlyImportError("No axis specified for bone rotation!");
|
||||||
NewBone.RotationAxis.x=GetAttribute<float>(SkeletonFile, "x");
|
NewBone.RotationAxis.x=GetAttribute<float>(SkeletonFile, "x");
|
||||||
NewBone.RotationAxis.y=GetAttribute<float>(SkeletonFile, "y");
|
NewBone.RotationAxis.y=GetAttribute<float>(SkeletonFile, "y");
|
||||||
NewBone.RotationAxis.z=GetAttribute<float>(SkeletonFile, "z");
|
NewBone.RotationAxis.z=GetAttribute<float>(SkeletonFile, "z");
|
||||||
|
|
||||||
//append the newly loaded bone to the bone list
|
//append the newly loaded bone to the bone list
|
||||||
Bones.push_back(NewBone);
|
Bones.push_back(NewBone);
|
||||||
|
|
||||||
//Proceed to the next bone:
|
//Proceed to the next bone:
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
}
|
}
|
||||||
//The bones in the file a not neccesarly ordered by there id's so we do it now:
|
//The bones in the file a not neccesarly ordered by there id's so we do it now:
|
||||||
std::sort(Bones.begin(), Bones.end());
|
std::sort(Bones.begin(), Bones.end());
|
||||||
|
|
||||||
//now the id of each bone should be equal to its position in the vector:
|
//now the id of each bone should be equal to its position in the vector:
|
||||||
//so we do a simple check:
|
//so we do a simple check:
|
||||||
{
|
{
|
||||||
bool IdsOk=true;
|
bool IdsOk=true;
|
||||||
for(int i=0; i<static_cast<signed int>(Bones.size()); ++i)//i is signed, because all Id's are also signed!
|
for(int i=0; i<static_cast<signed int>(Bones.size()); ++i)//i is signed, because all Id's are also signed!
|
||||||
{
|
{
|
||||||
if(Bones[i].Id!=i)
|
if(Bones[i].Id!=i)
|
||||||
IdsOk=false;
|
IdsOk=false;
|
||||||
}
|
}
|
||||||
if(!IdsOk)
|
if(!IdsOk)
|
||||||
throw DeadlyImportError("Bone Ids are not valid!"+FileName);
|
throw DeadlyImportError("Bone Ids are not valid!"+FileName);
|
||||||
}
|
}
|
||||||
DefaultLogger::get()->debug((Formatter::format(),"Number of bones: ",Bones.size()));
|
DefaultLogger::get()->debug((Formatter::format(),"Number of bones: ",Bones.size()));
|
||||||
//________________________________________________________________________________
|
//________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//----------------------------load bonehierarchy--------------------------------
|
//----------------------------load bonehierarchy--------------------------------
|
||||||
if(string("bonehierarchy")!=SkeletonFile->getNodeName())
|
if(string("bonehierarchy")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("no bonehierarchy node in "+FileName);
|
throw DeadlyImportError("no bonehierarchy node in "+FileName);
|
||||||
|
|
||||||
DefaultLogger::get()->debug("loading bonehierarchy...");
|
DefaultLogger::get()->debug("loading bonehierarchy...");
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
while(string("boneparent")==SkeletonFile->getNodeName())
|
while(string("boneparent")==SkeletonFile->getNodeName())
|
||||||
{
|
{
|
||||||
string Child, Parent;
|
string Child, Parent;
|
||||||
Child=GetAttribute<string>(SkeletonFile, "bone");
|
Child=GetAttribute<string>(SkeletonFile, "bone");
|
||||||
Parent=GetAttribute<string>(SkeletonFile, "parent");
|
Parent=GetAttribute<string>(SkeletonFile, "parent");
|
||||||
|
|
||||||
unsigned int ChildId, ParentId;
|
unsigned int ChildId, ParentId;
|
||||||
ChildId=find(Bones.begin(), Bones.end(), Child)->Id;
|
ChildId=find(Bones.begin(), Bones.end(), Child)->Id;
|
||||||
ParentId=find(Bones.begin(), Bones.end(), Parent)->Id;
|
ParentId=find(Bones.begin(), Bones.end(), Parent)->Id;
|
||||||
|
|
||||||
Bones[ChildId].ParentId=ParentId;
|
Bones[ChildId].ParentId=ParentId;
|
||||||
Bones[ParentId].Children.push_back(ChildId);
|
Bones[ParentId].Children.push_back(ChildId);
|
||||||
|
|
||||||
XmlRead(SkeletonFile);//i once forget this line, which led to an endless loop, did i mentioned, that irrxml sucks??
|
XmlRead(SkeletonFile);//i once forget this line, which led to an endless loop, did i mentioned, that irrxml sucks??
|
||||||
}
|
}
|
||||||
//_____________________________________________________________________________
|
//_____________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
//--------- Calculate the WorldToBoneSpace Matrix recursivly for all bones: ------------------
|
//--------- Calculate the WorldToBoneSpace Matrix recursivly for all bones: ------------------
|
||||||
BOOST_FOREACH(Bone &theBone, Bones)
|
BOOST_FOREACH(Bone &theBone, Bones)
|
||||||
{
|
{
|
||||||
if(-1==theBone.ParentId) //the bone is a root bone
|
if(-1==theBone.ParentId) //the bone is a root bone
|
||||||
{
|
{
|
||||||
theBone.CalculateBoneToWorldSpaceMatrix(Bones);
|
theBone.CalculateBoneToWorldSpaceMatrix(Bones);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//_______________________________________________________________________
|
//_______________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
//---------------------------load animations-----------------------------
|
//---------------------------load animations-----------------------------
|
||||||
if(string("animations")==SkeletonFile->getNodeName())//animations are optional values
|
if(string("animations")==SkeletonFile->getNodeName())//animations are optional values
|
||||||
{
|
{
|
||||||
DefaultLogger::get()->debug("Loading Animations");
|
DefaultLogger::get()->debug("Loading Animations");
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
while(string("animation")==SkeletonFile->getNodeName())
|
while(string("animation")==SkeletonFile->getNodeName())
|
||||||
{
|
{
|
||||||
Animation NewAnimation;
|
Animation NewAnimation;
|
||||||
NewAnimation.Name=GetAttribute<string>(SkeletonFile, "name");
|
NewAnimation.Name=GetAttribute<string>(SkeletonFile, "name");
|
||||||
NewAnimation.Length=GetAttribute<float>(SkeletonFile, "length");
|
NewAnimation.Length=GetAttribute<float>(SkeletonFile, "length");
|
||||||
|
|
||||||
//Load all Tracks
|
//Load all Tracks
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
if(string("tracks")!=SkeletonFile->getNodeName())
|
if(string("tracks")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("no tracks node in animation");
|
throw DeadlyImportError("no tracks node in animation");
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
while(string("track")==SkeletonFile->getNodeName())
|
while(string("track")==SkeletonFile->getNodeName())
|
||||||
{
|
{
|
||||||
Track NewTrack;
|
Track NewTrack;
|
||||||
NewTrack.BoneName=GetAttribute<string>(SkeletonFile, "bone");
|
NewTrack.BoneName=GetAttribute<string>(SkeletonFile, "bone");
|
||||||
|
|
||||||
//Load all keyframes;
|
//Load all keyframes;
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
if(string("keyframes")!=SkeletonFile->getNodeName())
|
if(string("keyframes")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("no keyframes node!");
|
throw DeadlyImportError("no keyframes node!");
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
while(string("keyframe")==SkeletonFile->getNodeName())
|
while(string("keyframe")==SkeletonFile->getNodeName())
|
||||||
{
|
{
|
||||||
Keyframe NewKeyframe;
|
Keyframe NewKeyframe;
|
||||||
NewKeyframe.Time=GetAttribute<float>(SkeletonFile, "time");
|
NewKeyframe.Time=GetAttribute<float>(SkeletonFile, "time");
|
||||||
|
|
||||||
//loop over the attributes:
|
//loop over the attributes:
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
|
|
||||||
//If any property doesn't show up, it will keep its initialization value
|
//If any property doesn't show up, it will keep its initialization value
|
||||||
|
|
||||||
//Position:
|
//Position:
|
||||||
if(string("translate")==SkeletonFile->getNodeName())
|
if(string("translate")==SkeletonFile->getNodeName())
|
||||||
{
|
{
|
||||||
NewKeyframe.Position.x=GetAttribute<float>(SkeletonFile, "x");
|
NewKeyframe.Position.x=GetAttribute<float>(SkeletonFile, "x");
|
||||||
NewKeyframe.Position.y=GetAttribute<float>(SkeletonFile, "y");
|
NewKeyframe.Position.y=GetAttribute<float>(SkeletonFile, "y");
|
||||||
NewKeyframe.Position.z=GetAttribute<float>(SkeletonFile, "z");
|
NewKeyframe.Position.z=GetAttribute<float>(SkeletonFile, "z");
|
||||||
}
|
}
|
||||||
|
|
||||||
//Rotation:
|
//Rotation:
|
||||||
else if(string("rotate")==SkeletonFile->getNodeName())
|
else if(string("rotate")==SkeletonFile->getNodeName())
|
||||||
{
|
{
|
||||||
float RotationAngle=GetAttribute<float>(SkeletonFile, "angle");
|
float RotationAngle=GetAttribute<float>(SkeletonFile, "angle");
|
||||||
aiVector3D RotationAxis;
|
aiVector3D RotationAxis;
|
||||||
XmlRead(SkeletonFile);
|
XmlRead(SkeletonFile);
|
||||||
if(string("axis")!=SkeletonFile->getNodeName())
|
if(string("axis")!=SkeletonFile->getNodeName())
|
||||||
throw DeadlyImportError("No axis for keyframe rotation!");
|
throw DeadlyImportError("No axis for keyframe rotation!");
|
||||||
RotationAxis.x=GetAttribute<float>(SkeletonFile, "x");
|
RotationAxis.x=GetAttribute<float>(SkeletonFile, "x");
|
||||||
RotationAxis.y=GetAttribute<float>(SkeletonFile, "y");
|
RotationAxis.y=GetAttribute<float>(SkeletonFile, "y");
|
||||||
RotationAxis.z=GetAttribute<float>(SkeletonFile, "z");
|
RotationAxis.z=GetAttribute<float>(SkeletonFile, "z");
|
||||||
|
|
||||||
if(0==RotationAxis.x && 0==RotationAxis.y && 0==RotationAxis.z)//we have an invalid rotation axis
|
if(0==RotationAxis.x && 0==RotationAxis.y && 0==RotationAxis.z)//we have an invalid rotation axis
|
||||||
{
|
{
|
||||||
RotationAxis.x=1.0f;
|
RotationAxis.x=1.0f;
|
||||||
if(0!=RotationAngle)//if we don't rotate at all, the axis does not matter
|
if(0!=RotationAngle)//if we don't rotate at all, the axis does not matter
|
||||||
{
|
{
|
||||||
DefaultLogger::get()->warn("Invalid Rotation Axis in Keyframe!");
|
DefaultLogger::get()->warn("Invalid Rotation Axis in Keyframe!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NewKeyframe.Rotation=aiQuaternion(RotationAxis, RotationAngle);
|
NewKeyframe.Rotation=aiQuaternion(RotationAxis, RotationAngle);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Scaling:
|
//Scaling:
|
||||||
else if(string("scale")==SkeletonFile->getNodeName())
|
else if(string("scale")==SkeletonFile->getNodeName())
|
||||||
{
|
{
|
||||||
NewKeyframe.Scaling.x=GetAttribute<float>(SkeletonFile, "x");
|
NewKeyframe.Scaling.x=GetAttribute<float>(SkeletonFile, "x");
|
||||||
NewKeyframe.Scaling.y=GetAttribute<float>(SkeletonFile, "y");
|
NewKeyframe.Scaling.y=GetAttribute<float>(SkeletonFile, "y");
|
||||||
NewKeyframe.Scaling.z=GetAttribute<float>(SkeletonFile, "z");
|
NewKeyframe.Scaling.z=GetAttribute<float>(SkeletonFile, "z");
|
||||||
}
|
}
|
||||||
|
|
||||||
//we suppose, that we read all attributes and this is a new keyframe or the end of the animation
|
//we suppose, that we read all attributes and this is a new keyframe or the end of the animation
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NewTrack.Keyframes.push_back(NewKeyframe);
|
NewTrack.Keyframes.push_back(NewKeyframe);
|
||||||
//XmlRead(SkeletonFile);
|
//XmlRead(SkeletonFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
NewAnimation.Tracks.push_back(NewTrack);
|
NewAnimation.Tracks.push_back(NewTrack);
|
||||||
}
|
}
|
||||||
|
|
||||||
Animations.push_back(NewAnimation);
|
Animations.push_back(NewAnimation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//_____________________________________________________________________________
|
//_____________________________________________________________________________
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void OgreImporter::CreateAssimpSkeleton(const std::vector<Bone> &Bones, const std::vector<Animation> &/*Animations*/)
|
void OgreImporter::CreateAssimpSkeleton(const std::vector<Bone> &Bones, const std::vector<Animation> &/*Animations*/)
|
||||||
{
|
{
|
||||||
if(!m_CurrentScene->mRootNode)
|
if(!m_CurrentScene->mRootNode)
|
||||||
throw DeadlyImportError("No root node exists!!");
|
throw DeadlyImportError("No root node exists!!");
|
||||||
if(0!=m_CurrentScene->mRootNode->mNumChildren)
|
if(0!=m_CurrentScene->mRootNode->mNumChildren)
|
||||||
throw DeadlyImportError("Root Node already has childnodes!");
|
throw DeadlyImportError("Root Node already has childnodes!");
|
||||||
|
|
||||||
|
|
||||||
//Createt the assimp bone hierarchy
|
//Createt the assimp bone hierarchy
|
||||||
vector<aiNode*> RootBoneNodes;
|
vector<aiNode*> RootBoneNodes;
|
||||||
BOOST_FOREACH(Bone theBone, Bones)
|
BOOST_FOREACH(Bone theBone, Bones)
|
||||||
{
|
{
|
||||||
if(-1==theBone.ParentId) //the bone is a root bone
|
if(-1==theBone.ParentId) //the bone is a root bone
|
||||||
{
|
{
|
||||||
//which will recursily add all other nodes
|
//which will recursily add all other nodes
|
||||||
RootBoneNodes.push_back(CreateAiNodeFromBone(theBone.Id, Bones, m_CurrentScene->mRootNode));
|
RootBoneNodes.push_back(CreateAiNodeFromBone(theBone.Id, Bones, m_CurrentScene->mRootNode));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RootBoneNodes.size()) {
|
if (RootBoneNodes.size()) {
|
||||||
m_CurrentScene->mRootNode->mNumChildren=RootBoneNodes.size();
|
m_CurrentScene->mRootNode->mNumChildren=RootBoneNodes.size();
|
||||||
m_CurrentScene->mRootNode->mChildren=new aiNode*[RootBoneNodes.size()];
|
m_CurrentScene->mRootNode->mChildren=new aiNode*[RootBoneNodes.size()];
|
||||||
memcpy(m_CurrentScene->mRootNode->mChildren, &RootBoneNodes[0], sizeof(aiNode*)*RootBoneNodes.size());
|
memcpy(m_CurrentScene->mRootNode->mChildren, &RootBoneNodes[0], sizeof(aiNode*)*RootBoneNodes.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void OgreImporter::PutAnimationsInScene(const std::vector<Bone> &Bones, const std::vector<Animation> &Animations)
|
void OgreImporter::PutAnimationsInScene(const std::vector<Bone> &Bones, const std::vector<Animation> &Animations)
|
||||||
{
|
{
|
||||||
//-----------------Create the Assimp Animations --------------------
|
//-----------------Create the Assimp Animations --------------------
|
||||||
if(Animations.size()>0)//Maybe the model had only a skeleton and no animations. (If it also has no skeleton, this function would'nt have been called
|
if(Animations.size()>0)//Maybe the model had only a skeleton and no animations. (If it also has no skeleton, this function would'nt have been called
|
||||||
{
|
{
|
||||||
m_CurrentScene->mNumAnimations=Animations.size();
|
m_CurrentScene->mNumAnimations=Animations.size();
|
||||||
m_CurrentScene->mAnimations=new aiAnimation*[Animations.size()];
|
m_CurrentScene->mAnimations=new aiAnimation*[Animations.size()];
|
||||||
for(unsigned int i=0; i<Animations.size(); ++i)//create all animations
|
for(unsigned int i=0; i<Animations.size(); ++i)//create all animations
|
||||||
{
|
{
|
||||||
aiAnimation* NewAnimation=new aiAnimation();
|
aiAnimation* NewAnimation=new aiAnimation();
|
||||||
NewAnimation->mName=Animations[i].Name;
|
NewAnimation->mName=Animations[i].Name;
|
||||||
NewAnimation->mDuration=Animations[i].Length;
|
NewAnimation->mDuration=Animations[i].Length;
|
||||||
NewAnimation->mTicksPerSecond=1.0f;
|
NewAnimation->mTicksPerSecond=1.0f;
|
||||||
|
|
||||||
//Create all tracks in this animation
|
//Create all tracks in this animation
|
||||||
NewAnimation->mNumChannels=Animations[i].Tracks.size();
|
NewAnimation->mNumChannels=Animations[i].Tracks.size();
|
||||||
NewAnimation->mChannels=new aiNodeAnim*[Animations[i].Tracks.size()];
|
NewAnimation->mChannels=new aiNodeAnim*[Animations[i].Tracks.size()];
|
||||||
for(unsigned int j=0; j<Animations[i].Tracks.size(); ++j)
|
for(unsigned int j=0; j<Animations[i].Tracks.size(); ++j)
|
||||||
{
|
{
|
||||||
aiNodeAnim* NewNodeAnim=new aiNodeAnim();
|
aiNodeAnim* NewNodeAnim=new aiNodeAnim();
|
||||||
NewNodeAnim->mNodeName=Animations[i].Tracks[j].BoneName;
|
NewNodeAnim->mNodeName=Animations[i].Tracks[j].BoneName;
|
||||||
|
|
||||||
//we need this, to acces the bones default pose, which we need to make keys absolute to the default bone pose
|
//we need this, to acces the bones default pose, which we need to make keys absolute to the default bone pose
|
||||||
vector<Bone>::const_iterator CurBone=find(Bones.begin(), Bones.end(), NewNodeAnim->mNodeName);
|
vector<Bone>::const_iterator CurBone=find(Bones.begin(), Bones.end(), NewNodeAnim->mNodeName);
|
||||||
aiMatrix4x4 t0, t1;
|
aiMatrix4x4 t0, t1;
|
||||||
aiMatrix4x4 DefBonePose=aiMatrix4x4::Translation(CurBone->Position, t1)
|
aiMatrix4x4 DefBonePose=aiMatrix4x4::Translation(CurBone->Position, t1)
|
||||||
* aiMatrix4x4::Rotation(CurBone->RotationAngle, CurBone->RotationAxis, t0);
|
* aiMatrix4x4::Rotation(CurBone->RotationAngle, CurBone->RotationAxis, t0);
|
||||||
|
|
||||||
|
|
||||||
//Create the keyframe arrays...
|
//Create the keyframe arrays...
|
||||||
unsigned int KeyframeCount=Animations[i].Tracks[j].Keyframes.size();
|
unsigned int KeyframeCount=Animations[i].Tracks[j].Keyframes.size();
|
||||||
NewNodeAnim->mNumPositionKeys=KeyframeCount;
|
NewNodeAnim->mNumPositionKeys=KeyframeCount;
|
||||||
NewNodeAnim->mNumRotationKeys=KeyframeCount;
|
NewNodeAnim->mNumRotationKeys=KeyframeCount;
|
||||||
NewNodeAnim->mNumScalingKeys =KeyframeCount;
|
NewNodeAnim->mNumScalingKeys =KeyframeCount;
|
||||||
NewNodeAnim->mPositionKeys=new aiVectorKey[KeyframeCount];
|
NewNodeAnim->mPositionKeys=new aiVectorKey[KeyframeCount];
|
||||||
NewNodeAnim->mRotationKeys=new aiQuatKey[KeyframeCount];
|
NewNodeAnim->mRotationKeys=new aiQuatKey[KeyframeCount];
|
||||||
NewNodeAnim->mScalingKeys =new aiVectorKey[KeyframeCount];
|
NewNodeAnim->mScalingKeys =new aiVectorKey[KeyframeCount];
|
||||||
|
|
||||||
//...and fill them
|
//...and fill them
|
||||||
for(unsigned int k=0; k<KeyframeCount; ++k)
|
for(unsigned int k=0; k<KeyframeCount; ++k)
|
||||||
{
|
{
|
||||||
aiMatrix4x4 t2, t3;
|
aiMatrix4x4 t2, t3;
|
||||||
|
|
||||||
//Create a matrix to transfrom a vector from the bones default pose to the bone bones in this animation key
|
//Create a matrix to transfrom a vector from the bones default pose to the bone bones in this animation key
|
||||||
aiMatrix4x4 PoseToKey=
|
aiMatrix4x4 PoseToKey=
|
||||||
aiMatrix4x4::Translation(Animations[i].Tracks[j].Keyframes[k].Position, t3) //pos
|
aiMatrix4x4::Translation(Animations[i].Tracks[j].Keyframes[k].Position, t3) //pos
|
||||||
* aiMatrix4x4(Animations[i].Tracks[j].Keyframes[k].Rotation.GetMatrix()) //rot
|
* aiMatrix4x4(Animations[i].Tracks[j].Keyframes[k].Rotation.GetMatrix()) //rot
|
||||||
* aiMatrix4x4::Scaling(Animations[i].Tracks[j].Keyframes[k].Scaling, t2); //scale
|
* aiMatrix4x4::Scaling(Animations[i].Tracks[j].Keyframes[k].Scaling, t2); //scale
|
||||||
|
|
||||||
|
|
||||||
//calculate the complete transformation from world space to bone space
|
//calculate the complete transformation from world space to bone space
|
||||||
aiMatrix4x4 CompleteTransform=DefBonePose * PoseToKey;
|
aiMatrix4x4 CompleteTransform=DefBonePose * PoseToKey;
|
||||||
|
|
||||||
aiVector3D Pos;
|
aiVector3D Pos;
|
||||||
aiQuaternion Rot;
|
aiQuaternion Rot;
|
||||||
aiVector3D Scale;
|
aiVector3D Scale;
|
||||||
|
|
||||||
CompleteTransform.Decompose(Scale, Rot, Pos);
|
CompleteTransform.Decompose(Scale, Rot, Pos);
|
||||||
|
|
||||||
double Time=Animations[i].Tracks[j].Keyframes[k].Time;
|
double Time=Animations[i].Tracks[j].Keyframes[k].Time;
|
||||||
|
|
||||||
NewNodeAnim->mPositionKeys[k].mTime=Time;
|
NewNodeAnim->mPositionKeys[k].mTime=Time;
|
||||||
NewNodeAnim->mPositionKeys[k].mValue=Pos;
|
NewNodeAnim->mPositionKeys[k].mValue=Pos;
|
||||||
|
|
||||||
NewNodeAnim->mRotationKeys[k].mTime=Time;
|
NewNodeAnim->mRotationKeys[k].mTime=Time;
|
||||||
NewNodeAnim->mRotationKeys[k].mValue=Rot;
|
NewNodeAnim->mRotationKeys[k].mValue=Rot;
|
||||||
|
|
||||||
NewNodeAnim->mScalingKeys[k].mTime=Time;
|
NewNodeAnim->mScalingKeys[k].mTime=Time;
|
||||||
NewNodeAnim->mScalingKeys[k].mValue=Scale;
|
NewNodeAnim->mScalingKeys[k].mValue=Scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
NewAnimation->mChannels[j]=NewNodeAnim;
|
NewAnimation->mChannels[j]=NewNodeAnim;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_CurrentScene->mAnimations[i]=NewAnimation;
|
m_CurrentScene->mAnimations[i]=NewAnimation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO: Auf nicht vorhandene Animationskeys achten!
|
//TODO: Auf nicht vorhandene Animationskeys achten!
|
||||||
//#pragma warning (s.o.)
|
//#pragma warning (s.o.)
|
||||||
//__________________________________________________________________
|
//__________________________________________________________________
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
aiNode* OgreImporter::CreateAiNodeFromBone(int BoneId, const std::vector<Bone> &Bones, aiNode* ParentNode)
|
aiNode* OgreImporter::CreateAiNodeFromBone(int BoneId, const std::vector<Bone> &Bones, aiNode* ParentNode)
|
||||||
{
|
{
|
||||||
//----Create the node for this bone and set its values-----
|
//----Create the node for this bone and set its values-----
|
||||||
aiNode* NewNode=new aiNode(Bones[BoneId].Name);
|
aiNode* NewNode=new aiNode(Bones[BoneId].Name);
|
||||||
NewNode->mParent=ParentNode;
|
NewNode->mParent=ParentNode;
|
||||||
|
|
||||||
aiMatrix4x4 t0,t1;
|
aiMatrix4x4 t0,t1;
|
||||||
NewNode->mTransformation=
|
NewNode->mTransformation=
|
||||||
aiMatrix4x4::Translation(Bones[BoneId].Position, t0)
|
aiMatrix4x4::Translation(Bones[BoneId].Position, t0)
|
||||||
*aiMatrix4x4::Rotation(Bones[BoneId].RotationAngle, Bones[BoneId].RotationAxis, t1)
|
*aiMatrix4x4::Rotation(Bones[BoneId].RotationAngle, Bones[BoneId].RotationAxis, t1)
|
||||||
;
|
;
|
||||||
//__________________________________________________________
|
//__________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
//---------- recursivly create all children Nodes: ----------
|
//---------- recursivly create all children Nodes: ----------
|
||||||
NewNode->mNumChildren=Bones[BoneId].Children.size();
|
NewNode->mNumChildren=Bones[BoneId].Children.size();
|
||||||
NewNode->mChildren=new aiNode*[Bones[BoneId].Children.size()];
|
NewNode->mChildren=new aiNode*[Bones[BoneId].Children.size()];
|
||||||
for(unsigned int i=0; i<Bones[BoneId].Children.size(); ++i)
|
for(unsigned int i=0; i<Bones[BoneId].Children.size(); ++i)
|
||||||
{
|
{
|
||||||
NewNode->mChildren[i]=CreateAiNodeFromBone(Bones[BoneId].Children[i], Bones, NewNode);
|
NewNode->mChildren[i]=CreateAiNodeFromBone(Bones[BoneId].Children[i], Bones, NewNode);
|
||||||
}
|
}
|
||||||
//____________________________________________________
|
//____________________________________________________
|
||||||
|
|
||||||
|
|
||||||
return NewNode;
|
return NewNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Bone::CalculateBoneToWorldSpaceMatrix(vector<Bone> &Bones)
|
void Bone::CalculateBoneToWorldSpaceMatrix(vector<Bone> &Bones)
|
||||||
{
|
{
|
||||||
//Calculate the matrix for this bone:
|
//Calculate the matrix for this bone:
|
||||||
|
|
||||||
aiMatrix4x4 t0,t1;
|
aiMatrix4x4 t0,t1;
|
||||||
aiMatrix4x4 Transf= aiMatrix4x4::Rotation(-RotationAngle, RotationAxis, t1)
|
aiMatrix4x4 Transf= aiMatrix4x4::Rotation(-RotationAngle, RotationAxis, t1)
|
||||||
* aiMatrix4x4::Translation(-Position, t0);
|
* aiMatrix4x4::Translation(-Position, t0);
|
||||||
|
|
||||||
if(-1==ParentId)
|
if(-1==ParentId)
|
||||||
{
|
{
|
||||||
BoneToWorldSpace=Transf;
|
BoneToWorldSpace=Transf;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BoneToWorldSpace=Transf*Bones[ParentId].BoneToWorldSpace;
|
BoneToWorldSpace=Transf*Bones[ParentId].BoneToWorldSpace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//and recursivly for all children:
|
//and recursivly for all children:
|
||||||
BOOST_FOREACH(int theChildren, Children)
|
BOOST_FOREACH(int theChildren, Children)
|
||||||
{
|
{
|
||||||
Bones[theChildren].CalculateBoneToWorldSpaceMatrix(Bones);
|
Bones[theChildren].CalculateBoneToWorldSpaceMatrix(Bones);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}//namespace Ogre
|
}//namespace Ogre
|
||||||
}//namespace Assimp
|
}//namespace Assimp
|
||||||
|
|
||||||
#endif // !! ASSIMP_BUILD_NO_OGRE_IMPORTER
|
#endif // !! ASSIMP_BUILD_NO_OGRE_IMPORTER
|
||||||
|
|
|
@ -51,6 +51,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Stanford Polygon Library (PLY) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour | aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ply"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
PLYImporter::PLYImporter()
|
PLYImporter::PLYImporter()
|
||||||
|
@ -79,9 +92,9 @@ bool PLYImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void PLYImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* PLYImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ply");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -78,10 +78,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -57,13 +57,25 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include "../include/assimp/mesh.h"
|
#include "../include/assimp/mesh.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quake III BSP Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"pk3"
|
||||||
|
};
|
||||||
|
|
||||||
namespace Assimp
|
namespace Assimp
|
||||||
{
|
{
|
||||||
|
|
||||||
using namespace Q3BSP;
|
using namespace Q3BSP;
|
||||||
|
|
||||||
static const std::string Q3BSPExtension = "pk3";
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Local function to create a material key name.
|
// Local function to create a material key name.
|
||||||
static void createKey( int id1, int id2, std::string &rKey )
|
static void createKey( int id1, int id2, std::string &rKey )
|
||||||
|
@ -161,7 +173,7 @@ Q3BSPFileImporter::~Q3BSPFileImporter()
|
||||||
bool Q3BSPFileImporter::CanRead( const std::string& rFile, IOSystem* /*pIOHandler*/, bool checkSig ) const
|
bool Q3BSPFileImporter::CanRead( const std::string& rFile, IOSystem* /*pIOHandler*/, bool checkSig ) const
|
||||||
{
|
{
|
||||||
if(!checkSig) {
|
if(!checkSig) {
|
||||||
return SimpleExtensionCheck( rFile, Q3BSPExtension.c_str() );
|
return SimpleExtensionCheck( rFile, "pk3" );
|
||||||
}
|
}
|
||||||
// TODO perhaps add keyword based detection
|
// TODO perhaps add keyword based detection
|
||||||
return false;
|
return false;
|
||||||
|
@ -169,9 +181,9 @@ bool Q3BSPFileImporter::CanRead( const std::string& rFile, IOSystem* /*pIOHandle
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Adds extensions.
|
// Adds extensions.
|
||||||
void Q3BSPFileImporter::GetExtensionList( std::set<std::string>& extensions )
|
const aiImporterDesc* Q3BSPFileImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert( Q3BSPExtension );
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -78,7 +78,7 @@ private:
|
||||||
typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>* >::iterator FaceMapIt;
|
typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>* >::iterator FaceMapIt;
|
||||||
typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>*>::const_iterator FaceMapConstIt;
|
typedef std::map<std::string, std::vector<Q3BSP::sQ3BSPFace*>*>::const_iterator FaceMapConstIt;
|
||||||
|
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
void InternReadFile(const std::string& pFile, aiScene* pScene, IOSystem* pIOHandler);
|
||||||
void separateMapName( const std::string &rImportName, std::string &rArchiveName, std::string &rMapName );
|
void separateMapName( const std::string &rImportName, std::string &rArchiveName, std::string &rMapName );
|
||||||
bool findFirstMapInArchive( Q3BSP::Q3BSPZipArchive &rArchive, std::string &rMapName );
|
bool findFirstMapInArchive( Q3BSP::Q3BSPZipArchive &rArchive, std::string &rMapName );
|
||||||
|
|
|
@ -53,6 +53,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Quick3D Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.quick3d.com/",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"q3o q3s"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
Q3DImporter::Q3DImporter()
|
Q3DImporter::Q3DImporter()
|
||||||
|
@ -81,10 +94,9 @@ bool Q3DImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void Q3DImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* Q3DImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("q3o");
|
return &desc;
|
||||||
extensions.insert("q3s");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -71,10 +71,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -53,6 +53,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Raw Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"raw"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
RAWImporter::RAWImporter()
|
RAWImporter::RAWImporter()
|
||||||
|
@ -71,10 +84,9 @@ bool RAWImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get the list of all supported file extensions
|
const aiImporterDesc* RAWImporter::GetInfo () const
|
||||||
void RAWImporter::GetExtensionList(std::set<std::string>& extensions)
|
|
||||||
{
|
{
|
||||||
extensions.insert("raw");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -72,10 +72,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -53,6 +53,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Valve SMD Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"smd vta"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
SMDImporter::SMDImporter()
|
SMDImporter::SMDImporter()
|
||||||
|
@ -73,10 +86,9 @@ bool SMDImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/, b
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all supported file extensions
|
// Get a list of all supported file extensions
|
||||||
void SMDImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* SMDImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("smd");
|
return &desc;
|
||||||
extensions.insert("vta");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -197,10 +197,10 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -51,6 +51,18 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Stereolithography (STL) Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"stl"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
|
@ -80,9 +92,9 @@ bool STLImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void STLImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* STLImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("stl");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -71,10 +71,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -48,6 +48,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Terragen Heightmap Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"http://www.planetside.co.uk/",
|
||||||
|
aiImporterFlags_SupportBinaryFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"ter"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
TerragenImporter::TerragenImporter()
|
TerragenImporter::TerragenImporter()
|
||||||
|
@ -83,9 +96,9 @@ bool TerragenImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler,
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Build a string of all file extensions supported
|
// Build a string of all file extensions supported
|
||||||
void TerragenImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* TerragenImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("ter");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -83,7 +83,7 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
void InternReadFile( const std::string& pFile, aiScene* pScene,
|
||||||
|
|
|
@ -58,6 +58,20 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Unreal Mesh Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"3d uc"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
UnrealImporter::UnrealImporter()
|
UnrealImporter::UnrealImporter()
|
||||||
|
@ -79,10 +93,9 @@ bool UnrealImporter::CanRead( const std::string& pFile, IOSystem* /*pIOHandler*/
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Build a string of all file extensions supported
|
// Build a string of all file extensions supported
|
||||||
void UnrealImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* UnrealImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("3d");
|
return &desc;
|
||||||
extensions.insert("uc");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -165,9 +165,9 @@ protected:
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** @brief Called by Importer::GetExtensionList()
|
/** @brief Called by Importer::GetExtensionList()
|
||||||
*
|
*
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
|
|
|
@ -51,6 +51,19 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using namespace Assimp;
|
using namespace Assimp;
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"Collada Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour | aiImporterFlags_SupportBinaryFlavour | aiImporterFlags_SupportCompressedFlavour,
|
||||||
|
1,
|
||||||
|
3,
|
||||||
|
1,
|
||||||
|
5,
|
||||||
|
"x"
|
||||||
|
};
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
XFileImporter::XFileImporter()
|
XFileImporter::XFileImporter()
|
||||||
|
@ -78,9 +91,10 @@ bool XFileImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, boo
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void XFileImporter::GetExtensionList(std::set<std::string>& extensions)
|
// Get file extension list
|
||||||
|
const aiImporterDesc* XFileImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("x");
|
return &desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -81,10 +81,10 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details
|
* See #BaseImporter::GetInfo for the details
|
||||||
*/
|
*/
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -79,6 +79,19 @@ struct free_it
|
||||||
|
|
||||||
template<> const std::string LogFunctions<XGLImporter>::log_prefix = "XGL: ";
|
template<> const std::string LogFunctions<XGLImporter>::log_prefix = "XGL: ";
|
||||||
|
|
||||||
|
static const aiImporterDesc desc = {
|
||||||
|
"XGL Importer",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
"",
|
||||||
|
aiImporterFlags_SupportTextFlavour,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
"xgl zgl"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Constructor to be privately used by Importer
|
// Constructor to be privately used by Importer
|
||||||
|
@ -115,10 +128,9 @@ bool XGLImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
// Get a list of all file extensions which are handled by this class
|
// Get a list of all file extensions which are handled by this class
|
||||||
void XGLImporter::GetExtensionList(std::set<std::string>& extensions)
|
const aiImporterDesc* XGLImporter::GetInfo () const
|
||||||
{
|
{
|
||||||
extensions.insert("xgl");
|
return &desc;
|
||||||
extensions.insert("zgl");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -74,9 +74,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Called by Importer::GetExtensionList() for each loaded importer.
|
/** Return importer meta information.
|
||||||
* See BaseImporter::GetExtensionList() for details */
|
* See #BaseImporter::GetInfo for the details */
|
||||||
void GetExtensionList(std::set<std::string>& extensions);
|
const aiImporterDesc* GetInfo () const;
|
||||||
|
|
||||||
// -------------------------------------------------------------------
|
// -------------------------------------------------------------------
|
||||||
/** Imports the given file into the given scene structure.
|
/** Imports the given file into the given scene structure.
|
||||||
|
|
|
@ -117,6 +117,20 @@ struct aiImporterDesc
|
||||||
maximum version.*/
|
maximum version.*/
|
||||||
unsigned int mMaxMajor;
|
unsigned int mMaxMajor;
|
||||||
unsigned int mMaxMinor;
|
unsigned int mMaxMinor;
|
||||||
|
|
||||||
|
/** List of file extensions this importer can handle.
|
||||||
|
List entries are separated by space characters.
|
||||||
|
All entries are lower case without a leading dot (i.e.
|
||||||
|
"xml dae" would be a valid value. Note that multiple
|
||||||
|
importers may respond to the same file extension -
|
||||||
|
assimp calls all importers in the order in which they
|
||||||
|
are registered and each importer gets the opportunity
|
||||||
|
to load the file until one importer "claims" the file. Apart
|
||||||
|
from file extension checks, importers typically use
|
||||||
|
other methods to quickly reject files (i.e. magic
|
||||||
|
words) so this does not mean that common or generic
|
||||||
|
file extensions such as XML would be tediously slow. */
|
||||||
|
const char* mFileExtensions;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1812,7 +1812,7 @@
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\code\OgreImporter.h"
|
RelativePath="..\..\code\OgreImporter.hpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
|
Loading…
Reference in New Issue