- fix: engine update fix
Some checks failed
Build & Test Map Renderer / build (ubuntu-latest) (push) Has been cancelled
Build & Test Debug / build (ubuntu-latest) (push) Has been cancelled
Check Merge Conflicts / Label (push) Has been cancelled
Test Packaging / Test Packaging (push) Has been cancelled
RGA schema validator / YAML RGA schema validator (push) Has been cancelled
Map file schema validator / YAML map schema validator (push) Has been cancelled
YAML Linter / YAML Linter (push) Has been cancelled
Build & Test Map Renderer / Build & Test Debug (push) Has been cancelled
Build & Test Debug / Build & Test Debug (push) Has been cancelled
Benchmarks / Run Benchmarks (push) Has been cancelled
Update Contrib and Patreons in credits / get_credits (push) Has been cancelled
Build & Publish Docfx / docfx (push) Has been cancelled

This commit is contained in:
2026-02-01 14:47:44 +03:00
parent 0026c52592
commit f02cc9cb87
66 changed files with 122 additions and 92 deletions

0
BuildChecker/hooks/post-checkout Executable file → Normal file
View File

0
BuildChecker/hooks/post-merge Executable file → Normal file
View File

View File

View File

@@ -78,7 +78,7 @@ public sealed class ExplosionDebugOverlay : Overlay
if (SpaceTiles == null)
return;
gridBounds = Matrix3.Invert(SpaceMatrix).TransformBox(args.WorldBounds);
gridBounds = ContentMathHelper.Invert(SpaceMatrix).TransformBox(args.WorldBounds);
DrawText(handle, gridBounds, SpaceMatrix, SpaceTiles, SpaceTileSize);
}
@@ -148,7 +148,7 @@ public sealed class ExplosionDebugOverlay : Overlay
if (SpaceTiles == null)
return;
gridBounds = Matrix3.Invert(SpaceMatrix).TransformBox(args.WorldBounds).Enlarged(2);
gridBounds = ContentMathHelper.Invert(SpaceMatrix).TransformBox(args.WorldBounds).Enlarged(2);
handle.SetTransform(SpaceMatrix);
DrawTiles(handle, gridBounds, SpaceTiles, SpaceTileSize);

View File

@@ -190,7 +190,7 @@ namespace Content.Client.Atmos.Overlays
var (_, _, worldMatrix, invMatrix) = gridXform.GetWorldPositionRotationMatrixWithInv();
state.drawHandle.SetTransform(worldMatrix);
var floatBounds = invMatrix.TransformBox(in state.WorldBounds).Enlarged(grid.TileSize);
var floatBounds = invMatrix.TransformBox(state.WorldBounds).Enlarged(grid.TileSize);
var localBounds = new Box2i(
(int) MathF.Floor(floatBounds.Left),
(int) MathF.Floor(floatBounds.Bottom),

View File

@@ -38,9 +38,9 @@ namespace Content.Client.Clickable
renderOrder = sprite.RenderOrder;
var (spritePos, spriteRot) = transform.GetWorldPositionRotation(xformQuery);
var spriteBB = sprite.CalculateRotatedBoundingBox(spritePos, spriteRot, eye.Rotation);
bottom = Matrix3.CreateRotation(eye.Rotation).TransformBox(spriteBB).Bottom;
bottom = Matrix3Helpers.CreateRotation(eye.Rotation).TransformBox(spriteBB).Bottom;
var invSpriteMatrix = Matrix3.Invert(sprite.GetLocalMatrix());
Matrix3x2.Invert(sprite.GetLocalMatrix(), out var invSpriteMatrix);
// This should have been the rotation of the sprite relative to the screen, but this is not the case with no-rot or directional sprites.
var relativeRotation = (spriteRot + eye.Rotation).Reduced().FlipPositive();
@@ -48,7 +48,7 @@ namespace Content.Client.Clickable
Angle cardinalSnapping = sprite.SnapCardinals ? relativeRotation.GetCardinalDir().ToAngle() : Angle.Zero;
// First we get `localPos`, the clicked location in the sprite-coordinate frame.
var entityXform = Matrix3.CreateInverseTransform(transform.WorldPosition, sprite.NoRotation ? -eye.Rotation : spriteRot - cardinalSnapping);
var entityXform = Matrix3Helpers.CreateInverseTransform(transform.WorldPosition, sprite.NoRotation ? -eye.Rotation : spriteRot - cardinalSnapping);
var localPos = invSpriteMatrix.Transform(entityXform.Transform(worldPos));
// Check explicitly defined click-able bounds
@@ -79,7 +79,9 @@ namespace Content.Client.Clickable
// convert to layer-local coordinates
layer.GetLayerDrawMatrix(dir, out var matrix);
var inverseMatrix = Matrix3.Invert(matrix);
Matrix3x2.Invert(matrix, out var inverseMatrix);
var layerLocal = inverseMatrix.Transform(localPos);
// Convert to image coordinates

View File

@@ -60,7 +60,7 @@ public sealed class DoAfterOverlay : Overlay
// If you use the display UI scale then need to set max(1f, displayscale) because 0 is valid.
const float scale = 1f;
var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale));
var rotationMatrix = Matrix3.CreateRotation(-rotation);
var rotationMatrix = Matrix3Helpers.CreateRotation(-rotation);
var curTime = _timing.CurTime;
@@ -97,8 +97,8 @@ public sealed class DoAfterOverlay : Overlay
: curTime;
var worldMatrix = Matrix3.CreateTranslation(worldPosition);
Matrix3.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
Matrix3.Multiply(rotationMatrix, scaledWorld, out var matty);
ContentMathHelper.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
ContentMathHelper.Multiply(rotationMatrix, scaledWorld, out var matty);
handle.SetTransform(matty);
var offset = 0f;

View File

@@ -78,7 +78,7 @@ public sealed class ExplosionOverlay : Overlay
if (visuals.SpaceTiles == null)
return;
gridBounds = Matrix3.Invert(visuals.SpaceMatrix).TransformBox(worldBounds).Enlarged(2);
gridBounds = ContentMathHelper.Invert(visuals.SpaceMatrix).TransformBox(worldBounds).Enlarged(2);
drawHandle.SetTransform(visuals.SpaceMatrix);
DrawTiles(drawHandle, gridBounds, index, visuals.SpaceTiles, visuals, visuals.SpaceTileSize, textures);

View File

@@ -10,3 +10,6 @@ global using Robust.Shared.IoC;
global using Robust.Shared.Maths;
global using Robust.Shared.ViewVariables;
global using Robust.Shared.Serialization.Manager.Attributes;
global using Content.Shared._Amour.ContentMath;
global using Matrix3 = System.Numerics.Matrix3x2;

View File

@@ -47,7 +47,7 @@ public sealed class EntityHealthBarOverlay : Overlay
const float scale = 1f;
var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale));
var rotationMatrix = Matrix3.CreateRotation(-rotation);
var rotationMatrix = Matrix3Helpers.CreateRotation(-rotation);
var query = _entManager.AllEntityQueryEnumerator<MobThresholdsComponent, MobStateComponent, DamageableComponent, SpriteComponent>();
while (query.MoveNext(out var uid,
@@ -88,8 +88,8 @@ public sealed class EntityHealthBarOverlay : Overlay
var worldPosition = _transform.GetWorldPosition(xform);
var worldMatrix = Matrix3.CreateTranslation(worldPosition);
Matrix3.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
Matrix3.Multiply(rotationMatrix, scaledWorld, out var matty);
ContentMathHelper.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
ContentMathHelper.Multiply(rotationMatrix, scaledWorld, out var matty);
handle.SetTransform(matty);

View File

@@ -32,7 +32,7 @@ public sealed partial class StencilOverlay
foreach (var grid in _grids)
{
var matrix = _transform.GetWorldMatrix(grid, xformQuery);
Matrix3.Multiply(in matrix, in invMatrix, out var matty);
ContentMathHelper.Multiply(matrix, invMatrix, out var matty);
worldHandle.SetTransform(matty);
foreach (var tile in grid.Comp.GetTilesIntersecting(worldAABB))

View File

@@ -108,8 +108,8 @@ public sealed partial class ShuttleDockControl : BaseShuttleControl
var gridNent = EntManager.GetNetEntity(GridEntity);
var mapPos = _xformSystem.ToMapCoordinates(_coordinates.Value);
var ourGridMatrix = _xformSystem.GetWorldMatrix(gridXform.Owner);
var dockMatrix = Matrix3.CreateTransform(_coordinates.Value.Position, Angle.Zero);
Matrix3.Multiply(dockMatrix, ourGridMatrix, out var offsetMatrix);
var dockMatrix = Matrix3Helpers.CreateTransform(_coordinates.Value.Position, Angle.Zero);
ContentMathHelper.Multiply(dockMatrix, ourGridMatrix, out var offsetMatrix);
offsetMatrix = offsetMatrix.Invert();
@@ -137,7 +137,7 @@ public sealed partial class ShuttleDockControl : BaseShuttleControl
continue;
var gridMatrix = _xformSystem.GetWorldMatrix(grid.Owner);
Matrix3.Multiply(in gridMatrix, in offsetMatrix, out var matty);
ContentMathHelper.Multiply(gridMatrix, offsetMatrix, out var matty);
var color = _shuttles.GetIFFColor(grid.Owner, grid.Owner == GridEntity, component: iffComp);
DrawGrid(handle, matty, grid, color);
@@ -153,7 +153,7 @@ public sealed partial class ShuttleDockControl : BaseShuttleControl
var position = matty.Transform(dock.Coordinates.Position);
var otherDockRotation = Matrix3.CreateRotation(dock.Angle);
var otherDockRotation = Matrix3Helpers.CreateRotation(dock.Angle);
var scaledPos = ScalePosition(position with {Y = -position.Y});
if (!controlBounds.Contains(scaledPos.Floored()))
@@ -308,7 +308,7 @@ public sealed partial class ShuttleDockControl : BaseShuttleControl
// Draw the dock's collision
var invertedPosition = Vector2.Zero;
invertedPosition.Y = -invertedPosition.Y;
var rotation = Matrix3.CreateRotation(-_angle.Value + MathF.PI);
var rotation = Matrix3Helpers.CreateRotation(-_angle.Value + MathF.PI);
var ourDockConnection = new UIBox2(
ScalePosition(rotation.Transform(new Vector2(-0.2f, -0.7f))),
ScalePosition(rotation.Transform(new Vector2(0.2f, -0.5f))));

View File

@@ -114,7 +114,7 @@ public sealed partial class ShuttleMapControl : BaseShuttleControl
var beaconsOnly = EntManager.TryGetComponent(mapUid, out FTLDestinationComponent? destComp) &&
destComp.BeaconsOnly;
var mapTransform = Matrix3.CreateInverseTransform(Offset, Angle.Zero);
var mapTransform = Matrix3Helpers.CreateInverseTransform(Offset, Angle.Zero);
if (beaconsOnly && TryGetBeacon(_beacons, mapTransform, args.RelativePixelPosition, PixelRect, out var foundBeacon, out _))
{
@@ -250,7 +250,7 @@ public sealed partial class ShuttleMapControl : BaseShuttleControl
DrawParallax(handle);
var viewedMapUid = _mapManager.GetMapEntityId(ViewingMap);
var matty = Matrix3.CreateInverseTransform(Offset, Angle.Zero);
var matty = Matrix3Helpers.CreateInverseTransform(Offset, Angle.Zero);
var realTime = _timing.RealTime;
var viewBox = new Box2(Offset - WorldRangeVector, Offset + WorldRangeVector);
var viewportObjects = GetViewportMapObjects(matty, mapObjects);

View File

@@ -137,9 +137,9 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
var mapPos = _transform.ToMapCoordinates(_coordinates.Value);
var offset = _coordinates.Value.Position;
var posMatrix = Matrix3.CreateTransform(offset, _rotation.Value);
var posMatrix = Matrix3Helpers.CreateTransform(offset, _rotation.Value);
var (_, ourEntRot, ourEntMatrix) = _transform.GetWorldPositionRotationMatrix(_coordinates.Value.EntityId);
Matrix3.Multiply(posMatrix, ourEntMatrix, out var ourWorldMatrix);
ContentMathHelper.Multiply(posMatrix, ourEntMatrix, out var ourWorldMatrix);
var ourWorldMatrixInvert = ourWorldMatrix.Invert();
// Draw our grid in detail
@@ -148,7 +148,7 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
fixturesQuery.HasComponent(ourGridId.Value))
{
var ourGridMatrix = _transform.GetWorldMatrix(ourGridId.Value);
Matrix3.Multiply(in ourGridMatrix, in ourWorldMatrixInvert, out var matrix);
ContentMathHelper.Multiply(ourGridMatrix, ourWorldMatrixInvert, out var matrix);
var color = _shuttles.GetIFFColor(ourGridId.Value, self: true);
DrawGrid(handle, matrix, (ourGridId.Value, ourGrid), color);
@@ -194,7 +194,7 @@ public sealed partial class ShuttleNavControl : BaseShuttleControl
continue;
var gridMatrix = _transform.GetWorldMatrix(gUid);
Matrix3.Multiply(in gridMatrix, in ourWorldMatrixInvert, out var matty);
ContentMathHelper.Multiply(gridMatrix, ourWorldMatrixInvert, out var matty);
var color = _shuttles.GetIFFColor(grid, self: false, iff);
// Others default:

View File

@@ -40,7 +40,7 @@ public sealed class StatusIconOverlay : Overlay
var xformQuery = _entity.GetEntityQuery<TransformComponent>();
var scaleMatrix = Matrix3.CreateScale(new Vector2(1, 1));
var rotationMatrix = Matrix3.CreateRotation(-eyeRot);
var rotationMatrix = Matrix3Helpers.CreateRotation(-eyeRot);
var query = _entity.AllEntityQueryEnumerator<StatusIconComponent, SpriteComponent, TransformComponent, MetaDataComponent>();
while (query.MoveNext(out var uid, out var comp, out var sprite, out var xform, out var meta))
@@ -63,8 +63,8 @@ public sealed class StatusIconOverlay : Overlay
continue;
var worldMatrix = Matrix3.CreateTranslation(worldPos);
Matrix3.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
Matrix3.Multiply(rotationMatrix, scaledWorld, out var matty);
ContentMathHelper.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
ContentMathHelper.Multiply(rotationMatrix, scaledWorld, out var matty);
handle.SetTransform(matty);
var countL = 0;

View File

@@ -65,7 +65,7 @@ public sealed class DirectionIcon : TextureRect
if (_rotation != null)
{
var offset = (-_rotation.Value).RotateVec(Size * UIScale / 2) - Size * UIScale / 2;
handle.SetTransform(Matrix3.CreateTransform(GlobalPixelPosition - offset, -_rotation.Value));
handle.SetTransform(Matrix3Helpers.CreateTransform(GlobalPixelPosition - offset, -_rotation.Value));
}
base.Draw(handle);

View File

@@ -169,7 +169,7 @@ public partial class MapGridControl : LayoutContainer
var inversePos = (value - MidPointVector) / MinimapScale;
inversePos = inversePos with { Y = -inversePos.Y };
inversePos = Matrix3.CreateTransform(Offset, Angle.Zero).Transform(inversePos);
inversePos = Matrix3Helpers.CreateTransform(Offset, Angle.Zero).Transform(inversePos);
return inversePos;
}

View File

@@ -277,7 +277,7 @@ namespace Content.Client.Viewport
EnsureViewportCreated();
var matrix = Matrix3.Invert(GetLocalToScreenMatrix());
var matrix = ContentMathHelper.Invert(GetLocalToScreenMatrix());
coords = matrix.Transform(coords);
return _viewport!.LocalToWorld(coords);
@@ -291,7 +291,7 @@ namespace Content.Client.Viewport
EnsureViewportCreated();
var matrix = Matrix3.Invert(GetLocalToScreenMatrix());
Matrix3x2.Invert(GetLocalToScreenMatrix(), out var matrix);
coords = matrix.Transform(coords);
var ev = new PixelToMapEvent(coords, this, _viewport!);
@@ -314,13 +314,13 @@ namespace Content.Client.Viewport
return matrix.Transform(vpLocal);
}
public Matrix3 GetWorldToScreenMatrix()
public Matrix3x2 GetWorldToScreenMatrix()
{
EnsureViewportCreated();
return _viewport!.GetWorldToLocalMatrix() * GetLocalToScreenMatrix();
}
public Matrix3 GetLocalToScreenMatrix()
public Matrix3x2 GetLocalToScreenMatrix()
{
EnsureViewportCreated();
@@ -331,7 +331,7 @@ namespace Content.Client.Viewport
// Basically a nonsense scenario, at least make sure to return something that can be inverted.
return Matrix3.Identity;
return Matrix3.CreateTransform(GlobalPixelPosition + drawBox.TopLeft, 0, scaleFactor);
return Matrix3Helpers.CreateTransform(GlobalPixelPosition + drawBox.TopLeft, 0, scaleFactor);
}
private void EnsureViewportCreated()

View File

@@ -27,7 +27,7 @@ public sealed class CultHudOverlay : Overlay
const float scale = 1f;
var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale));
var rotationMatrix = Matrix3.CreateRotation(-rotation);
var rotationMatrix = Matrix3Helpers.CreateRotation(-rotation);
foreach (var cultist in _entityManager.EntityQuery<CultistComponent>(true))
{
@@ -40,8 +40,8 @@ public sealed class CultHudOverlay : Overlay
var worldPosition = _transformSystem.GetWorldPosition(xform);
var worldMatrix = Matrix3.CreateTranslation(worldPosition);
Matrix3.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
Matrix3.Multiply(rotationMatrix, scaledWorld, out var matty);
ContentMathHelper.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
ContentMathHelper.Multiply(rotationMatrix, scaledWorld, out var matty);
handle.SetTransform(matty);

View File

@@ -59,7 +59,7 @@ public sealed class EntityHealthBarOverlay : Overlay
const float scale = 1f;
var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale));
var rotationMatrix = Matrix3.CreateRotation(-rotation);
var rotationMatrix = Matrix3Helpers.CreateRotation(-rotation);
var query = _entManager.EntityQueryEnumerator<MobStateComponent, DamageableComponent, MobThresholdsComponent>();
@@ -77,8 +77,8 @@ public sealed class EntityHealthBarOverlay : Overlay
var worldPosition = _transform.GetWorldPosition(xform);
var worldMatrix = Matrix3.CreateTranslation(worldPosition);
Matrix3.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
Matrix3.Multiply(rotationMatrix, scaledWorld, out var matty);
ContentMathHelper.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
ContentMathHelper.Multiply(rotationMatrix, scaledWorld, out var matty);
handle.SetTransform(matty);

View File

@@ -38,7 +38,7 @@ public sealed class EntityJobInfoOverlay : Overlay
const float scale = 1f;
var scaleMatrix = Matrix3.CreateScale(new Vector2(scale, scale));
var rotationMatrix = Matrix3.CreateRotation(-rotation);
var rotationMatrix = Matrix3Helpers.CreateRotation(-rotation);
foreach (var hum in _entManager.EntityQuery<HumanoidAppearanceComponent>(true))
{
@@ -51,8 +51,8 @@ public sealed class EntityJobInfoOverlay : Overlay
var worldPosition = _transform.GetWorldPosition(xform);
var worldMatrix = Matrix3.CreateTranslation(worldPosition);
Matrix3.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
Matrix3.Multiply(rotationMatrix, scaledWorld, out var matty);
ContentMathHelper.Multiply(scaleMatrix, worldMatrix, out var scaledWorld);
ContentMathHelper.Multiply(rotationMatrix, scaledWorld, out var matty);
handle.SetTransform(matty);

0
Content.Server.Database/add-migration.ps1 Executable file → Normal file
View File

0
Content.Server.Database/add-migration.sh Executable file → Normal file
View File

View File

@@ -403,7 +403,7 @@ public record struct PriceCalculationEvent()
[ByRefEvent]
public record struct EstimatedPriceCalculationEvent()
{
public EntityPrototype Prototype;
public EntityPrototype Prototype = default!;
/// <summary>
/// The total price of the entity.

View File

@@ -72,9 +72,8 @@ public sealed class ExplosionGridTileFlood : ExplosionTileFlood
var transform = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(Grid.Owner);
var size = (float) Grid.TileSize;
_matrix.R0C2 = size / 2;
_matrix.R1C2 = size / 2;
_matrix *= transform.WorldMatrix * Matrix3.Invert(spaceMatrix);
_matrix *= transform.WorldMatrix * ContentMathHelper.Invert(spaceMatrix);
var relativeAngle = transform.WorldRotation - spaceAngle;
_offset = relativeAngle.RotateVec(new Vector2(size / 4, size / 4));
}

View File

@@ -75,9 +75,7 @@ public sealed partial class ExplosionSystem : EntitySystem
tileSize = targetGrid.TileSize;
}
var offsetMatrix = Matrix3.Identity;
offsetMatrix.R0C2 = tileSize / 2f;
offsetMatrix.R1C2 = tileSize / 2f;
var offsetMatrix = Matrix3Helpers.CreateScale(new Vector2(tileSize / 2f));
// Here we can end up with a triple nested for loop:
// foreach other grid

View File

@@ -698,7 +698,7 @@ sealed class Explosion
});
_spaceMatrix = spaceMatrix;
_invSpaceMatrix = Matrix3.Invert(spaceMatrix);
_invSpaceMatrix = ContentMathHelper.Invert(spaceMatrix);
}
foreach (var grid in gridData)

View File

@@ -286,8 +286,8 @@ namespace Content.Server.Ghost
if (_ticker.RunLevel != GameRunLevel.PostRound && !component.Visible)
{
_visibilitySystem.AddLayer(uid, visibility, (int) VisibilityFlags.Ghost, false);
_visibilitySystem.RemoveLayer(uid, visibility, (int) VisibilityFlags.Normal, false);
_visibilitySystem.AddLayer(new Entity<VisibilityComponent?>(uid, visibility), (int) VisibilityFlags.Ghost, false);
_visibilitySystem.RemoveLayer(new Entity<VisibilityComponent?>(uid, visibility), (int) VisibilityFlags.Normal, false);
_visibilitySystem.RefreshVisibility(uid, visibilityComponent: visibility);
}
@@ -306,8 +306,8 @@ namespace Content.Server.Ghost
// Entity can't be seen by ghosts anymore.
if (TryComp(uid, out VisibilityComponent? visibility) && !component.Visible)
{
_visibilitySystem.RemoveLayer(uid, visibility, (int) VisibilityFlags.Ghost, false);
_visibilitySystem.AddLayer(uid, visibility, (int) VisibilityFlags.Normal, false);
_visibilitySystem.RemoveLayer(new Entity<VisibilityComponent?>(uid, visibility), (int) VisibilityFlags.Ghost, false);
_visibilitySystem.AddLayer(new Entity<VisibilityComponent?>(uid, visibility), (int) VisibilityFlags.Normal, false);
_visibilitySystem.RefreshVisibility(uid, visibilityComponent: visibility);
}

View File

@@ -10,3 +10,6 @@ global using Robust.Shared.IoC;
global using Robust.Shared.Maths;
global using Robust.Shared.ViewVariables;
global using Robust.Shared.Serialization.Manager.Attributes;
global using Content.Shared._Amour.ContentMath;
global using Matrix3 = System.Numerics.Matrix3x2;

View File

@@ -184,12 +184,12 @@ namespace Content.Server.Pointing.EntitySystems
}
}
var layer = (int) VisibilityFlags.Normal;
var layer = (ushort) VisibilityFlags.Normal;
if (TryComp(player, out VisibilityComponent? playerVisibility))
{
var arrowVisibility = EntityManager.EnsureComponent<VisibilityComponent>(arrow);
layer = playerVisibility.Layer;
_visibilitySystem.SetLayer(arrow, arrowVisibility, layer);
_visibilitySystem.SetLayer(new Entity<VisibilityComponent?>(arrow, arrowVisibility), layer);
}
// Get players that are in range and whose visibility layer matches the arrow's.

View File

@@ -19,7 +19,7 @@ public sealed partial class DungeonJob
var gen = _prototype.Index<DungeonPresetPrototype>(preset);
var dungeonRotation = _dungeon.GetDungeonRotation(seed);
var dungeonTransform = Matrix3.CreateTransform(_position, dungeonRotation);
var dungeonTransform = Matrix3Helpers.CreateTransform(_position, dungeonRotation);
var roomPackProtos = new Dictionary<Vector2i, List<DungeonRoomPackPrototype>>();
foreach (var pack in _prototype.EnumeratePrototypes<DungeonRoomPackPrototype>())
@@ -128,7 +128,7 @@ public sealed partial class DungeonJob
var aRotation = dir.AsDir().ToAngle();
// Use this pack
packTransform = Matrix3.CreateTransform(bounds.Center, aRotation);
packTransform = Matrix3Helpers.CreateTransform(bounds.Center, aRotation);
packRotations[i] = aRotation;
pack = aPack;
break;
@@ -176,7 +176,7 @@ public sealed partial class DungeonJob
if (!roomProtos.TryGetValue(roomDimensions, out roomProto))
{
Matrix3.Multiply(packTransform, dungeonTransform, out matty);
ContentMathHelper.Multiply(packTransform, dungeonTransform, out matty);
for (var x = roomSize.Left; x < roomSize.Right; x++)
{
@@ -209,10 +209,10 @@ public sealed partial class DungeonJob
roomRotation += Math.PI;
}
var roomTransform = Matrix3.CreateTransform(roomSize.Center - packCenter, roomRotation);
var roomTransform = Matrix3Helpers.CreateTransform(roomSize.Center - packCenter, roomRotation);
Matrix3.Multiply(roomTransform, packTransform, out matty);
Matrix3.Multiply(matty, dungeonTransform, out var dungeonMatty);
ContentMathHelper.Multiply(roomTransform, packTransform, out matty);
ContentMathHelper.Multiply(matty, dungeonTransform, out var dungeonMatty);
// The expensive bit yippy.
_dungeon.SpawnRoom(gridUid, grid, dungeonMatty, room);

View File

@@ -75,8 +75,8 @@ public sealed partial class DungeonSystem
roomRotation = GetRoomRotation(room, random);
}
var roomTransform = Matrix3.CreateTransform((Vector2) room.Size / 2f, roomRotation);
Matrix3.Multiply(roomTransform, originTransform, out var finalTransform);
var roomTransform = Matrix3Helpers.CreateTransform((Vector2) room.Size / 2f, roomRotation);
ContentMathHelper.Multiply(roomTransform, originTransform, out var finalTransform);
SpawnRoom(gridUid, grid, finalTransform, room, clearExisting);
}

View File

@@ -71,9 +71,9 @@ public sealed partial class DockingSystem
var gridDockAngle = gridDockXform.LocalRotation.Opposite();
var offsetAngle = gridDockAngle - shuttleDockAngle;
var stationDockMatrix = Matrix3.CreateInverseTransform(stationDockPos, shuttleDockAngle);
var gridXformMatrix = Matrix3.CreateTransform(gridDockXform.LocalPosition, gridDockAngle);
Matrix3.Multiply(in stationDockMatrix, in gridXformMatrix, out matty);
var stationDockMatrix = Matrix3Helpers.CreateInverseTransform(stationDockPos, shuttleDockAngle);
var gridXformMatrix = Matrix3Helpers.CreateTransform(gridDockXform.LocalPosition, gridDockAngle);
ContentMathHelper.Multiply(stationDockMatrix, gridXformMatrix, out matty);
if (!ValidSpawn(grid, matty, offsetAngle, shuttleFixtures, isMap))
return false;

View File

@@ -1,3 +1,4 @@
using System.Numerics;
using Content.Server._White.Other;
using Content.Server.Atmos.Components;
using Content.Server.Singularity.Components;
@@ -228,7 +229,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
continue;
var scaling = (1f / distance2) * physics.Mass; // TODO: Variable falloff gradiants.
_physics.ApplyLinearImpulse(entity, (displacement * baseMatrixDeltaV) * scaling, body: physics);
_physics.ApplyLinearImpulse(entity, (Vector2.Transform(displacement, baseMatrixDeltaV)) * scaling, body: physics);
if (stunTime > 0f)
_stun.TryParalyze(entity, TimeSpan.FromSeconds(stunTime), true);
@@ -244,11 +245,7 @@ public sealed class GravityWellSystem : SharedGravityWellSystem
/// <param name="baseRadialDeltaV">The base amount of velocity that will be added to entities in range towards the epicenter of the pulse.</param>
/// <param name="baseTangentialDeltaV">The base amount of velocity that will be added to entities in range counterclockwise relative to the epicenter of the pulse.</param>
public void GravPulse(MapCoordinates mapPos, float maxRange, float minRange = 0.0f, float baseRadialDeltaV = 0.0f, float baseTangentialDeltaV = 0.0f, float stunTime = 0f, List<EntityUid>? ignore = null)
=> GravPulse(mapPos, maxRange, minRange, new Matrix3(
baseRadialDeltaV, +baseTangentialDeltaV, 0.0f,
-baseTangentialDeltaV, baseRadialDeltaV, 0.0f,
0.0f, 0.0f, 1.0f
), stunTime, ignore);
=> GravPulse(mapPos, maxRange, minRange, new Matrix3x2(baseRadialDeltaV, -baseTangentialDeltaV, baseTangentialDeltaV, baseRadialDeltaV, 0.0f, 0.0f), stunTime, ignore);
#endregion GravPulse

View File

@@ -128,7 +128,7 @@ public sealed partial class HallucinationsSystem : EntitySystem
var hallucination = Spawn(_random.Pick(stat.Spawns), newCoords);
EnsureComp<VisibilityComponent>(hallucination, out var visibility);
_visibilitySystem.SetLayer(hallucination, visibility, (int) stat.Layer, false);
_visibilitySystem.SetLayer(new Entity<VisibilityComponent?>(hallucination, visibility), (ushort) stat.Layer, false);
_visibilitySystem.RefreshVisibility(hallucination, visibilityComponent: visibility);
}
@@ -140,7 +140,7 @@ public sealed partial class HallucinationsSystem : EntitySystem
var uidhallucination = Spawn(_random.Pick(stat.Spawns), uidnewCoords);
EnsureComp<VisibilityComponent>(uidhallucination, out var uidvisibility);
_visibilitySystem.SetLayer(uidhallucination, uidvisibility, (int) stat.Layer, false);
_visibilitySystem.SetLayer(new Entity<VisibilityComponent?>(uidhallucination, uidvisibility), (ushort) stat.Layer, false);
_visibilitySystem.RefreshVisibility(uidhallucination, visibilityComponent: uidvisibility);
}

View File

@@ -182,7 +182,7 @@ public sealed class BodyPrototypeSerializer : ITypeReader<BodyPrototype, Mapping
foreach (var (slotId, (part, connections, organs)) in allConnections)
{
var slot = new BodyPrototypeSlot(part != null ? new EntProtoId(part) : null!, connections ?? new HashSet<string>(), organs ?? new Dictionary<string, string>());
var slot = new BodyPrototypeSlot(part != null ? new EntProtoId(part) : default!, connections ?? new HashSet<string>(), organs ?? new Dictionary<string, string>());
slots.Add(slotId, slot);
}

View File

@@ -12,4 +12,5 @@ global using Robust.Shared.Maths;
global using Robust.Shared.ViewVariables;
global using Robust.Shared.Serialization.Manager.Attributes;
global using Content.Shared._Amour.ContentMath;
global using Matrix3 = System.Numerics.Matrix3x2;

View File

@@ -192,7 +192,7 @@ public abstract class SharedItemSystem : EntitySystem
var shapes = GetItemShape(entity);
var boundingShape = shapes.GetBoundingBox();
var boundingCenter = ((Box2) boundingShape).Center;
var matty = Matrix3.CreateTransform(boundingCenter, rotation);
var matty = Matrix3Helpers.CreateTransform(boundingCenter, rotation);
var drift = boundingShape.BottomLeft - matty.TransformBox(boundingShape).BottomLeft;
var adjustedShapes = new List<Box2i>();

View File

@@ -137,8 +137,12 @@ public abstract class SharedNavMapSystem : EntitySystem
public void ApplyToFullState(IComponentState fullState)
{
return;
if(fullState is not NavMapComponentState state)
return;
DebugTools.Assert(!FullState);
var state = (NavMapComponentState) fullState;
DebugTools.Assert(state.FullState);
foreach (var key in state.Chunks.Keys)

View File

@@ -0,0 +1,22 @@
using System.Numerics;
namespace Content.Shared._Amour.ContentMath;
public static class ContentMathHelper
{
public static Vector2 Transform(this Matrix3x2 matrix, Vector2 vector)
{
return Vector2.Transform(vector, matrix);
}
public static void Multiply(Matrix3x2 scaleMatrix, Matrix3x2 worldMatrix, out Matrix3x2 p2)
{
p2 = scaleMatrix * worldMatrix;
}
public static Matrix3x2 Invert(this Matrix3x2 matrix)
{
Matrix3x2.Invert(matrix, out Matrix3x2 result);
return result;
}
}

View File

@@ -1,4 +1,5 @@
using System.Linq;
using System.Text;
using Robust.Shared.Random;
namespace Content.Shared._White.Cult.Systems;
@@ -34,7 +35,7 @@ public sealed class CultistWordGeneratorManager
if (length <= 0)
throw new ArgumentException("Word length must be greater than zero.");
var word = "";
var word = new StringBuilder();
for (var i = 0; i < length; i++)
{
@@ -42,10 +43,10 @@ public sealed class CultistWordGeneratorManager
var randomChar = GetRandomChar(isVowel ? Vowels : Consonants);
word += randomChar;
word.Append(randomChar);
}
return word;
return word.ToString();
}
private char GetRandomChar(string characters)

View File

@@ -55,7 +55,7 @@ namespace Content.Tests.Shared.Alert
entManager.System<AlertsSystem>().ShowAlert(alertsComponent.Owner, AlertType.LowPressure, null, null);
var getty = new ComponentGetState();
entManager.EventBus.RaiseComponentEvent(alertsComponent, getty);
entManager.EventBus.RaiseComponentEvent(alertsComponent.Owner,alertsComponent, getty);
var alertState = (AlertsComponent.AlertsComponent_AutoState) getty.State!;
Assert.That(alertState, Is.Not.Null);
@@ -65,14 +65,14 @@ namespace Content.Tests.Shared.Alert
entManager.System<AlertsSystem>().ShowAlert(alertsComponent.Owner, AlertType.HighPressure, null, null);
// Lazy
entManager.EventBus.RaiseComponentEvent(alertsComponent, getty);
entManager.EventBus.RaiseComponentEvent(alertsComponent.Owner, alertsComponent, getty);
alertState = (AlertsComponent.AlertsComponent_AutoState) getty.State!;
Assert.That(alertState.Alerts.Count, Is.EqualTo(1));
Assert.That(alertState.Alerts.ContainsKey(highpressure.AlertKey));
entManager.System<AlertsSystem>().ClearAlertCategory(alertsComponent.Owner, AlertCategory.Pressure);
entManager.EventBus.RaiseComponentEvent(alertsComponent, getty);
entManager.EventBus.RaiseComponentEvent(alertsComponent.Owner, alertsComponent, getty);
alertState = (AlertsComponent.AlertsComponent_AutoState) getty.State!;
Assert.That(alertState.Alerts.Count, Is.EqualTo(0));
}

0
Content.Tools/test/run.sh Executable file → Normal file
View File

0
RUN_THIS.py Executable file → Normal file
View File

View File

@@ -36,7 +36,7 @@
- type: entity
id: AlertSpriteView
categories: [ hideSpawnMenu ]
categories: [ HideSpawnMenu ]
components:
- type: Sprite
layers:

View File

@@ -16,7 +16,7 @@
- type: entity
id: AlertEssenceSpriteView
categories: [ hideSpawnMenu ]
categories: [ HideSpawnMenu ]
components:
- type: Sprite
sprite: /Textures/Interface/Alerts/essence_counter.rsi

View File

@@ -4,7 +4,7 @@
name: base flatpack
description: A flatpack used for constructing something.
categories:
- hideSpawnMenu
- HideSpawnMenu
components:
- type: Item
size: Large

View File

@@ -84,7 +84,7 @@
- type: entity
id: FlatpackerNoBoardEffect
categories:
- hideSpawnMenu
- HideSpawnMenu
components:
- type: Sprite
sprite: Structures/Machines/autolathe.rsi

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 606 B

After

Width:  |  Height:  |  Size: 606 B

View File

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 552 B

0
Resources/Textures/Effects/explosion.rsi/explosion.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 9.9 KiB

0
Tools/actions_changelog_rss.py Executable file → Normal file
View File

0
Tools/actions_changelogs_since_last_run.py Executable file → Normal file
View File

0
Tools/check_crlf.py Executable file → Normal file
View File

0
Tools/dump_commits_since.ps1 Executable file → Normal file
View File

0
Tools/dump_github_contributors.ps1 Executable file → Normal file
View File

0
Tools/dump_patrons.ps1 Executable file → Normal file
View File

0
Tools/dump_user_data.py Executable file → Normal file
View File

0
Tools/gen_build_info.py Executable file → Normal file
View File

0
Tools/generate_hashes.ps1 Executable file → Normal file
View File

0
Tools/make_roompack.py Executable file → Normal file
View File

0
Tools/mapping-merge-driver.sh Executable file → Normal file
View File

0
Tools/update_changelog.py Executable file → Normal file
View File

0
upstream_merge_tool.sh Executable file → Normal file
View File