Record Class ModelKeyframe
java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.ModelKeyframe
- Record Components:
channel- the channel this keyframe affects (position, rotation, scale)dataPoints- the list of data points (values) for this keyframebezierLeftTime- the time offset for the left bezier handlebezierLeftValue- the value offset for the left bezier handlebezierRightTime- the time offset for the right bezier handlebezierRightValue- the value offset for the right bezier handleinterpolation- the interpolation type (e.g., linear, catmullrom, bezier)time- the time of the keyframe in seconds
- All Implemented Interfaces:
Comparable<Timed>, Timed
@Internal
public record ModelKeyframe(@Nullable KeyframeChannel channel, @NotNull List<ModelDatapoint> dataPoints, @Nullable Float3 bezierLeftTime, @Nullable Float3 bezierLeftValue, @Nullable Float3 bezierRightTime, @Nullable Float3 bezierRightValue, @Nullable VectorInterpolator interpolation, float time)
extends Record
implements Timed
Represents a single keyframe in an animation timeline.
A keyframe defines the state of a bone (position, rotation, or scale) at a specific time, along with interpolation data (linear, catmull-rom, bezier) to smooth transitions.
- Since:
- 1.15.2
-
Constructor Summary
ConstructorsConstructorDescriptionModelKeyframe(@Nullable KeyframeChannel channel, @NotNull List<ModelDatapoint> dataPoints, @Nullable Float3 bezierLeftTime, @Nullable Float3 bezierLeftValue, @Nullable Float3 bezierRightTime, @Nullable Float3 bezierRightValue, @Nullable VectorInterpolator interpolation, float time) Creates an instance of aModelKeyframerecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable Float3Returns the value of thebezierLeftTimerecord component.@Nullable Float3Returns the value of thebezierLeftValuerecord component.@Nullable Float3Returns the value of thebezierRightTimerecord component.@Nullable Float3Returns the value of thebezierRightValuerecord component.@NotNull KeyframeChannelchannel()Returns the channel this keyframe affects.@NotNull List<ModelDatapoint> Returns the value of thedataPointsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasPoint()Checks if this keyframe contains any data points.@NotNull VectorInterpolatorReturns the interpolation type for this keyframe.@NotNull ModelDatapointpoint()Returns the first data point in the list.@NotNull VectorPointpoint(@NotNull ModelLoadContext context, @NotNull Function<org.joml.Vector3f, org.joml.Vector3f> function) Converts this keyframe into a processedVectorPoint.floattime()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ModelKeyframe
public ModelKeyframe(@Nullable @Nullable KeyframeChannel channel, @NotNull @NotNull List<ModelDatapoint> dataPoints, @Nullable @Nullable Float3 bezierLeftTime, @Nullable @Nullable Float3 bezierLeftValue, @Nullable @Nullable Float3 bezierRightTime, @Nullable @Nullable Float3 bezierRightValue, @Nullable @Nullable VectorInterpolator interpolation, float time) Creates an instance of aModelKeyframerecord class.- Parameters:
channel- the value for thechannelrecord componentdataPoints- the value for thedataPointsrecord componentbezierLeftTime- the value for thebezierLeftTimerecord componentbezierLeftValue- the value for thebezierLeftValuerecord componentbezierRightTime- the value for thebezierRightTimerecord componentbezierRightValue- the value for thebezierRightValuerecord componentinterpolation- the value for theinterpolationrecord componenttime- the value for thetimerecord component
-
-
Method Details
-
hasPoint
public boolean hasPoint()Checks if this keyframe contains any data points.- Returns:
- true if data points exist, false otherwise
- Since:
- 1.15.2
-
point
Returns the first data point in the list.- Returns:
- the first data point
- Throws:
NoSuchElementException- if the list is empty- Since:
- 1.15.2
-
point
@NotNull public @NotNull VectorPoint point(@NotNull @NotNull ModelLoadContext context, @NotNull @NotNull Function<org.joml.Vector3f, org.joml.Vector3f> function) Converts this keyframe into a processedVectorPoint.- Parameters:
context- the model loading contextfunction- a transformation function to apply to the vector values (e.g., coordinate conversion)- Returns:
- the vector point
- Since:
- 1.15.2
-
interpolation
Returns the interpolation type for this keyframe.- Returns:
- the interpolation type, defaulting to
VectorInterpolator.LINEARif null - Since:
- 1.15.2
-
channel
Returns the channel this keyframe affects.- Returns:
- the channel, defaulting to
KeyframeChannel.NOT_FOUNDif null - Since:
- 1.15.2
-
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. -
dataPoints
Returns the value of thedataPointsrecord component.- Returns:
- the value of the
dataPointsrecord component
-
bezierLeftTime
Returns the value of thebezierLeftTimerecord component.- Returns:
- the value of the
bezierLeftTimerecord component
-
bezierLeftValue
Returns the value of thebezierLeftValuerecord component.- Returns:
- the value of the
bezierLeftValuerecord component
-
bezierRightTime
Returns the value of thebezierRightTimerecord component.- Returns:
- the value of the
bezierRightTimerecord component
-
bezierRightValue
Returns the value of thebezierRightValuerecord component.- Returns:
- the value of the
bezierRightValuerecord component
-
time
-