mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Fixed initialization of EditorCamera
`this = default` overwrote `_cameraRotationSpeed` with 0 thus breaking user input
This commit is contained in:
@@ -3,13 +3,14 @@ using GlitchyEngine.Renderer;
|
|||||||
using GlitchyEngine.Math;
|
using GlitchyEngine.Math;
|
||||||
using System;
|
using System;
|
||||||
using GlitchyEngine.Events;
|
using GlitchyEngine.Events;
|
||||||
|
using System.Diagnostics;
|
||||||
|
|
||||||
namespace GlitchyEngine.World
|
namespace GlitchyEngine.World
|
||||||
{
|
{
|
||||||
struct EditorCamera : Camera, IDisposable
|
struct EditorCamera : Camera, IDisposable
|
||||||
{
|
{
|
||||||
private float3 _position;
|
private float3 _position = .Zero;
|
||||||
private Quaternion _rotation;
|
private Quaternion _rotation = .Identity;
|
||||||
|
|
||||||
private float3 _focalPosition = .Zero;
|
private float3 _focalPosition = .Zero;
|
||||||
private float _focalDistance = 5.0f;
|
private float _focalDistance = 5.0f;
|
||||||
@@ -19,16 +20,16 @@ namespace GlitchyEngine.World
|
|||||||
private float _cameraRotationSpeedY = 0.001f;
|
private float _cameraRotationSpeedY = 0.001f;
|
||||||
private float _cameraFastFactor = 10f;
|
private float _cameraFastFactor = 10f;
|
||||||
|
|
||||||
private Matrix _view;
|
private Matrix _view = ?;
|
||||||
|
|
||||||
private float _fovY;
|
private float _fovY = ?;
|
||||||
private float _nearPlane;
|
private float _nearPlane = ?;
|
||||||
private float _aspectRatio;
|
private float _aspectRatio = ?;
|
||||||
|
|
||||||
private RenderTargetGroup _renderTarget = null;
|
private RenderTargetGroup _renderTarget = null;
|
||||||
|
|
||||||
internal bool BindMouse;
|
internal bool BindMouse = false;
|
||||||
internal uint8 MouseCooldown;
|
internal uint8 MouseCooldown = 0;
|
||||||
|
|
||||||
private bool _isAltMode = false;
|
private bool _isAltMode = false;
|
||||||
|
|
||||||
@@ -38,7 +39,7 @@ namespace GlitchyEngine.World
|
|||||||
public bool InUse => BindMouse;
|
public bool InUse => BindMouse;
|
||||||
|
|
||||||
/// If true, the camera can be rotated/moved
|
/// If true, the camera can be rotated/moved
|
||||||
public bool AllowMove;
|
public bool AllowMove = true;
|
||||||
|
|
||||||
public RenderTargetGroup RenderTarget
|
public RenderTargetGroup RenderTarget
|
||||||
{
|
{
|
||||||
@@ -147,7 +148,6 @@ namespace GlitchyEngine.World
|
|||||||
|
|
||||||
public this(float3 position, Quaternion rotation, float fovY, float nearPlane, float aspectRatio)
|
public this(float3 position, Quaternion rotation, float fovY, float nearPlane, float aspectRatio)
|
||||||
{
|
{
|
||||||
this = default;
|
|
||||||
_position = position;
|
_position = position;
|
||||||
_rotation = rotation;
|
_rotation = rotation;
|
||||||
_fovY = fovY;
|
_fovY = fovY;
|
||||||
|
|||||||
Reference in New Issue
Block a user