From 522a1e70fb50be27fb46eb1819a92cca31894e85 Mon Sep 17 00:00:00 2001 From: miku-666 <74728189+NessieHax@users.noreply.github.com> Date: Wed, 9 Oct 2024 14:30:54 +0200 Subject: [PATCH] CubeMeshCollection - Implemented 'GetBounds' --- PCK-Studio/Rendering/CubeMeshCollection.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PCK-Studio/Rendering/CubeMeshCollection.cs b/PCK-Studio/Rendering/CubeMeshCollection.cs index 4a07217a..e0603983 100644 --- a/PCK-Studio/Rendering/CubeMeshCollection.cs +++ b/PCK-Studio/Rendering/CubeMeshCollection.cs @@ -169,7 +169,11 @@ namespace PckStudio.Rendering public override BoundingBox GetBounds(Matrix4 transform) { - throw new NotImplementedException(); + IEnumerable boundingBoxes = cubes + .Where(c => c.Visible) + .Select(c => c.GetBounds(Transform * transform)) + .DefaultIfEmpty(); + return BoundingBox.GetEnclosingBoundingBox(boundingBoxes); } internal Vector3 GetFaceCenter(int index, Cube.Face face)