de.javagl.swogl.scene
Interface Light


public interface Light

This interface describes a Light. Default Light instances may be created with the Lights class. Lights may be added to the LightSetup that usually is part of a SwoglApplication.

All methods will store copies of the given arguments, or return copies of the internal state, respectively.


Nested Class Summary
static class Light.Type
          The type of a Light
 
Method Summary
 void addLightListener(LightListener lightListener)
          Add the given LightListener to be informed about modifications of this Light.
 javax.vecmath.Color4f getAmbientColor()
          Return the ambient color of this Light.
 float getConstantAttenuation()
          Return the constant attenuation of this Light.
 javax.vecmath.Color4f getDiffuseColor()
          Return the diffuse color of this Light.
 javax.vecmath.Vector3f getDirection()
          Return the direction of this Light.
 float getLinearAttenuation()
          Return the linear attenuation of this Light.
 javax.vecmath.Point3f getPosition()
          Return the position of this Light.
 float getQuadraticAttenuation()
          Return the quadratic attenuation of this Light.
 javax.vecmath.Color4f getSpecularColor()
          Return the specular color of this Light.
 float getSpotCutoff()
          Return the cutoff angle of this Light, in degrees.
 float getSpotExponent()
          Return the spot light attenuation exponent.
 Light.Type getType()
          Returns the Light.Type of this Light
 void removeLightListener(LightListener lightListener)
          Remove the given LightListener
 void setAmbientColor(float r, float g, float b, float a)
          Set the ambient color of this Light
 void setAmbientColor(javax.vecmath.Tuple4f ambient)
          Set the ambient color of this Light
 void setConstantAttenuation(float constant)
          Set the constant attenuation of this Light
 void setDiffuseColor(float r, float g, float b, float a)
          Set the diffuse color of this Light
 void setDiffuseColor(javax.vecmath.Tuple4f diffuse)
          Set the diffuse color of this Light
 void setDirection(float x, float y, float z)
          Set the direction of this Light For point lights, this value has no effect.
 void setDirection(javax.vecmath.Tuple3f direction)
          Set the direction of this Light For point lights, this value has no effect.
 void setLinearAttenuation(float linear)
          Set the linear attenuation of this Light
 void setPosition(float x, float y, float z)
          Set the position of this Light.
 void setPosition(javax.vecmath.Tuple3f position)
          Set the position of this Light.
 void setQuadraticAttenuation(float quadratic)
          Set the quadratic attenuation of this Light
 void setSpecularColor(float r, float g, float b, float a)
          Set the specular color of this Light
 void setSpecularColor(javax.vecmath.Tuple4f specular)
          Set the specular color of this Light
 void setSpotCutoff(float cutoff)
          Set the spot cutoff angle of this Light, in degrees.
 void setSpotExponent(float spotExponent)
          Set the spot exponent of this Light.
 

Method Detail

getType

Light.Type getType()
Returns the Light.Type of this Light

Returns:
The Light.Type

setAmbientColor

void setAmbientColor(javax.vecmath.Tuple4f ambient)
Set the ambient color of this Light

Parameters:
ambient - The ambient color

setAmbientColor

void setAmbientColor(float r,
                     float g,
                     float b,
                     float a)
Set the ambient color of this Light

Parameters:
r - The red component
g - The green component
b - The blue component
a - The alpha component

getAmbientColor

javax.vecmath.Color4f getAmbientColor()
Return the ambient color of this Light.

Returns:
The ambient color

setDiffuseColor

void setDiffuseColor(javax.vecmath.Tuple4f diffuse)
Set the diffuse color of this Light

Parameters:
diffuse - The diffuse color

setDiffuseColor

void setDiffuseColor(float r,
                     float g,
                     float b,
                     float a)
Set the diffuse color of this Light

Parameters:
r - The red component
g - The green component
b - The blue component
a - The alpha component

getDiffuseColor

javax.vecmath.Color4f getDiffuseColor()
Return the diffuse color of this Light.

Returns:
The diffuse color

setSpecularColor

void setSpecularColor(javax.vecmath.Tuple4f specular)
Set the specular color of this Light

Parameters:
specular - The specular color

setSpecularColor

void setSpecularColor(float r,
                      float g,
                      float b,
                      float a)
Set the specular color of this Light

Parameters:
r - The red component
g - The green component
b - The blue component
a - The alpha component

getSpecularColor

javax.vecmath.Color4f getSpecularColor()
Return the specular color of this Light.

Returns:
The specular color

setPosition

void setPosition(javax.vecmath.Tuple3f position)
Set the position of this Light. For directional lights, this value has no effect.

Parameters:
position - The position

setPosition

void setPosition(float x,
                 float y,
                 float z)
Set the position of this Light. For directional lights, this value has no effect.

Parameters:
x - The x coordinate
y - The y coordinate
z - The z coordinate

getPosition

javax.vecmath.Point3f getPosition()
Return the position of this Light.

Returns:
The position

setDirection

void setDirection(javax.vecmath.Tuple3f direction)
Set the direction of this Light For point lights, this value has no effect.

Parameters:
direction - The direction

setDirection

void setDirection(float x,
                  float y,
                  float z)
Set the direction of this Light For point lights, this value has no effect.

Parameters:
x - The x coordinate
y - The y coordinate
z - The z coordinate

getDirection

javax.vecmath.Vector3f getDirection()
Return the direction of this Light.

Returns:
The direction

setConstantAttenuation

void setConstantAttenuation(float constant)
Set the constant attenuation of this Light

Parameters:
constant - The attenuation

getConstantAttenuation

float getConstantAttenuation()
Return the constant attenuation of this Light.

Returns:
The constant attenuation

setLinearAttenuation

void setLinearAttenuation(float linear)
Set the linear attenuation of this Light

Parameters:
linear - The attenuation

getLinearAttenuation

float getLinearAttenuation()
Return the linear attenuation of this Light.

Returns:
The linear attenuation

setQuadraticAttenuation

void setQuadraticAttenuation(float quadratic)
Set the quadratic attenuation of this Light

Parameters:
quadratic - The attenuation

getQuadraticAttenuation

float getQuadraticAttenuation()
Return the quadratic attenuation of this Light.

Returns:
The quadratic attenuation

setSpotCutoff

void setSpotCutoff(float cutoff)
Set the spot cutoff angle of this Light, in degrees. The given value will be clamped to be in the range [0,90]. This value will only be used for spot lights.

Parameters:
cutoff - The cutoff

getSpotCutoff

float getSpotCutoff()
Return the cutoff angle of this Light, in degrees. The value will be in the range [0,90]

Returns:
The cutoff angle, in degrees.

setSpotExponent

void setSpotExponent(float spotExponent)
Set the spot exponent of this Light. The light is attenuated from the center to the edge of the spot cone. Higher exponents result in more focused lights. This value will only be used for spot lights.

Parameters:
spotExponent - The spot exponent

getSpotExponent

float getSpotExponent()
Return the spot light attenuation exponent.

Returns:
The spot attenuation exponent.

addLightListener

void addLightListener(LightListener lightListener)
Add the given LightListener to be informed about modifications of this Light.

Parameters:
lightListener - The listener to add

removeLightListener

void removeLightListener(LightListener lightListener)
Remove the given LightListener

Parameters:
lightListener - The listener to remove