com.jme.scene.state
Class MaterialState

java.lang.Object
  extended bycom.jme.scene.state.RenderState
      extended bycom.jme.scene.state.MaterialState
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LWJGLMaterialState

public abstract class MaterialState
extends RenderState

MaterialState defines a state to define an objects material settings. Material is defined by the emissive quality of the object, the ambient color, diffuse color and specular color. The material also defines the shininess of the object and the alpha value of the object.

Version:
$Id: MaterialState.java,v 1.6 2004/08/01 23:44:40 cep21 Exp $
Author:
Mark Powell
See Also:
Serialized Form

Field Summary
protected static ColorRGBA currentAmbient
           
protected static ColorRGBA currentDiffuse
           
protected static ColorRGBA currentEmissive
           
protected static float currentShininess
           
protected static ColorRGBA currentSpecular
           
static ColorRGBA defaultAmbient
          Default ambient color for all material states.
static ColorRGBA defaultDiffuse
          Default diffuse color for all material states.
static ColorRGBA defaultEmissive
          Default emissive color for all material states.
static float defaultShininess
          Default shininess for all material states.
static ColorRGBA defaultSpecular
          Default specular color for all material states.
 
Fields inherited from class com.jme.scene.state.RenderState
RS_ALPHA, RS_ATTRIBUTE, RS_CULL, RS_DITHER, RS_FOG, RS_FRAGMENT_PROGRAM, RS_GLSL_SHADER_OBJECTS, RS_LIGHT, RS_MATERIAL, RS_MAX_STATE, RS_SHADE, RS_STENCIL, RS_TEXTURE, RS_VERTEX_PROGRAM, RS_WIREFRAME, RS_ZBUFFER
 
Constructor Summary
MaterialState()
          Constructor instantiates a new MaterialState object.
 
Method Summary
 float getAlpha()
          getAlpha returns the alpha value for this material state.
 ColorRGBA getAmbient()
          getAmbient retreives the ambient color of the material.
 ColorRGBA getDiffuse()
          getDiffuse retrieves the diffuse color of the material.
 ColorRGBA getEmissive()
          getEmissive retrieves the emissive color of the material.
 float getShininess()
          getShininess retrieves the shininess value of the material.
 ColorRGBA getSpecular()
          getSpecular retrieves the specular color of the material.
 int getType()
          getType returns the render state type of this.
 void setAlpha(float alpha)
          setAlpha sets the alpha value for this material state.
 void setAmbient(ColorRGBA ambient)
          setAmbient sets the ambient color of the material.
 void setDiffuse(ColorRGBA diffuse)
          setDiffuse sets the diffuse color of the material.
 void setEmissive(ColorRGBA emissive)
          setEmissive sets the emissive color of the material.
 void setShininess(float shininess)
          setShininess sets the shininess of the material.
 void setSpecular(ColorRGBA specular)
          setSpecular sets the specular color of the material.
 
Methods inherited from class com.jme.scene.state.RenderState
apply, extract, isEnabled, setEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentAmbient

protected static ColorRGBA currentAmbient

currentDiffuse

protected static ColorRGBA currentDiffuse

currentSpecular

protected static ColorRGBA currentSpecular

currentEmissive

protected static ColorRGBA currentEmissive

currentShininess

protected static float currentShininess

defaultAmbient

public static final ColorRGBA defaultAmbient
Default ambient color for all material states.


defaultDiffuse

public static final ColorRGBA defaultDiffuse
Default diffuse color for all material states.


defaultSpecular

public static final ColorRGBA defaultSpecular
Default specular color for all material states.


defaultEmissive

public static final ColorRGBA defaultEmissive
Default emissive color for all material states.


defaultShininess

public static final float defaultShininess
Default shininess for all material states.

See Also:
Constant Field Values
Constructor Detail

MaterialState

public MaterialState()
Constructor instantiates a new MaterialState object.

Method Detail

getAlpha

public float getAlpha()
getAlpha returns the alpha value for this material state. This value isn't actually used directly by jME. Alpha value is more for a user refrence.

Returns:
The current alpha value.
See Also:
AlphaState

setAlpha

public void setAlpha(float alpha)
setAlpha sets the alpha value for this material state. This value isn't actually used directly by jME. Alpha value is more for a user refrence.

Parameters:
alpha - The new alpha value of this material state.
See Also:
AlphaState

getAmbient

public ColorRGBA getAmbient()
getAmbient retreives the ambient color of the material.

Returns:
the color of the ambient value.

setAmbient

public void setAmbient(ColorRGBA ambient)
setAmbient sets the ambient color of the material.

Parameters:
ambient - the ambient color of the material.

getDiffuse

public ColorRGBA getDiffuse()
getDiffuse retrieves the diffuse color of the material.

Returns:
the color of the diffuse value.

setDiffuse

public void setDiffuse(ColorRGBA diffuse)
setDiffuse sets the diffuse color of the material.

Parameters:
diffuse - the diffuse color of the material.

getEmissive

public ColorRGBA getEmissive()
getEmissive retrieves the emissive color of the material.

Returns:
the color of the emissive value.

setEmissive

public void setEmissive(ColorRGBA emissive)
setEmissive sets the emissive color of the material.

Parameters:
emissive - the emissive color of the material.

getShininess

public float getShininess()
getShininess retrieves the shininess value of the material.

Returns:
the shininess value of the material.

setShininess

public void setShininess(float shininess)
setShininess sets the shininess of the material.

Parameters:
shininess - the shininess of the material.

getSpecular

public ColorRGBA getSpecular()
getSpecular retrieves the specular color of the material.

Returns:
the specular color of the material.

setSpecular

public void setSpecular(ColorRGBA specular)
setSpecular sets the specular color of the material.

Parameters:
specular - the specular color of the material.

getType

public int getType()
getType returns the render state type of this. (RS_MATERIAL).

Specified by:
getType in class RenderState
Returns:
An int identifying this render state.
See Also:
RenderState.getType()