graphics
Class CModelDef
in ModelDef.h
in ModelDef.cpp
- class CModelDef
m_Bones
public CBoneState* m_Bones;
m_Name
private CStr m_Name;
m_NumBones
public u32 m_NumBones;
m_NumFaces
public u32 m_NumFaces;
m_NumPropPoints
public u32 m_NumPropPoints;
m_NumVertices
public u32 m_NumVertices;
m_pFaces
public SModelFace* m_pFaces;
m_PropPoints
public SPropPoint* m_PropPoints;
m_pVertices
public SModelVertex* m_pVertices;
m_RenderData
private CModelDef::RenderDataMap m_RenderData;
CModelDef
public CModelDef();
~CModelDef
public ~CModelDef();
FindPropPoint
public SPropPoint* FindPropPoint( const char* name ) const;
GetBones
public CBoneState* GetBones() const;
GetFaces
public SModelFace* GetFaces() const;
GetName
public const CStr& GetName() const;
GetNumBones
public size_t GetNumBones() const;
GetNumFaces
public size_t GetNumFaces() const;
GetNumPropPoints
public int GetNumPropPoints() const;
GetNumVertices
public size_t GetNumVertices() const;
GetPropPoints
public SPropPoint* GetPropPoints() const;
GetRenderData
public CModelDefRPrivate* GetRenderData( const void* key ) const;
GetVertices
public SModelVertex* GetVertices() const;
Load
public static CModelDef* Load( const char* filename, const char* name );
- Loads a PMD file.
- Parameters:
filename
- VFS path of .pmd file to load
name
- arbitrary name to give the model for debugging purposes
- Returns:
- the model - always non-NULL
- Throws:
PSERROR_File
- if it can't load the model
Save
public static void Save( const char* filename, const CModelDef* mdef );
SetRenderData
public void SetRenderData( const void* key, CModelDefRPrivate* data );
- Register renderer private data. Use the key to
distinguish between private data used by different render paths.
The private data will be managed by this CModelDef object:
It will be deleted when CModelDef is destructed or when private
data is registered using the same key.
- Parameters:
key
- The opaque key that is used to identify the caller.
The given private data can be retrieved by passing key to GetRenderData.
data
- The private data.
postconditions : data is bound to the lifetime of this CModelDef
object.
SkinNormal
public static CVector3D SkinNormal( const SModelVertex& vtx, const CMatrix3D newPoseMatrices[], const CMatrix3D inverseBindMatrices[] );
- Transform the given vertex's normal from the bind pose into the new pose.
- Returns:
- new world-space vertex normal
SkinPoint
public static CVector3D SkinPoint( const SModelVertex& vtx, const CMatrix3D newPoseMatrices[], const CMatrix3D inverseBindMatrices[] );
- =========================================================================
File : ModelDef.cpp
Project : 0 A.D.
Description : Defines a raw 3d model.
=========================================================================