CrystalSpace

Public API Reference

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

iMaterial Struct Reference
[3D]

This class represents a material as seen from the engine view. More...

#include <material.h>

Inheritance diagram for iMaterial:

iShaderVariableContext iBase List of all members.

Public Methods

virtual void SetShader (csStringID type, iShader *shader)=0
 Associate a shader with a shader type.

virtual iShaderGetShader (csStringID type)=0
 Get shader associated with a shader type.

virtual iTextureHandleGetTexture ()=0
 Get the base texture from the material.

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

virtual int GetTextureLayerCount ()=0
 Get the number of texture layers.

virtual csTextureLayerGetTextureLayer (int idx)=0
 Get a texture layer.

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

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

virtual void GetReflection (float &oDiffuse, float &oAmbient, float &oReflection)=0
 Get light reflection parameters for this material.

virtual void SetReflection (float oDiffuse, float oAmbient, float oReflection)=0
 Set the reflection parameters.


Detailed Description

This class represents a material as seen from the engine view.

You need to register this to the texture manager to get a handle to an internal compiled material. This interface plays same role related to iMaterialHandle as iImage plays related to iTextureHandle.

Definition at line 93 of file material.h.


Member Function Documentation

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

Get the flat color.

If the material has a texture assigned, this will return the mean texture color.

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

Get light reflection parameters for this material.

virtual iShader* iMaterial::GetShader csStringID    type [pure virtual]
 

Get shader associated with a shader type.

virtual iTextureHandle* iMaterial::GetTexture csStringID    name [pure virtual]
 

Get a texture from the material.

virtual iTextureHandle* iMaterial::GetTexture   [pure virtual]
 

Get the base texture from the material.

virtual csTextureLayer* iMaterial::GetTextureLayer int    idx [pure virtual]
 

Get a texture layer.

virtual int iMaterial::GetTextureLayerCount   [pure virtual]
 

Get the number of texture layers.

The base texture is not counted in this.

virtual void iMaterial::SetFlatColor const csRGBcolor   col [pure virtual]
 

Set the flat shading color.

virtual void iMaterial::SetReflection float    oDiffuse,
float    oAmbient,
float    oReflection
[pure virtual]
 

Set the reflection parameters.

virtual void iMaterial::SetShader csStringID    type,
iShader   shader
[pure virtual]
 

Associate a shader with a shader type.


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