|
Aviatrix3D 2.0 Dev |
||||||||||
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.Node
org.j3d.aviatrix3d.Leaf
org.j3d.aviatrix3d.Light
org.j3d.aviatrix3d.DirectionalLight
Representation of a directional light source.
A directional light has a direction, but no location. This implementation uses the OpenGL convention of having the light vector pointed in the opposite direction to where you think the light is pointing.
Field Summary |
Fields inherited from class org.j3d.aviatrix3d.Light |
AMBIENT_TYPE, ambientColor, diffuseColor, DIRECTIONAL_TYPE, effectBounds, enabled, globalScope, POINT_TYPE, specularColor, SPOT_TYPE |
Fields inherited from class org.j3d.aviatrix3d.Node |
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, LISTENER_SET_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG |
Constructor Summary | |
DirectionalLight()
Creates a light with the colour set to black. |
|
DirectionalLight(float[] col)
Create a light with the given base colour.Colour must be in the range [0, 1] otherwise an exception is generated. |
|
DirectionalLight(float[] col,
float[] dir)
Create a light with the given base colour.Colour must be in the range [0, 1] otherwise an exception is generated. |
Method Summary | |
int |
compareTo(Light l)
Compares this object with the specified object for order. |
void |
getDirection(float[] dir)
Retrieve the current direction vector from the light. |
protected void |
markBoundsDirty()
Mark this node as having dirty bounds due to one of it's children having their bounds changed. |
void |
postRender(javax.media.opengl.GL gl,
java.lang.Object lightId)
|
void |
render(javax.media.opengl.GL gl,
java.lang.Object lightId)
Overloaded form of the render() method to render the light details given the specific Light ID used by OpenGL. |
void |
setDirection(float[] dir)
Set the direction to the new value. |
void |
setDirection(float x,
float y,
float z)
Set the direction to the new value. |
Methods inherited from class org.j3d.aviatrix3d.Light |
compareColor3, compareTo, getAmbientColor, getDiffuseColor, getEffectBounds, getRenderable, getSpecularColor, isEnabled, isGlobalScope, setAmbientColor, setDiffuseColor, setEffectBounds, setEnabled, setGlobalScope, setSpecularColor |
Methods inherited from class org.j3d.aviatrix3d.Node |
boundsChanged, checkForCyclicParent, getBounds, getParent, recomputeBounds, removeParent, setBounds, setLive, setParent, updateBounds, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicChild, dataChanged, getUserData, isLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.j3d.aviatrix3d.Renderable |
equals |
Constructor Detail |
public DirectionalLight()
public DirectionalLight(float[] col) throws java.lang.IllegalArgumentException
col
- The new colour value to usepublic DirectionalLight(float[] col, float[] dir) throws java.lang.IllegalArgumentException
col
- The new colour value to usedir
- The direction of the lightMethod Detail |
public void render(javax.media.opengl.GL gl, java.lang.Object lightId)
gl
- The GL context to render withlightId
- the ID of the light to make GL calls withpublic void postRender(javax.media.opengl.GL gl, java.lang.Object lightId)
protected void markBoundsDirty()
markBoundsDirty
in class Node
public void setDirection(float[] dir) throws InvalidWriteTimingException
dir
- The new direction value to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void setDirection(float x, float y, float z) throws InvalidWriteTimingException
x
- The x component of the direction value to usey
- The y component of the direction value to usez
- The z component of the direction value to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void getDirection(float[] dir)
dir
- An array to copy the direction intopublic int compareTo(Light l)
compareTo
in class Light
l
- The light instance to be compared
|
Aviatrix3D 2.0 Dev |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |