Record Class Curve
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.client.vfx.Curve
- Record Components:
in- the easing of the first halfout- the easing of the second half
A value over a lifetime, in three points: it eases from
start to middle over the first half, then
from middle to end over the second. Particles use one for their size, opacity and spin, which is what
lets them swell and fade instead of popping in and out.
Curve.constant(0.25F) // always 0.25
Curve.of(0.0F, 1.0F) // grows, linearly
Curve.of(0.0F, 1.0F, 0.0F) // in, then out again
Curve.of(0.2F, 0.6F, 0.0F).easing(Easing.EXPO_OUT, Easing.SINE_IN) // bursts open, then drifts shut
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatat(float progress) The value at a progress through the lifetime,0to1(clamped).static Curveconstant(float value) This curve with both halves eased the same way.floatend()Returns the value of theendrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.in()Returns the value of theinrecord component.floatmiddle()Returns the value of themiddlerecord component.static Curveof(float start, float end) Fromstarttoend, passing half way between them at half the lifetime.static Curveof(float start, float middle, float end) out()Returns the value of theoutrecord component.scaled(float factor) This curve with every point multiplied.floatstart()Returns the value of thestartrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
ZERO
-
ONE
-
FADE
Opacity for most particles: quickly in, slowly out.
-
-
Constructor Details
-
Method Details
-
constant
-
of
Fromstarttoend, passing half way between them at half the lifetime. -
of
-
easing
This curve with both halves eased the same way. -
easing
-
scaled
This curve with every point multiplied. -
at
public float at(float progress) The value at a progress through the lifetime,0to1(clamped). -
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 '=='. -
start
public float start()Returns the value of thestartrecord component.- Returns:
- the value of the
startrecord component
-
middle
public float middle()Returns the value of themiddlerecord component.- Returns:
- the value of the
middlerecord component
-
end
public float end()Returns the value of theendrecord component.- Returns:
- the value of the
endrecord component
-
in
Returns the value of theinrecord component.- Returns:
- the value of the
inrecord component
-
out
Returns the value of theoutrecord component.- Returns:
- the value of the
outrecord component
-