Module technology.sola.engine
Record Class LightFlicker
java.lang.Object
java.lang.Record
technology.sola.engine.graphics.components.LightFlicker
- Record Components:
min- minimum light intensity between 0 and 1max- maximum light intensity between 0 and 1rate- the rate which flickering happens between 0 and 1smoothingFunction- function applied to smooth current intensity and next intensity value
@NullMarked
public record LightFlicker(float min, float max, float rate, LightFlicker.FlickerSmoothing smoothingFunction)
extends Record
LightFlicker
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDefines the API for the function called to smooth the transition between the current and next light intensity values. -
Constructor Summary
ConstructorsConstructorDescriptionLightFlicker(float min, float max) Creates a LightFlicker instance with a low flicker rate and a running average smoothing function.LightFlicker(float min, float max, float rate, LightFlicker.FlickerSmoothing smoothingFunction) Creates an instance of aLightFlickerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatmax()Returns the value of themaxrecord component.floatmin()Returns the value of theminrecord component.floatrate()Returns the value of theraterecord component.Returns the value of thesmoothingFunctionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
LightFlicker
public LightFlicker(float min, float max) Creates a LightFlicker instance with a low flicker rate and a running average smoothing function.- Parameters:
min- minimum light intensity between 0 and 1max- maximum light intensity between 0 and 1
-
LightFlicker
public LightFlicker(float min, float max, float rate, LightFlicker.FlickerSmoothing smoothingFunction) Creates an instance of aLightFlickerrecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord componentrate- the value for theraterecord componentsmoothingFunction- the value for thesmoothingFunctionrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
min
public float min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
public float max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
rate
public float rate()Returns the value of theraterecord component.- Returns:
- the value of the
raterecord component
-
smoothingFunction
Returns the value of thesmoothingFunctionrecord component.- Returns:
- the value of the
smoothingFunctionrecord component
-