Final grid movement optimisation (#2711)

This commit is contained in:
metalgearsloth
2022-05-14 14:54:31 +10:00
committed by GitHub
parent 70fbefbe62
commit 32bdc19fe9
21 changed files with 257 additions and 112 deletions
@@ -35,8 +35,8 @@ namespace Robust.UnitTesting.Shared.Map
gridId2 = mapManager.CreateGrid(mapId);
gridEnt1 = gridId1.GridEntityId;
gridEnt2 = gridId2.GridEntityId;
physics1 = IoCManager.Resolve<IEntityManager>().GetComponent<PhysicsComponent>(gridEnt1.Value);
physics2 = IoCManager.Resolve<IEntityManager>().GetComponent<PhysicsComponent>(gridEnt2.Value);
physics1 = entManager.GetComponent<PhysicsComponent>(gridEnt1.Value);
physics2 = entManager.GetComponent<PhysicsComponent>(gridEnt2.Value);
// Can't collide static bodies and grids (at time of this writing) start as static
// (given most other games would probably prefer them as static) hence we need to make them dynamic.
physics1.BodyType = BodyType.Dynamic;
@@ -56,7 +56,7 @@ namespace Robust.UnitTesting.Shared.Map
grid.SetTile(new Vector2i(-1, -2), new Tile(1));
grid.SetTile(new Vector2i(1, 2), new Tile(1));
var bounds = grid.WorldBounds;
var bounds = grid.WorldAABB;
// this is world, so add the grid world pos
Assert.That(bounds.Bottom, Is.EqualTo(-2+5));
@@ -82,7 +82,7 @@ namespace Robust.UnitTesting.Shared.Map
grid.SetTile(new Vector2i(1, 2), Tile.Empty);
var bounds = grid.WorldBounds;
var bounds = grid.WorldAABB;
// this is world, so add the grid world pos
Assert.That(bounds.Bottom, Is.EqualTo(-2+5));