Class DirectionalLight

All Implemented Interfaces:
Styleable, EventTarget

public non-sealed class DirectionalLight extends LightBase
A light that illuminates an object from a specific direction. The direction is defined by the direction vector property.

DirectionalLights can represent strong light sources that are far enough from the objects they illuminate that their light rays appear to be parallel. Because these light sources are considered to be infinitely far, they cannot be attenuated. The sun is a common light source that can be simulated with this light type.

Since:
18
See Also:
  • Property Details

  • Constructor Details

    • DirectionalLight

      public DirectionalLight()
      Creates a new DirectionalLight with a default Color.WHITE color.
    • DirectionalLight

      public DirectionalLight(Color color)
      Creates a new DirectionalLight with the specified color.
      Parameters:
      color - the color of the light source
  • Method Details

    • setDirection

      public final void setDirection(Point3D value)
      Sets the value of the direction property.
      Property description:
      The direction vector of the directional light. It can be rotated by setting a rotation transform on the DirectionalLight. The vector need not be normalized.
      Default value:
      Point3D(0, 0, 1)
      Parameters:
      value - the value for the direction property
      See Also:
    • getDirection

      public final Point3D getDirection()
      Gets the value of the direction property.
      Property description:
      The direction vector of the directional light. It can be rotated by setting a rotation transform on the DirectionalLight. The vector need not be normalized.
      Default value:
      Point3D(0, 0, 1)
      Returns:
      the value of the direction property
      See Also:
    • directionProperty

      public final ObjectProperty<Point3D> directionProperty()
      The direction vector of the directional light. It can be rotated by setting a rotation transform on the DirectionalLight. The vector need not be normalized.
      Default value:
      Point3D(0, 0, 1)
      Returns:
      the direction property
      See Also: