Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

CMaterial Class Reference

Material class. More...

#include <Material.h>

Inheritance diagram for CMaterial:

CXMLResource CResource CEntity COpenGLMaterial List of all members.

Public Member Functions

virtual int LoadXML (TiXmlNode *pDataNode, CString strFilename)
virtual int SaveXML (TiXmlNode *pDataNode, CString strFilename)
virtual void Bind ()=0
tRGBA & GetAmbient ()
tRGBA & GetDiffuse ()
tRGBA & GetEmissive ()
tRGBA & GetSpecular ()
float & GetShininess ()
void SetAmbient (tRGBA ambient)
void SetDiffuse (tRGBA diffuse)
void SetEmissive (tRGBA emissive)
void SetSpecular (tRGBA specular)
void SetShininess (float fShininess)
virtual void Destroy ()
virtual bool IsOfType (eEntityType eType)

Protected Attributes

tRGBA m_Ambient
tRGBA m_Diffuse
tRGBA m_Emissive
tRGBA m_Specular
float m_fShininess

Detailed Description

Material class.

This class provides means for 4 different material colors as well as loading/saving it in XML.

Definition at line 13 of file Material.h.


Member Function Documentation

void CMaterial::Bind  )  [pure virtual]
 

Method details: Binds this material as current one

Implemented in COpenGLMaterial.

Definition at line 185 of file Material.cpp.

void CMaterial::Destroy  )  [virtual]
 

Method details: Clean-up

Reimplemented from CXMLResource.

Reimplemented in COpenGLMaterial.

Definition at line 190 of file Material.cpp.

tRGBA & CMaterial::GetAmbient  ) 
 

Method details:

Returns:
Const. Reference to the Ambient color structure
Definition at line 160 of file Material.cpp.

References m_Ambient.

Referenced by CGUIElement::Draw(), CBitmapFont::Draw(), and CGUIElement::GetProperties().

tRGBA & CMaterial::GetDiffuse  ) 
 

Method details:

Returns:
Const. Reference to the Diffuse color structure
Definition at line 165 of file Material.cpp.

References m_Diffuse.

Referenced by CGUIElement::GetProperties().

tRGBA & CMaterial::GetEmissive  ) 
 

Method details:

Returns:
Const. Reference to the Emissive color structure
Definition at line 175 of file Material.cpp.

References m_Emissive.

Referenced by CGUIElement::GetProperties().

float & CMaterial::GetShininess  ) 
 

Method details:

Returns:
Const. Reference to the amount of shininess
Definition at line 180 of file Material.cpp.

References m_fShininess.

Referenced by CGUIElement::GetProperties().

tRGBA & CMaterial::GetSpecular  ) 
 

Method details:

Returns:
Const. Reference to the Specular color structure
Definition at line 170 of file Material.cpp.

References m_Specular.

Referenced by CGUIElement::GetProperties().

bool CMaterial::IsOfType eEntityType  eType  )  [virtual]
 

Method details: This is an implementation of Custom RTTI

Reimplemented from CXMLResource.

Reimplemented in COpenGLMaterial.

Definition at line 195 of file Material.cpp.

References CXMLResource::IsOfType().

int CMaterial::LoadXML TiXmlNode pDataNode,
CString  strFilename
[virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that holds data for the material
strFilename - String containing filename where the data for the material is stored

Reimplemented from CXMLResource.

Reimplemented in COpenGLMaterial.

Definition at line 16 of file Material.cpp.

References TiXmlElement::Attribute(), CXMLResource::LoadXML(), TiXmlNode::pcValue(), SetAmbient(), SetDiffuse(), SetEmissive(), SetShininess(), and SetSpecular().

Referenced by CMaterialManager::LoadResource(), and COpenGLMaterial::LoadXML().

int CMaterial::SaveXML TiXmlNode pDataNode,
CString  strFilename
[virtual]
 

Method details:

Parameters:
pDataNode - Pointer to XML Node that will be the parent hold the data for this material
strFilename - String containing filename where the data for the material is stored

Reimplemented from CXMLResource.

Reimplemented in COpenGLMaterial.

Definition at line 79 of file Material.cpp.

References CEntity::GetName(), TiXmlNode::InsertEndChild(), m_Ambient, m_Diffuse, m_Emissive, m_fShininess, m_Specular, TiXmlDocument::SaveFile(), TiXmlElement::SetAttribute(), and TiXmlNode::ToElement().

Referenced by COpenGLMaterial::SaveXML(), and CMaterialManager::SaveXML().

void CMaterial::SetAmbient tRGBA  ambient  ) 
 

Method details:

Parameters:
ambient - RGBA for the ambient component
Definition at line 135 of file Material.cpp.

References m_Ambient.

Referenced by LoadXML().

void CMaterial::SetDiffuse tRGBA  diffuse  ) 
 

Method details:

Parameters:
diffuse - RGBA for the diffuse component
Definition at line 140 of file Material.cpp.

References m_Diffuse.

Referenced by LoadXML().

void CMaterial::SetEmissive tRGBA  emissive  ) 
 

Method details:

Parameters:
emissive - RGBA for the emissive component
Definition at line 145 of file Material.cpp.

References m_Emissive.

Referenced by LoadXML().

void CMaterial::SetShininess float  fShininess  ) 
 

Method details:

Parameters:
fShininess - amount of shininess
Definition at line 155 of file Material.cpp.

References m_fShininess.

Referenced by LoadXML().

void CMaterial::SetSpecular tRGBA  specular  ) 
 

Method details:

Parameters:
specular - RGBA for the specular component
Definition at line 150 of file Material.cpp.

References m_Specular.

Referenced by LoadXML().


Member Data Documentation

tRGBA CMaterial::m_Ambient [protected]
 

Ambient component Definition at line 104 of file Material.h.

Referenced by GetAmbient(), SaveXML(), and SetAmbient().

tRGBA CMaterial::m_Diffuse [protected]
 

Diffuse component Definition at line 104 of file Material.h.

Referenced by GetDiffuse(), SaveXML(), and SetDiffuse().

tRGBA CMaterial::m_Emissive [protected]
 

Emissive component Definition at line 104 of file Material.h.

Referenced by GetEmissive(), SaveXML(), and SetEmissive().

float CMaterial::m_fShininess [protected]
 

Shininess component Definition at line 109 of file Material.h.

Referenced by GetShininess(), SaveXML(), and SetShininess().

tRGBA CMaterial::m_Specular [protected]
 

Specular component Definition at line 104 of file Material.h.

Referenced by GetSpecular(), SaveXML(), and SetSpecular().


The documentation for this class was generated from the following files:
Generated on Sun Jul 17 21:34:30 2005 for OpenGL GUI by doxygen 1.3.8