|
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 | |
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, equals, 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 setShininess(float s) throws InvalidWriteTimingException
s
- The shininess factor value
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic 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 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 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 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 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 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 with
|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |