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

lsd::CMaterial Class Reference

Base class for materials found in models. More...

#include <LSDMaterial.h>

Inheritance diagram for lsd::CMaterial:
lsd::CLambertMaterial

List of all members.

Classes

struct  LSD_COLOR

Public Types

enum  LSD_MATERIAL_TYPE { LSD_MT_LAMBERT, LSD_MT_PHONG }
typedef struct
lsd::CMaterial::LSD_COLOR
LPLSD_COLOR
typedef struct
lsd::CMaterial::LSD_COLOR 
LPCLSD_COLOR

Public Member Functions

CMaterial &LSE_CALL operator= (const CMaterial &_mOther)
virtual CMaterial &LSE_CALL Copy (const CMaterial &_mOther)
virtual LSD_MATERIAL_TYPE LSE_CALL GetType () const =0
virtual LSSTD_ERRORS LSE_CALL LoadFromStream (const lsstd::IStream &_sStream, CAllocator *_paAllocator, LSUINT32 _ui32Version)=0
virtual LSVOID LSE_CALL SetAllocator (CAllocator *_paAllocator)
virtual LSVOID LSE_CALL Trash ()
LSE_INLINE const CString &LSE_CALL GetName () const
LSE_INLINE CVector4 LSE_CALL GetDiffuseColor () const
LSE_INLINE const CString &LSE_CALL GetDiffuseTexture () const
LSE_INLINE CVector4 LSE_CALL GetAmbientColor () const
LSE_INLINE CVector4 LSE_CALL GetEmissiveColor () const
LSE_INLINE CVector4 LSE_CALL GetTransparencyColor () const
LSE_INLINE const CString &LSE_CALL GetTransparencyTexture () const
LSE_INLINE const CString &LSE_CALL GetNormalTexture () const
LSE_INLINE const CString &LSE_CALL GetBumpTexture () const

Protected Attributes

CString m_sName
CString m_sNormalMap
LSD_COLOR m_cDiffuse
LSD_COLOR m_cAmbient
LSD_COLOR m_cEmissive
LSD_COLOR m_cBump
LSD_COLOR m_cTransparent
LSD_COLOR m_cDisplacement

Detailed Description

Base class for materials found in models.

Class CMaterial Description: Base class for materials found in models. Phong and Lambert derive from this.


Member Typedef Documentation

A color. A color is both an RGB value but may also contain a texture.


Member Enumeration Documentation

Material types.


Member Function Documentation

virtual CMaterial& LSE_CALL lsd::CMaterial::Copy ( const CMaterial _mOther) [virtual]

Copy this object from another.

Parameters:
_mOtherThe object to copy.
Returns:
Returns the copied object.
LSE_INLINE CVector4 LSE_CALL lsd::CMaterial::GetAmbientColor ( ) const

Get the ambient color for this material.

Returns:
Returns the ambient color for this material as a CVector4 type.
LSE_INLINE const CString &LSE_CALL lsd::CMaterial::GetBumpTexture ( ) const

Get the bump-map texture for this material.

Returns:
Returns the bump-map texture for this material.
LSE_INLINE CVector4 LSE_CALL lsd::CMaterial::GetDiffuseColor ( ) const

Get the diffuse color for this material.

Returns:
Returns the diffuse color for this material as a CVector4 type.
LSE_INLINE const CString &LSE_CALL lsd::CMaterial::GetDiffuseTexture ( ) const

Get the diffuse texture for this material.

Returns:
Returns the diffuse texture for this material.
LSE_INLINE CVector4 LSE_CALL lsd::CMaterial::GetEmissiveColor ( ) const

Get the emissive color for this material.

Returns:
Returns the emissive color for this material as a CVector4 type.
LSE_INLINE const CString &LSE_CALL lsd::CMaterial::GetName ( ) const

Get the name of this material.

Returns:
Returns a constant reference to the name of this material.
LSE_INLINE const CString &LSE_CALL lsd::CMaterial::GetNormalTexture ( ) const

Get the normal-map texture for this material.

Returns:
Returns the normal-map texture for this material.
LSE_INLINE CVector4 LSE_CALL lsd::CMaterial::GetTransparencyColor ( ) const

Get the transparency color for this material.

Returns:
Returns the transparency color for this material as a CVector4 type.
LSE_INLINE const CString &LSE_CALL lsd::CMaterial::GetTransparencyTexture ( ) const

Get the transparency texture for this material.

Returns:
Returns the transparency texture for this material.
virtual LSD_MATERIAL_TYPE LSE_CALL lsd::CMaterial::GetType ( ) const [pure virtual]

Get the material type.

Returns:
Returns the type of this material.

Implemented in lsd::CLambertMaterial.

virtual LSSTD_ERRORS LSE_CALL lsd::CMaterial::LoadFromStream ( const lsstd::IStream _sStream,
CAllocator *  _paAllocator,
LSUINT32  _ui32Version 
) [pure virtual]

Load material data from a stream.

Parameters:
_sStreamThe stream from which to load material data.
_paAllocatorThe allocator to use for all data allocated by this object.
_ui32VersionFile version.
Returns:
Returns an error code indicating the type of error or success.

Implemented in lsd::CLambertMaterial.

CMaterial& LSE_CALL lsd::CMaterial::operator= ( const CMaterial _mOther)

Copy operator.

Parameters:
_mOtherThe object to copy.
Returns:
Returns the copied object.
virtual LSVOID LSE_CALL lsd::CMaterial::SetAllocator ( CAllocator *  _paAllocator) [virtual]

Set the allocator for this object. Can be done only once.

Parameters:
_paAllocatorThe allocator to use for all data allocated by this object.
virtual LSVOID LSE_CALL lsd::CMaterial::Trash ( ) [virtual]

Trash all contents of this material.


Member Data Documentation

Ambient color.

Bump-map color.

Diffuse color.

Displacement color.

Emissive color.

Transparency color.

CString lsd::CMaterial::m_sName [protected]

Name.

CString lsd::CMaterial::m_sNormalMap [protected]

Normal map file.


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