Class Light

java.lang.Object
foundry.veil.render.deferred.light.Light
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DirectionalLight, PointLight

public abstract class Light extends Object implements Cloneable
A source of luminance in a scene. Drawn using LightRenderer.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Types of lights that can exist.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.joml.Vector3f
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Removes the dirty flag after this light has been uploaded.
    abstract Light
     
    org.joml.Vector3fc
     
    int
     
    abstract Light.Type
     
    boolean
     
    abstract boolean
    Checks whether this light can be seen in the specified frustum.
    void
    Marks the data in this light as dirty and needing re-uploading.
    setColor(float red, float green, float blue)
    Sets the RGB color of this light.
    setColor(int color)
    Sets the RGB color of this light.
    setColor(org.joml.Vector3fc color)
    Sets the RGB color of this light.

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • color

      protected final org.joml.Vector3f color
  • Constructor Details

    • Light

      public Light()
  • Method Details

    • isVisible

      public abstract boolean isVisible(CullFrustum frustum)
      Checks whether this light can be seen in the specified frustum.
      Parameters:
      frustum - The frustum to check visibility with
      Returns:
      Whether that light is visible
    • markDirty

      public void markDirty()
      Marks the data in this light as dirty and needing re-uploading.
    • clean

      public void clean()
      Removes the dirty flag after this light has been uploaded.
    • getColor

      public org.joml.Vector3fc getColor()
      Returns:
      The color of this light
    • getColorInt

      public int getColorInt()
      Returns:
      An integer representing the RGB of this light
    • setColor

      public Light setColor(org.joml.Vector3fc color)
      Sets the RGB color of this light.
      Parameters:
      color - The new color values
    • setColor

      public Light setColor(float red, float green, float blue)
      Sets the RGB color of this light.
      Parameters:
      red - The new red
      green - The new green
      blue - The new blue
    • setColor

      public Light setColor(int color)
      Sets the RGB color of this light.
      Parameters:
      color - THe new RGB of this light
    • isDirty

      public boolean isDirty()
      Returns:
      If this light needs to be re-uploaded to the renderer
    • getType

      public abstract Light.Type getType()
      Returns:
      The type of light this is
    • clone

      public abstract Light clone()
      Overrides:
      clone in class Object