"L. Spiro Engine"
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes

lse::CModelInstance Class Reference

The base class for model instances. More...

#include <LSEModelInstance.h>

Inheritance diagram for lse::CModelInstance:
lse::CActor lse::CEntity

List of all members.

Public Types

typedef CVectorPoD
< CMeshInstance *, LSUINT32 > 
CMeshList

Public Member Functions

LSBOOL LSE_CALL CreateModelFromFile (const LSCHAR *_pcPath, CStdAllocator *_psaAllocator=NULL)
LSVOID LSE_CALL Reset ()
virtual LSUINT32 LSE_CALL EntityType () const
virtual LSUINT32 LSE_CALL ModelType () const
LSE_INLINE const CAabb &LSE_CALL Aabb () const
CMeshInstance *LSE_CALL MeshByName (const LSCHAR *_pcName)
const CMeshInstance *LSE_CALL MeshByName (const LSCHAR *_pcName) const
LSE_INLINE CMeshList &LSE_CALL Meshes ()
LSE_INLINE const CMeshList
&LSE_CALL 
Meshes () const

Static Public Attributes

static CModelManager
< CSharedModelPtr > 
m_mmModelMan

Protected Member Functions

virtual CSharedModelPtr LSE_CALL GetModel (const LSCHAR *_pcPath) const
virtual CMeshInstance *LSE_CALL CreateMesh () const
virtual LSBOOL LSE_CALL LoadFinished ()
CMeshInstance *LSE_CALL MeshById (LSUINT64 _ui64Id)
virtual LSVOID LSE_CALL WorldDidChange () const

Protected Attributes

CSharedModelPtr m_smpModel
CMeshList m_mlMeshes
CAabb m_aAabb
CStdAllocator * m_psaAllocator
CAllocator m_aVecAllocator

Detailed Description

The base class for model instances.

Class CModelInstance Description: The base class for model instances.


Member Typedef Documentation

typedef CVectorPoD<CMeshInstance *, LSUINT32> lse::CModelInstance::CMeshList

List of meshes.


Member Function Documentation

LSE_INLINE const CAabb &LSE_CALL lse::CModelInstance::Aabb ( ) const

Gets the world AABB for this mesh.

Returns:
Returns the the world AABB for this mesh.
virtual CMeshInstance* LSE_CALL lse::CModelInstance::CreateMesh ( ) const [protected, virtual]

Creates a new mesh. Override to change the type of mesh it creates.

Returns:
Returns a new mesh.
LSBOOL LSE_CALL lse::CModelInstance::CreateModelFromFile ( const LSCHAR *  _pcPath,
CStdAllocator *  _psaAllocator = NULL 
)

Create a standard non-renderable model from a file.

Parameters:
_pcPathNULL-terminated path to the file to load.
_psaAllocatorAn optional allocator that will be used for all allocations made by this object.
Returns:
Returns false if the model fails to load. In debug mode, the error is printed to the debug console.
virtual LSUINT32 LSE_CALL lse::CModelInstance::EntityType ( ) const [virtual]

Get the entity type.

Returns:
Returns the type mask for this entity.

Reimplemented from lse::CActor.

virtual CSharedModelPtr LSE_CALL lse::CModelInstance::GetModel ( const LSCHAR *  _pcPath) const [protected, virtual]

Gets a shared pointer to a shared model. Override to change how the shared pointer is created.

Parameters:
_pcPathNULL-terminated path to the file to load.
Returns:
Returns a shared pointer to a model. If loading the model fails, an invalid pointer is returned.
virtual LSBOOL LSE_CALL lse::CModelInstance::LoadFinished ( ) [protected, virtual]

Called after a successful load. Override to change behavior.

Returns:
Returns false if any error occurred. The error should be printed to the debug console.
CMeshInstance* LSE_CALL lse::CModelInstance::MeshById ( LSUINT64  _ui64Id) [protected]

Get a mesh instance with the given unique ID.

Parameters:
_ui64IdUnique ID of the mesh instance to find.
Returns:
Returns the mesh with the given ID or NULL if none exists.
CMeshInstance* LSE_CALL lse::CModelInstance::MeshByName ( const LSCHAR *  _pcName)

Gets a mesh by name.

Parameters:
_pcNameName of the mesh to which to get a pointer.
Returns:
Returns a pointer to the mesh with the given name or NULL if no such mesh exists under this model.
const CMeshInstance* LSE_CALL lse::CModelInstance::MeshByName ( const LSCHAR *  _pcName) const

Gets a mesh by name.

Parameters:
_pcNameName of the mesh to which to get a pointer.
Returns:
Returns a pointer to the mesh with the given name or NULL if no such mesh exists under this model.
LSE_INLINE const CModelInstance::CMeshList &LSE_CALL lse::CModelInstance::Meshes ( ) const

Gets a reference to the array of meshes on this model.

Returns:
Returns a read-only array of meshes on this model.
LSE_INLINE CModelInstance::CMeshList &LSE_CALL lse::CModelInstance::Meshes ( )

Gets a reference to the array of meshes on this model.

Returns:
Returns a read/write array of meshes on this model.
virtual LSUINT32 LSE_CALL lse::CModelInstance::ModelType ( ) const [virtual]

Gets the model type.

Returns:
Returns the model type mask for this model.
LSVOID LSE_CALL lse::CModelInstance::Reset ( )

Resets this objects entirely to scratch.

virtual LSVOID LSE_CALL lse::CModelInstance::WorldDidChange ( ) const [protected, virtual]

Inform child classes that the world transform has changed.

Reimplemented from lse::CActor.


Member Data Documentation

CAabb lse::CModelInstance::m_aAabb [mutable, protected]

The axis-aligned bounding box for this model.

CAllocator lse::CModelInstance::m_aVecAllocator [protected]

Allocator for vectors.

Our array of meshes, one for each mesh in the source model.

CModelManager<CSharedModelPtr> lse::CModelInstance::m_mmModelMan [static]

The model manager used to avoid redundant loads.

CStdAllocator* lse::CModelInstance::m_psaAllocator [protected]

The allocator we use.

CSharedModelPtr lse::CModelInstance::m_smpModel [protected]

Shared pointer to the source model.


The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator