Open pengi opened 5 months ago
Currently have no idea how to implement :( Btw the relevant code is third-handed.
Fabric-1.21-1.1.3 halved the angle of the roll.
I'm unfortunately not used to this development environment, so would take me some time to set up and learn to get a patch myself unfortunately... :/
I agree with halved angle of the roll. Looking at this screenshot
I think it should be negative too. Otherwise I think it should be correct.
Note that this is together with the "do a barrel roll" mod, which alters the behavior of the flight, and sticks the camera to the player, so it acts a bit like an airplane flight.
When not having the "do a barrel roll" mod enabled, I think it may look better as is.
So I think what needs to be done is to have an option (possibly in a configuration file) that multiplies the roll with -2
compared to the previous version. Or maybe have a parameter that specifies a constant for how much to multiply the roll with.
To clarify the screenshot:
I want the horizon line in hud to follow the horizon of the world (if the world would stretch to infinity)
At this screenshot, the horizon line should be just above the actual horizon, since the player is at altitude and the world is just loaded a bit away, the apparent horizon is lower.
To clarify the screenshot:
I want the horizon line in hud to follow the horizon of the world (if the world would stretch to infinity)
At this screenshot, the horizon line should be just above the actual horizon, since the player is at altitude and the world is just loaded a bit away, the apparent horizon is lower.
I'll implement a "rollCoefficient" for that
Hi there! I've got same "issue", but horizon line in the hud is almost following actual horizon, I am right now trying to mess with its setting in the confing.
P.s. I'm using Cool Elytra Roll mod (( https://modrinth.com/mod/cool-elytra-roll ))
The correct effect should be like this: https://www.youtube.com/watch?v=WlWCB49DieU
This is a fix but not no get merged to the mainline. https://github.com/HuJK/FlightHUD-Do-a-Barrel-Roll-Fix
This fix removes all estimation of roll angle, it just inject to RenderSystem and retrive the value getInverseViewRotationMatrix()
.
So, no matter how other mods rotates the view, it will always be perfict align to the player ViewRotation.
Maybe we can port this patch to FlightHud Reborn, too? But I'm busy recently, may need other guys to to this.
WIP migration, but get stucked now, https://github.com/MikhailTapio/FlightHud/compare/fabric-dev...HuJK-Data:FlightHud-Reborn:fabric-dev
This patch changes how this HUD works, it inject to net.minecraft.client.render.GameRenderer
directly
https://github.com/HuJK-Data/FlightHud-Reborn/blob/43a036235e17f42660beedc29f6d719f55b283fa/src/main/java/com/plr/flighthud/mixin/GameRendererMixin.java
But this code is from 1.18.2, I got some error says package net.minecraft.client.render does not exist
, need some help.
> Task :compileJava
/workspaces/FlightHud-Reborn/src/main/java/com/plr/flighthud/mixin/GameRendererMixin.java:17: error: Mixin has no targets
@Mixin(GameRenderer.class)
^
/workspaces/FlightHud-Reborn/src/main/java/com/plr/flighthud/mixin/GameRendererMixin.java:5: error: package net.minecraft.client.render does not exist
import net.minecraft.client.render.GameRenderer;
^
/workspaces/FlightHud-Reborn/src/main/java/com/plr/flighthud/mixin/GameRendererMixin.java:6: error: package net.minecraft.client.util.math does not exist
import net.minecraft.client.util.math.MatrixStack;
^
/workspaces/FlightHud-Reborn/src/main/java/com/plr/flighthud/mixin/GameRendererMixin.java:34: error: cannot find symbol
MatrixStack matrices,
^
symbol: class MatrixStack
location: class GameRendererMixin
/workspaces/FlightHud-Reborn/src/main/java/com/plr/flighthud/mixin/GameRendererMixin.java:17: error: cannot find symbol
@Mixin(GameRenderer.class)
^
symbol: class GameRenderer
5 errors
Found the reason. getInverseViewRotationMatrix()
get removed.
I've been port this fix to 1.18.2
~1.20.4
here: https://github.com/HuJK/FlightHUD-Do-a-Barrel-Roll-Fix/releases
But the RenderSystem.getInverseViewRotationMatrix()
has been removed at 1.20.5
Now I'm get stucked here.
Found a solution for this issue you can checkout my code https://github.com/HuJK/FlightHUD-Do-a-Barrel-Roll-Fix/commit/851e355e7fa75cda5c48f2268838471a1ab0c886
You can checkout my code and port to FlightHUD Reborn.
Source code: Injection part and Calculation Part
My fix injects to RenderSystem
and get the user view from camera.getRotation()
, then calculate the roll based on it.
So that it will always be perfict align to the player ViewRotation.
I just checked that version, and it looks way better.
Had some minor patches to it too, but since this repo doesn't contain the source, I made a PR to HuJKs fork, to get all the patches together.
https://github.com/HuJK/FlightHUD-Do-a-Barrel-Roll-Fix/pull/1
Cool gimmick mod, that I would like to try.
However, the artificial horizon should stick solid and aligned with the real horizon, even if it would result in little bit less visual changes.
Using it together with for example the mod "do a barrel roll" would make the "correct" horizon more useful even.
Maybe as a setting?