CrystalSpace

Public API Reference

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

csMaterial Class Reference

A material class. More...

#include <material.h>

Inheritance diagram for csMaterial:

iMaterial iBase List of all members.

Public Methods

 csMaterial ()
 create an empty material. More...

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

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

csRGBcolor & GetFlatColor ()
 Get the flat shading color. More...

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

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

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

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

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

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

iTextureWrapper * GetTextureWrapper () const
 Get the texture (if none NULL is returned). More...

void SetTextureWrapper (iTextureWrapper *tex)
 Set the texture (pass NULL 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...

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

virtual iEffectDefinition * GetEffect ()
 Get effect. More...

virtual iTextureHandle * GetTexture ()
 Get texture. More...

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

virtual csTextureLayer * GetTextureLayer (int idx)
 Get a texture layer. More...

virtual void GetFlatColor (csRGBpixel &oColor, bool useTextureMean=1)
 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...


Public Attributes

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


Detailed Description

A material class.

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


Constructor & Destructor Documentation

csMaterial::csMaterial (    ) 
 

create an empty material.

csMaterial::csMaterial (  iTextureWrapper *    txt ) 
 

create a material with only the texture given.

virtual csMaterial::~csMaterial (    )  [virtual]
 

destroy material.


Member Function Documentation

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

Add a texture layer (currently only one supported).

float csMaterial::GetAmbient (    )  const [inline]
 

Get ambient lighting for the material.

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

float csMaterial::GetDiffuse (    )  const [inline]
 

Get diffuse reflection constant for the material.

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

virtual iEffectDefinition* csMaterial::GetEffect (    )  [virtual]
 

Get effect.

Implements iMaterial.

virtual void csMaterial::GetFlatColor (  csRGBpixel &    oColor,
bool    useTextureMean = 1
)  [virtual]
 

Get flat color.

Implements iMaterial.

csRGBcolor& csMaterial::GetFlatColor (    )  [inline]
 

Get the flat shading color.

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

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

Get reflection values (diffuse, ambient, reflection).

Implements iMaterial.

float csMaterial::GetReflection (    )  const [inline]
 

Get reflection of the material.

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

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 (    )  const [inline]
 

Get the texture (if none NULL is returned).

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

void csMaterial::SetAmbient (  float    val )  [inline]
 

Set ambient lighting for the material.

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

void csMaterial::SetDiffuse (  float    val )  [inline]
 

Set diffuse reflection constant for the material.

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

virtual void csMaterial::SetEffect (  iEffectDefinition *    ed )  [virtual]
 

Set effect.

Implements iMaterial.

virtual void csMaterial::SetFlatColor (  const csRGBcolor &    col )  [inline, virtual]
 

Set the flat shading color.

Implements iMaterial.

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

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

Set reflection values (diffuse, ambient, reflection).

Implements iMaterial.

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

void csMaterial::SetReflection (  float    val )  [inline]
 

Set reflection of the material.

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

void csMaterial::SetTextureWrapper (  iTextureWrapper *    tex ) 
 

Set the texture (pass NULL to set no texture).


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