CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csMaterial Class Reference

A material class. More...

#include <material.h>

Inheritance diagram for csMaterial:

iMaterial iShaderBranch iBase List of all members.

Public Methods

 csMaterial (csEngine *engine)
 create an empty material. More...

 csMaterial (csEngine *engine, iTextureWrapper *txt)
 create a material with only the texture given. More...

virtual ~csMaterial ()
 destroy material. More...

csRGBcolorGetFlatColor ()
 Get the flat shading color. More...

float GetDiffuse ()
 Get diffuse reflection constant for the material. More...

void SetDiffuse (float val)
 Set diffuse reflection constant for the material. More...

float GetAmbient ()
 Get ambient lighting for the material. More...

void SetAmbient (float val)
 Set ambient lighting for the material. More...

float GetReflection ()
 Get reflection of the material. More...

void SetReflection (float val)
 Set reflection of the material. More...

iTextureWrapperGetTextureWrapper () const
 Get the base diffuse texture (if none 0 is returned). More...

void SetTextureWrapper (iTextureWrapper *tex)
 Set the base diffuse texture (pass 0 to set no texture). More...

void AddTextureLayer (iTextureWrapper *txtwrap, uint mode, float uscale, float vscale, float ushift, float vshift)
 Add a texture layer (currently only one supported). More...

iTextureWrapperGetTextureWrapper (csStringID name)
 Get a texture (if none 0 is returned). More...

virtual void SetShader (csStringID type, iShaderWrapper *shader)
 Associate a shader with a shader type. More...

virtual iShaderWrapperGetShader (csStringID type)
 Get shader associated with a shader type. More...

virtual void AddChild (iShaderBranch *c)
 Add a child to this branch. More...

virtual void AddVariable (csShaderVariable *v)
 Add a variable to this context. More...

virtual csShaderVariableGetVariable (csStringID name)
 Get variable. More...

virtual csSymbolTableGetSymbolTable ()
 Get the symbol table (used by the implementation to store the variables). More...

virtual csSymbolTableGetSymbolTable (int i)
 Get a symbol table from the array of symbol tables. More...

virtual void SelectSymbolTable (int i)
 Select the current symbol table from the array of symbol tables. More...

virtual void SetEffect (iEffectDefinition *ed)
 Set effect. More...

virtual iEffectDefinitionGetEffect ()
 Get effect. More...

virtual iTextureHandleGetTexture ()
 Get texture. More...

virtual iTextureHandleGetTexture (csStringID name)
 Get a texture from the material. More...

virtual int GetTextureLayerCount ()
 Get num texture layers. More...

virtual csTextureLayerGetTextureLayer (int idx)
 Get a texture layer. More...

virtual void GetFlatColor (csRGBpixel &oColor, bool useTextureMean=true)
 Get flat color. More...

virtual void SetFlatColor (const csRGBcolor &col)
 Set the flat shading color. More...

virtual void GetReflection (float &oDiffuse, float &oAmbient, float &oReflection)
 Get reflection values (diffuse, ambient, reflection). More...

virtual void SetReflection (float oDiffuse, float oAmbient, float oReflection)
 Set reflection values (diffuse, ambient, reflection). More...

void Visit ()
 Visit all textures. More...


Public Attributes

csMaterial::MaterialEngine scfiMaterialEngine
 iMaterialEngine implementation. More...


Friends

class csEngine

Detailed Description

A material class.

Definition at line 78 of file csengine/material.h.


Constructor & Destructor Documentation

csMaterial::csMaterial csEngine   engine
 

create an empty material.

csMaterial::csMaterial csEngine   engine,
iTextureWrapper   txt
 

create a material with only the texture given.

virtual csMaterial::~csMaterial   [virtual]
 

destroy material.


Member Function Documentation

virtual void csMaterial::AddChild iShaderBranch   c [inline, virtual]
 

Add a child to this branch.

Implements iShaderBranch.

Definition at line 191 of file csengine/material.h.

References csSymbolTable::AddChild, iShaderBranch::GetSymbolTable, and SCF_QUERY_INTERFACE.

void csMaterial::AddTextureLayer iTextureWrapper   txtwrap,
uint    mode,
float    uscale,
float    vscale,
float    ushift,
float    vshift
 

Add a texture layer (currently only one supported).

virtual void csMaterial::AddVariable csShaderVariable   v [inline, virtual]
 

Add a variable to this context.

Implements iShaderBranch.

Definition at line 197 of file csengine/material.h.

References csShaderVariable::GetName, and csSymbolTable::SetSymbol.

float csMaterial::GetAmbient  
 

Get ambient lighting for the material.

float csMaterial::GetDiffuse  
 

Get diffuse reflection constant for the material.

virtual iEffectDefinition* csMaterial::GetEffect   [virtual]
 

Get effect.

Implements iMaterial.

virtual void csMaterial::GetFlatColor csRGBpixel   oColor,
bool    useTextureMean = true
[virtual]
 

Get flat color.

Implements iMaterial.

csRGBcolor& csMaterial::GetFlatColor  
 

Get the flat shading color.

virtual void csMaterial::GetReflection float &    oDiffuse,
float &    oAmbient,
float &    oReflection
[virtual]
 

Get reflection values (diffuse, ambient, reflection).

Implements iMaterial.

float csMaterial::GetReflection  
 

Get reflection of the material.

virtual iShaderWrapper* csMaterial::GetShader csStringID    type [virtual]
 

Get shader associated with a shader type.

Implements iMaterial.

virtual csSymbolTable* csMaterial::GetSymbolTable int    i [inline, virtual]
 

Get a symbol table from the array of symbol tables.

If there is only one symbol table, return that one.

Implements iShaderBranch.

Definition at line 206 of file csengine/material.h.

virtual csSymbolTable* csMaterial::GetSymbolTable   [inline, virtual]
 

Get the symbol table (used by the implementation to store the variables).

Implements iShaderBranch.

Definition at line 205 of file csengine/material.h.

virtual iTextureHandle* csMaterial::GetTexture csStringID    name [virtual]
 

Get a texture from the material.

Implements iMaterial.

virtual iTextureHandle* csMaterial::GetTexture   [virtual]
 

Get texture.

Implements iMaterial.

virtual csTextureLayer* csMaterial::GetTextureLayer int    idx [virtual]
 

Get a texture layer.

Implements iMaterial.

virtual int csMaterial::GetTextureLayerCount   [virtual]
 

Get num texture layers.

Implements iMaterial.

iTextureWrapper* csMaterial::GetTextureWrapper csStringID    name
 

Get a texture (if none 0 is returned).

iTextureWrapper* csMaterial::GetTextureWrapper   const [inline]
 

Get the base diffuse texture (if none 0 is returned).

Definition at line 168 of file csengine/material.h.

virtual csShaderVariable* csMaterial::GetVariable csStringID    name [inline, virtual]
 

Get variable.

Implements iShaderBranch.

Definition at line 201 of file csengine/material.h.

References csStringID, and csSymbolTable::GetSymbol.

virtual void csMaterial::SelectSymbolTable int    i [inline, virtual]
 

Select the current symbol table from the array of symbol tables.

If there is only one symbol table, this is a no-op.

Implements iShaderBranch.

Definition at line 207 of file csengine/material.h.

void csMaterial::SetAmbient float    val
 

Set ambient lighting for the material.

void csMaterial::SetDiffuse float    val
 

Set diffuse reflection constant for the material.

virtual void csMaterial::SetEffect iEffectDefinition   ed [virtual]
 

Set effect.

Implements iMaterial.

virtual void csMaterial::SetFlatColor const csRGBcolor   col [virtual]
 

Set the flat shading color.

Implements iMaterial.

virtual void csMaterial::SetReflection float    oDiffuse,
float    oAmbient,
float    oReflection
[virtual]
 

Set reflection values (diffuse, ambient, reflection).

Implements iMaterial.

void csMaterial::SetReflection float    val
 

Set reflection of the material.

virtual void csMaterial::SetShader csStringID    type,
iShaderWrapper   shader
[virtual]
 

Associate a shader with a shader type.

Implements iMaterial.

void csMaterial::SetTextureWrapper iTextureWrapper   tex
 

Set the base diffuse texture (pass 0 to set no texture).

void csMaterial::Visit  
 

Visit all textures.


Member Data Documentation

csMaterial::MaterialEngine csMaterial::scfiMaterialEngine
 

iMaterialEngine implementation.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14