Class AreaLightData

java.lang.Object
foundry.veil.api.client.render.light.data.LightData
foundry.veil.api.client.render.light.data.AreaLightData
All Implemented Interfaces:
EditorAttributeProvider, InstancedLightData

public class AreaLightData extends LightData implements InstancedLightData, EditorAttributeProvider
Represents a light emitting quad in the world.
Since:
2.0.0
  • 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

    • AreaLightData

      public AreaLightData()
  • Method Details

    • updateMatrix

      protected void updateMatrix()
    • getType

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

      public org.joml.Vector3d getPosition()
      Returns:
      The XYZ position of this light in the world
    • 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
    • setSize

      public AreaLightData 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 AreaLightData 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 AreaLightData setDistance(float distance)
      Sets the maximum distance the light can influence.
      Parameters:
      distance - The maximum area of influence for the light
    • setColor

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

      public AreaLightData setColor(Colorc color)
      Description copied from class: LightData
      Sets the RGB color of this light.
      Overrides:
      setColor in class LightData
      Parameters:
      color - The new color values
    • setColor

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

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

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

      public void store(ByteBuffer buffer)
      Description copied from interface: InstancedLightData
      Stores the data of this light into the specified buffer.
      Specified by:
      store in interface InstancedLightData
      Parameters:
      buffer - The buffer to fill
    • isVisible

      public boolean isVisible(CullFrustum frustum)
      Description copied from class: LightData
      Checks if this light is visible to the camera.
      Specified by:
      isVisible in class LightData
      Parameters:
      frustum - The frustum to check against
      Returns:
      Whether this light is visible
    • setTo

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

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