|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme.scene.state.RenderState
com.jme.scene.state.MaterialState
public abstract class MaterialState
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.
Nested Class Summary | |
---|---|
static class |
MaterialState.ColorMaterial
|
static class |
MaterialState.MaterialFace
|
Nested classes/interfaces inherited from class com.jme.scene.state.RenderState |
---|
RenderState.StateType |
Field Summary | |
---|---|
protected ColorRGBA |
ambient
|
protected MaterialState.ColorMaterial |
colorMaterial
|
static ColorRGBA |
defaultAmbient
Default ambient color for all material states. |
static MaterialState.ColorMaterial |
defaultColorMaterial
Default color material mode 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 MaterialState.MaterialFace |
defaultMaterialFace
Default material face for all material states. |
static float |
defaultShininess
Default shininess for all material states. |
static ColorRGBA |
defaultSpecular
Default specular color for all material states. |
protected ColorRGBA |
diffuse
|
protected ColorRGBA |
emissive
|
protected MaterialState.MaterialFace |
materialFace
|
protected float |
shininess
|
protected ColorRGBA |
specular
|
Fields inherited from class com.jme.scene.state.RenderState |
---|
QUICK_COMPARE, RS_BLEND, RS_CLIP, RS_COLORMASK_STATE, RS_CULL, 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 | |
---|---|
ColorRGBA |
getAmbient()
getAmbient retreives the ambient color of the material. |
java.lang.Class<?> |
getClassTag()
|
MaterialState.ColorMaterial |
getColorMaterial()
getColorMaterial retrieves the color material mode, which
determines how geometry colors affect the material. |
ColorRGBA |
getDiffuse()
getDiffuse retrieves the diffuse color of the material. |
ColorRGBA |
getEmissive()
getEmissive retrieves the emissive color of the material. |
MaterialState.MaterialFace |
getMaterialFace()
getMaterialFace retrieves the face this material state
affects. |
float |
getShininess()
getShininess retrieves the shininess value of the
material. |
ColorRGBA |
getSpecular()
getSpecular retrieves the specular color of the material. |
RenderState.StateType |
getStateType()
getStateType returns the type RenderState.StateType.Material |
int |
getType()
Deprecated. As of 2.0, use RenderState.getStateType() instead. |
void |
read(JMEImporter e)
|
void |
setAmbient(ColorRGBA ambient)
setAmbient sets the ambient color of the material. |
void |
setColorMaterial(MaterialState.ColorMaterial material)
setColorMaterial sets the color material mode. |
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 |
setMaterialFace(MaterialState.MaterialFace face)
setMaterialFace sets the face this material state affects. |
void |
setShininess(float shininess)
setShininess sets the shininess of the material. |
void |
setSpecular(ColorRGBA specular)
setSpecular sets the specular color of the material. |
void |
write(JMEExporter e)
|
Methods inherited from class com.jme.scene.state.RenderState |
---|
apply, createStateRecord, extract, isEnabled, needsRefresh, setEnabled, setNeedsRefresh, setQuickCompares |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ColorRGBA defaultAmbient
public static final ColorRGBA defaultDiffuse
public static final ColorRGBA defaultSpecular
public static final ColorRGBA defaultEmissive
public static final float defaultShininess
public static final MaterialState.ColorMaterial defaultColorMaterial
public static final MaterialState.MaterialFace defaultMaterialFace
protected ColorRGBA ambient
protected ColorRGBA diffuse
protected ColorRGBA specular
protected ColorRGBA emissive
protected float shininess
protected MaterialState.ColorMaterial colorMaterial
protected MaterialState.MaterialFace materialFace
Constructor Detail |
---|
public MaterialState()
MaterialState
object.
Method Detail |
---|
public ColorRGBA getAmbient()
getAmbient
retreives the ambient color of the material.
public void setAmbient(ColorRGBA ambient)
setAmbient
sets the ambient color of the material.
ambient
- the ambient color of the material.public ColorRGBA getDiffuse()
getDiffuse
retrieves the diffuse color of the material.
public void setDiffuse(ColorRGBA diffuse)
setDiffuse
sets the diffuse color of the material.
diffuse
- the diffuse color of the material.public ColorRGBA getEmissive()
getEmissive
retrieves the emissive color of the material.
public void setEmissive(ColorRGBA emissive)
setEmissive
sets the emissive color of the material.
emissive
- the emissive color of the material.public float getShininess()
getShininess
retrieves the shininess value of the
material.
public void setShininess(float shininess)
setShininess
sets the shininess of the material.
shininess
- the shininess of the material. Must be between 0 and 128.public ColorRGBA getSpecular()
getSpecular
retrieves the specular color of the material.
public void setSpecular(ColorRGBA specular)
setSpecular
sets the specular color of the material.
specular
- the specular color of the material.public MaterialState.ColorMaterial getColorMaterial()
getColorMaterial
retrieves the color material mode, which
determines how geometry colors affect the material.
public void setColorMaterial(MaterialState.ColorMaterial material)
setColorMaterial
sets the color material mode.
material
- the color material mode
java.lang.IllegalArgumentException
- if material is nullpublic MaterialState.MaterialFace getMaterialFace()
getMaterialFace
retrieves the face this material state
affects.
public void setMaterialFace(MaterialState.MaterialFace face)
setMaterialFace
sets the face this material state affects.
face
- the new face setting
java.lang.IllegalArgumentException
- if material is nullpublic int getType()
RenderState.getStateType()
instead.
getType
returns the render state type of this.
(RS_MATERIAL).
getType
in class RenderState
RenderState.getType()
public RenderState.StateType getStateType()
getStateType
returns the type RenderState.StateType.Material
getStateType
in class RenderState
RenderState.StateType.Material
RenderState.getStateType()
public void write(JMEExporter e) throws java.io.IOException
write
in interface Savable
write
in class RenderState
java.io.IOException
public void read(JMEImporter e) throws java.io.IOException
read
in interface Savable
read
in class RenderState
java.io.IOException
public java.lang.Class<?> getClassTag()
getClassTag
in interface Savable
getClassTag
in class RenderState
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |