|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.opengl.renderer.state.RenderState
com.threerings.opengl.renderer.state.MaterialState
public class MaterialState
Contains the material state.
| Field Summary | |
|---|---|
static MaterialState |
DEFAULT
The default material. |
static MaterialState |
WHITE
A simple white material. |
| Fields inherited from class com.threerings.opengl.renderer.state.RenderState |
|---|
ALPHA_STATE, ARRAY_STATE, COLOR_MASK_STATE, COLOR_STATE, CULL_STATE, DEPTH_STATE, FOG_STATE, LIGHT_STATE, LINE_STATE, MATERIAL_STATE, POINT_STATE, POLYGON_STATE, SHADER_STATE, STATE_COUNT, STENCIL_STATE, TEXTURE_STATE, TRANSFORM_STATE |
| Constructor Summary | |
|---|---|
MaterialState()
Creates a new material state. |
|
MaterialState(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
Creates a new two-sided material state. |
|
MaterialState(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean twoSide,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
Creates a new material state. |
|
MaterialState(Color4f ambient,
Color4f diffuse,
Color4f specular,
Color4f emission,
float shininess,
int colorMaterialMode,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
Creates a new one-sided material state. |
|
| Method Summary | |
|---|---|
void |
apply(Renderer renderer)
Applies this state. |
boolean |
equals(Object other)
|
Color4f |
getBackAmbient()
Returns a reference to the back ambient color. |
Color4f |
getBackDiffuse()
Returns a reference to the back diffuse color. |
Color4f |
getBackEmission()
Returns a reference to the back emissive color. |
float |
getBackShininess()
Returns the back shininess. |
Color4f |
getBackSpecular()
Returns a reference to the back specular color. |
int |
getColorMaterialFace()
Returns the color material face. |
int |
getColorMaterialMode()
Returns the color material mode (or -1 if disabled). |
boolean |
getFlatShading()
Returns whether or not flat shading is enabled. |
Color4f |
getFrontAmbient()
Returns a reference to the front ambient color. |
Color4f |
getFrontDiffuse()
Returns a reference to the front diffuse color. |
Color4f |
getFrontEmission()
Returns a reference to the front emissive color. |
float |
getFrontShininess()
Returns the front shininess. |
Color4f |
getFrontSpecular()
Returns a reference to the front specular color. |
static MaterialState |
getInstance(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
If there is a shared instance with the supplied parameters, returns a reference to it; otherwise, returns a new state with the parameters. |
static MaterialState |
getInstance(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean twoSide,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
If there is a shared instance with the supplied parameters, returns a reference to it; otherwise, returns a new state with the parameters. |
static MaterialState |
getInstance(Color4f ambient,
Color4f diffuse,
Color4f specular,
Color4f emission,
float shininess,
int colorMaterialMode,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
If there is a shared instance with the supplied parameters, returns a reference to it; otherwise, returns a new state with the parameters. |
static MaterialState |
getInstance(MaterialState state)
If there is a shared equivalent to the specified state, this method will return the shared state; otherwise, it will simply return the parameter. |
boolean |
getLocalViewer()
Returns whether or not local viewer mode is enabled. |
boolean |
getSeparateSpecular()
Returns whether or not separate specular is enabled. |
boolean |
getTwoSide()
Returns whether or not two sided lighting is enabled. |
int |
getType()
Returns the type of this state. |
| Methods inherited from class com.threerings.opengl.renderer.state.RenderState |
|---|
copy, createDefaultSet, createEmptySet, getDefaults, isDirty, setDirty |
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final MaterialState DEFAULT
public static final MaterialState WHITE
| Constructor Detail |
|---|
public MaterialState(Color4f ambient,
Color4f diffuse,
Color4f specular,
Color4f emission,
float shininess,
int colorMaterialMode,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
public MaterialState(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
public MaterialState(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean twoSide,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
public MaterialState()
| Method Detail |
|---|
public static MaterialState getInstance(Color4f ambient,
Color4f diffuse,
Color4f specular,
Color4f emission,
float shininess,
int colorMaterialMode,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
public static MaterialState getInstance(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
public static MaterialState getInstance(Color4f frontAmbient,
Color4f frontDiffuse,
Color4f frontSpecular,
Color4f frontEmission,
float frontShininess,
Color4f backAmbient,
Color4f backDiffuse,
Color4f backSpecular,
Color4f backEmission,
float backShininess,
int colorMaterialMode,
int colorMaterialFace,
boolean twoSide,
boolean localViewer,
boolean separateSpecular,
boolean flatShading)
public static MaterialState getInstance(MaterialState state)
public Color4f getFrontAmbient()
public Color4f getFrontDiffuse()
public Color4f getFrontSpecular()
public Color4f getFrontEmission()
public float getFrontShininess()
public Color4f getBackAmbient()
public Color4f getBackDiffuse()
public Color4f getBackSpecular()
public Color4f getBackEmission()
public float getBackShininess()
public int getColorMaterialMode()
public int getColorMaterialFace()
public boolean getTwoSide()
public boolean getLocalViewer()
public boolean getSeparateSpecular()
public boolean getFlatShading()
public int getType()
RenderState
getType in class RenderStatepublic void apply(Renderer renderer)
RenderState
apply in class RenderStatepublic boolean equals(Object other)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||