|
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.Node
org.j3d.aviatrix3d.Leaf
org.j3d.aviatrix3d.Light
org.j3d.aviatrix3d.PointLight
Representation of a point light source.
A positional light has a position, but no location.
Field Summary | |
protected float |
cAttenuation
The constant attentuation factor |
protected float |
lAttenuation
The linear attentuation factor |
protected float[] |
position
The colour of the light |
protected float |
qAttenuation
The quadratic attentuation factor |
Fields inherited from class org.j3d.aviatrix3d.Light |
AMBIENT_TYPE, ambientColor, diffuseColor, DIRECTIONAL_TYPE, enabled, 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, updateHandler, WRITE_TIMING_MSG |
Constructor Summary | |
PointLight()
Creates a light with the colour set to black. |
|
PointLight(float[] col)
Create a light with the given base colour.Colour must be in the range [0, 1] otherwise an exception is generated. |
|
PointLight(float[] col,
float[] pos)
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 |
getAttenuation(float[] values)
Set the attenuation factors for the light. |
void |
getPosition(float[] pos)
Retrieve the current position 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(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu,
java.lang.Object lightId)
|
void |
render(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu,
java.lang.Object lightId)
Overloaded form of the render() method to render the light details given the specific Light ID used by OpenGL. |
void |
setAttenuation(float[] values)
Set the attenuation factors for the light. |
void |
setAttenuation(float constant,
float linear,
float quad)
Set the attenuation factors for the light. |
void |
setPosition(float[] pos)
Set the position to the new value. |
void |
setPosition(float x,
float y,
float z)
Set the position to the new value. |
Methods inherited from class org.j3d.aviatrix3d.Light |
compareColor3, compareTo, getAmbientColor, getDiffuseColor, getSpecularColor, isEnabled, setAmbientColor, setDiffuseColor, setEnabled, setSpecularColor |
Methods inherited from class org.j3d.aviatrix3d.Node |
boundsChanged, checkForCyclicParent, getBounds, getParent, recomputeBounds, removeParent, setBounds, setLive, setParent, updateBounds |
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 |
Field Detail |
protected float[] position
protected float cAttenuation
protected float lAttenuation
protected float qAttenuation
Constructor Detail |
public PointLight()
public PointLight(float[] col) throws java.lang.IllegalArgumentException
col
- The new colour value to usepublic PointLight(float[] col, float[] pos) throws java.lang.IllegalArgumentException
col
- The new colour value to usepos
- The position of the lightMethod Detail |
public void render(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu, java.lang.Object lightId)
gl
- The GL context to render withglu
- The GL utility context to render withlightId
- the ID of the light to make GL calls withpublic void postRender(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu, java.lang.Object lightId)
protected void markBoundsDirty()
markBoundsDirty
in class Node
public void setPosition(float[] pos) throws InvalidWriteTimingException
pos
- The new position value to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void setPosition(float x, float y, float z) throws InvalidWriteTimingException
x
- The x component of the position value to usey
- The y component of the position value to usez
- The z component of the position value to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void getPosition(float[] pos)
pos
- An array to copy the position intopublic void setAttenuation(float constant, float linear, float quad) throws InvalidWriteTimingException
constant
- The constant attenuation factorlinear
- The linear attenuation factorquad
- The quadratic attenuation factor
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void setAttenuation(float[] values) throws InvalidWriteTimingException
values
- Each value in the order:InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void getAttenuation(float[] values)
values
- Array to copy the values into, in the order:public int compareTo(Light l)
compareTo
in class Light
l
- The light instance to be compared
|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |