|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.NodeComponent
org.j3d.aviatrix3d.Material
Describes the material properties of an object.
Field Summary |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
liveCount |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, updateHandler, WRITE_TIMING_MSG |
Constructor Summary | |
Material()
Constructs a material with default values. |
|
Material(float[] ambientColor,
float[] emissiveColor,
float[] diffuseColor,
float[] specularColor,
float shininess,
float transparency)
Create a new material with all the colours specified. |
Method Summary | |
int |
compareTo(Material mat)
Compares this object with the specified object for order. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
equals(Material mat)
Compares this object with the specified object to check for equivalence. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
void |
getAmbientColor(float[] col)
Get the current value of the ambient color. |
void |
getDiffuseColor(float[] col)
Get the current value of the diffuse color. |
void |
getEmissiveColor(float[] col)
Get the current value of the emissive color. |
float |
getShininess()
Get the current shininess value. |
void |
getSpecularColor(float[] col)
Get the current value of the specular color. |
float |
getTransparency()
Get the value for the existing transparency values |
boolean |
isLightingEnabled()
Get the current lighting enabled flag. |
void |
renderState(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Issue ogl commands needed for this component |
void |
restoreState(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Restore all openGL state to the given drawable |
void |
setAmbientColor(float[] col)
Set the ambient color to the new value. |
void |
setDiffuseColor(float[] col)
Set the diffuse color to the new value. |
void |
setEmissiveColor(float[] col)
Set the emissive color to the new value. |
void |
setLightingEnabled(boolean state)
Set the flag that enables or disables lighting on any geometry using this material. |
void |
setShininess(float s)
Set the shininess factor. |
void |
setSpecularColor(float[] col)
Set the specular color to the new value. |
void |
setTransparency(float transparency)
Set the amount of transparency to be used for this material. |
Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
addParent, getParents, hasChanged, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicChild, checkForCyclicParent, dataChanged, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Material()
ambient color = (0.2, 0.2, 0.2) emisive color = (0.0, 0.0, 0.0) diffuse color = (0.8, 0.8, 0.8) specular color = (0, 0, 0) shininess = 0.2 transparency = 1
public Material(float[] ambientColor, float[] emissiveColor, float[] diffuseColor, float[] specularColor, float shininess, float transparency)
ambientColor
- emissiveColor
- diffuseColor
- specularColor
- shininess
- The shininess factor valuetransparency
- A transparency value between 0 and 1Method Detail |
public void renderState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
renderState
in class NodeComponent
gl
- The gl context to draw withglu
- The utility context to draw withpublic void restoreState(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
restoreState
in class NodeComponent
gl
- The gl context to draw withglu
- The utility context to draw withpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
Derived classes should extend this one to add the extra comparisons needed.
compareTo
in interface java.lang.Comparable
o
- The object to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
o
- The object to be compared
public void setShininess(float s) throws InvalidWriteTimingException
s
- The shininess factor value
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic float getShininess()
public void setDiffuseColor(float[] col) throws InvalidWriteTimingException
col
- The new colour to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void getDiffuseColor(float[] col)
col
- The array to copy the values intopublic void setSpecularColor(float[] col) throws InvalidWriteTimingException
col
- The new colour to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void getSpecularColor(float[] col)
col
- The array to copy the values intopublic void setEmissiveColor(float[] col) throws InvalidWriteTimingException
col
- The new colour to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void getEmissiveColor(float[] col)
col
- The array to copy the values intopublic void setAmbientColor(float[] col) throws InvalidWriteTimingException
col
- The new colour to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void getAmbientColor(float[] col)
col
- The array to copy the values intopublic void setTransparency(float transparency) throws InvalidWriteTimingException
transparency
- A value between 0 and 1
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic float getTransparency()
public void setLightingEnabled(boolean state) throws InvalidWriteTimingException
state
- true if lighting should be used
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic boolean isLightingEnabled()
public int compareTo(Material mat)
mat
- The material to be compared
public boolean equals(Material mat)
mat
- The material to be compared
|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |