Package kr.toxicity.model.api.animation
Record Class VectorPoint
java.lang.Object
java.lang.Record
kr.toxicity.model.api.animation.VectorPoint
- Record Components:
function- a function to get the vector value, which may be dynamic (e.g., based on Molang expressions)time- the time of this keyframe in secondsbezier- the bezier curve configuration for interpolation, if applicableinterpolator- the interpolation method to use (e.g., linear, bezier, catmull-rom)
- All Implemented Interfaces:
Comparable<Timed>,Timed
public record VectorPoint(@NotNull FloatFunction<org.joml.Vector3f> function, float time, @NotNull VectorPoint.BezierConfig bezier, @NotNull VectorInterpolator interpolator)
extends Record
implements Timed
Represents a keyframe point in an animation timeline.
This record holds the value of a vector (position, rotation, or scale) at a specific time, along with interpolation information to create smooth transitions between keyframes.
- Since:
- 1.15.2
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordConfiguration for bezier curve interpolation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final VectorPointAn empty, default vector point at time 0 with linear interpolation. -
Constructor Summary
ConstructorsConstructorDescriptionVectorPoint(@NotNull FloatFunction<org.joml.Vector3f> function, float time, @NotNull VectorPoint.BezierConfig bezier, @NotNull VectorInterpolator interpolator) Creates an instance of aVectorPointrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull VectorPoint.BezierConfigbezier()Returns the value of thebezierrecord component.booleanIndicates whether some other object is "equal to" this one.@NotNull FloatFunction<org.joml.Vector3f> function()Returns the value of thefunctionrecord component.inthashCode()Returns a hash code value for this object.@NotNull VectorInterpolatorReturns the value of theinterpolatorrecord component.booleanChecks if the interpolation method for this point is continuous.floattime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.@NotNull org.joml.Vector3fvector()Gets the vector value at this keyframe's specific time.@NotNull org.joml.Vector3fvector(float time) Gets the vector value at a specific time, evaluating the function if necessary.
-
Field Details
-
EMPTY
An empty, default vector point at time 0 with linear interpolation.- Since:
- 1.15.2
-
-
Constructor Details
-
VectorPoint
public VectorPoint(@NotNull @NotNull FloatFunction<org.joml.Vector3f> function, float time, @NotNull @NotNull VectorPoint.BezierConfig bezier, @NotNull @NotNull VectorInterpolator interpolator) Creates an instance of aVectorPointrecord class.- Parameters:
function- the value for thefunctionrecord componenttime- the value for thetimerecord componentbezier- the value for thebezierrecord componentinterpolator- the value for theinterpolatorrecord component
-
-
Method Details
-
vector
@NotNull public @NotNull org.joml.Vector3f vector()Gets the vector value at this keyframe's specific time.- Returns:
- the vector value
- Since:
- 1.15.2
-
vector
@NotNull public @NotNull org.joml.Vector3f vector(float time) Gets the vector value at a specific time, evaluating the function if necessary.- Parameters:
time- the time to evaluate at- Returns:
- the calculated vector
- Since:
- 1.15.2
-
isContinuous
public boolean isContinuous()Checks if the interpolation method for this point is continuous.- Returns:
- true if continuous (e.g., linear), false if stepped
- Since:
- 1.15.2
-
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 '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
function
Returns the value of thefunctionrecord component.- Returns:
- the value of the
functionrecord component
-
time
public float time()Returns the value of thetimerecord component. -
bezier
Returns the value of thebezierrecord component.- Returns:
- the value of the
bezierrecord component
-
interpolator
Returns the value of theinterpolatorrecord component.- Returns:
- the value of the
interpolatorrecord component
-