|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.jinx.video.Light
public class Light
Represents a light source for rendering. Light sources are composed of
two parts, a Material object for the color of light and a vector that is
used as the position of the light. The shininess portion of the Material is
ignored.
NOTE: Never wrap a Light object in a DisplayList of any kind. Lights are
adaptively enabled as needed, so wrapping them in a DisplayList may cause one
light to interfere with another.
API Stability: Stable.
Constructor Summary | |
---|---|
Light()
Constructs a light with the default Material at the origin. |
|
Light(float[] position)
Constructs a light with the default Material at the origin, with the given position. |
Method Summary | |
---|---|
void |
deinit(Context opt)
Does nothing. |
void |
draw(Context opt)
Renders this Visible to glDrawable. |
Material |
getColor()
Returns the color of this light. |
float |
getConstantAttenuation()
Provides the constant attenuation for this light. |
float |
getLinearAttenuation()
Provides the linear attenuation for this light. |
float[] |
getPosition()
Returns the position of the light. |
float |
getQuadraticAttenuation()
Provides the quadratic attenuation for this light. |
float |
getSpotCutoff()
Provides the spotlight cutoff angle for this light. |
float[] |
getSpotDirection()
Provides the spotlight direction for this light. |
float |
getSpotExponent()
Provides the spot exponent for this light. |
void |
init(Context opt)
Does nothing. |
void |
setColor(Material color)
Sets the color of this light. |
void |
setConstantAttenuation(float constantAttenuation)
Sets the constant attenuation for this light. |
void |
setLinearAttenuation(float linearAttenuation)
Sets the linear attenuation for this light. |
void |
setPosition(float[] position)
Sets the position of the light in three dimensional space with an additional w coordinate that indicates weather the light is at an infinite distance or not. |
void |
setQuadraticAttenuation(float quadraticAttenuation)
Sets the quadratic attenuation for this light. |
void |
setSpotCutoff(float spotCutoff)
Sets the spotlight cutoff angle for this light. |
void |
setSpotDirection(float[] spotDirection)
Sets the spotlight direction. |
void |
setSpotExponent(float spotExponent)
Sets the spot exponent for this light. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Light()
public Light(float[] position)
position
- the vector for the position of the light.Method Detail |
---|
public void init(Context opt)
init
in interface Visible
opt
- describes the rendering options that are being used.public void deinit(Context opt)
deinit
in interface Visible
opt
- describes the rendering options that are being used.public float getQuadraticAttenuation()
public void setQuadraticAttenuation(float quadraticAttenuation)
quadraticAttenuation
- the value as a float.public float getLinearAttenuation()
public void setLinearAttenuation(float linearAttenuation)
linearAttenuation
- the value as a float.public float getConstantAttenuation()
public void setConstantAttenuation(float constantAttenuation)
constantAttenuation
- the value as a float.public float getSpotCutoff()
public void setSpotCutoff(float spotCutoff)
spotCutoff
- the spot cutoff as a float. 180 indicates that the
light isn't a spotlight.public float[] getSpotDirection()
public void setSpotDirection(float[] spotDirection)
spotDirection
- a three dimensional float array describing the
direction of the spotlight.public float getSpotExponent()
public void setSpotExponent(float spotExponent)
spotExponent
- the spot exponent as a float.public Material getColor()
public void setColor(Material color)
color
- the Material object to use as the color of this light.public float[] getPosition()
public void setPosition(float[] position)
position
- the vector to use as the position of this light.public void draw(Context opt)
Visible
draw
in interface Visible
opt
- describes the rendering options that are being used.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |