Remove transform methods from mapgrid (#12233)

This commit is contained in:
metalgearsloth
2022-11-01 11:27:18 +11:00
committed by GitHub
parent 297686c4ff
commit c9a2ab1cee
25 changed files with 144 additions and 78 deletions

View File

@@ -387,10 +387,12 @@ public sealed partial class CargoSystem
var center = new Vector2();
var minRadius = 0f;
Box2? aabb = null;
var xformQuery = GetEntityQuery<TransformComponent>();
foreach (var grid in _mapManager.GetAllMapGrids(xform.MapID))
{
aabb = aabb?.Union(grid.WorldAABB) ?? grid.WorldAABB;
var worldAABB = xformQuery.GetComponent(grid.GridEntityId).WorldMatrix.TransformBox(grid.LocalAABB);
aabb = aabb?.Union(worldAABB) ?? worldAABB;
}
if (aabb != null)