Skip to content

Commit

Permalink
fix swim anim
Browse files Browse the repository at this point in the history
  • Loading branch information
AViewFromTheTop committed Jan 8, 2025
1 parent 65f90e9 commit e021593
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public void setupAnim(@NotNull T entity, float limbSwing, float limbSwingAmount,
limbSwingAmount = Math.min(limbSwingAmount * 1.5F, 1F);
this.animate(entity.layDownAnimationState, PenguinAnimation.PENGUIN_LAY_DOWN, ageInTicks);
this.animateWalk(limbSwing, limbSwingAmount * notSwimmingAmount * notWadingProgress * notSlidingProgress);
this.animateSlide(limbSwing * 2F, limbSwingAmount * 2F, slideProgress * notSwimmingAmount * notWadingProgress);
this.animateSlide(limbSwing * 2F, Math.min(limbSwingAmount * 2F, 1F), slideProgress * notSwimmingAmount * notWadingProgress);
this.animateWade(ageInTicks, wadeProgress * notMovingDelta);
this.animateWadeMove(limbSwing, limbSwingAmount * wadeProgress * notSwimmingAmount * movementDelta);
//this.animateSwimIdle(ageInTicks, wadeProgress * notMovingDelta);
Expand Down Expand Up @@ -355,7 +355,7 @@ private void animateSwim(float limbSwing, float limbSwingAmount, float headPitch
float swimLimbAmount = limbSwingAmount * swimAmount;
float swimLimbToRad = swimLimbAmount * Mth.DEG_TO_RAD;

float flipperZRot = Mth.cos(limbSwing * 0.2F) * swimLimbAmount * swimAmount + (Mth.HALF_PI * 0.35F * swimAmount);
float flipperZRot = Mth.clamp(Mth.cos(limbSwing * 0.2F) * swimLimbAmount * swimAmount + (Mth.HALF_PI * 0.35F * swimAmount), 0F, Mth.PI);
this.left_flipper.zRot -= flipperZRot;
this.right_flipper.zRot += flipperZRot;

Expand Down

0 comments on commit e021593

Please sign in to comment.