Class AnimationState<T extends net.minecraft.world.entity.LivingEntity>

java.lang.Object
dev.oxydien.mathimations.animations.AnimationState<T>
Type Parameters:
T -

public class AnimationState<T extends net.minecraft.world.entity.LivingEntity> extends Object
Represents a single animation instance within a layer, including its current weight and transition state.
  • Constructor Details

    • AnimationState

      public AnimationState(int animationId, IMathAnimation<T> animation)
  • 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

      public void applyToPose(T entity, AnimationContext ctx)
      Applies this animation to a pose
      Parameters:
      entity - The entity being animated
      ctx - 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

      public IMathAnimation<T> getAnimation()
    • getAnimationId

      public int getAnimationId()
    • getWeight

      public float getWeight()
    • setWeight

      public void setWeight(float equal)
    • toString

      public String toString()
      Overrides:
      toString in class Object