crystalspace.jbind.interfaces.ivideo.material
Interface iMaterial

All Superinterfaces:
iBase, iPointer, iShaderVariableContext
All Known Implementing Classes:
csMaterial

public interface iMaterial
extends iShaderVariableContext

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.

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/devapi/structiMaterial.php

Method Summary
 iEffectDefinition getEffect()
          Get the effect from the material.
 csRGBpixel getFlatColor()
          Get the flat color.
 csRGBpixel getFlatColor(boolean useTextureMean)
          Get the flat color.
 float[] getReflection()
          Get light reflection parameters for this material.
 iShader getShader(int type)
          Get shader associated with a shader type.
 iTextureHandle getTexture()
          Get the base texture from the material.
 iTextureHandle getTexture(int name)
          Get a texture from the material.
 csTextureLayer getTextureLayer(int idx)
          Get a texture layer.
 int getTextureLayerCount()
          Get the number of texture layers.
 void setEffect(iEffectDefinition ed)
          Set the material's effect.
 void setFlatColor(csRGBcolor col)
          Set the flat shading color.
 void setReflection(float oDiffuse, float oAmbient, float oReflection)
          Set the reflection parameters.
 void setShader(int type, iShader shader)
          Associate a shader with a shader type.
 
Methods inherited from interface crystalspace.jbind.interfaces.ivideo.shader.shader.iShaderVariableContext
addVariable, fillVariableList, getVariable, getVariableAdd, getVariableRecursive, getVariableRecursiveAdd
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

getEffect

public iEffectDefinition getEffect()
Get the effect from the material. Implemented in csMaterial, and csIsoMaterial.

Returns:

getFlatColor

public csRGBpixel getFlatColor()
Get the flat color. If the material has a texture assigned, this will return the mean texture color. Implemented in csMaterial, and csIsoMaterial.

Returns:

getFlatColor

public csRGBpixel getFlatColor(boolean useTextureMean)
Get the flat color. If the material has a texture assigned, this will return the mean texture color. Implemented in csMaterial, and csIsoMaterial.

Parameters:
useTextureMean -
Returns:

getReflection

public float[] getReflection()
Get light reflection parameters for this material. Implemented in csMaterial, and csIsoMaterial.

Returns:

getShader

public iShader getShader(int type)
Get shader associated with a shader type. Implemented in csMaterial, and csIsoMaterial.

Parameters:
type -
Returns:

getTexture

public iTextureHandle getTexture(int name)
Get a texture from the material. Implemented in csMaterial, and csIsoMaterial.

Parameters:
name -
Returns:

getTexture

public iTextureHandle getTexture()
Get the base texture from the material. Implemented in csMaterial, and csIsoMaterial.

Returns:

getTextureLayer

public csTextureLayer getTextureLayer(int idx)
Get a texture layer. Implemented in csMaterial, and csIsoMaterial.

Parameters:
idx -
Returns:

getTextureLayerCount

public int getTextureLayerCount()
Get the number of texture layers. The base texture is not counted in this. Implemented in csMaterial, and csIsoMaterial.

Returns:

setEffect

public void setEffect(iEffectDefinition ed)
Set the material's effect. Implemented in csMaterial, and csIsoMaterial.

Parameters:
ed -

setFlatColor

public void setFlatColor(csRGBcolor col)
Set the flat shading color. Implemented in csMaterial, and csIsoMaterial.

Parameters:
col -

setReflection

public void setReflection(float oDiffuse,
                          float oAmbient,
                          float oReflection)
Set the reflection parameters. Implemented in csMaterial, and csIsoMaterial.

Parameters:
oDiffuse -
oAmbient -
oReflection -

setShader

public void setShader(int type,
                      iShader shader)
Associate a shader with a shader type. Implemented in csMaterial, and csIsoMaterial.

Parameters:
type -
shader -