Based on #18. Thanks for fixing support for 1.19.4 @end-user!
Switch to use whatever camera orientation is used in GameRenderer#renderWorld. Fetches the InverseViewRotationMatrix used just before world rendering occurs and computes roll from that.
This enables roll support for mods Cool Elytra Roll and Do a Barrel Roll, and implicitly supports any other mod which changes camera orientation.
Also moves the FlightComputer instance to be public static final FlightHud#computer, since both InGameHudMixin and GameRendererMixin need access and it seems a good place to put the singleton.
Based on #18. Thanks for fixing support for 1.19.4 @end-user!
Switch to use whatever camera orientation is used in
GameRenderer#renderWorld
. Fetches theInverseViewRotationMatrix
used just before world rendering occurs and computes roll from that.This enables roll support for mods Cool Elytra Roll and Do a Barrel Roll, and implicitly supports any other mod which changes camera orientation.
Also moves the
FlightComputer
instance to bepublic static final FlightHud#computer
, since bothInGameHudMixin
andGameRendererMixin
need access and it seems a good place to put the singleton.Short demo clip, showing a full flip with Do a Barrel Roll, here: https://youtu.be/V4x2M-dlUL0