CubeMeshCollection - Implemented 'GetBounds'

This commit is contained in:
miku-666
2024-10-09 14:30:54 +02:00
parent 953199d687
commit 522a1e70fb

View File

@@ -169,7 +169,11 @@ namespace PckStudio.Rendering
public override BoundingBox GetBounds(Matrix4 transform)
{
throw new NotImplementedException();
IEnumerable<BoundingBox> 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)