|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.Node org.j3d.aviatrix3d.Leaf org.j3d.aviatrix3d.Light org.j3d.aviatrix3d.SpotLight
public class SpotLight
Representation of a spot light source.
A spot light has a direction, location and directs light as a conical shape in the given direction. Within the spotlight, there's a maximum angle that the light is effective to, and a drop-off rate of the light from the center to the maximum angle.
Internationalisation Resource Names
Field Summary |
---|
Fields inherited from class org.j3d.aviatrix3d.Light |
---|
AMBIENT_TYPE, ambientColor, diffuseColor, DIRECTIONAL_TYPE, effectBounds, enabled, globalOnly, INVALID_ALPHA_PROP, INVALID_BLUE_PROP, INVALID_GREEN_PROP, INVALID_RED_PROP, 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_TIMING_ERR_PROP, updateHandler |
Fields inherited from interface org.j3d.aviatrix3d.rendering.LeafCullable |
---|
AUDIO_CULLABLE, CLIP_CULLABLE, FOG_CULLABLE, GEOMETRY_CULLABLE, LIGHT_CULLABLE, OVERRIDE_CULLABLE |
Constructor Summary | |
---|---|
SpotLight()
Creates a light with the colour set to black. |
|
SpotLight(float[] col)
Create a light with the given base colour.Colour must be in the range [0, 1] otherwise an exception is generated. |
|
SpotLight(float[] col,
float[] pos,
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 |
getAttenuation(float[] values)
Set the attenuation factors for the light. |
float |
getCutOffAngle()
Get the current gut-off angle. |
void |
getDirection(float[] dir)
Retrieve the current direction vector from the light. |
float |
getDropOffRateExponent()
Get the current drop off exponent rate. |
void |
getPosition(float[] pos)
Retrieve the current position vector from the light. |
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 |
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 |
setCutOffAngle(float angle)
Set the cut-off angle. |
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. |
void |
setDropOffRateExponent(float exp)
Set the value of the exponent that can be used to control how the light intensity drops off from the center to the cut off angle. |
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, getCullableType, getDiffuseColor, getEffectBounds, getRenderable, getSpecularColor, isEnabled, isGlobalOnly, setAmbientColor, setDiffuseColor, setEffectBounds, setEnabled, setGlobalOnly, setSpecularColor |
Methods inherited from class org.j3d.aviatrix3d.Node |
---|
boundsChanged, checkForCyclicParent, getBounds, getParent, markBoundsDirty, recomputeBounds, removeParent, requestBoundsUpdate, setBounds, setParent, updateBounds, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, 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.rendering.LeafCullable |
---|
getBounds |
Methods inherited from interface org.j3d.aviatrix3d.rendering.Renderable |
---|
equals |
Constructor Detail |
---|
public SpotLight()
public SpotLight(float[] col) throws java.lang.IllegalArgumentException
col
- The new colour value to use
java.lang.IllegalArgumentException
public SpotLight(float[] col, float[] pos, float[] dir) throws java.lang.IllegalArgumentException
col
- The new colour value to usedir
- The direction of the light
java.lang.IllegalArgumentException
Method 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)
public void setCutOffAngle(float angle) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
angle
- The angle in degrees [0, 90]
java.lang.IllegalArgumentException
- The angle was outside the range
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic float getCutOffAngle()
public void setDropOffRateExponent(float exp) throws java.lang.IllegalArgumentException, InvalidWriteTimingException
exp
- The value of the exponent
java.lang.IllegalArgumentException
- The exponent was less than zero
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic float getDropOffRateExponent()
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 data changed 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 data changed callback methodpublic void getDirection(float[] dir)
dir
- An array to copy the direction intopublic void setPosition(float[] pos) throws InvalidWriteTimingException
pos
- The new position value to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener data changed 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 data changed 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 data changed 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 data changed 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
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |