dragSprite.DrawDepth = (int) DrawDepth.Overlays;
if (!dragSprite.NoRotation)
{
- Transform(_dragShadow.Value).WorldRotation = Transform(_draggedEntity.Value).WorldRotation;
+ _transformSystem.SetWorldRotationNoLerp(_dragShadow.Value, _transformSystem.GetWorldRotation(_draggedEntity.Value));
}
// drag initiated
if (localToWorld.EqualsApprox(mousePos.Position, 0.01f)) return;
- var requestedGridOrigin = mousePos.Position - xform.WorldRotation.RotateVec(_localPosition);
+ var requestedGridOrigin = mousePos.Position - _transformSystem.GetWorldRotation(xform).RotateVec(_localPosition);
_lastMousePosition = new MapCoordinates(requestedGridOrigin, mousePos.MapId);
RaiseNetworkEvent(new GridDragRequestPosition()
var board = Spawn("ChessBoard", xform.Coordinates);
var session = _tabletopSystem.EnsureSession(Comp<TabletopGameComponent>(board));
xform.Coordinates = EntityCoordinates.FromMap(_mapManager, session.Position);
- xform.WorldRotation = Angle.Zero;
+ _transformSystem.SetWorldRotationNoLerp((args.Target, xform), Angle.Zero);
},
Impact = LogImpact.Extreme,
Message = string.Join(": ", chessName, Loc.GetString("admin-smite-chess-dimension-description"))
return;
// Used by ExperiencePressureDifference to correct push/throw directions from tile-relative to physics world.
- var gridWorldRotation = xforms.GetComponent(gridAtmosphere).WorldRotation;
+ var gridWorldRotation = _transformSystem.GetWorldRotation(gridAtmosphere);
// If we're using monstermos, smooth out the yeet direction to follow the flow
if (MonstermosEqualization)
return;
_needToTransform = true;
- var transform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Grid.Owner);
+ var entityManager = IoCManager.Resolve<IEntityManager>();
+
+ var transformSystem = entityManager.System<SharedTransformSystem>();
+ var transform = entityManager.GetComponent<TransformComponent>(Grid.Owner);
var size = (float) Grid.TileSize;
_matrix.M31 = size / 2;
_matrix.M32 = size / 2;
Matrix3x2.Invert(spaceMatrix, out var invSpace);
_matrix *= transform.WorldMatrix * invSpace;
- var relativeAngle = transform.WorldRotation - spaceAngle;
+ var relativeAngle = transformSystem.GetWorldRotation(transform) - spaceAngle;
_offset = relativeAngle.RotateVec(new Vector2(size / 4, size / 4));
}
{
var targetGrid = Comp<MapGridComponent>(referenceGrid.Value);
var xform = Transform(referenceGrid.Value);
- targetAngle = xform.WorldRotation;
+ targetAngle = _transformSystem.GetWorldRotation(xform);
targetMatrix = xform.InvWorldMatrix;
tileSize = targetGrid.TileSize;
}
{
var xform = Transform(Comp<MapGridComponent>(referenceGrid.Value).Owner);
spaceMatrix = xform.WorldMatrix;
- spaceAngle = xform.WorldRotation;
+ spaceAngle = _transformSystem.GetWorldRotation(xform);
}
// is the explosion starting on a grid?
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedHandsSystem _handsSystem = default!;
[Dependency] private readonly ThrowingSystem _throwingSystem = default!;
+ [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
private void FallOver(EntityUid uid, StandingStateComponent component, DropHandItemsEvent args)
{
if (!TryComp(uid, out HandsComponent? handsComp))
return;
- var worldRotation = EntityManager.GetComponent<TransformComponent>(uid).WorldRotation.ToVec();
+ var worldRotation = _transformSystem.GetWorldRotation(uid).ToVec();
foreach (var hand in handsComp.Hands.Values)
{
if (hand.HeldEntity is not EntityUid held)
private static bool GetWorldTileBox(TileRef turf, out Box2Rotated res)
{
var entManager = IoCManager.Resolve<IEntityManager>();
+ var xformSystem = entManager.System<SharedTransformSystem>();
if (entManager.TryGetComponent<MapGridComponent>(turf.GridUid, out var tileGrid))
{
- var gridRot = entManager.GetComponent<TransformComponent>(turf.GridUid).WorldRotation;
+ var gridRot = xformSystem.GetWorldRotation(turf.GridUid);
// This is scaled to 90 % so it doesn't encompass walls on other tiles.
var tileBox = Box2.UnitCentered.Scale(0.9f);