Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD

graphics
Class CModel

CRenderableObject, boost::noncopyable
   |
   +--CModel

   in Model.h
   in Model.cpp

class CModel
extends CRenderableObject, boost::noncopyable


Inner Classes, Typedefs, and Enums
struct CModel::Prop
          
 
Field Summary
private CSkeletonAnim* m_Anim
          
private float m_AnimSpeed
          
private float m_AnimTime
          
private CMatrix3D* m_BoneMatrices
          
private u32 m_Flags
          
private CMatrix3D* m_InverseBindBoneMatrices
          
private CMaterial m_Material
          
private CSkeletonAnim* m_NextAnim
          
private CBound m_ObjectBounds
          
private CModel* m_Parent
          If non-null, m_Parent points to the model that we are attached to.
private CModelDefPtr m_pModelDef
          
private bool m_PositionValid
          true if both transform and and bone matrices are valid.
private std::vector< CModel::Prop > m_Props
          
private CColor m_ShadingColor
          
private CSkeletonAnimManager& m_SkeletonAnimManager
          
private CTexture m_Texture
          
   
Fields inherited from class CRenderableObject
m_Bounds, m_Transform, m_InvTransform, m_RenderData
 
Constructor Summary
CModel( CSkeletonAnimManager& skeletonAnimManager )
          Destructor
~CModel()
          ReleaseData: delete anything allocated by the model
 
Method Summary
 void AddProp( SPropPoint* point, CModel* model, CObjectEntry* objectentry )
          RemoveProp: remove a prop from the given point
 CSkeletonAnim* BuildAnimation( const char* filename, const char* name, float speed, double actionpos, double actionpos2 )
          Update: update this model by the given time, in seconds
 void CalcAnimatedObjectBound( CSkeletonAnimDef* anim, CBound& result )
          BuildAnimation: load raw animation frame animation from given file, and build a animation specific to this model
 void CalcBounds()
          CalcObjectBounds: calculate object space bounds of this model, based solely on vertex positions
 void CalcObjectBounds()
          CalcAnimatedObjectBound: calculate bounds encompassing all vertex positions for given animation
 CModel* Clone() const
          SetTransform: set the transform on this object, and reorientate props accordingly
 void CopyAnimationFrom( CModel* source )
          AddProp: add a prop to the model on the given point
 const CMatrix3D* GetAnimatedBoneMatrices()
          
 CSkeletonAnim* GetAnimation() const
          
 u32 GetFlags() const
          
 const CMatrix3D* GetInverseBindBoneMatrices()
          
 CMaterial& GetMaterial()
          
 CModelDefPtr GetModelDef()
          
 const std::vector< CModel::Prop >& GetProps() const
          
 CColor GetShadingColor()
          
 CTexture* GetTexture()
          
 bool InitModel( CModelDefPtr modeldef )
          CalcBound: calculate the world space bounds of this model
private void InvalidatePosition()
          ValidatePosition: ensure that current transform and bone matrices are both uptodate
 bool IsSkinned()
          Return whether this is a skinned/skeletal model.
 bool NeedsNewAnim( float time ) const
          InvalidatePosition
private void ReleaseData()
          InitModel: setup model from given geometry
 void RemoveProp( SPropPoint* point )
          Clone: return a clone of this model
 bool SetAnimation( CSkeletonAnim* anim, bool once = false, float speed = 1000. 0f, CSkeletonAnim* next = NULL )
          CopyAnimation
 void SetDirtyRec( u32 dirtyflags )
          
 void SetFlags( u32 flags )
          
 void SetMaterial( const CMaterial& material )
          
 void SetPlayerColor( CColor& colour )
          
 void SetPlayerID( int id )
          
 void SetShadingColor( CColor& colour )
          
 void SetTexture( const CTexture& tex )
          
 void SetTransform( const CMatrix3D& transform )
          Set transform of this object.
 void Update( float time )
          
 void ValidatePosition()
          SetAnimation: set the given animation as the current animation on this model; return false on error, else true
   
Methods inherited from class CRenderableObject
SetTransform, GetTransform, GetInvTransform, SetDirty, CalcBounds, GetBounds, InvalidateBounds, SetRenderData, GetRenderData
 

Field Detail

m_Anim

private CSkeletonAnim* m_Anim;

m_AnimSpeed

private float m_AnimSpeed;

m_AnimTime

private float m_AnimTime;

m_BoneMatrices

private CMatrix3D* m_BoneMatrices;

