Record Class SpringInterpolator
java.lang.Object
java.lang.Record
cromveil.combatnumbers.animation.SpringInterpolator
- All Implemented Interfaces:
Interpolator
public record SpringInterpolator(float from, float to, float velocity, float stiffness, float damping, ComposeMode compose)
extends Record
implements Interpolator
-
Constructor Summary
ConstructorsConstructorDescriptionSpringInterpolator(float from, float to, float velocity, float stiffness, float damping, ComposeMode compose) Creates an instance of aSpringInterpolatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncompose()Returns the value of thecomposerecord component.floatdamping()Returns the value of thedampingrecord component.floatendValue()final booleanIndicates whether some other object is "equal to" this one.floatfrom()Returns the value of thefromrecord component.final inthashCode()Returns a hash code value for this object.floatfloatReturns the value of thestiffnessrecord component.floatto()Returns the value of thetorecord component.final StringtoString()Returns a string representation of this record class.floatvelocity()Returns the value of thevelocityrecord component.static SpringInterpolatorwithDefaults(float from, float to, float velocity) static SpringInterpolatorwithDefaults(float from, float to, float velocity, ComposeMode compose)
-
Constructor Details
-
SpringInterpolator
public SpringInterpolator(float from, float to, float velocity, float stiffness, float damping, ComposeMode compose) Creates an instance of aSpringInterpolatorrecord class.- Parameters:
from- the value for thefromrecord componentto- the value for thetorecord componentvelocity- the value for thevelocityrecord componentstiffness- the value for thestiffnessrecord componentdamping- the value for thedampingrecord componentcompose- the value for thecomposerecord component
-
-
Method Details
-
withDefaults
public static SpringInterpolator withDefaults(float from, float to, float velocity, ComposeMode compose) -
withDefaults
-
startValue
public float startValue()- Specified by:
startValuein interfaceInterpolator
-
endValue
public float endValue()- Specified by:
endValuein interfaceInterpolator
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
from
public float from()Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord component
-
to
public float to()Returns the value of thetorecord component.- Returns:
- the value of the
torecord component
-
velocity
public float velocity()Returns the value of thevelocityrecord component.- Returns:
- the value of the
velocityrecord component
-
stiffness
public float stiffness()Returns the value of thestiffnessrecord component.- Returns:
- the value of the
stiffnessrecord component
-
damping
public float damping()Returns the value of thedampingrecord component.- Returns:
- the value of the
dampingrecord component
-
compose
Returns the value of thecomposerecord component.- Specified by:
composein interfaceInterpolator- Returns:
- the value of the
composerecord component
-