File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
src/main/java/dev/latvian/mods/klib Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1111public class KLibClientEventHandler {
1212 @ SubscribeEvent (priority = EventPriority .HIGHEST )
1313 public static void setup (FrameGraphSetupEvent event ) {
14- ClientMatrices .MODEL_VIEW .set (event .getModelViewMatrix ());
15- ClientMatrices .PROJECTION .set (event .getProjectionMatrix ());
16- ClientMatrices .WORLD .set (event .getProjectionMatrix ().mul (event .getModelViewMatrix ()));
17- ClientMatrices .INVERSE_WORLD .set (ClientMatrices .WORLD ).invert ();
14+ ClientMatrices .updateMain (event .getModelViewMatrix (), event .getProjectionMatrix ());
1815 }
1916}
Original file line number Diff line number Diff line change 11package dev .latvian .mods .klib .math ;
22
33import org .joml .Matrix4f ;
4+ import org .joml .Matrix4fc ;
45
56public interface ClientMatrices {
67 Matrix4f MODEL_VIEW = new Matrix4f ();
@@ -9,4 +10,11 @@ public interface ClientMatrices {
910 Matrix4f INVERSE_WORLD = new Matrix4f ();
1011 Matrix4f PERSPECTIVE = new Matrix4f ();
1112 Matrix4f FRUSTUM = new Matrix4f ();
13+
14+ static void updateMain (Matrix4fc modelView , Matrix4fc projection ) {
15+ MODEL_VIEW .set (modelView );
16+ PROJECTION .set (projection );
17+ WORLD .set (projection ).mul (modelView );
18+ INVERSE_WORLD .set (WORLD ).invert ();
19+ }
1220}
You can’t perform that action at this time.
0 commit comments