m_Flags

private u32 m_Flags;

m_InverseBindBoneMatrices

private CMatrix3D* m_InverseBindBoneMatrices;

m_Material

private CMaterial m_Material;

m_NextAnim

private CSkeletonAnim* m_NextAnim;

m_ObjectBounds

private CBound m_ObjectBounds;

m_Parent

private CModel* m_Parent;
If non-null, m_Parent points to the model that we are attached to.

m_pModelDef

private CModelDefPtr m_pModelDef;

m_PositionValid

private bool m_PositionValid;
true if both transform and and bone matrices are valid.

m_Props

private std::vector< CModel::Prop > m_Props;

m_ShadingColor

private CColor m_ShadingColor;

m_SkeletonAnimManager

private CSkeletonAnimManager& m_SkeletonAnimManager;

m_Texture

private CTexture m_Texture;


Constructor Detail

CModel

public CModel( CSkeletonAnimManager& skeletonAnimManager );
Destructor

~CModel

public ~CModel();
ReleaseData: delete anything allocated by the model


Method Detail

AddProp

public void AddProp( SPropPoint* point, CModel* model, CObjectEntry* objectentry );
RemoveProp: remove a prop from the given point

BuildAnimation

public CSkeletonAnim* BuildAnimation( const char* filename, const char* name, float speed, double actionpos, double actionpos2 );
Update: update this model by the given time, in seconds

CalcAnimatedObjectBound

public void CalcAnimatedObjectBound( CSkeletonAnimDef* anim, CBound& result );
BuildAnimation: load raw animation frame animation from given file, and build a animation specific to this model

CalcBounds

public void CalcBounds();
CalcObjectBounds: calculate object space bounds of this model, based solely on vertex positions

CalcObjectBounds

public void CalcObjectBounds();
CalcAnimatedObjectBound: calculate bounds encompassing all vertex positions for given animation

Clone

public CModel* Clone() const;
SetTransform: set the transform on this object, and reorientate props accordingly

CopyAnimationFrom

public void CopyAnimationFrom( CModel* source );
AddProp: add a prop to the model on the given point

GetAnimatedBoneMatrices

public const CMatrix3D* GetAnimatedBoneMatrices();

GetAnimation

public CSkeletonAnim* GetAnimation() const;

GetFlags

public u32 GetFlags() const;

GetInverseBindBoneMatrices

public const CMatrix3D* GetInverseBindBoneMatrices();

GetMaterial

public CMaterial& GetMaterial();

GetModelDef

public CModelDefPtr GetModelDef();

GetProps

public const std::vector< CModel::Prop >& GetProps() const;

GetShadingColor

public CColor GetShadingColor();

GetTexture

public CTexture* GetTexture();

InitModel

public bool InitModel( CModelDefPtr modeldef );
CalcBound: calculate the world space bounds of this model

InvalidatePosition

private void InvalidatePosition();
ValidatePosition: ensure that current transform and bone matrices are both uptodate

IsSkinned

public bool IsSkinned();
Return whether this is a skinned/skeletal model. If it is, Get*BoneMatrices() will return valid non-NULL arrays.

NeedsNewAnim

public bool NeedsNewAnim( float time ) const;
InvalidatePosition

ReleaseData

private void ReleaseData();
InitModel: setup model from given geometry

RemoveProp

public void RemoveProp( SPropPoint* point );
Clone: return a clone of this model

SetAnimation

public bool SetAnimation( CSkeletonAnim* anim, bool once = false, float speed = 1000. 0f, CSkeletonAnim* next = NULL );
CopyAnimation

SetDirtyRec

public void SetDirtyRec( u32 dirtyflags );

SetFlags

public void SetFlags( u32 flags );

SetMaterial

public void SetMaterial( const CMaterial& material );

SetPlayerColor

public void SetPlayerColor( CColor& colour );

SetPlayerID

public void SetPlayerID( int id );

SetShadingColor

public void SetShadingColor( CColor& colour );

SetTexture

public void SetTexture( const CTexture& tex );

SetTransform

public void SetTransform( const CMatrix3D& transform );
Set transform of this object.

Update

public void Update( float time );

ValidatePosition

public void ValidatePosition();
SetAnimation: set the given animation as the current animation on this model; return false on error, else true

 Overview   Project   Class   Tree   Deprecated   Index 
0 A.D.
Generated on September 04, 2007 at 18:13
CppDoc v2.4.0
FRAMES    NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD