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

lsd::CSharedModel Class Reference

Provides the shared model data that model instances use. More...

#include <LSDSharedModel.h>

Inheritance diagram for lsd::CSharedModel:
lsd::CDrawableSharedModel

List of all members.

Classes

struct  LSD_MODEL_IMAGE

Public Types

typedef struct
lsd::CSharedModel::LSD_MODEL_IMAGE
LPLSD_MODEL_IMAGE
typedef struct
lsd::CSharedModel::LSD_MODEL_IMAGE 
LPCLSD_MODEL_IMAGE

Public Member Functions

CSharedModel &LSE_CALL operator= (const CSharedModel &_smOther)
LSSTD_ERRORS LSE_CALL LoadFromFile (const LSCHAR *_pcFile)
virtual LSSTD_ERRORS LSE_CALL LoadFromStream (const lsstd::IStream &_sStream)
virtual LSVOID LSE_CALL Reset ()
LSE_INLINE LSUINT32 LSE_CALL TotalMeshes () const
LSE_INLINE const
CIntermediateMeshInstance
&LSE_CALL 
MeshByIndex (LSUINT32 _ui32Index) const
LSE_INLINE
CIntermediateMeshInstance
&LSE_CALL 
MeshByIndex (LSUINT32 _ui32Index)
const
CIntermediateMeshInstance
*LSE_CALL 
MeshById (LSUINT64 _ui64Id) const
LSE_INLINE const CAabb &LSE_CALL Aabb () const
LSE_INLINE const CSphere &LSE_CALL BoundingSphere () const

Protected Member Functions

LSSTD_ERRORS LSE_CALL LoadMaterials (const lsstd::IStream &_sStream)
LSSTD_ERRORS LSE_CALL LoadTextures (const lsstd::IStream &_sStream, LSUINT8 &_ui8TexturesLoaded)
LSSTD_ERRORS LSE_CALL LoadImages (const lsstd::IStream &_sStream)

Static Protected Member Functions

static LSBOOL LSE_CALL ReadString (const lsstd::IStream &_sStream, CString &_sRet)

Protected Attributes

CVectorPoD
< CIntermediateSharedMesh
*, LSUINT32 > 
m_vSharedMeshes
CVector
< CIntermediateMeshInstance,
LSUINT32 > 
m_vMeshInstances
CVectorPoD< CMaterial *, LSUINT32 > m_vMaterials
CVector< CModelTexturem_vTextures
CVector< LSD_MODEL_IMAGEm_vImages
CAabb m_aAabb
CSphere m_sBoundingSphere
CStdAllocator * m_psaAllocator
CAllocator m_aVecAllocator

Detailed Description

Provides the shared model data that model instances use.

Class CSharedModel Description: Provides the shared model data that model instances use. A model is composed of several sub- models. For example, bringing together a sub-model for the head, torsoa, legs, and arms will result in the final model object, represented by this class. This class only manages its sub-models, and has no vertex data in it. Additionally, this class has no rendering or animation capabilities. These are added by other classes through inheritance.


Member Typedef Documentation

Images.


Member Function Documentation

LSE_INLINE const CAabb &LSE_CALL lsd::CSharedModel::Aabb ( ) const

Gets the AABB for this instance, non-transformed.

Returns:
Returns the AABB for this instance.
LSE_INLINE const CSphere &LSE_CALL lsd::CSharedModel::BoundingSphere ( ) const

Gets the bounding sphere for this instance, non-transformed.

Returns:
Returns the bounding sphere for this instance.
LSSTD_ERRORS LSE_CALL lsd::CSharedModel::LoadFromFile ( const LSCHAR *  _pcFile)

Load a model master object (shared model) from a file. The path must be given in UTF-8 format.

Parameters:
_pcFilePath to the file to load.
Returns:
Returns an error code indicating the type of error or success.
virtual LSSTD_ERRORS LSE_CALL lsd::CSharedModel::LoadFromStream ( const lsstd::IStream _sStream) [virtual]

Load a model master object (shared model) from any stream type.

Parameters:
_sStreamThe stream from which to load the model data.
Returns:
Returns an error code indicating the type of error or success.

Reimplemented in lsd::CDrawableSharedModel.

LSSTD_ERRORS LSE_CALL lsd::CSharedModel::LoadImages ( const lsstd::IStream _sStream) [protected]

Load images from a stream.

Parameters:
_sStreamThe stream from which to load images.
Returns:
Returns an error code indicating the type of error or success.
LSSTD_ERRORS LSE_CALL lsd::CSharedModel::LoadMaterials ( const lsstd::IStream _sStream) [protected]

Load materials from a stream.

Parameters:
_sStreamThe stream from which to load materials.
Returns:
Returns an error code indicating the type of error or success.
LSSTD_ERRORS LSE_CALL lsd::CSharedModel::LoadTextures ( const lsstd::IStream _sStream,
LSUINT8 &  _ui8TexturesLoaded 
) [protected]

Load textures from a stream.

Parameters:
_sStreamThe stream from which to load textures.
_ui8TexturesLoadedReturned by the function. Indicates whether or not texture data was loaded. If false, textures need to be loaded from disk.
Returns:
Returns an error code indicating the type of error or success.
const CIntermediateMeshInstance* LSE_CALL lsd::CSharedModel::MeshById ( LSUINT64  _ui64Id) const

Gets a mesh by its unique ID. If no mesh has the given ID, NULL is returned.

Parameters:
_ui64IdID of the mesh to find.
Returns:
Returns a mesh by its unique ID. If no mesh has the given ID, NULL is returned.
LSE_INLINE CIntermediateMeshInstance &LSE_CALL lsd::CSharedModel::MeshByIndex ( LSUINT32  _ui32Index)

Gets a mesh by index. The index must be below TotalMeshes().

Parameters:
_ui32IndexIndex of the mesh to be returned.
Returns:
Returns a constant reference to the requested mesh by index.
LSE_INLINE const CIntermediateMeshInstance &LSE_CALL lsd::CSharedModel::MeshByIndex ( LSUINT32  _ui32Index) const

Gets a mesh by index. The index must be below TotalMeshes().

Parameters:
_ui32IndexIndex of the mesh to be returned.
Returns:
Returns a constant reference to the requested mesh by index.
CSharedModel& LSE_CALL lsd::CSharedModel::operator= ( const CSharedModel _smOther)

Assignment operator. Copies the given object into this one.

Parameters:
_smOtherThe object to copy.
Returns:
Returns this object after the copy.
static LSBOOL LSE_CALL lsd::CSharedModel::ReadString ( const lsstd::IStream _sStream,
CString &  _sRet 
) [static, protected]

Read a string from a stream.

Parameters:
_sStreamThe stream from which to read a string.
_sRetThe returned string.
Returns:
Returns true if there was enough memory to complete the operation.
virtual LSVOID LSE_CALL lsd::CSharedModel::Reset ( ) [virtual]

Reset the model to scratch.

Reimplemented in lsd::CDrawableSharedModel.

LSE_INLINE LSUINT32 LSE_CALL lsd::CSharedModel::TotalMeshes ( ) const

Gets the number of meshes on this model.

Returns:
Returns the number of meshes on this model.

Member Data Documentation

CAabb lsd::CSharedModel::m_aAabb [protected]

The non-transformed AABB for this model.

CAllocator lsd::CSharedModel::m_aVecAllocator [protected]

Allocator for vectors. It uses m_psaAllocator.

CStdAllocator* lsd::CSharedModel::m_psaAllocator [protected]

Allocator to use for all allocations made by this object.

Our bounding sphere.

Array of images.

CVectorPoD<CMaterial *, LSUINT32> lsd::CSharedModel::m_vMaterials [protected]

Array of materials.

Array of mesh instances.

CVectorPoD<CIntermediateSharedMesh *, LSUINT32> lsd::CSharedModel::m_vSharedMeshes [protected]

Array of shared mesh data.

Array of textures.


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