99import engine .input .Input ;
1010import engine .input .Key ;
1111import engine .scene .Scene ;
12+ import engine .scene .camera .Camera ;
13+ import math .Mathf ;
1214
1315/**
1416 * The {@code DebugInfoUpdater} class is responsible for updating debug information displayed by a
@@ -24,9 +26,11 @@ public class DebugInfoUpdater {
2426 private static final String CATEGORY_SCENE = "Scene" ;
2527
2628 private static final String CATEGORY_SYSTEM = "System" ;
27-
29+
2830 private static final String CATEGORY_OS = "OS" ;
2931
32+ private static final String CATEGORY_CAMERA = "Camera" ;
33+
3034 private final DebugOverlay debugOverlay ;
3135
3236 private final PerformanceMetrics performanceMetrics = new PerformanceMetrics ();
@@ -80,6 +84,7 @@ public void update(Timer timer, Scene activeScene, Input input) {
8084 updateInputMetrics (input );
8185 if (activeScene != null ) {
8286 updateSceneMetrics (activeScene );
87+ updateCameraInfo (activeScene .getActiveCamera ());
8388 }
8489 updateOsMetrics ();
8590 }
@@ -91,12 +96,20 @@ private String keysToString(Collection<Key> keys) {
9196 }
9297 return pressedKeys ;
9398 }
94-
99+
100+ private void updateCameraInfo (Camera camera ) {
101+ if (camera == null ) return ;
102+ setInfo (CATEGORY_CAMERA , "Aspect" , camera .getAspectRatio ());
103+ setInfo (CATEGORY_CAMERA , "FOV" , Mathf .toDegrees (camera .getFieldOfView ()));
104+ setInfo (CATEGORY_CAMERA , "Near" , Mathf .toDegrees (camera .getNearPlane ()));
105+ setInfo (CATEGORY_CAMERA , "Far" , Mathf .toDegrees (camera .getFarPlane ()));
106+ }
107+
95108 private void updateOsMetrics () {
96- setInfo (CATEGORY_OS , "Name" , osBean .getName ());
97- setInfo (CATEGORY_OS , "Arch" , osBean .getArch ());
98- setInfo (CATEGORY_OS , "Processors" , osBean .getAvailableProcessors ());
99- setInfo (CATEGORY_OS , "Version" , osBean .getVersion ());
109+ setInfo (CATEGORY_OS , "Name" , osBean .getName ());
110+ setInfo (CATEGORY_OS , "Arch" , osBean .getArch ());
111+ setInfo (CATEGORY_OS , "Processors" , osBean .getAvailableProcessors ());
112+ setInfo (CATEGORY_OS , "Version" , osBean .getVersion ());
100113 }
101114
102115 private void updateInputMetrics (Input input ) {
0 commit comments