Record Class Transition
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcanvas.api.armature.Transition
- Record Components:
duration- seconds the blend takes; 0 cutseasing- how the blend is paced (only named curves,Easings, can be sent from the server)
How one animation gives way to the next: over how long, along which curve, and how the two meet.
Transition.crossfade(0.3F) // both move while they blend: walk into run
Transition.freeze(0.25F, Easing.CUBIC_OUT) // the old pose holds still while the new one blends in
Transition.CUT // no blend at all
A motion can carry its own (Motion.transition); otherwise its layer decides, by its rules or its default
(see AnimLayer.transition). Immutable.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TransitionStraight to the next animation.static final TransitionWhat a layer uses when nothing else is set: a fifth of a second, crossfading, sine in-out.static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf, Transition> -
Constructor Summary
ConstructorsConstructorDescriptionTransition(float duration, Easing easing, Transition.Mode mode) Creates an instance of aTransitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanblends()Whether there is a blend at all.static Transitioncrossfade(float seconds) Both animations keep moving while one blends into the other.static Transitionfloatduration()Returns the value of thedurationrecord component.easing()Returns the value of theeasingrecord component.final booleanIndicates whether some other object is "equal to" this one.static Transitionfreeze(float seconds) The old animation stops where it is and the new one blends in from that still pose: seamless even when the old one is cut off mid-swing, and never a mix of two motions at once.static Transitionfinal inthashCode()Returns a hash code value for this object.mode()Returns the value of themoderecord component.final StringtoString()Returns a string representation of this record class.withDuration(float seconds) withEasing(Easing easing)
-
Field Details
-
DEFAULT
What a layer uses when nothing else is set: a fifth of a second, crossfading, sine in-out. -
CUT
Straight to the next animation. -
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.FriendlyByteBuf, Transition> STREAM_CODEC
-
-
Constructor Details
-
Method Details
-
crossfade
Both animations keep moving while one blends into the other. -
crossfade
-
freeze
The old animation stops where it is and the new one blends in from that still pose: seamless even when the old one is cut off mid-swing, and never a mix of two motions at once. -
freeze
-
withDuration
-
withEasing
-
blends
public boolean blends()Whether there is a blend at all. -
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. -
duration
-
easing
-
mode
Returns the value of themoderecord component.- Returns:
- the value of the
moderecord component
-