From 9dfd5628412abde8f3d6fef716923f4d9243a4f9 Mon Sep 17 00:00:00 2001 From: "Luis C.M" <42545778+c0508383@users.noreply.github.com> Date: Mon, 9 Jan 2023 01:22:48 -0600 Subject: [PATCH] Fixed uninterpolated NPC puppet part offsets. --- .../noppes/npcs/client/model/ModelMPM.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/main/java/noppes/npcs/client/model/ModelMPM.java b/src/main/java/noppes/npcs/client/model/ModelMPM.java index 75c7fc2f8..0efd2457e 100644 --- a/src/main/java/noppes/npcs/client/model/ModelMPM.java +++ b/src/main/java/noppes/npcs/client/model/ModelMPM.java @@ -677,18 +677,21 @@ public class ModelMPM extends ModelNPCMale{ modelPart.prevPivots[1] = (modelPart.pivotY - modelPart.prevPivots[1]) * modelPart.animRate / 10f + modelPart.prevPivots[1]; modelPart.prevPivots[2] = (modelPart.pivotZ - modelPart.prevPivots[2]) * modelPart.animRate / 10f + modelPart.prevPivots[2]; } else { - int directionX = Float.compare(modelPart.pivotX, renderer.rotationPointX); - renderer.rotationPointX += directionX * modelPart.animRate / 10f; - renderer.rotationPointX = directionX == 1 ? - Math.min(modelPart.pivotX,renderer.rotationPointX) : Math.max(modelPart.pivotX,renderer.rotationPointX); - int directionY = Float.compare(modelPart.pivotY, renderer.rotationPointY); - renderer.rotationPointY += directionY * modelPart.animRate / 10f; - renderer.rotationPointY = directionY == 1 ? - Math.min(modelPart.pivotY,renderer.rotationPointY) : Math.max(modelPart.pivotY,renderer.rotationPointY); - int directionZ = Float.compare(modelPart.pivotZ, renderer.rotationPointZ); - renderer.rotationPointZ += directionZ * modelPart.animRate / 10f; - renderer.rotationPointZ = directionZ == 1 ? - Math.min(modelPart.pivotZ,renderer.rotationPointZ) : Math.max(modelPart.pivotZ,renderer.rotationPointZ); + renderer.rotationPointX += modelPart.prevPivots[0]; + renderer.rotationPointY += modelPart.prevPivots[1]; + renderer.rotationPointZ += modelPart.prevPivots[2]; + int directionX = Float.compare(modelPart.pivotX, modelPart.prevPivots[0]); + modelPart.prevPivots[0] += directionX * modelPart.animRate / 10f; + modelPart.prevPivots[0] = directionX == 1 ? + Math.min(modelPart.pivotX,modelPart.prevPivots[0]) : Math.max(modelPart.pivotX,modelPart.prevPivots[0]); + int directionY = Float.compare(modelPart.pivotY, modelPart.prevPivots[1]); + modelPart.prevPivots[1] += directionY * modelPart.animRate / 10f; + modelPart.prevPivots[1] = directionY == 1 ? + Math.min(modelPart.pivotY,modelPart.prevPivots[1]) : Math.max(modelPart.pivotY,modelPart.prevPivots[1]); + int directionZ = Float.compare(modelPart.pivotZ, modelPart.prevPivots[2]); + modelPart.prevPivots[2] += directionZ * modelPart.animRate / 10f; + modelPart.prevPivots[2] = directionZ == 1 ? + Math.min(modelPart.pivotZ,modelPart.prevPivots[2]) : Math.max(modelPart.pivotZ,modelPart.prevPivots[2]); } } }