Class SpeedModifier
java.lang.Object
dev.kosmx.playerAnim.api.layered.AnimationContainer<IAnimation>
dev.kosmx.playerAnim.api.layered.modifier.AbstractModifier
dev.kosmx.playerAnim.api.layered.modifier.SpeedModifier
- All Implemented Interfaces:
IAnimation
Modifies the animation speed.
speed = 2 means twice the speed, the animation will take half as long
length = 1/speed-
Field Summary
FieldsFields inherited from class dev.kosmx.playerAnim.api.layered.modifier.AbstractModifier
hostFields inherited from class dev.kosmx.playerAnim.api.layered.AnimationContainer
anim -
Constructor Summary
Constructors -
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.voidsetupAnim(float tickDelta) Called before rendering a characterprotected voidstep(float delta) 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 dev.kosmx.playerAnim.api.layered.modifier.AbstractModifier
canRemoveMethods inherited from class dev.kosmx.playerAnim.api.layered.AnimationContainer
getAnim, getFirstPersonConfiguration, getFirstPersonMode, isActive, setAnim
-
Field Details
-
speed
public float speed
-
-
Constructor Details
-
SpeedModifier
public SpeedModifier(float speed)
-
-
Method Details
-
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- Overrides:
tickin classAnimationContainer<IAnimation>
-
setupAnim
public void setupAnim(float tickDelta) Description copied from interface:IAnimationCalled before rendering a character- Specified by:
setupAnimin interfaceIAnimation- Overrides:
setupAnimin classAnimationContainer<IAnimation>- Parameters:
tickDelta- Time since the last tick. 0-1
-
step
protected void step(float delta) -
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- Overrides:
get3DTransformin classAnimationContainer<IAnimation>- 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
-