Class DirectionalLightData

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

public class DirectionalLightData extends LightData implements EditorAttributeProvider
Represents a light where all rays come from the same direction everywhere. (The sun)
Since:
2.0.0
  • Field Details

    • direction

      protected final org.joml.Vector3f direction
  • Constructor Details

    • DirectionalLightData

      public DirectionalLightData()
  • Method Details

    • getDirection

      public org.joml.Vector3f getDirection()
      Returns:
      The direction this light is facing
    • setDirection

      public DirectionalLightData setDirection(org.joml.Vector3fc direction)
      Sets the direction of this light.
      Parameters:
      direction - The new direction
    • setDirection

      public DirectionalLightData setDirection(float x, float y, float z)
      Sets the direction of this light.
      Parameters:
      x - The new x direction
      y - The new y direction
      z - The new z direction
    • setColor

      public DirectionalLightData 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 DirectionalLightData 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 DirectionalLightData 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 DirectionalLightData 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 DirectionalLightData 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
    • setTo

      public DirectionalLightData 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