Update content for physics query namespace change (#4701)
This commit is contained in:
@@ -33,7 +33,7 @@ namespace Content.Shared.Construction.Conditions
|
||||
return false;
|
||||
|
||||
// now we need to check that user actually tries to build wallmount on a wall
|
||||
var physics = EntitySystem.Get<SharedBroadphaseSystem>();
|
||||
var physics = EntitySystem.Get<SharedPhysicsSystem>();
|
||||
var rUserToObj = new CollisionRay(userWorldPosition, userToObject.Normalized, (int) CollisionGroup.Impassable);
|
||||
var length = userToObject.Length;
|
||||
var userToObjRaycastResults = physics.IntersectRayWithPredicate(user.Transform.MapID, rUserToObj, maxLength: length,
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Content.Shared.Interaction
|
||||
[UsedImplicitly]
|
||||
public abstract class SharedInteractionSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedBroadphaseSystem _sharedBroadphaseSystem = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _sharedBroadphaseSystem = default!;
|
||||
[Dependency] private readonly SharedPopupSystem _popupSystem = default!;
|
||||
|
||||
public const float InteractionRange = 2;
|
||||
|
||||
@@ -181,7 +181,7 @@ namespace Content.Shared.Maps
|
||||
/// </summary>
|
||||
public static bool IsBlockedTurf(this TileRef turf, bool filterMobs)
|
||||
{
|
||||
var physics = EntitySystem.Get<SharedBroadphaseSystem>();
|
||||
var physics = EntitySystem.Get<SharedPhysicsSystem>();
|
||||
|
||||
var worldBox = GetWorldTileBox(turf);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace Content.Shared.Movement
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
|
||||
private ActionBlockerSystem _blocker = default!;
|
||||
private SharedBroadphaseSystem _broadPhaseSystem = default!;
|
||||
private SharedPhysicsSystem _broadPhaseSystem = default!;
|
||||
|
||||
private bool _relativeMovement;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Content.Shared.Movement
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
_broadPhaseSystem = EntitySystem.Get<SharedBroadphaseSystem>();
|
||||
_broadPhaseSystem = EntitySystem.Get<SharedPhysicsSystem>();
|
||||
_blocker = EntitySystem.Get<ActionBlockerSystem>();
|
||||
var configManager = IoCManager.Resolve<IConfigurationManager>();
|
||||
configManager.OnValueChanged(CCVars.RelativeMovement, SetRelativeMovement, true);
|
||||
@@ -161,12 +161,7 @@ namespace Content.Shared.Movement
|
||||
/// <summary>
|
||||
/// Used for weightlessness to determine if we are near a wall.
|
||||
/// </summary>
|
||||
/// <param name="broadPhaseSystem"></param>
|
||||
/// <param name="transform"></param>
|
||||
/// <param name="mover"></param>
|
||||
/// <param name="collider"></param>
|
||||
/// <returns></returns>
|
||||
public static bool IsAroundCollider(SharedBroadphaseSystem broadPhaseSystem, ITransformComponent transform, IMobMoverComponent mover, IPhysBody collider)
|
||||
public static bool IsAroundCollider(SharedPhysicsSystem broadPhaseSystem, ITransformComponent transform, IMobMoverComponent mover, IPhysBody collider)
|
||||
{
|
||||
var enlargedAABB = collider.GetWorldAABB().Enlarged(mover.GrabRange);
|
||||
|
||||
|
||||
@@ -16,9 +16,9 @@ namespace Content.Shared.Spawning
|
||||
EntityCoordinates coordinates,
|
||||
CollisionGroup collisionLayer,
|
||||
in Box2? box = null,
|
||||
SharedBroadphaseSystem? physicsManager = null)
|
||||
SharedPhysicsSystem? physicsManager = null)
|
||||
{
|
||||
physicsManager ??= EntitySystem.Get<SharedBroadphaseSystem>();
|
||||
physicsManager ??= EntitySystem.Get<SharedPhysicsSystem>();
|
||||
var mapCoordinates = coordinates.ToMap(entityManager);
|
||||
|
||||
return entityManager.SpawnIfUnobstructed(prototypeName, mapCoordinates, collisionLayer, box, physicsManager);
|
||||
@@ -30,10 +30,10 @@ namespace Content.Shared.Spawning
|
||||
MapCoordinates coordinates,
|
||||
CollisionGroup collisionLayer,
|
||||
in Box2? box = null,
|
||||
SharedBroadphaseSystem? collision = null)
|
||||
SharedPhysicsSystem? collision = null)
|
||||
{
|
||||
var boxOrDefault = box.GetValueOrDefault(Box2.UnitCentered).Translated(coordinates.Position);
|
||||
collision ??= EntitySystem.Get<SharedBroadphaseSystem>();
|
||||
collision ??= EntitySystem.Get<SharedPhysicsSystem>();
|
||||
|
||||
foreach (var body in collision.GetCollidingEntities(coordinates.MapId, in boxOrDefault))
|
||||
{
|
||||
@@ -61,7 +61,7 @@ namespace Content.Shared.Spawning
|
||||
CollisionGroup collisionLayer,
|
||||
[NotNullWhen(true)] out IEntity? entity,
|
||||
Box2? box = null,
|
||||
SharedBroadphaseSystem? physicsManager = null)
|
||||
SharedPhysicsSystem? physicsManager = null)
|
||||
{
|
||||
entity = entityManager.SpawnIfUnobstructed(prototypeName, coordinates, collisionLayer, box, physicsManager);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace Content.Shared.Spawning
|
||||
CollisionGroup collisionLayer,
|
||||
[NotNullWhen(true)] out IEntity? entity,
|
||||
in Box2? box = null,
|
||||
SharedBroadphaseSystem? physicsManager = null)
|
||||
SharedPhysicsSystem? physicsManager = null)
|
||||
{
|
||||
entity = entityManager.SpawnIfUnobstructed(prototypeName, coordinates, collisionLayer, box, physicsManager);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user