Skip to content

Commit

Permalink
Fix eyeAltitude not matching currentCameraPosition
Browse files Browse the repository at this point in the history
Co-Authored-By: IMS <[email protected]>
  • Loading branch information
Asek3 and IMS212 committed Nov 21, 2023
1 parent 619bb4a commit e9a320e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/main/java/net/coderbot/iris/uniforms/CameraUniforms.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -106,5 +107,9 @@ public Vector3d getCurrentCameraPosition() {
public Vector3d getPreviousCameraPosition() {
return previousCameraPosition;
}

public double getCurrentCameraPositionY() {
return currentCameraPosition.y;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e9a320e

Please sign in to comment.