com.jme3.light
Class DirectionalLight

java.lang.Object
  extended by com.jme3.light.Light
      extended by com.jme3.light.DirectionalLight
All Implemented Interfaces:
Savable, java.lang.Cloneable

public class DirectionalLight
extends Light

DirectionalLight is a light coming from a certain direction in world space. E.g sun or moon light.

Directional lights have no specific position in the scene, they always come from their direction regardless of where an object is placed.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.jme3.light.Light
Light.Type
 
Field Summary
protected  Vector3f direction
           
 
Fields inherited from class com.jme3.light.Light
color, enabled, lastDistance, name
 
Constructor Summary
DirectionalLight()
           
 
Method Summary
 void computeLastDistance(Spatial owner)
          Used internally to compute the last distance value.
 Vector3f getDirection()
          Returns the direction vector of the light.
 Light.Type getType()
          Returns the light type
 void read(JmeImporter im)
           
 void setDirection(Vector3f dir)
          Sets the direction of the light.
 void write(JmeExporter ex)
           
 
Methods inherited from class com.jme3.light.Light
clone, getColor, getName, setColor, setName
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

direction

protected Vector3f direction
Constructor Detail

DirectionalLight

public DirectionalLight()
Method Detail

computeLastDistance

public void computeLastDistance(Spatial owner)
Description copied from class: Light
Used internally to compute the last distance value.

Specified by:
computeLastDistance in class Light

getDirection

public Vector3f getDirection()
Returns the direction vector of the light.

Returns:
The direction vector of the light.
See Also:
setDirection(com.jme3.math.Vector3f)

setDirection

public void setDirection(Vector3f dir)
Sets the direction of the light.

Represents the vector direction the light is coming from. (1, 0, 0) would represent a directional light coming from the X axis.

Parameters:
dir - the direction of the light.

getType

public Light.Type getType()
Description copied from class: Light
Returns the light type

Specified by:
getType in class Light
Returns:
the light type
See Also:
Light.Type

write

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

read

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