Cafu Engine
CafuModelT Class Reference

This class represents a native Cafu model. More...

#include "Model_cmdl.hpp"

Classes

struct  AnimT
 This struct describes one animation sequence, e.g. "run", "walk", "jump", etc. More...
 
struct  ChannelT
 Channels allow animations to play only on a subset of the joints, so that multiple animations can play on different parts of the model at the same time. More...
 
struct  GuiFixtureT
 This struct defines how and where a GUI can be fixed to the model. More...
 
struct  JointT
 This struct represents a joint in the skeleton / a node in the hierarchy of the model. More...
 
struct  MeshT
 This struct defines a triangle mesh in the model. More...
 
struct  SkinT
 This struct describes additional/alternative skins for the meshes of this model. More...
 

Public Member Functions

 CafuModelT (ModelLoaderT &Loader)
 The constructor. More...
 
 ~CafuModelT ()
 The destructor. More...
 
void Import (AnimImporterT &Importer)
 Imports animations into this model using the given AnimImporterT. More...
 
void Save (std::ostream &OutStream) const
 Saves the model into the given stream. More...
 
const std::string & GetFileName () const
 
const MaterialManagerImplTGetMaterialManager () const
 
const ArrayT< JointT > & GetJoints () const
 
const ArrayT< MeshT > & GetMeshes () const
 
const ArrayT< SkinT > & GetSkins () const
 
const ArrayT< GuiFixtureT > & GetGuiFixtures () const
 
const ArrayT< AnimT > & GetAnims () const
 
const ArrayT< ChannelT > & GetChannels () const
 
const CafuModelTGetDlodModel () const
 
float GetDlodDist () const
 
const MaterialTGetMaterial (unsigned long MeshNr, int SkinNr) const
 Returns the proper material for the given mesh in the given skin. More...
 
MatSys::RenderMaterialTGetRenderMaterial (unsigned long MeshNr, int SkinNr) const
 Returns the proper render material for the given mesh in the given skin. More...
 
bool IsMeshNrOK (const GuiFixtureT &GF, unsigned int PointNr) const
 Determines if GF.Points[PointNr].MeshNr is a valid index into this model. More...
 
bool IsVertexNrOK (const GuiFixtureT &GF, unsigned int PointNr) const
 Determines if GF.Points[PointNr].VertexNr is a valid index into this model. More...
 
AnimExprPoolTGetAnimExprPool () const
 This method returns the pool of anim expressions for this model. More...
 
AnimPoseTGetSharedPose (IntrusivePtrT< AnimExpressionT > AE) const
 This method is strictly for backwards-compatibility only, do not use in new code! More...
 
void Print () const
 Prints some model data to stdout, used for debugging. More...
 

Static Public Attributes

static const unsigned int CMDL_FILE_VERSION =1
 The current version of the cmdl file format. More...
 

Friends

class ModelEditor::CommandAddT
 
class ModelEditor::CommandDeleteT
 
class ModelEditor::CommandRenameT
 
class ModelEditor::CommandSetAnimFPST
 
class ModelEditor::CommandSetAnimNextT
 
class ModelEditor::CommandSetMaterialT
 
class ModelEditor::CommandSetMeshTSMethodT
 
class ModelEditor::CommandSetMeshShadowsT
 
class ModelEditor::CommandTransformJointT
 
class ModelEditor::CommandUpdateAnimT
 
class ModelEditor::CommandUpdateChannelT
 
class ModelEditor::CommandUpdateGuiFixtureT
 
class ModelEditor::CommandUpdateTriangleT
 
class ModelEditor::CommandUpdateUVCoordsT
 

Detailed Description

This class represents a native Cafu model.

Constructor & Destructor Documentation

CafuModelT::CafuModelT ( ModelLoaderT Loader)

The constructor.

Creates a new Cafu model from a file as directed by the given model loader.

Parameters
LoaderThe model loader that actually imports the file and fills in the model data.
CafuModelT::~CafuModelT ( )

The destructor.

Member Function Documentation

AnimExprPoolT& CafuModelT::GetAnimExprPool ( ) const
inline

This method returns the pool of anim expressions for this model.

const MaterialT * CafuModelT::GetMaterial ( unsigned long  MeshNr,
int  SkinNr 
) const

Returns the proper material for the given mesh in the given skin.

MatSys::RenderMaterialT * CafuModelT::GetRenderMaterial ( unsigned long  MeshNr,
int  SkinNr 
) const

Returns the proper render material for the given mesh in the given skin.

AnimPoseT * CafuModelT::GetSharedPose ( IntrusivePtrT< AnimExpressionT AE) const

This method is strictly for backwards-compatibility only, do not use in new code!

void CafuModelT::Import ( AnimImporterT Importer)

Imports animations into this model using the given AnimImporterT.

At this time, this method is actually unused, because in the Model Editor, the related command is a friend and thus accesses the m_Anims member directly.

bool CafuModelT::IsMeshNrOK ( const GuiFixtureT GF,
unsigned int  PointNr 
) const

Determines if GF.Points[PointNr].MeshNr is a valid index into this model.

bool CafuModelT::IsVertexNrOK ( const GuiFixtureT GF,
unsigned int  PointNr 
) const

Determines if GF.Points[PointNr].VertexNr is a valid index into this model.

void CafuModelT::Print ( ) const

Prints some model data to stdout, used for debugging.

void CafuModelT::Save ( std::ostream &  OutStream) const

Saves the model into the given stream.

Member Data Documentation

const unsigned int CafuModelT::CMDL_FILE_VERSION =1
static

The current version of the cmdl file format.


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