Class DirectionalLight

java.lang.Object
foundry.veil.render.deferred.light.Light
foundry.veil.render.deferred.light.DirectionalLight
All Implemented Interfaces:
Cloneable

public class DirectionalLight extends Light
Represents a light where all rays come from the same direction everywhere. (The sun)
  • Field Details

    • direction

      protected final org.joml.Vector3f direction
  • Constructor Details

    • DirectionalLight

      public DirectionalLight()
  • Method Details

    • isVisible

      public boolean isVisible(CullFrustum frustum)
      Description copied from class: Light
      Checks whether this light can be seen in the specified frustum.
      Specified by:
      isVisible in class Light
      Parameters:
      frustum - The frustum to check visibility with
      Returns:
      Whether that light is visible
    • getDirection

      public org.joml.Vector3fc getDirection()
      Returns:
      The direction this light is facing
    • setColor

      public DirectionalLight setColor(float red, float green, float blue)
      Description copied from class: Light
      Sets the RGB color of this light.
      Overrides:
      setColor in class Light
      Parameters:
      red - The new red
      green - The new green
      blue - The new blue
    • setColor

      public DirectionalLight setColor(org.joml.Vector3fc color)
      Description copied from class: Light
      Sets the RGB color of this light.
      Overrides:
      setColor in class Light
      Parameters:
      color - The new color values
    • setColor

      public DirectionalLight setColor(int color)
      Description copied from class: Light
      Sets the RGB color of this light.
      Overrides:
      setColor in class Light
      Parameters:
      color - THe new RGB of this light
    • setDirection

      public DirectionalLight setDirection(org.joml.Vector3fc direction)
      Sets the direction of this light.
      Parameters:
      direction - The new direction
    • setDirection

      public DirectionalLight setDirection(float x, float y, float z)
      Sets the direction of this light.
      Parameters:
      x - The new x direction
      y - The new y direction
      z - The new z direction
    • getType

      public Light.Type getType()
      Specified by:
      getType in class Light
      Returns:
      The type of light this is
    • clone

      public DirectionalLight clone()
      Specified by:
      clone in class Light