Class Light
java.lang.Object
foundry.veil.api.client.render.light.Light
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
AreaLight
,DirectionalLight
,PointLight
A source of luminance in a scene. Drawn using
LightRenderer
.-
Field Summary
Modifier and TypeFieldDescriptionprotected float
protected final org.joml.Vector3f
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clean()
Removes the dirty flag after this light has been uploaded.abstract Light
clone()
float
org.joml.Vector3fc
getColor()
int
abstract LightTypeRegistry.LightType
<?> getType()
boolean
isDirty()
void
Marks the data in this light as dirty and needing re-uploading.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.setColor
(org.joml.Vector3fc color) Sets the RGB color of this light.setTo
(net.minecraft.client.Camera camera) Sets the light position/rotation to be the same as the specified camera.
-
Field Details
-
color
protected final org.joml.Vector3f color -
brightness
protected float brightness
-
-
Constructor Details
-
Light
public Light()
-
-
Method Details
-
markDirty
public void markDirty()Marks the data in this light as dirty and needing re-uploading. -
clean
public void clean()Removes the dirty flag after this light has been uploaded. -
getColor
public org.joml.Vector3fc getColor()- Returns:
- The color of this light
-
getColorInt
public int getColorInt()- Returns:
- An integer representing the RGB of this light
-
setColor
Sets the RGB color of this light.- Parameters:
color
- The new color values
-
setColor
Sets the RGB color of this light.- Parameters:
red
- The new redgreen
- The new greenblue
- The new blue
-
setColor
Sets the RGB color of this light.- Parameters:
color
- THe new RGB of this light
-
setBrightness
Sets the brightness of the light. This acts as a multiplier on the light's color.- Parameters:
brightness
- The new brightness of the light.
-
setTo
Sets the light position/rotation to be the same as the specified camera.- Parameters:
camera
- The camera to set relative to
-
getBrightness
public float getBrightness()- Returns:
- The brightness multiplier of the light.
-
isDirty
public boolean isDirty()- Returns:
- If this light needs to be re-uploaded to the renderer
-
getType
- Returns:
- The type of light this is
-
clone
-