Class DirectionalLight

java.lang.Object
com.ardor3d.light.Light
com.ardor3d.light.DirectionalLight
All Implemented Interfaces:
Savable, Serializable

public class DirectionalLight extends Light
DirectionalLight defines a light that is assumed to be infinitely far away (something similar to the sun). This means the direction of the light rays are all parallel. The direction field of this class identifies the direction in which the light is traveling, which is opposite how jME works.
See Also:
  • Constructor Details

    • DirectionalLight

      public DirectionalLight()
      Constructor instantiates a new DirectionalLight object. The initial light colors are white and the direction the light travels is along the positive z axis (0,0,1).
  • Method Details

    • getDirection

      public ReadOnlyVector3 getDirection()
      Returns:
      the direction the light traveling in.
    • setDirection

      public void setDirection(ReadOnlyVector3 direction)
      Parameters:
      direction - the direction the light is traveling in.
    • setDirection

      public void setDirection(double x, double y, double z)
      Parameters:
      x - the direction the light is traveling in on the x axis.
      y - the direction the light is traveling in on the y axis.
      z - the direction the light is traveling in on the z axis.
    • 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:
    • write

      public void write(OutputCapsule capsule) throws IOException
      Specified by:
      write in interface Savable
      Overrides:
      write in class Light
      Throws:
      IOException
    • read

      public void read(InputCapsule capsule) throws IOException
      Specified by:
      read in interface Savable
      Overrides:
      read in class Light
      Throws:
      IOException