Assimp  v3.1.1 (June 2014)
Assimp::MD3Importer Class Reference

Importer class to load MD3 files. 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...
 
 MD3Importer ()
 
void SetupProperties (const Importer *pImp)
 Called prior to ReadFile(). More...
 
 ~MD3Importer ()
 
- Public Member Functions inherited from Assimp::BaseImporter
 BaseImporter ()
 Constructor to be privately used by Importer. More...
 
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...
 
aiSceneReadFile (const Importer *pImp, const std::string &pFile, IOSystem *pIOHandler)
 Imports the given file and returns the imported data. More...
 
virtual ~BaseImporter ()
 Destructor, private as well. More...
 

Protected Member Functions

void ConvertPath (const char *texture_name, const char *header_path, std::string &out) const
 Convert a texture path in a MD3 file to a proper value. More...
 
const aiImporterDescGetInfo () 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...
 
bool ReadMultipartFile ()
 Read a Q3 multipart file. More...
 
void ReadShader (Q3Shader::ShaderData &fill) const
 Try to read the shader for a MD3 file. More...
 
void ReadSkin (Q3Shader::SkinData &fill) const
 Try to read the skin for a MD3 file. More...
 
void ValidateHeaderOffsets ()
 Validate offsets in the header. More...
 
void ValidateSurfaceHeaderOffsets (const MD3::Surface *pcSurfHeader)
 

Protected Attributes

unsigned int configFrameID
 Configuration option: frame to be loaded. More...
 
bool configHandleMP
 Configuration option: process multi-part files. More...
 
std::string configShaderFile
 Configuration option: name or path of shader. More...
 
std::string configSkinFile
 Configuration option: name of skin file to be read. More...
 
bool configSpeedFlag
 Configuration option: speed flag was set? More...
 
std::string filename
 Pure file we're currently reading. More...
 
unsigned int fileSize
 Size of the file, in bytes. More...
 
BE_NCONST unsigned char * mBuffer
 File buffer
More...
 
std::string mFile
 Current file name. More...
 
IOSystemmIOHandler
 IO system to be used to access the data. More...
 
aiScenemScene
 Output scene to be filled. More...
 
std::string path
 Current base directory
More...
 
BE_NCONST MD3::HeaderpcHeader
 Header of the MD3 file. More...
 
- Protected Attributes inherited from Assimp::BaseImporter
std::string m_ErrorText
 Error description in case there was one. More...
 
ProgressHandlerm_progress
 Currently set progress handler. More...
 

Additional Inherited Members

- Public Types inherited from Assimp::BaseImporter
enum  TextFileMode { ALLOW_EMPTY, FORBID_EMPTY }
 
- Static Public Member Functions inherited from Assimp::BaseImporter
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)
 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...
 

Detailed Description

Importer class to load MD3 files.

Constructor & Destructor Documentation

◆ MD3Importer()

MD3Importer::MD3Importer ( )

◆ ~MD3Importer()

MD3Importer::~MD3Importer ( )

Member Function Documentation

◆ CanRead()

bool MD3Importer::CanRead ( const std::string &  pFile,
IOSystem pIOHandler,
bool  checkSig 
) const
virtual

Returns whether the class can handle the format of the given file.

See BaseImporter::CanRead() for details.

Implements Assimp::BaseImporter.

◆ ConvertPath()

void MD3Importer::ConvertPath ( const char *  texture_name,
const char *  header_path,
std::string &  out 
) const
protected

Convert a texture path in a MD3 file to a proper value.

Parameters
[in]texture_namePath to be converted
[in]header_pathBase path specified in MD3 header
[out]outReceives the converted output string

◆ GetInfo()

const aiImporterDesc * MD3Importer::GetInfo ( ) const
protectedvirtual

Return importer meta information.

See #BaseImporter::GetInfo for the details

Implements Assimp::BaseImporter.

◆ InternReadFile()

void MD3Importer::InternReadFile ( const std::string &  pFile,
aiScene pScene,
IOSystem pIOHandler 
)
protectedvirtual

Imports the given file into the given scene structure.

See BaseImporter::InternReadFile() for details

Implements Assimp::BaseImporter.

◆ ReadMultipartFile()

bool MD3Importer::ReadMultipartFile ( )
protected

Read a Q3 multipart file.

Returns
true if multi part has been processed

◆ ReadShader()

void MD3Importer::ReadShader ( Q3Shader::ShaderData fill) const
protected

Try to read the shader for a MD3 file.

Parameters
fillReceives output information

◆ ReadSkin()

void MD3Importer::ReadSkin ( Q3Shader::SkinData fill) const
protected

Try to read the skin for a MD3 file.

Parameters
fillReceives output information

◆ SetupProperties()

void MD3Importer::SetupProperties ( const Importer pImp)
virtual

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.

◆ ValidateHeaderOffsets()

void MD3Importer::ValidateHeaderOffsets ( )
protected

Validate offsets in the header.

◆ ValidateSurfaceHeaderOffsets()

void MD3Importer::ValidateSurfaceHeaderOffsets ( const MD3::Surface pcSurfHeader)
protected

Member Data Documentation

◆ configFrameID

unsigned int Assimp::MD3Importer::configFrameID
protected

Configuration option: frame to be loaded.

◆ configHandleMP

bool Assimp::MD3Importer::configHandleMP
protected

Configuration option: process multi-part files.

◆ configShaderFile

std::string Assimp::MD3Importer::configShaderFile
protected

Configuration option: name or path of shader.

◆ configSkinFile

std::string Assimp::MD3Importer::configSkinFile
protected

Configuration option: name of skin file to be read.

◆ configSpeedFlag

bool Assimp::MD3Importer::configSpeedFlag
protected

Configuration option: speed flag was set?

◆ filename

std::string Assimp::MD3Importer::filename
protected

Pure file we're currently reading.

◆ fileSize

unsigned int Assimp::MD3Importer::fileSize
protected

Size of the file, in bytes.

◆ mBuffer

BE_NCONST unsigned char* Assimp::MD3Importer::mBuffer
protected

File buffer

◆ mFile

std::string Assimp::MD3Importer::mFile
protected

Current file name.

◆ mIOHandler

IOSystem* Assimp::MD3Importer::mIOHandler
protected

IO system to be used to access the data.

◆ mScene

aiScene* Assimp::MD3Importer::mScene
protected

Output scene to be filled.

◆ path

std::string Assimp::MD3Importer::path
protected

Current base directory

◆ pcHeader

BE_NCONST MD3::Header* Assimp::MD3Importer::pcHeader
protected

Header of the MD3 file.


The documentation for this class was generated from the following files: