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,DDALightData,IndirectLightData,InstancedLightData,LightGuideProvider
public class PointLightData
extends LightData
implements IndirectLightData, DDALightData, EditorAttributeProvider, LightGuideProvider
Represents a light where all rays come from a position in space.
- Since:
- 2.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatprotected booleanprotected final org.joml.Vector3dprotected floatFields inherited from class foundry.veil.api.client.render.light.data.LightData
brightness, color -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatorg.joml.Vector3dcorg.joml.Vector3dAllows the value to be safely modified.floatgetType()booleanbooleanisVisible(CullFrustum frustum) Checks if this light is visible to the camera.voidRenders all ImGui attributes into the current editor panel.voidrenderLightGuide(MatrixStack stack, com.mojang.blaze3d.vertex.VertexConsumer consumer) Render the light guides using the VertexConsumer.setBrightness(float brightness) Sets the brightness of the light.setColor(float red, float green, float blue) Sets the RGB color of this light.setColor(int color) Sets the RGB color of this light.Sets the RGB color of this light.setColor(org.joml.Vector3fc color) Sets the RGB color of this light.setInscatteringStrength(float inscattering) setOcclusionEnabled(boolean occlusionEnabled) setPosition(double x, double y, double z) setPosition(org.joml.Vector3dc pos) setRadius(float radius) setTo(net.minecraft.client.Camera camera) Sets the light position/rotation to be the same as the specified camera.voidstore(ByteBuffer buffer) Stores the data of this light into the specified buffer.Methods inherited from class foundry.veil.api.client.render.light.data.LightData
getBrightness, getColor, getColorMutable, getRevision, markDirty
-
Field Details
-
position
protected final org.joml.Vector3d position -
radius
protected float radius -
occlusionEnabled
protected boolean occlusionEnabled -
inscattering
protected float inscattering
-
-
Constructor Details
-
PointLightData
public PointLightData()
-
-
Method Details
-
getRadius
public float getRadius()- Specified by:
getRadiusin interfaceIndirectLightData- Returns:
- The maximum distance the light can travel
-
getPosition
public org.joml.Vector3dc getPosition()- Specified by:
getPositionin interfaceIndirectLightData- 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
- Since:
- 4.3.0
-
isOcclusionEnabled
public boolean isOcclusionEnabled()- Specified by:
isOcclusionEnabledin interfaceDDALightData- Returns:
- Whether occlusion is enabled
-
getInscatteringStrength
public float getInscatteringStrength()- Returns:
- The strength of the light's in-scattering effect.
- Since:
- 4.4.0
-
setPosition
-
setPosition
-
setRadius
-
setOcclusionEnabled
-
setInscatteringStrength
- Since:
- 4.4.0
-
setColor
Description copied from class:LightDataSets the RGB color of this light. -
setColor
Description copied from class:LightDataSets the RGB color of this light. -
setColor
Description copied from class:LightDataSets the RGB color of this light. -
setColor
Description copied from class:LightDataSets the RGB color of this light. -
setBrightness
Description copied from class:LightDataSets the brightness of the light. This acts as a multiplier on the light's color.- Overrides:
setBrightnessin classLightData- Parameters:
brightness- The new brightness of the light.
-
isVisible
Description copied from class:LightDataChecks if this light is visible to the camera. -
store
Description copied from interface:InstancedLightDataStores the data of this light into the specified buffer.- Specified by:
storein interfaceInstancedLightData- Parameters:
buffer- The buffer to fill
-
setTo
Description copied from class:LightDataSets the light position/rotation to be the same as the specified camera. -
getType
-
renderImGuiAttributes
public void renderImGuiAttributes()Description copied from interface:EditorAttributeProviderRenders all ImGui attributes into the current editor panel.- Specified by:
renderImGuiAttributesin interfaceEditorAttributeProvider
-
renderLightGuide
Description copied from interface:LightGuideProviderRender the light guides using the VertexConsumer.- Specified by:
renderLightGuidein interfaceLightGuideProvider
-