com.jme3.light
Class Light

java.lang.Object
  extended by com.jme3.light.Light
All Implemented Interfaces:
Savable, java.lang.Cloneable
Direct Known Subclasses:
AmbientLight, DirectionalLight, PointLight, SpotLight

public abstract class Light
extends java.lang.Object
implements Savable, java.lang.Cloneable

Abstract class for representing a light source.

All light source types have a color.


Nested Class Summary
static class Light.Type
          Describes the light type.
 
Field Summary
protected  ColorRGBA color
           
protected  boolean enabled
          If light is disabled, it will not have any
protected  float lastDistance
          Used in LightList for caching the distance to the owner spatial.
protected  java.lang.String name
          The light name.
 
Constructor Summary
Light()
           
 
Method Summary
 Light clone()
           
protected abstract  void computeLastDistance(Spatial owner)
          Used internally to compute the last distance value.
 ColorRGBA getColor()
          Returns the color of the light.
 java.lang.String getName()
          Return the light name.
abstract  Light.Type getType()
          Returns the light type
 void read(JmeImporter im)
           
 void setColor(ColorRGBA color)
          Sets the light color.
 void setName(java.lang.String name)
          This method sets the light name.
 void write(JmeExporter ex)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

color

protected ColorRGBA color

lastDistance

protected transient float lastDistance
Used in LightList for caching the distance to the owner spatial. Should be reset after the sorting.


enabled

protected boolean enabled
If light is disabled, it will not have any


name

protected java.lang.String name
The light name.

Constructor Detail

Light

public Light()
Method Detail

getColor

public ColorRGBA getColor()
Returns the color of the light.

Returns:
The color of the light.

setName

public void setName(java.lang.String name)
This method sets the light name.

Parameters:
name - the light name

getName

public java.lang.String getName()
Return the light name.

Returns:
the light name

setColor

public void setColor(ColorRGBA color)
Sets the light color.

Parameters:
color - the light color.

clone

public Light clone()
Overrides:
clone in class java.lang.Object

write

public void write(JmeExporter ex)
           throws java.io.IOException
Specified by:
write in interface Savable
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Specified by:
read in interface Savable
Throws:
java.io.IOException

computeLastDistance

protected abstract void computeLastDistance(Spatial owner)
Used internally to compute the last distance value.


getType

public abstract Light.Type getType()
Returns the light type

Returns:
the light type
See Also:
Light.Type