Class PointLight

java.lang.Object
foundry.veil.render.deferred.light.Light
foundry.veil.render.deferred.light.PointLight
All Implemented Interfaces:
InstancedLight, PositionedLight<PointLight>, Cloneable

public class PointLight extends Light implements InstancedLight, PositionedLight<PointLight>
Represents a light where all rays come from a position in space.
  • Field Details

    • position

      protected final org.joml.Vector3d position
    • radius

      protected float radius
    • falloff

      protected float falloff
  • Constructor Details

    • PointLight

      public PointLight()
  • Method Details

    • store

      public void store(ByteBuffer buffer)
      Description copied from interface: InstancedLight
      Stores the data of this light into the specified buffer.
      Specified by:
      store in interface InstancedLight
      Parameters:
      buffer - The buffer to fill
    • 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
    • getPosition

      public org.joml.Vector3d getPosition()
      Specified by:
      getPosition in interface PositionedLight<PointLight>
      Returns:
      The position of this light
    • getRadius

      public float getRadius()
      Returns:
      The maximum distance the light can travel
    • getFalloff

      public float getFalloff()
      Returns:
      The additional linear falloff applied to the light
    • setColor

      public PointLight 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 PointLight 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
    • setPosition

      public PointLight setPosition(double x, double y, double z)
      Description copied from interface: PositionedLight
      Sets the origin position of this light.
      Specified by:
      setPosition in interface PositionedLight<PointLight>
      Parameters:
      x - The x position of the light
      y - The y position of the light
      z - The z position of the light
    • setRadius

      public PointLight setRadius(float radius)
      Sets the maximum radius the light can influence.
      Parameters:
      radius - The maximum area of influence for the light
    • setFalloff

      public PointLight setFalloff(float falloff)
      Sets the additional linear falloff factor for attenuation.
      Parameters:
      falloff - The linear falloff factor
    • getType

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

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