|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.video.Material
public class Material
Material objects hold values for the colors of vertices and lights. They're
composed of three, four element arrays of floats. In order, these elements
are red, green, blue and alpha transparency values. Each material also has a
shininess value, but this is only used for vertices, not lights.
The three arrays, in order, are for ambient, diffuse, and specular
lighting.
API Stability: Stable.
Constructor Summary | |
---|---|
Material()
Constructs a default white Material. |
|
Material(float[] ambient,
float[] diffuse,
float[] specular,
float shininess)
Constructs a Material with ambient, diffuse, specular and shininess components. |
|
Material(float[] ambient,
float[] diffuse,
float[] specular,
float[] emission,
float shininess)
Constructs a Material object using the given color values. |
Method Summary | |
---|---|
java.lang.Object |
clone()
|
void |
draw(Context opt)
"Draws" the Material, causing any vertices that come after it to be colored with the material. |
void |
draw(Context opt,
int number,
float[] vertex)
Causes the Coloration to be drawn. |
Material |
duplicate()
|
boolean |
equals(java.lang.Object o)
|
float[] |
getAmbient()
Provides the ambient portion of the color. |
float[] |
getDiffuse()
Provides the diffuse portion of the color. |
float[] |
getEmission()
Provides the emissive portion of the color. |
float |
getShininess()
Provides the shininess value of the color. |
float[] |
getSpecular()
Provides the specular portion of the color. |
static void |
interpolate(Material a,
Material b,
Material c,
float i)
|
void |
load(net.jinx.db.Hierarchy h)
Configures this Coloration from the given Hierarchy. |
void |
setShininess(float shininess)
Allows setting the shininess of the Material. |
void |
store(net.jinx.db.Hierarchy h)
Stores this Coloration to the given Hierarchy. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Material()
public Material(float[] ambient, float[] diffuse, float[] specular, float shininess)
ambient
- the ambient part.diffuse
- the diffuse part.specular
- the specular part.shininess
- the shininess part.public Material(float[] ambient, float[] diffuse, float[] specular, float[] emission, float shininess)
ambient
- the ambient color array.diffuse
- the diffuse color array.specular
- the specular color array.shininess
- the shininess value.Method Detail |
---|
public float[] getAmbient()
public float[] getDiffuse()
public float[] getSpecular()
public float[] getEmission()
public float getShininess()
public void setShininess(float shininess)
shininess
- the shininess value.public void draw(Context opt, int number, float[] vertex)
Coloration
draw
in interface Coloration
opt
- the rendering options that are being used. Implementatons
of this interface should pay attention to the color related flags.number
- the current vertex number.vertex
- the current vertex position (x, y, and z coordinates).public void draw(Context opt)
opt
- the Context object for rendering.public void load(net.jinx.db.Hierarchy h)
Coloration
load
in interface Coloration
h
- the Hierarchy to configure this Coloration from.public void store(net.jinx.db.Hierarchy h)
Coloration
store
in interface Coloration
h
- the Hierarchy to store this Coloration to.public java.lang.Object clone()
clone
in class java.lang.Object
public Material duplicate()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public static void interpolate(Material a, Material b, Material c, float i)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |