diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Camera.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Camera.cs index 17df797..10016c2 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Render/Camera.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/Camera.cs @@ -21,10 +21,32 @@ namespace SlatedGameToolkit.Framework.Graphics.Render public bool LockedOrientation { get; set; } = false; /// - /// The up direction of the camera. + /// The up direction for orienting the camera. /// - /// A vector representing the up direction of the camera. + /// A vector representing the up direction. public Vector3 Up { get; set; } = Vector3.UnitY; + + /// + /// What the right direction is for the camera's current orientation. + /// + /// A vector representing the right direction for the camera's current orientation. + public Vector3 CameraRight + { + get + { + return Vector3.Cross(CameraFront, Up); + } + } + + /// + /// The up direction for the camera's current orientation. + /// + /// A vector representing the up direction for the camera's current orientation. + public Vector3 CameraUp { + get { + return Vector3.Cross(CameraFront, -CameraRight); + } + } public event EventHandler projectionUpdateEvent; public bool Orthographic { @@ -141,7 +163,6 @@ namespace SlatedGameToolkit.Framework.Graphics.Render if (height <= 0) throw new ArgumentException("Height can't be less than or equal to 0."); this.Width = width; this.Height = height; - this.Position = new Vector3(0, 0, 3); this.CameraFront = -Vector3.UnitZ; } diff --git a/src/SlatedGameToolkit.Framework/Graphics/Render/Camera2D.cs b/src/SlatedGameToolkit.Framework/Graphics/Render/Camera2D.cs index 8359206..b6cd20b 100644 --- a/src/SlatedGameToolkit.Framework/Graphics/Render/Camera2D.cs +++ b/src/SlatedGameToolkit.Framework/Graphics/Render/Camera2D.cs @@ -27,6 +27,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Render this.Orthographic = true; this.LockedOrientation = true; this.CameraFront = -Vector3.UnitZ; + base.Position = Vector3.UnitZ; } } } \ No newline at end of file