Added camera axis' for convenience.
Untested.
This commit is contained in:
parent
8827bfbb78
commit
bbdafb2489
@ -21,10 +21,32 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
|
|||||||
public bool LockedOrientation { get; set; } = false;
|
public bool LockedOrientation { get; set; } = false;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The up direction of the camera.
|
/// The up direction for orienting the camera.
|
||||||
/// </summary>
|
/// </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;
|
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 event EventHandler projectionUpdateEvent;
|
||||||
|
|
||||||
public bool Orthographic {
|
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.");
|
if (height <= 0) throw new ArgumentException("Height can't be less than or equal to 0.");
|
||||||
this.Width = width;
|
this.Width = width;
|
||||||
this.Height = height;
|
this.Height = height;
|
||||||
this.Position = new Vector3(0, 0, 3);
|
|
||||||
this.CameraFront = -Vector3.UnitZ;
|
this.CameraFront = -Vector3.UnitZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,6 +27,7 @@ namespace SlatedGameToolkit.Framework.Graphics.Render
|
|||||||
this.Orthographic = true;
|
this.Orthographic = true;
|
||||||
this.LockedOrientation = true;
|
this.LockedOrientation = true;
|
||||||
this.CameraFront = -Vector3.UnitZ;
|
this.CameraFront = -Vector3.UnitZ;
|
||||||
|
base.Position = Vector3.UnitZ;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user