Package dev.kosmx.playerAnim.api.layered
Class KeyframeAnimationPlayer
java.lang.Object
dev.kosmx.playerAnim.api.layered.KeyframeAnimationPlayer
- All Implemented Interfaces:
IActualAnimation<KeyframeAnimationPlayer>,IAnimation
public class KeyframeAnimationPlayer
extends Object
implements IActualAnimation<KeyframeAnimationPlayer>
KeyframeAnimationPlayer
If you're here, you're probably looking for this (except if you want to animate from code)It plays
KeyframeAnimation
new KeyframeAnimationPlayer(animation)
New FirstPerson mode is supported with chainable setters :D
new KeyframeAnimationPlayer(animation)
.setFirstPersonConfiguration(new FirstPersonConfiguration())
.setFirstPersonMode(FirstPersonMode.THIRD_PERSON_MODEL);
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionintprotected float -
Constructor Summary
ConstructorsConstructorDescriptionKeyframeAnimationPlayer(@NotNull KeyframeAnimation animation) KeyframeAnimationPlayer(@NotNull KeyframeAnimation animation, int t) KeyframeAnimationPlayer(@NotNull KeyframeAnimation animation, int t, boolean mutable) -
Method Summary
Modifier and TypeMethodDescription@NotNull Vec3fget3DTransform(@NotNull String modelName, @NotNull TransformType type, float tickDelta, @NotNull Vec3f value0) Get the transformed value to a model part, transform type.intgetData()@NotNull FirstPersonConfigurationgetFirstPersonConfiguration(float tickDelta) @NotNull FirstPersonModegetFirstPersonMode(float tickDelta) Active animation can request first person render mode.intintgetTick()booleanisActive()Is the animation currently active.booleanbooleanis the emote already in an infinite loop?voidsetupAnim(float tickDelta) Called before rendering a charactervoidstop()voidtick()Animation tick, on lag free client 20 [tick/sec] You can get the animations time from other places, but it will be invoked when the animation is ACTIVEMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.kosmx.playerAnim.api.layered.IActualAnimation
setFirstPersonConfiguration, setFirstPersonMode
-
Field Details
-
tickDelta
protected float tickDelta -
bodyParts
-
perspective
public int perspective
-
-
Constructor Details
-
KeyframeAnimationPlayer
public KeyframeAnimationPlayer(@NotNull @NotNull KeyframeAnimation animation, int t, boolean mutable) - Parameters:
animation- animation to playt- begin playing from tickmutable- if true, the part data will be copied as a construction step. The copied version can be changed while playing the animation but the copy takes time.
-
KeyframeAnimationPlayer
- Parameters:
animation-KeyframeAnimationto playt- begin playing from tick
-
KeyframeAnimationPlayer
-
-
Method Details
-
getFirstPersonConfiguration
- Specified by:
getFirstPersonConfigurationin interfaceIAnimation- Parameters:
tickDelta-- Returns:
- current first person configuration, only requested when playing this animation
-
getFirstPersonMode
Description copied from interface:IAnimationActive animation can request first person render mode.- Specified by:
getFirstPersonModein interfaceIAnimation- Parameters:
tickDelta- current tickDelta- Returns:
FirstPersonMode
-
tick
public void tick()Description copied from interface:IAnimationAnimation tick, on lag free client 20 [tick/sec] You can get the animations time from other places, but it will be invoked when the animation is ACTIVE- Specified by:
tickin interfaceIAnimation
-
getTick
public int getTick() -
stop
public void stop() -
isActive
public boolean isActive()Description copied from interface:IAnimationIs the animation currently active. Tick will only be invoked when ACTIVE- Specified by:
isActivein interfaceIAnimation- Returns:
- active
-
get3DTransform
@NotNull public @NotNull Vec3f get3DTransform(@NotNull @NotNull String modelName, @NotNull @NotNull TransformType type, float tickDelta, @NotNull @NotNull Vec3f value0) Description copied from interface:IAnimationGet the transformed value to a model part, transform type.- Specified by:
get3DTransformin interfaceIAnimation- Parameters:
modelName- The questionable model parttype- Transform typetickDelta- Time since the last tick. 0-1value0- The value before the transform. For identity transform return with it.- Returns:
- The new transform value
-
setupAnim
public void setupAnim(float tickDelta) Description copied from interface:IAnimationCalled before rendering a character- Specified by:
setupAnimin interfaceIAnimation- Parameters:
tickDelta- Time since the last tick. 0-1
-
isLoopStarted
public boolean isLoopStarted()is the emote already in an infinite loop?- Returns:
- :D
-
getData
-
getPart
-
getStopTick
public int getStopTick() -
getCurrentTick
public int getCurrentTick() -
isInfinite
public boolean isInfinite()
-