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

public class AreaLight extends Light implements InstancedLight, PositionedLight<AreaLight>, EditorAttributeProvider
  • Field Details

    • position

      protected final org.joml.Vector3d position
    • orientation

      protected final org.joml.Quaternionf orientation
    • size

      protected final org.joml.Vector2f size
    • angle

      protected float angle
    • distance

      protected float distance
  • Constructor Details

    • AreaLight

      public AreaLight()
  • 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
    • getType

      public LightTypeRegistry.LightType<?> getType()
      Specified by:
      getType in class Light
      Returns:
      The type of light this is
    • getPosition

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

      public org.joml.Quaternionf getOrientation()
      Returns:
      The current orientation of the light.
    • getSize

      public org.joml.Vector2f getSize()
      Returns:
      The size of the light's surface
    • getAngle

      public float getAngle()
      Returns:
      The maximum angle of the light from the plane's surface.
    • getDistance

      public float getDistance()
      Returns:
      The maximum distance the light can travel
    • setColor

      public AreaLight 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 AreaLight 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
    • setBrightness

      public AreaLight setBrightness(float brightness)
      Description copied from class: Light
      Sets the brightness of the light. This acts as a multiplier on the light's color.
      Overrides:
      setBrightness in class Light
      Parameters:
      brightness - The new brightness of the light.
    • setPosition

      public AreaLight 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<AreaLight>
      Parameters:
      x - The x position of the light
      y - The y position of the light
      z - The z position of the light
    • setOrientation

      public AreaLight setOrientation(org.joml.Quaternionfc orientation)
      Sets the orientation of the light's surface
      Parameters:
      orientation - The orientation of the light's surface.
    • setSize

      public AreaLight setSize(double x, double y)
      Sets the size of the light's surface
      Parameters:
      x - The length, in blocks, of the light's surface.
      y - The width, in blocks, of the light's surface.
    • setAngle

      public AreaLight setAngle(float angle)
      Sets the maximum angle the light can influence.
      Parameters:
      angle - The maximum angle of the light's influence in radians
    • setDistance

      public AreaLight setDistance(float distance)
      Sets the maximum distance the light can influence.
      Parameters:
      distance - The maximum area of influence for the light
    • setTo

      public Light setTo(net.minecraft.client.Camera camera)
      Description copied from class: Light
      Sets the light position/rotation to be the same as the specified camera.
      Overrides:
      setTo in class Light
      Parameters:
      camera - The camera to set relative to
    • updateMatrix

      protected void updateMatrix()
    • clone

      public AreaLight clone()
      Specified by:
      clone in class Light
    • renderImGuiAttributes

      public void renderImGuiAttributes()
      Description copied from interface: EditorAttributeProvider
      Renders all ImGui attributes into the current editor panel.
      Specified by:
      renderImGuiAttributes in interface EditorAttributeProvider