Skip to content

Commit 804ce85

Browse files
committed
fix montrals yaw animation
1 parent 30c9405 commit 804ce85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

projects/pswg/src/main/java/com/parzivail/pswg/BaseClientContent.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ public static void animateTwilek(SwgSpecies species, AbstractClientPlayerEntity
9999
tailMidL.pitch = tailMidR.pitch = (5.11f * h4 + 2.01f * h3 - 10.2f * h2 - 26.38f * h - 1.48f) * MathHelper.RADIANS_PER_DEGREE;
100100
tailLowerL.pitch = tailLowerR.pitch = (-3.15f * h4 + 2.57f * h2 - 23.03f * h - 2.93f) * MathHelper.RADIANS_PER_DEGREE;
101101

102-
var y = MathHelper.wrapDegrees(model.head.yaw * MathHelper.DEGREES_PER_RADIAN) * MathHelper.RADIANS_PER_DEGREE;
102+
var yaw = MathHelper.lerpAngleDegrees(tickDelta, entity.prevHeadYaw, entity.headYaw) - MathHelper.lerpAngleDegrees(tickDelta, entity.prevBodyYaw, entity.bodyYaw);
103+
var y = MathHelper.wrapDegrees(yaw) * MathHelper.RADIANS_PER_DEGREE;
103104
tailBaseL.roll = Math.max(0, y / 3f) + Math.min(0, y / 9f);
104105
tailBaseR.roll = Math.min(0, y / 3f) + Math.max(0, y / 9f);
105106
}

0 commit comments

Comments
 (0)