Class AnimationState<T extends net.minecraft.world.entity.LivingEntity>
java.lang.Object
dev.oxydien.mathimations.animations.AnimationState<T>
- Type Parameters:
T-
Represents a single animation instance within a layer, including its
current weight and transition state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyToPose(T entity, AnimationContext ctx) Applies this animation to a poseintdoubleReturns the EntityStartTime of when the animation has entered the active listfloatbooleanCheck if this animation has reached its target weightbooleanCheck if this animation is fading out (weight is zero or heading to zero)booleanvoidsetAnimationStartTime(double animationStartTime) Sets the animation start time.voidsetWeight(float equal) toString()voidtransitionTo(float target) Start transitioning towards a target weightvoidtransitionTo(float target, float transitionTime) Start transitioning towards a target weightvoidupdateWeight(double delta) Updates the weight towards the target weight
-
Constructor Details
-
AnimationState
-
-
Method Details
-
updateWeight
public void updateWeight(double delta) Updates the weight towards the target weight- Parameters:
delta- Time since last update in seconds
-
getAnimationStartTime
public double getAnimationStartTime()Returns the EntityStartTime of when the animation has entered the active list -
setAnimationStartTime
public void setAnimationStartTime(double animationStartTime) Sets the animation start time. This is used to calculate the animation time relative to the animation start time. -
applyToPose
Applies this animation to a pose- Parameters:
entity- The entity being animatedctx- The animation context
-
transitionTo
public void transitionTo(float target, float transitionTime) Start transitioning towards a target weight- Parameters:
target- The target weight (0.0 to 1.0)transitionTime- Time to complete transition in seconds
-
transitionTo
public void transitionTo(float target) Start transitioning towards a target weight- Parameters:
target- The target weight (0.0 to 1.0)
-
hasReachedTarget
public boolean hasReachedTarget()Check if this animation has reached its target weight -
isFadedOut
public boolean isFadedOut()Check if this animation is fading out (weight is zero or heading to zero) -
isInactive
public boolean isInactive() -
getAnimation
-
getAnimationId
public int getAnimationId() -
getWeight
public float getWeight() -
setWeight
public void setWeight(float equal) -
toString
-