Package dev.kosmx.playerAnim.api.layered
Class AnimationStack
java.lang.Object
dev.kosmx.playerAnim.api.layered.AnimationStack
- All Implemented Interfaces:
IAnimation
Player animation stack, can contain multiple active or passive layers, will always be evaluated from the lowest index.
Highest index = it can override everything else
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAnimLayer(int priority, IAnimation layer) Add an animation layer.@NotNull Vec3fget3DTransform(@NotNull String modelName, @NotNull TransformType type, float tickDelta, @NotNull Vec3f value0) Get the transformed value to a model part, transform type.@NotNull FirstPersonConfigurationgetFirstPersonConfiguration(float tickDelta) @NotNull FirstPersonModegetFirstPersonMode(float tickDelta) Active animation can request first person render mode.booleanisActive()Is the animation currently active.booleanremoveLayer(int layerLevel) Remove EVERY layer with prioritybooleanremoveLayer(IAnimation layer) Remove an animation layervoidsetupAnim(float tickDelta) Called before rendering a charactervoidtick()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 ACTIVE
-
Constructor Details
-
AnimationStack
public AnimationStack()
-
-
Method Details
-
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:
- true if exists level what is active.
-
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
-
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
-
addAnimLayer
Add an animation layer. If there are multiple with the same priority, the one, added first will have larger priority- Parameters:
priority- prioritylayer- animation layer note: Same priority entries logic is subject to change
-
removeLayer
Remove an animation layer- Parameters:
layer- needle- Returns:
- true if any elements were removed.
-
removeLayer
public boolean removeLayer(int layerLevel) Remove EVERY layer with priority- Parameters:
layerLevel- search and destroy- Returns:
- true if any elements were removed.
-
getFirstPersonMode
Description copied from interface:IAnimationActive animation can request first person render mode.- Specified by:
getFirstPersonModein interfaceIAnimation- Parameters:
tickDelta- current tickDelta- Returns:
FirstPersonMode
-
getFirstPersonConfiguration
- Specified by:
getFirstPersonConfigurationin interfaceIAnimation- Parameters:
tickDelta-- Returns:
- current first person configuration, only requested when playing this animation
-