com.jme.light
Class DirectionalLight

java.lang.Object
  extended by com.jme.light.Light
      extended by com.jme.light.DirectionalLight
All Implemented Interfaces:
Savable, java.io.Serializable

public class DirectionalLight
extends Light

DirectionalLight defines a light that is assumed to be infintely far away (something similar to the sun). This means the direction of the light rays are all parallel. The direction the light is coming from is defined by the class.

Version:
$Id: DirectionalLight.java 4131 2009-03-19 20:15:28Z blaine.dev $
Author:
Mark Powell
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme.light.Light
Light.Type
 
Field Summary
 
Fields inherited from class com.jme.light.Light
shadowCaster
 
Constructor Summary
DirectionalLight()
          Constructor instantiates a new DirectionalLight object.
 
Method Summary
 Vector3f getDirection()
          getDirection returns the direction the light is emitting from.
 Light.Type getType()
          getType returns this light's type (Type.Directional).
 void read(JMEImporter e)
           
 void setDirection(Vector3f direction)
          setDirection sets the direction the light is emitting from.
 void write(JMEExporter e)
           
 
Methods inherited from class com.jme.light.Light
copyFrom, getAmbient, getClassTag, getConstant, getDiffuse, getLightMask, getLinear, getQuadratic, getSpecular, isAttenuate, isEnabled, isShadowCaster, popLightMask, pushLightMask, setAmbient, setAttenuate, setConstant, setDiffuse, setEnabled, setLightMask, setLinear, setQuadratic, setShadowCaster, setSpecular
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectionalLight

public DirectionalLight()
Constructor instantiates a new DirectionalLight object. The initial light colors are white and the direction the light emits from is (0,0,0).

Method Detail

getDirection

public Vector3f getDirection()
getDirection returns the direction the light is emitting from.

Returns:
the direction the light is emitting from.

setDirection

public void setDirection(Vector3f direction)
setDirection sets the direction the light is emitting from.

Parameters:
direction - the direction the light is emitting from.

getType

public Light.Type getType()
getType returns this light's type (Type.Directional).

Specified by:
getType in class Light
Returns:
the type of light that has been created.
See Also:
Light.getType()

write

public void write(JMEExporter e)
           throws java.io.IOException
Specified by:
write in interface Savable
Overrides:
write in class Light
Throws:
java.io.IOException

read

public void read(JMEImporter e)
          throws java.io.IOException
Specified by:
read in interface Savable
Overrides:
read in class Light
Throws:
java.io.IOException