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 interface
Defines 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 aLightFlicker
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.float
max()
Returns the value of themax
record component.float
min()
Returns the value of themin
record component.float
rate()
Returns the value of therate
record component.Returns the value of thesmoothingFunction
record component.final String
toString()
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 aLightFlicker
record class.- Parameters:
min
- the value for themin
record componentmax
- the value for themax
record componentrate
- the value for therate
record componentsmoothingFunction
- the value for thesmoothingFunction
record 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 themin
record component.- Returns:
- the value of the
min
record component
-
max
public float max()Returns the value of themax
record component.- Returns:
- the value of the
max
record component
-
rate
public float rate()Returns the value of therate
record component.- Returns:
- the value of the
rate
record component
-
smoothingFunction
Returns the value of thesmoothingFunction
record component.- Returns:
- the value of the
smoothingFunction
record component
-