From e4e86bd21d5542a7474c079d77968eb64365bdb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20L=C3=BCbe=C3=9F?= Date: Sun, 19 Jul 2026 14:27:18 +0200 Subject: [PATCH] Fixed initialization of EditorCamera `this = default` overwrote `_cameraRotationSpeed` with 0 thus breaking user input --- GlitchyEngine/src/World/EditorCamera.bf | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/GlitchyEngine/src/World/EditorCamera.bf b/GlitchyEngine/src/World/EditorCamera.bf index 226bb08..c9591fc 100644 --- a/GlitchyEngine/src/World/EditorCamera.bf +++ b/GlitchyEngine/src/World/EditorCamera.bf @@ -3,13 +3,14 @@ using GlitchyEngine.Renderer; using GlitchyEngine.Math; using System; using GlitchyEngine.Events; +using System.Diagnostics; namespace GlitchyEngine.World { struct EditorCamera : Camera, IDisposable { - private float3 _position; - private Quaternion _rotation; + private float3 _position = .Zero; + private Quaternion _rotation = .Identity; private float3 _focalPosition = .Zero; private float _focalDistance = 5.0f; @@ -19,16 +20,16 @@ namespace GlitchyEngine.World private float _cameraRotationSpeedY = 0.001f; private float _cameraFastFactor = 10f; - private Matrix _view; + private Matrix _view = ?; - private float _fovY; - private float _nearPlane; - private float _aspectRatio; + private float _fovY = ?; + private float _nearPlane = ?; + private float _aspectRatio = ?; private RenderTargetGroup _renderTarget = null; - internal bool BindMouse; - internal uint8 MouseCooldown; + internal bool BindMouse = false; + internal uint8 MouseCooldown = 0; private bool _isAltMode = false; @@ -38,7 +39,7 @@ namespace GlitchyEngine.World public bool InUse => BindMouse; /// If true, the camera can be rotated/moved - public bool AllowMove; + public bool AllowMove = true; public RenderTargetGroup RenderTarget { @@ -147,7 +148,6 @@ namespace GlitchyEngine.World public this(float3 position, Quaternion rotation, float fovY, float nearPlane, float aspectRatio) { - this = default; _position = position; _rotation = rotation; _fovY = fovY;