Skip to content

Commit

Permalink
Fix rotation locking being locked behind animation smoothing
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Sep 6, 2024
1 parent 8070c8b commit 6a2d493
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,19 @@ public void updateModel(AbstractClientPlayer entity, PlayerModel<AbstractClientP

NEAnimationsLoader.INSTANCE.animationProvider.applyAnimations(entity, model, deltaTick, swing);

if (NEABaseMod.config.enableAnimationSmoothing && entity instanceof PlayerData data) {
if (entity instanceof PlayerData data) {
float[] last = data.getLastRotations();
int passedTicks = data.isUpdated(tickId);
boolean differentFrame = passedTicks != 0;
float timePassed = passedTicks * 50f;
float speed = NEABaseMod.config.animationSmoothingSpeed;
interpolate(model.leftArm, last, 0, timePassed, differentFrame, speed, deltaTick);
interpolate(model.rightArm, last, ENTRY_SIZE, timePassed, differentFrame, speed, deltaTick);
if (!NEABaseMod.config.disableLegSmoothing) {
interpolate(model.leftLeg, last, ENTRY_SIZE * 2, timePassed, differentFrame, speed, deltaTick);
interpolate(model.rightLeg, last, ENTRY_SIZE * 3, timePassed, differentFrame, speed, deltaTick);
if (NEABaseMod.config.enableAnimationSmoothing) {
float speed = NEABaseMod.config.animationSmoothingSpeed;
interpolate(model.leftArm, last, 0, timePassed, differentFrame, speed, deltaTick);
interpolate(model.rightArm, last, ENTRY_SIZE, timePassed, differentFrame, speed, deltaTick);
if (!NEABaseMod.config.disableLegSmoothing) {
interpolate(model.leftLeg, last, ENTRY_SIZE * 2, timePassed, differentFrame, speed, deltaTick);
interpolate(model.rightLeg, last, ENTRY_SIZE * 3, timePassed, differentFrame, speed, deltaTick);
}
}
if (entity == mc.cameraEntity) {
// For now located here due to smoothing logic being here.
Expand Down

0 comments on commit 6a2d493

Please sign in to comment.