Holidays 12.10. -> 25.10.2020
~ Moved code around in files. SM.Base: + PostProcessing-system + OnInitialization() for Scenes. + Shader-Extensions + Added option to not react while unfocused to the window. + Added Screenshots to the window. + Connected the log system to the SM.OGL-action system. ~ Replaced IShader with abstract MaterialShader. ~ When a log compression folder doesn't exist, it will create one. SM.OGL: + Added support for UniformArrays + Added ShaderPreProcessing + Added Shader Extensions. + Added Debug actions. + SM.OGL settings ~ Framebuffer Size is automaticly changed, when the window and scale is set. SM2D: + Added easy shader drawing.
This commit is contained in:
parent
2c00dbd31a
commit
03b3942732
102 changed files with 2683 additions and 1398 deletions
|
|
@ -1,41 +1,52 @@
|
|||
using OpenTK;
|
||||
#region usings
|
||||
|
||||
using OpenTK;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace SM.Base.Scene
|
||||
{
|
||||
/// <summary>
|
||||
/// Controller for a camera
|
||||
/// Controller for a camera
|
||||
/// </summary>
|
||||
public abstract class GenericCamera
|
||||
{
|
||||
/// <summary>
|
||||
/// The matrix for the orthographic world.
|
||||
/// The matrix for the orthographic world.
|
||||
/// </summary>
|
||||
public static Matrix4 OrthographicWorld { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// The matrix for the perspective world.
|
||||
/// The matrix for the perspective world.
|
||||
/// </summary>
|
||||
public static Matrix4 PerspectiveWorld { get; protected set; }
|
||||
|
||||
/// <summary>
|
||||
/// This defines what is up. (Normalized)
|
||||
/// <para>Default: <see cref="Vector3.UnitY"/></para>
|
||||
/// This defines what is up. (Normalized)
|
||||
/// <para>Default: <see cref="Vector3.UnitY" /></para>
|
||||
/// </summary>
|
||||
public static Vector3 UpVector { get; set; } = Vector3.UnitY;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Contains the view matrix of this camera.
|
||||
/// <para>Default: <see cref="Matrix4.Identity"/></para>
|
||||
/// Contains the view matrix of this camera.
|
||||
/// <para>Default: <see cref="Matrix4.Identity" /></para>
|
||||
/// </summary>
|
||||
public Matrix4 ViewMatrix { get; protected set; } = Matrix4.Identity;
|
||||
|
||||
/// <summary>
|
||||
/// Returns the world matrix that is connected to this camera.
|
||||
/// Returns the world matrix that is connected to this camera.
|
||||
/// </summary>
|
||||
public Matrix4 World => Orthographic ? OrthographicWorld : PerspectiveWorld;
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the view matrix.
|
||||
/// Represents if the camera is orthographic.
|
||||
/// </summary>
|
||||
/// <returns>The calculated view matrix. Same as <see cref="ViewMatrix"/></returns>
|
||||
public abstract bool Orthographic { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Calculates the view matrix.
|
||||
/// </summary>
|
||||
/// <returns>The calculated view matrix. Same as <see cref="ViewMatrix" /></returns>
|
||||
internal Matrix4 CalculateViewMatrix()
|
||||
{
|
||||
ViewMatrix = ViewCalculation();
|
||||
|
|
@ -43,18 +54,17 @@ namespace SM.Base.Scene
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// This calculates the view matrix.
|
||||
/// This calculates the view matrix.
|
||||
/// </summary>
|
||||
/// <returns>The new view matrix. This is the returns for <see cref="CalculateViewMatrix"/> and the next value for <see cref="ViewMatrix"/>. </returns>
|
||||
/// <returns>
|
||||
/// The new view matrix. This is the returns for <see cref="CalculateViewMatrix" /> and the next value for
|
||||
/// <see cref="ViewMatrix" />.
|
||||
/// </returns>
|
||||
protected abstract Matrix4 ViewCalculation();
|
||||
|
||||
/// <summary>
|
||||
/// Represents if the camera is orthographic.
|
||||
/// </summary>
|
||||
public abstract bool Orthographic { get; }
|
||||
/// <summary>
|
||||
/// This will calculate the world.
|
||||
/// <para>This is called on <see cref="GenericWindow{TScene,TCamera}.ViewportCamera"/> to calculate the world.</para>
|
||||
/// This will calculate the world.
|
||||
/// <para>This is called on <see cref="GenericWindow{TScene,TCamera}.ViewportCamera" /> to calculate the world.</para>
|
||||
/// </summary>
|
||||
/// <param name="world">The world scale</param>
|
||||
/// <param name="aspect">The aspect ratio from the window.</param>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue