Cafu Engine
LoaderMd5T Class Reference

This class imports a Doom3 (.md5) model file into a new Cafu model. More...

#include "Loader_md5.hpp"

Inheritance diagram for LoaderMd5T:

Public Member Functions

 LoaderMd5T (const std::string &FileName, int Flags=NONE)
 The constructor for importing a Doom3 (.md5) model file into a new Cafu model. More...
 
void Load (ArrayT< CafuModelT::JointT > &Joints, ArrayT< CafuModelT::MeshT > &Meshes, ArrayT< CafuModelT::AnimT > &Anims, MaterialManagerImplT &MaterialMan)
 Actually loads the file data into the appropriate parts of the Cafu model. More...
 
void Load (ArrayT< CafuModelT::SkinT > &Skins, const MaterialManagerImplT &MaterialMan)
 Loads the skins of the Cafu model. More...
 
void Load (ArrayT< CafuModelT::GuiFixtureT > &GuiFixtures)
 Loads the GUI fixtures of the Cafu model. More...
 
void Load (ArrayT< CafuModelT::ChannelT > &Channels)
 Loads the animation channels (groups of joints) of the Cafu model. More...
 
bool Load (unsigned int Level, CafuModelT *&DlodModel, float &DlodDist)
 Loads the dlod-model and dlod-distance at the given level. More...
 
- Public Member Functions inherited from ModelLoaderT
 ModelLoaderT (const std::string &FileName, int Flags)
 The constructor. More...
 
virtual ~ModelLoaderT ()
 The virtual destructor. More...
 
virtual const std::string & GetFileName () const
 Returns the file name of the imported model. More...
 
virtual void Postprocess (ArrayT< CafuModelT::MeshT > &Meshes)
 Postprocesses the file data according to flags given to the constructor. More...
 

Additional Inherited Members

- Public Types inherited from ModelLoaderT
enum  FlagsT { NONE =0x00, REMOVE_DEGEN_TRIANGLES =0x01, REMOVE_UNUSED_VERTICES =0x02, REMOVE_UNUSED_WEIGHTS =0x04 }
 
- Protected Member Functions inherited from ModelLoaderT
void RemoveDegenTriangles (CafuModelT::MeshT &Mesh)
 Removes triangles with zero-length edges from the given mesh. More...
 
void RemoveUnusedVertices (CafuModelT::MeshT &Mesh)
 Removes unused vertices from the given mesh. More...
 
void AbandonDuplicateWeights (CafuModelT::MeshT &Mesh)
 Makes sure that vertices that are geo-dups of each other refer to the same set of weights. More...
 
void RemoveUnusedWeights (CafuModelT::MeshT &Mesh)
 Removes unused weights from the given mesh (should be called after RemoveUnusedVertices()). More...
 
MaterialT CreateDefaultMaterial (const std::string &MatName, bool EditorSave=true) const
 Creates and returns a fail-safe wire-frame material with the given name, for use when a material with more detailed or more specific settings is not available. More...
 
- Protected Attributes inherited from ModelLoaderT
const std::string m_FileName
 
const int m_Flags
 

Detailed Description

This class imports a Doom3 (.md5) model file into a new Cafu model.

Constructor & Destructor Documentation

LoaderMd5T::LoaderMd5T ( const std::string &  FileName,
int  Flags = NONE 
)

The constructor for importing a Doom3 (.md5) model file into a new Cafu model.

Parameters
FileNameThe name of the .md5 file to import.
FlagsThe flags to load the model with. See ModelLoaderT::FlagsT for details. If FileName ends with "md5", it is assumed that the file has a white-space separated list of one md5mesh and arbitrarily many md5anim files. If FileName ends with "md5mesh", this file is loaded without any animation information (e.g. for static detail models).

Member Function Documentation

void LoaderMd5T::Load ( ArrayT< CafuModelT::JointT > &  Joints,
ArrayT< CafuModelT::MeshT > &  Meshes,
ArrayT< CafuModelT::AnimT > &  Anims,
MaterialManagerImplT MaterialMan 
)
virtual

Actually loads the file data into the appropriate parts of the Cafu model.

Implements ModelLoaderT.

void LoaderMd5T::Load ( ArrayT< CafuModelT::SkinT > &  Skins,
const MaterialManagerImplT MaterialMan 
)
inlinevirtual

Loads the skins of the Cafu model.

Implements ModelLoaderT.

void LoaderMd5T::Load ( ArrayT< CafuModelT::GuiFixtureT > &  GuiFixtures)
inlinevirtual

Loads the GUI fixtures of the Cafu model.

Implements ModelLoaderT.

void LoaderMd5T::Load ( ArrayT< CafuModelT::ChannelT > &  Channels)
inlinevirtual

Loads the animation channels (groups of joints) of the Cafu model.

Implements ModelLoaderT.

bool LoaderMd5T::Load ( unsigned int  Level,
CafuModelT *&  DlodModel,
float &  DlodDist 
)
inlinevirtual

Loads the dlod-model and dlod-distance at the given level.

Implements ModelLoaderT.


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