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,20 @@
using System;
using OMI.Formats.Model;
using System.Numerics;
namespace PckStudio.Core.Extensions
{
public static class ModelBoxExtension
{
public static BoundingBox GetBoundingBox(this ModelBox modelBox)
{
Vector3 halfSize = modelBox.Size / 2f;
Vector3 halfSizeInflated = new Vector3(modelBox.Inflate) + halfSize;
Vector3 transformedCenter = modelBox.Position + halfSize;
Vector3 start = transformedCenter - halfSizeInflated;
Vector3 end = transformedCenter + halfSizeInflated;
return new BoundingBox(start, end);
}
}
}