Added camera axis' for convenience.

Untested.
This commit is contained in:
Harrison Deng 2020-06-25 11:18:54 -05:00
parent 8827bfbb78
commit bbdafb2489
2 changed files with 25 additions and 3 deletions

View File

@ -21,10 +21,32 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
public bool LockedOrientation { get; set; } = false;
/// <summary>
/// The up direction of the camera.
/// The up direction for orienting the camera.
/// </summary>
/// <value>A vector representing the up direction of the camera.</value>
/// <value>A vector representing the up direction.</value>
public Vector3 Up { get; set; } = Vector3.UnitY;
/// <summary>
/// What the right direction is for the camera's current orientation.
/// </summary>
/// <value>A vector representing the right direction for the camera's current orientation.</value>
public Vector3 CameraRight
{
get
{
return Vector3.Cross(CameraFront, Up);
}
}
/// <summary>
/// The up direction for the camera's current orientation.
/// </summary>
/// <value>A vector representing the up direction for the camera's current orientation.</value>
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;
}

View File

@ -27,6 +27,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
this.Orthographic = true;
this.LockedOrientation = true;
this.CameraFront = -Vector3.UnitZ;
base.Position = Vector3.UnitZ;
}
}
}