The base class for importing arbitrary model files into Cafu models. More...
#include "Loader.hpp"
Classes | |
class | LoadErrorT |
A class that is thrown on model load errors. More... | |
class | UserCallbacksI |
An interface for user callbacks. More... | |
Public Types | |
enum | FlagsT { NONE =0x00, REMOVE_DEGEN_TRIANGLES =0x01, REMOVE_UNUSED_VERTICES =0x02, REMOVE_UNUSED_WEIGHTS =0x04 } |
Public Member Functions | |
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 | Load (ArrayT< CafuModelT::JointT > &Joints, ArrayT< CafuModelT::MeshT > &Meshes, ArrayT< CafuModelT::AnimT > &Anims, MaterialManagerImplT &MaterialMan)=0 |
Actually loads the file data into the appropriate parts of the Cafu model. More... | |
virtual void | Load (ArrayT< CafuModelT::SkinT > &Skins, const MaterialManagerImplT &MaterialMan)=0 |
Loads the skins of the Cafu model. More... | |
virtual void | Load (ArrayT< CafuModelT::GuiFixtureT > &GuiFixtures)=0 |
Loads the GUI fixtures of the Cafu model. More... | |
virtual void | Load (ArrayT< CafuModelT::ChannelT > &Channels)=0 |
Loads the animation channels (groups of joints) of the Cafu model. More... | |
virtual bool | Load (unsigned int Level, CafuModelT *&DlodModel, float &DlodDist)=0 |
Loads the dlod-model and dlod-distance at the given level. More... | |
virtual void | Postprocess (ArrayT< CafuModelT::MeshT > &Meshes) |
Postprocesses the file data according to flags given to the constructor. More... | |
Protected Member Functions | |
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 | |
const std::string | m_FileName |
const int | m_Flags |
The base class for importing arbitrary model files into Cafu models.
The concrete derived classes determine which specific file format is imported.
ModelLoaderT::ModelLoaderT | ( | const std::string & | FileName, |
int | Flags | ||
) |
The constructor.
|
inlinevirtual |
The virtual destructor.
|
protected |
Makes sure that vertices that are geo-dups of each other refer to the same set of weights.
|
protected |
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.
|
inlinevirtual |
Returns the file name of the imported model.
This method is reimplemented in the LoaderDlodT
class.
Reimplemented in LoaderDlodT.
|
pure virtual |
Actually loads the file data into the appropriate parts of the Cafu model.
Implemented in LoaderDummyT, LoaderHL1mdlT, LoaderHL2mdlT, LoaderCafuT, LoaderDlodT, LoaderFbxT, LoaderAseT, LoaderMdlT, LoaderMd5T, and LoaderLwoT.
|
pure virtual |
Loads the skins of the Cafu model.
Implemented in LoaderDummyT, LoaderHL1mdlT, LoaderHL2mdlT, LoaderCafuT, LoaderDlodT, LoaderFbxT, LoaderAseT, LoaderMdlT, LoaderMd5T, and LoaderLwoT.
|
pure virtual |
Loads the GUI fixtures of the Cafu model.
Implemented in LoaderDummyT, LoaderHL1mdlT, LoaderHL2mdlT, LoaderCafuT, LoaderDlodT, LoaderFbxT, LoaderAseT, LoaderMdlT, LoaderMd5T, and LoaderLwoT.
|
pure virtual |
Loads the animation channels (groups of joints) of the Cafu model.
Implemented in LoaderDummyT, LoaderHL1mdlT, LoaderHL2mdlT, LoaderCafuT, LoaderDlodT, LoaderFbxT, LoaderAseT, LoaderMdlT, LoaderMd5T, and LoaderLwoT.
|
pure virtual |
Loads the dlod-model and dlod-distance at the given level.
Implemented in LoaderDummyT, LoaderHL1mdlT, LoaderHL2mdlT, LoaderCafuT, LoaderDlodT, LoaderFbxT, LoaderAseT, LoaderMdlT, LoaderMd5T, and LoaderLwoT.
|
virtual |
Postprocesses the file data according to flags given to the constructor.
Reimplemented in LoaderMdlT.
|
protected |
Removes triangles with zero-length edges from the given mesh.
This is especially important because such triangles "connect" two vertices that the CafuModelT code considers as "geometrical duplicates" of each other. That is, a single triangle refers to the same vertex coordinate twice, which triggers related assertions in debug builds.
|
protected |
Removes unused vertices from the given mesh.
|
protected |
Removes unused weights from the given mesh (should be called after RemoveUnusedVertices()).