Skip to content

Commit

Permalink
yeouch
Browse files Browse the repository at this point in the history
  • Loading branch information
der-fruhling committed Aug 9, 2024
1 parent ffc9c5d commit 6f7b487
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,15 @@ default float getYaw(float f) {
var ref = getReference();
if (ref == null) return 0.0f;
if (f == 1.0f) return ref.yaw * getValueScale();

while (ref.yaw - ref.prevYaw < -180.0f) {
ref.prevYaw -= 360.0f;
}

while (ref.yaw - ref.prevYaw >= 180.0f) {
ref.prevYaw += 360.0f;
}

return Mth.lerp(f, ref.prevYaw * getPrevValueScale(), ref.yaw * getValueScale());
}

Expand Down

0 comments on commit 6f7b487

Please sign in to comment.