Class PointLightData

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

public class PointLightData extends LightData implements IndirectLightData, EditorAttributeProvider
Represents a light where all rays come from a position in space.
Since:
2.0.0
  • Field Details

    • position

      protected final org.joml.Vector3d position
    • radius

      protected float radius
  • Constructor Details

    • PointLightData

      public PointLightData()
  • Method Details

    • getRadius

      public float getRadius()
      Specified by:
      getRadius in interface IndirectLightData
      Returns:
      The maximum distance the light can travel
    • getPosition

      public org.joml.Vector3dc getPosition()
      Specified by:
      getPosition in interface IndirectLightData
      Returns:
      The position of this light
    • setPosition

      public PointLightData setPosition(org.joml.Vector3dc pos)
    • setPosition

      public PointLightData setPosition(double x, double y, double z)
    • setRadius

      public PointLightData setRadius(float radius)
    • setColor

      public PointLightData 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 PointLightData 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 PointLightData 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 PointLightData 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 PointLightData 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.
    • 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
    • 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
    • setTo

      public PointLightData 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
    • getType

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

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