Move Common functionality to Core project & rendering and Model support as well

This commit is contained in:
miku-666
2025-09-01 23:03:39 +02:00
parent 698056a0a0
commit 9656c8b48d
177 changed files with 5979 additions and 1279 deletions

View File

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using PckStudio.Core.Extensions;
namespace PckStudio.Core
{
public struct BoundingBox
{
public static BoundingBox Empty = new BoundingBox(OpenTK.Vector3.Zero, OpenTK.Vector3.Zero);
public readonly OpenTK.Vector3 Start;
public readonly OpenTK.Vector3 End;
public readonly OpenTK.Vector3 Center;
public readonly OpenTK.Vector3 Volume;
public BoundingBox(OpenTK.Vector3 start, OpenTK.Vector3 end)
{
Start = start;
End = end;
OpenTK.Vector3 size = End - Start;
Volume = OpenTKExtensions.Abs(size);
Center = start + Volume / 2;
}
public BoundingBox(System.Numerics.Vector3 start, System.Numerics.Vector3 end)
: this(start.ToOpenTKVector(), end.ToOpenTKVector())
{
}
public OpenTK.Matrix4 GetTransform()
{
return OpenTK.Matrix4.CreateScale(Volume) * OpenTK.Matrix4.CreateTranslation(Start);
}
}
}