Remove most usages of obsolete TransformComponent methods (#19571)

This commit is contained in:
Visne
2023-08-30 04:05:19 +02:00
committed by GitHub
parent 3ba60835ec
commit 1416942bea
91 changed files with 312 additions and 221 deletions

View File

@@ -36,7 +36,7 @@ public sealed partial class PathfindingSystem
return Vector2.Zero;
}
endPos = startXform.InvWorldMatrix.Transform(endXform.WorldMatrix.Transform(endPos));
endPos = _transform.GetInvWorldMatrix(startXform).Transform(_transform.GetWorldMatrix(endXform).Transform(endPos));
}
// TODO: Numerics when we changeover.

View File

@@ -410,8 +410,7 @@ public sealed partial class PathfindingSystem
private Vector2i GetOrigin(EntityCoordinates coordinates, EntityUid gridUid)
{
var gridXform = Transform(gridUid);
var localPos = gridXform.InvWorldMatrix.Transform(coordinates.ToMapPos(EntityManager));
var localPos = _transform.GetInvWorldMatrix(gridUid).Transform(coordinates.ToMapPos(EntityManager));
return new Vector2i((int) Math.Floor(localPos.X / ChunkSize), (int) Math.Floor(localPos.Y / ChunkSize));
}

View File

@@ -47,6 +47,7 @@ namespace Content.Server.NPC.Pathfinding
[Dependency] private readonly FixtureSystem _fixtures = default!;
[Dependency] private readonly NPCSystem _npc = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
private readonly Dictionary<ICommonSession, PathfindingDebugMode> _subscribedSessions = new();
@@ -382,7 +383,7 @@ namespace Content.Server.NPC.Pathfinding
return null;
}
var localPos = xform.InvWorldMatrix.Transform(coordinates.ToMapPos(EntityManager));
var localPos = _transform.GetInvWorldMatrix(xform).Transform(coordinates.ToMapPos(EntityManager));
var origin = GetOrigin(localPos);
if (!TryGetChunk(origin, comp, out var chunk))