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,39 +1,36 @@
|
|||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
#region usings
|
||||
|
||||
using System;
|
||||
using OpenTK;
|
||||
|
||||
#endregion
|
||||
|
||||
namespace SM.OGL.Mesh
|
||||
{
|
||||
/// <summary>
|
||||
/// Contains information about bounding boxes of meshes
|
||||
/// Contains information about bounding boxes of meshes
|
||||
/// </summary>
|
||||
public class BoundingBox
|
||||
{
|
||||
/// <summary>
|
||||
/// The minimum corner.
|
||||
/// </summary>
|
||||
public Vector3 Min = Vector3.Zero;
|
||||
/// <summary>
|
||||
/// The maximum corner.
|
||||
/// The maximum corner.
|
||||
/// </summary>
|
||||
public Vector3 Max = Vector3.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Returns specific configurations of corners
|
||||
/// The minimum corner.
|
||||
/// </summary>
|
||||
/// <param name="x">If true, it takes the X-value of maximum, otherwise the minimum.</param>
|
||||
/// <param name="y">If true, it takes the Y-value of maximum, otherwise the minimum.</param>
|
||||
/// <param name="z">If true, it takes the Z-value of maximum, otherwise the minimum.</param>
|
||||
/// <returns></returns>
|
||||
public Vector3 this[bool x, bool y, bool z] => new Vector3(x ? Max.X : Min.X, y ? Max.Y : Min.Y, z ? Max.Z : Min.Z);
|
||||
public Vector3 Min = Vector3.Zero;
|
||||
|
||||
/// <summary>
|
||||
/// Empty constructor
|
||||
/// Empty constructor
|
||||
/// </summary>
|
||||
public BoundingBox() {}
|
||||
public BoundingBox()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the bounding box with predefined min and max values
|
||||
/// Creates the bounding box with predefined min and max values
|
||||
/// </summary>
|
||||
/// <param name="min"></param>
|
||||
/// <param name="max"></param>
|
||||
|
|
@ -44,12 +41,22 @@ namespace SM.OGL.Mesh
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the bounding box.
|
||||
/// Returns specific configurations of corners
|
||||
/// </summary>
|
||||
/// <param name="x">If true, it takes the X-value of maximum, otherwise the minimum.</param>
|
||||
/// <param name="y">If true, it takes the Y-value of maximum, otherwise the minimum.</param>
|
||||
/// <param name="z">If true, it takes the Z-value of maximum, otherwise the minimum.</param>
|
||||
/// <returns></returns>
|
||||
public Vector3 this[bool x, bool y, bool z] =>
|
||||
new Vector3(x ? Max.X : Min.X, y ? Max.Y : Min.Y, z ? Max.Z : Min.Z);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the bounding box.
|
||||
/// </summary>
|
||||
/// <param name="vector"></param>
|
||||
public void Update(Vector2 vector)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
Min[i] = Math.Min(Min[i], vector[i]);
|
||||
Max[i] = Math.Max(Max[i], vector[i]);
|
||||
|
|
@ -57,12 +64,12 @@ namespace SM.OGL.Mesh
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the bounding box.
|
||||
/// Updates the bounding box.
|
||||
/// </summary>
|
||||
/// <param name="vector"></param>
|
||||
public void Update(Vector3 vector)
|
||||
{
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (var i = 0; i < 3; i++)
|
||||
{
|
||||
Min[i] = Math.Min(Min[i], vector[i]);
|
||||
Max[i] = Math.Max(Min[i], vector[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue