From e9a320edd32d8b1fac9739703a799be3390a5b37 Mon Sep 17 00:00:00 2001 From: Asek3 <64613894+Asek3@users.noreply.github.com> Date: Tue, 21 Nov 2023 20:41:01 +0200 Subject: [PATCH] Fix eyeAltitude not matching currentCameraPosition Co-Authored-By: IMS --- src/main/java/net/coderbot/iris/uniforms/CameraUniforms.java | 5 +++++ src/main/java/net/coderbot/iris/uniforms/CommonUniforms.java | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/coderbot/iris/uniforms/CameraUniforms.java b/src/main/java/net/coderbot/iris/uniforms/CameraUniforms.java index 4d3f9ad5b4..24c3dc6e8e 100644 --- a/src/main/java/net/coderbot/iris/uniforms/CameraUniforms.java +++ b/src/main/java/net/coderbot/iris/uniforms/CameraUniforms.java @@ -24,6 +24,7 @@ public static void addCameraUniforms(UniformHolder uniforms, FrameUpdateNotifier .uniform1f(ONCE, "near", () -> 0.05) .uniform1f(PER_FRAME, "far", CameraUniforms::getRenderDistanceInBlocks) .uniform3d(PER_FRAME, "cameraPosition", tracker::getCurrentCameraPosition) + .uniform1f(PER_FRAME, "eyeAltitude", tracker::getCurrentCameraPositionY) .uniform3d(PER_FRAME, "previousCameraPosition", tracker::getPreviousCameraPosition); } @@ -106,5 +107,9 @@ public Vector3d getCurrentCameraPosition() { public Vector3d getPreviousCameraPosition() { return previousCameraPosition; } + + public double getCurrentCameraPositionY() { + return currentCameraPosition.y; + } } } diff --git a/src/main/java/net/coderbot/iris/uniforms/CommonUniforms.java b/src/main/java/net/coderbot/iris/uniforms/CommonUniforms.java index 7a9172e295..e7f09ac6e6 100644 --- a/src/main/java/net/coderbot/iris/uniforms/CommonUniforms.java +++ b/src/main/java/net/coderbot/iris/uniforms/CommonUniforms.java @@ -110,7 +110,6 @@ public static void generalCommonUniforms(UniformHolder uniforms, FrameUpdateNoti uniforms .uniform1b(PER_FRAME, "hideGUI", () -> client.options.hideGui) - .uniform1f(PER_FRAME, "eyeAltitude", () -> Objects.requireNonNull(client.getCameraEntity()).getEyeY()) .uniform1i(PER_FRAME, "isEyeInWater", CommonUniforms::isEyeInWater) .uniform1f(PER_FRAME, "blindness", CommonUniforms::getBlindness) .uniform1f(PER_FRAME, "nightVision", CommonUniforms::getNightVision)