Assimp
v4.1. (December 2018)
|
Importer class for the MD5 file format. More...
Inherits Assimp::BaseImporter.
Public Member Functions | |
bool | CanRead (const std::string &pFile, IOSystem *pIOHandler, bool checkSig) const |
Returns whether the class can handle the format of the given file. More... | |
MD5Importer () | |
~MD5Importer () | |
![]() | |
BaseImporter () AI_NO_EXCEPT | |
Constructor to be privately used by Importer. More... | |
virtual const ImporterUnits & | GetApplicationUnits () |
const std::string & | GetErrorText () const |
Returns the error description of the last error that occurred. More... | |
void | GetExtensionList (std::set< std::string > &extensions) |
Called by #Importer::GetExtensionList for each loaded importer. More... | |
virtual double | GetFileScale () const |
aiScene * | ReadFile (Importer *pImp, const std::string &pFile, IOSystem *pIOHandler) |
Imports the given file and returns the imported data. More... | |
virtual void | SetApplicationUnits (const ImporterUnits &unit) |
virtual void | SetFileScale (double scale) |
Will be called only by scale process when scaling is requested. More... | |
virtual | ~BaseImporter () |
Destructor, private as well. More... | |
Protected Member Functions | |
void | AttachChilds_Anim (int iParentID, aiNode *piParent, AnimBoneList &bones, const aiNodeAnim **node_anims) |
Construct node hierarchy from a given MD5ANIM. More... | |
void | AttachChilds_Mesh (int iParentID, aiNode *piParent, BoneList &bones) |
Construct node hierarchy from a given MD5MESH. More... | |
const aiImporterDesc * | GetInfo () const |
Return importer meta information. More... | |
void | InternReadFile (const std::string &pFile, aiScene *pScene, IOSystem *pIOHandler) |
Imports the given file into the given scene structure. More... | |
void | LoadFileIntoMemory (IOStream *pFile) |
Load the contents of a specific file into memory and allocates a buffer to keep it. More... | |
void | LoadMD5AnimFile () |
Load a *.MD5ANIM file. More... | |
void | LoadMD5CameraFile () |
Load a *.MD5CAMERA file. More... | |
void | LoadMD5MeshFile () |
Load a *.MD5MESH file. More... | |
void | MakeDataUnique (MD5::MeshDesc &meshSrc) |
Build unique vertex buffers from a given MD5ANIM. More... | |
void | SetupProperties (const Importer *pImp) |
Called prior to ReadFile(). More... | |
void | UnloadFileFromMemory () |
Protected Attributes | |
bool | bHadMD5Anim |
true if a MD5ANIM file has already been parsed More... | |
bool | bHadMD5Camera |
true if a MD5CAMERA file has already been parsed More... | |
bool | bHadMD5Mesh |
true if a MD5MESH file has already been parsed More... | |
bool | configNoAutoLoad |
configuration option: prevent anim autoload More... | |
unsigned int | fileSize |
Size of the file. More... | |
unsigned int | iLineNumber |
Current line number. More... | |
char * | mBuffer |
Buffer to hold the loaded file. More... | |
std::string | mFile |
Path to the file, excluding the file extension but with the dot. More... | |
IOSystem * | mIOHandler |
IOSystem to be used to access files. More... | |
IOSystem * | pIOHandler |
(Custom) I/O handler implementation More... | |
aiScene * | pScene |
Scene to be filled. More... | |
![]() | |
ImporterUnits | applicationUnits = ImporterUnits::M |
double | fileScale = 1.0 |
double | importerScale = 1.0 |
std::string | m_ErrorText |
Error description in case there was one. More... | |
ProgressHandler * | m_progress |
Currently set progress handler. More... | |
Additional Inherited Members | |
![]() | |
enum | ImporterUnits { M, MM, CM, INCHES, FEET } |
enum | TextFileMode { ALLOW_EMPTY, FORBID_EMPTY } |
Enum to define, if empty files are ok or not. More... | |
![]() | |
static bool | CheckMagicToken (IOSystem *pIOHandler, const std::string &pFile, const void *magic, unsigned int num, unsigned int offset=0, unsigned int size=4) |
Check whether a file starts with one or more magic tokens. More... | |
static void | ConvertToUTF8 (std::vector< char > &data) |
An utility for all text file loaders. More... | |
static void | ConvertUTF8toISO8859_1 (std::string &data) |
An utility for all text file loaders. More... | |
template<typename T > | |
static AI_FORCE_INLINE void | CopyVector (std::vector< T > &vec, T *&out, unsigned int &outLength) |
Utility function to move a std::vector into a aiScene array. More... | |
static std::string | GetExtension (const std::string &pFile) |
Extract file extension from a string. More... | |
static bool | SearchFileHeaderForToken (IOSystem *pIOSystem, const std::string &file, const char **tokens, unsigned int numTokens, unsigned int searchBytes=200, bool tokensSol=false, bool noAlphaBeforeTokens=false) |
A utility for CanRead(). More... | |
static bool | SimpleExtensionCheck (const std::string &pFile, const char *ext0, const char *ext1=NULL, const char *ext2=NULL) |
Check whether a file has a specific file extension. More... | |
static void | TextFileToBuffer (IOStream *stream, std::vector< char > &data, TextFileMode mode=FORBID_EMPTY) |
Utility for text file loaders which copies the contents of the file into a memory buffer and converts it to our UTF8 representation. More... | |
![]() | |
std::map< ImporterUnits, double > | importerUnits |
Assimp Importer unit conversions available if you need another measurment unit add it below. More... | |
MD5Importer::MD5Importer | ( | ) |
MD5Importer::~MD5Importer | ( | ) |
|
protected |
Construct node hierarchy from a given MD5ANIM.
iParentID | Current parent ID |
piParent | Parent node to attach to |
bones | Input bones |
node_anims | Generated node animations |
|
protected |
Construct node hierarchy from a given MD5MESH.
iParentID | Current parent ID |
piParent | Parent node to attach to |
bones | Input bones |
|
virtual |
Returns whether the class can handle the format of the given file.
See BaseImporter::CanRead() for details.
Implements Assimp::BaseImporter.
|
protectedvirtual |
Return importer meta information.
See #BaseImporter::GetInfo for the details
Implements Assimp::BaseImporter.
|
protectedvirtual |
Imports the given file into the given scene structure.
See BaseImporter::InternReadFile() for details
Implements Assimp::BaseImporter.
|
protected |
Load the contents of a specific file into memory and allocates a buffer to keep it.
mBuffer is modified to point to this buffer.
pFile | File stream to be read |
|
protected |
Load a *.MD5ANIM file.
|
protected |
Load a *.MD5CAMERA file.
|
protected |
Load a *.MD5MESH file.
|
protected |
Build unique vertex buffers from a given MD5ANIM.
meshSrc | Input data |
|
protectedvirtual |
Called prior to ReadFile().
The function is a request to the importer to update its configuration basing on the Importer's configuration property list.
Reimplemented from Assimp::BaseImporter.
|
protected |
|
protected |
true if a MD5ANIM file has already been parsed
|
protected |
true if a MD5CAMERA file has already been parsed
|
protected |
true if a MD5MESH file has already been parsed
|
protected |
configuration option: prevent anim autoload
|
protected |
Size of the file.
|
protected |
Current line number.
For debugging purposes
|
protected |
Buffer to hold the loaded file.
|
protected |
Path to the file, excluding the file extension but with the dot.
|
protected |
(Custom) I/O handler implementation
|
protected |
Scene to be filled.