Package dev.kosmx.playerAnim.api.layered
Interface IAnimation
- All Known Subinterfaces:
IActualAnimation<T>
- All Known Implementing Classes:
AbstractFadeModifier,AbstractModifier,AdjustmentModifier,AnimationContainer,AnimationStack,FirstPersonModifier,KeyframeAnimationPlayer,MirrorModifier,ModifierLayer,PlayerAnimationFrame,SpeedModifier
public interface IAnimation
An entry in
AnimationStack, used to get the animated parts current transform-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull Vec3fget3DTransform(@NotNull PartKey modelKey, @NotNull TransformType type, float tickDelta, @NotNull Vec3f value0) Get the transformed value to a model part, transform type.default @NotNull Vec3fget3DTransform(@NotNull String modelName, @NotNull TransformType type, float tickDelta, @NotNull Vec3f value0) Deprecated, for removal: This API element is subject to removal in a future version.default @NotNull FirstPersonConfigurationgetFirstPersonConfiguration(float tickDelta) default @NotNull FirstPersonModegetFirstPersonMode(float tickDelta) Active animation can request first person render mode.booleanisActive()Is the animation currently active.voidsetupAnim(float tickDelta) Called before rendering a characterdefault 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 ACTIVE
-
Method Details
-
tick
default void tick()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 -
isActive
boolean isActive()Is the animation currently active. Tick will only be invoked when ACTIVE- Returns:
- active
-
get3DTransform
@Deprecated(forRemoval=true) @NotNull default @NotNull Vec3f get3DTransform(@NotNull @NotNull String modelName, @NotNull @NotNull TransformType type, float tickDelta, @NotNull @NotNull Vec3f value0) Deprecated, for removal: This API element is subject to removal in a future version.useget3DTransform(PartKey, TransformType, float, Vec3f)instead.PartKeyis supposed to be faster than string comparisons.Get the transformed value to a model part, transform type.- 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
-
get3DTransform
@NotNull default @NotNull Vec3f get3DTransform(@NotNull @NotNull PartKey modelKey, @NotNull @NotNull TransformType type, float tickDelta, @NotNull @NotNull Vec3f value0) Get the transformed value to a model part, transform type.API note
DO NOT CALL super.get3DTransform() as the default implementation will be removed.- Parameters:
modelKey- 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
void setupAnim(float tickDelta) Called before rendering a character- Parameters:
tickDelta- Time since the last tick. 0-1
-
getFirstPersonMode
Active animation can request first person render mode.- Parameters:
tickDelta- current tickDelta- Returns:
FirstPersonMode
-
getFirstPersonConfiguration
- Parameters:
tickDelta-- Returns:
- current first person configuration, only requested when playing this animation
-
get3DTransform(PartKey, TransformType, float, Vec3f)instead.