Class SpotLightData

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

Represents a light emitting quad in the world.
Since:
4.4.0
  • Field Details

    • position

      protected final org.joml.Vector3d position
    • orientation

      protected final org.joml.Quaternionf orientation
    • size

      protected float size
    • angle

      protected float angle
    • distance

      protected float distance
    • occlusionEnabled

      protected boolean occlusionEnabled
    • inscattering

      protected float inscattering
  • Constructor Details

    • SpotLightData

      public SpotLightData()
  • Method Details

    • getType

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

      public org.joml.Vector3dc getPosition()
      Returns:
      The XYZ position of this light in the world
    • getPositionMutable

      public org.joml.Vector3d getPositionMutable()
      Allows the value to be safely modified.
      Returns:
      The XYZ position of this light in the world
    • getOrientation

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

      public org.joml.Quaternionf getOrientationMutable()
      Allows the value to be safely modified.
      Returns:
      The current orientation of the light
    • getSize

      public float 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
    • isOcclusionEnabled

      public boolean isOcclusionEnabled()
      Specified by:
      isOcclusionEnabled in interface DDALightData
      Returns:
      Whether occlusion is enabled
    • getInscatteringStrength

      public float getInscatteringStrength()
      Returns:
      The strength of the light's in-scattering effect.
      Since:
      4.4.0
    • setSize

      public SpotLightData setSize(float size)
      Sets the size of the light's surface
      Parameters:
      size - The size, in blocks, of the light's surface.
    • setAngle

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

      public SpotLightData setOcclusionEnabled(boolean occlusionEnabled)
    • setInscatteringStrength

      public SpotLightData setInscatteringStrength(float inscattering)
      Since:
      4.4.0
    • setColor

      public SpotLightData 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 SpotLightData 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 SpotLightData 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 SpotLightData 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 SpotLightData 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
    • renderLightGuide

      public void renderLightGuide(MatrixStack stack, com.mojang.blaze3d.vertex.VertexConsumer consumer)
      Description copied from interface: LightGuideProvider
      Render the light guides using the VertexConsumer.
      Specified by:
      renderLightGuide in interface LightGuideProvider