diff --git a/Robust.Client/Audio/Midi/MidiManager.cs b/Robust.Client/Audio/Midi/MidiManager.cs index 5ce78c683..d5a11f061 100644 --- a/Robust.Client/Audio/Midi/MidiManager.cs +++ b/Robust.Client/Audio/Midi/MidiManager.cs @@ -16,6 +16,7 @@ using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Systems; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; diff --git a/Robust.Client/Debugging/DebugPhysicsSystem.cs b/Robust.Client/Debugging/DebugPhysicsSystem.cs index 8f63da0e6..89d2d5cf5 100644 --- a/Robust.Client/Debugging/DebugPhysicsSystem.cs +++ b/Robust.Client/Debugging/DebugPhysicsSystem.cs @@ -57,9 +57,11 @@ using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Physics.Dynamics.Contacts; using Robust.Shared.Physics.Dynamics.Joints; +using Robust.Shared.Physics.Systems; namespace Robust.Client.Debugging { diff --git a/Robust.Client/GameObjects/ClientComponentFactory.cs b/Robust.Client/GameObjects/ClientComponentFactory.cs index e06f4810e..f63ef0e06 100644 --- a/Robust.Client/GameObjects/ClientComponentFactory.cs +++ b/Robust.Client/GameObjects/ClientComponentFactory.cs @@ -1,6 +1,7 @@ using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.IoC; +using Robust.Shared.Physics.Components; using Robust.Shared.Reflection; namespace Robust.Client.GameObjects diff --git a/Robust.Client/GameObjects/EntitySystems/AudioSystem.cs b/Robust.Client/GameObjects/EntitySystems/AudioSystem.cs index 96c27d478..90b4478fd 100644 --- a/Robust.Client/GameObjects/EntitySystems/AudioSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/AudioSystem.cs @@ -11,6 +11,7 @@ using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Physics; +using Robust.Shared.Physics.Systems; using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Timing; diff --git a/Robust.Client/GameObjects/EntitySystems/VelocityDebugSystem.cs b/Robust.Client/GameObjects/EntitySystems/VelocityDebugSystem.cs index c2be188c2..e0a0d1ad9 100644 --- a/Robust.Client/GameObjects/EntitySystems/VelocityDebugSystem.cs +++ b/Robust.Client/GameObjects/EntitySystems/VelocityDebugSystem.cs @@ -5,6 +5,7 @@ using Robust.Client.UserInterface.Controls; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; namespace Robust.Client.GameObjects { diff --git a/Robust.Client/Physics/BroadPhaseSystem.cs b/Robust.Client/Physics/BroadPhaseSystem.cs index 36891d30a..b6fbb6f82 100644 --- a/Robust.Client/Physics/BroadPhaseSystem.cs +++ b/Robust.Client/Physics/BroadPhaseSystem.cs @@ -1,4 +1,5 @@ using Robust.Shared.Physics; +using Robust.Shared.Physics.Systems; namespace Robust.Client.Physics { diff --git a/Robust.Client/Physics/JointSystem.cs b/Robust.Client/Physics/JointSystem.cs index 6e361ad4c..fd4aaa1df 100644 --- a/Robust.Client/Physics/JointSystem.cs +++ b/Robust.Client/Physics/JointSystem.cs @@ -4,6 +4,7 @@ using Robust.Shared.GameStates; using Robust.Shared.Map; using Robust.Shared.Physics; using Robust.Shared.Physics.Dynamics.Joints; +using Robust.Shared.Physics.Systems; namespace Robust.Client.Physics { diff --git a/Robust.Client/Physics/PhysicsMapComponent.cs b/Robust.Client/Physics/PhysicsMapComponent.cs index f444ec4f7..57b05a796 100644 --- a/Robust.Client/Physics/PhysicsMapComponent.cs +++ b/Robust.Client/Physics/PhysicsMapComponent.cs @@ -4,6 +4,7 @@ using Robust.Shared; using Robust.Shared.Configuration; using Robust.Shared.GameObjects; using Robust.Shared.IoC; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; namespace Robust.Client.Physics diff --git a/Robust.Client/Physics/PhysicsSystem.cs b/Robust.Client/Physics/PhysicsSystem.cs index d7534b016..87c22f6ab 100644 --- a/Robust.Client/Physics/PhysicsSystem.cs +++ b/Robust.Client/Physics/PhysicsSystem.cs @@ -2,6 +2,7 @@ using JetBrains.Annotations; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Physics.Systems; using Robust.Shared.Timing; namespace Robust.Client.Physics diff --git a/Robust.Client/Placement/PlacementMode.cs b/Robust.Client/Placement/PlacementMode.cs index 82d81c693..e59e34b0f 100644 --- a/Robust.Client/Placement/PlacementMode.cs +++ b/Robust.Client/Placement/PlacementMode.cs @@ -8,6 +8,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; +using Robust.Shared.Physics.Systems; using Robust.Shared.Utility; namespace Robust.Client.Placement diff --git a/Robust.Server/Console/Commands/ScaleCommand.cs b/Robust.Server/Console/Commands/ScaleCommand.cs index 3a64f076b..d98d1c03e 100644 --- a/Robust.Server/Console/Commands/ScaleCommand.cs +++ b/Robust.Server/Console/Commands/ScaleCommand.cs @@ -6,6 +6,7 @@ using Robust.Shared.IoC; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Systems; namespace Robust.Server.Console.Commands; diff --git a/Robust.Server/Console/Commands/SpinCommand.cs b/Robust.Server/Console/Commands/SpinCommand.cs index e139e7df8..311fc60c8 100644 --- a/Robust.Server/Console/Commands/SpinCommand.cs +++ b/Robust.Server/Console/Commands/SpinCommand.cs @@ -2,6 +2,7 @@ using Robust.Shared.Console; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; namespace Robust.Server.Console.Commands; diff --git a/Robust.Server/Console/Commands/TestbedCommand.cs b/Robust.Server/Console/Commands/TestbedCommand.cs index b88d0c4d9..69b0cc6a6 100644 --- a/Robust.Server/Console/Commands/TestbedCommand.cs +++ b/Robust.Server/Console/Commands/TestbedCommand.cs @@ -30,8 +30,10 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Physics.Dynamics.Joints; +using Robust.Shared.Physics.Systems; using Robust.Shared.Timing; namespace Robust.Server.Console.Commands diff --git a/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs b/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs index d277ee43c..625426d66 100644 --- a/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs +++ b/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs @@ -6,6 +6,8 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; +using Robust.Shared.Physics.Systems; namespace Robust.Server.GameObjects { diff --git a/Robust.Server/GameObjects/ServerComponentFactory.cs b/Robust.Server/GameObjects/ServerComponentFactory.cs index 54233fcc6..c0dfefef1 100644 --- a/Robust.Server/GameObjects/ServerComponentFactory.cs +++ b/Robust.Server/GameObjects/ServerComponentFactory.cs @@ -1,6 +1,7 @@ using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.IoC; +using Robust.Shared.Physics.Components; using Robust.Shared.Reflection; namespace Robust.Server.GameObjects diff --git a/Robust.Server/GameStates/PVSSystem.cs b/Robust.Server/GameStates/PVSSystem.cs index d8e540ebd..405ffa1fc 100644 --- a/Robust.Server/GameStates/PVSSystem.cs +++ b/Robust.Server/GameStates/PVSSystem.cs @@ -17,6 +17,7 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Network; using Robust.Shared.Network.Messages; +using Robust.Shared.Physics.Components; using Robust.Shared.Players; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -226,7 +227,7 @@ internal sealed partial class PVSSystem : EntitySystem // we just discard it. _visSetPool.Return(overflowEnts); } - + if (sessionData.SentEntities.TryGetValue(ackedTick, out var ackedData)) ProcessAckedTick(sessionData, ackedData, ackedTick, lastAckedTick); } @@ -691,7 +692,7 @@ internal sealed partial class PVSSystem : EntitySystem if (visibleEnts.Count != 0) throw new Exception("Encountered non-empty object inside of _visSetPool. Was the same object returned to the pool more than once?"); - + var deletions = _entityPvsCollection.GetDeletedIndices(fromTick); foreach (var i in chunkIndices) @@ -754,7 +755,7 @@ internal sealed partial class PVSSystem : EntitySystem var entFromTick = entered ? lastSeen.GetValueOrDefault(uid) : fromTick; var state = GetEntityState(session, uid, entFromTick, mQuery.GetComponent(uid)); - if (entered || !state.Empty) + if (entered || !state.Empty) entityStates.Add(state); } @@ -808,7 +809,7 @@ internal sealed partial class PVSSystem : EntitySystem foreach (var uid in lastSent.Keys) { if (!visibleEnts.ContainsKey(uid)) - leftView.Add(uid); + leftView.Add(uid); } return leftView.Count > 0 ? leftView : null; @@ -901,7 +902,7 @@ internal sealed partial class PVSSystem : EntitySystem // the budget. Chances are the packet will arrive in a nice and orderly fashion, and the client will stick to // their requested budget. However this can cause issues if a packet gets dropped, because a player may create // 2x or more times the normal entity creation budget. - // + // // The fix for that would be to just also give the PVS budget a client-side aspect that controls entity creation // rate. if (enteredSinceLastSent) diff --git a/Robust.Server/Maps/MapLoader.cs b/Robust.Server/Maps/MapLoader.cs index ec63edade..be711759a 100644 --- a/Robust.Server/Maps/MapLoader.cs +++ b/Robust.Server/Maps/MapLoader.cs @@ -15,7 +15,9 @@ using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager; diff --git a/Robust.Server/Physics/BroadPhaseSystem.cs b/Robust.Server/Physics/BroadPhaseSystem.cs index e734eb17a..9613eb10e 100644 --- a/Robust.Server/Physics/BroadPhaseSystem.cs +++ b/Robust.Server/Physics/BroadPhaseSystem.cs @@ -1,5 +1,6 @@ using Robust.Server.GameObjects; using Robust.Shared.Physics; +using Robust.Shared.Physics.Systems; namespace Robust.Server.Physics { diff --git a/Robust.Server/Physics/GridFixtureSystem.cs b/Robust.Server/Physics/GridFixtureSystem.cs index a15833668..750db10e1 100644 --- a/Robust.Server/Physics/GridFixtureSystem.cs +++ b/Robust.Server/Physics/GridFixtureSystem.cs @@ -12,6 +12,7 @@ using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Players; using Robust.Shared.Timing; using Robust.Shared.Utility; diff --git a/Robust.Server/Physics/JointSystem.cs b/Robust.Server/Physics/JointSystem.cs index 9f0ff3c11..c6b2b45f5 100644 --- a/Robust.Server/Physics/JointSystem.cs +++ b/Robust.Server/Physics/JointSystem.cs @@ -3,6 +3,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.Physics; using Robust.Shared.Physics.Dynamics.Joints; +using Robust.Shared.Physics.Systems; namespace Robust.Server.Physics { diff --git a/Robust.Shared/Containers/BaseContainer.cs b/Robust.Shared/Containers/BaseContainer.cs index 4c10a58df..55308c021 100644 --- a/Robust.Shared/Containers/BaseContainer.cs +++ b/Robust.Shared/Containers/BaseContainer.cs @@ -3,6 +3,8 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; +using Robust.Shared.Physics.Systems; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; diff --git a/Robust.Shared/Containers/IContainer.cs b/Robust.Shared/Containers/IContainer.cs index 8ca40938f..da5b549ca 100644 --- a/Robust.Shared/Containers/IContainer.cs +++ b/Robust.Shared/Containers/IContainer.cs @@ -2,7 +2,7 @@ using System; using System.Collections.Generic; using JetBrains.Annotations; using Robust.Shared.GameObjects; -using Robust.Shared.Serialization; +using Robust.Shared.Physics.Components; using Robust.Shared.Serialization.Manager.Attributes; namespace Robust.Shared.Containers diff --git a/Robust.Shared/GameObjects/EntityManager.Components.cs b/Robust.Shared/GameObjects/EntityManager.Components.cs index 9a6c3433b..afb66797d 100644 --- a/Robust.Shared/GameObjects/EntityManager.Components.cs +++ b/Robust.Shared/GameObjects/EntityManager.Components.cs @@ -9,6 +9,7 @@ using Robust.Shared.Utility; using System.Runtime.CompilerServices; using Robust.Shared.Log; using System.Diagnostics; +using Robust.Shared.Physics.Components; #if EXCEPTION_TOLERANCE using Robust.Shared.Exceptions; #endif diff --git a/Robust.Shared/GameObjects/Systems/CollideOnAnchorSystem.cs b/Robust.Shared/GameObjects/Systems/CollideOnAnchorSystem.cs index 25eb19106..8635b8dcc 100644 --- a/Robust.Shared/GameObjects/Systems/CollideOnAnchorSystem.cs +++ b/Robust.Shared/GameObjects/Systems/CollideOnAnchorSystem.cs @@ -1,3 +1,5 @@ +using Robust.Shared.Physics.Components; + namespace Robust.Shared.GameObjects { public sealed class CollideOnAnchorSystem : EntitySystem diff --git a/Robust.Shared/GameObjects/Systems/CollisionWakeSystem.cs b/Robust.Shared/GameObjects/Systems/CollisionWakeSystem.cs index 0de504bbb..5bd68beae 100644 --- a/Robust.Shared/GameObjects/Systems/CollisionWakeSystem.cs +++ b/Robust.Shared/GameObjects/Systems/CollisionWakeSystem.cs @@ -2,6 +2,8 @@ using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; +using Robust.Shared.Physics.Systems; namespace Robust.Shared.GameObjects { diff --git a/Robust.Shared/GameObjects/Systems/SharedGridFixtureSystem.cs b/Robust.Shared/GameObjects/Systems/SharedGridFixtureSystem.cs index b15aa968e..c16875b64 100644 --- a/Robust.Shared/GameObjects/Systems/SharedGridFixtureSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedGridFixtureSystem.cs @@ -8,7 +8,9 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Systems; using Robust.Shared.Serialization; using Robust.Shared.Utility; diff --git a/Robust.Shared/GameObjects/Systems/SharedGridTraversalSystem.cs b/Robust.Shared/GameObjects/Systems/SharedGridTraversalSystem.cs index 1ea0bc95a..9d4fdc3f6 100644 --- a/Robust.Shared/GameObjects/Systems/SharedGridTraversalSystem.cs +++ b/Robust.Shared/GameObjects/Systems/SharedGridTraversalSystem.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using Robust.Shared.IoC; using Robust.Shared.Map; +using Robust.Shared.Physics.Components; namespace Robust.Shared.GameObjects { diff --git a/Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs b/Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs index aaab628c8..a322dd605 100644 --- a/Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs +++ b/Robust.Shared/GameObjects/Systems/SharedTransformSystem.Component.cs @@ -7,6 +7,7 @@ using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.Shared.Timing; using Robust.Shared.Utility; diff --git a/Robust.Shared/Map/FindGridsEnumerator.cs b/Robust.Shared/Map/FindGridsEnumerator.cs index ded905e15..0ed768dc2 100644 --- a/Robust.Shared/Map/FindGridsEnumerator.cs +++ b/Robust.Shared/Map/FindGridsEnumerator.cs @@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis; using Robust.Shared.GameObjects; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; namespace Robust.Shared.Map { diff --git a/Robust.Shared/Map/IMapManagerInternal.cs b/Robust.Shared/Map/IMapManagerInternal.cs index cfff185c2..a31f7d3cd 100644 --- a/Robust.Shared/Map/IMapManagerInternal.cs +++ b/Robust.Shared/Map/IMapManagerInternal.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Robust.Shared.GameObjects; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Timing; namespace Robust.Shared.Map diff --git a/Robust.Shared/Map/MapGrid.cs b/Robust.Shared/Map/MapGrid.cs index 2fb41b848..691e2ceaa 100644 --- a/Robust.Shared/Map/MapGrid.cs +++ b/Robust.Shared/Map/MapGrid.cs @@ -5,6 +5,7 @@ using System.Linq; using Robust.Shared.GameObjects; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Systems; using Robust.Shared.Timing; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; diff --git a/Robust.Shared/Map/MapManager.Queries.cs b/Robust.Shared/Map/MapManager.Queries.cs index 504b67d3a..18f5eba85 100644 --- a/Robust.Shared/Map/MapManager.Queries.cs +++ b/Robust.Shared/Map/MapManager.Queries.cs @@ -6,6 +6,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Log; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.Shared.Utility; namespace Robust.Shared.Map; diff --git a/Robust.Shared/Physics/BroadPhase/DynamicTreeBroadPhase.cs b/Robust.Shared/Physics/BroadPhase/DynamicTreeBroadPhase.cs index 39a7c2208..795e78a35 100644 --- a/Robust.Shared/Physics/BroadPhase/DynamicTreeBroadPhase.cs +++ b/Robust.Shared/Physics/BroadPhase/DynamicTreeBroadPhase.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using Robust.Shared.Maths; using Robust.Shared.Physics.Dynamics; -namespace Robust.Shared.Physics.Broadphase +namespace Robust.Shared.Physics.BroadPhase { public sealed class DynamicTreeBroadPhase : IBroadPhase { diff --git a/Robust.Shared/GameObjects/Components/Collidable/PhysicsComponent.Collision.cs b/Robust.Shared/Physics/Components/PhysicsComponent.Collision.cs similarity index 61% rename from Robust.Shared/GameObjects/Components/Collidable/PhysicsComponent.Collision.cs rename to Robust.Shared/Physics/Components/PhysicsComponent.Collision.cs index 7dbb8d329..41ec237c9 100644 --- a/Robust.Shared/GameObjects/Components/Collidable/PhysicsComponent.Collision.cs +++ b/Robust.Shared/Physics/Components/PhysicsComponent.Collision.cs @@ -1,10 +1,9 @@ using System; -using Robust.Shared.Physics; -using Robust.Shared.Physics.Dynamics; using Robust.Shared.Serialization; -namespace Robust.Shared.GameObjects +namespace Robust.Shared.Physics.Components { + // TODO: Move to content [Serializable, NetSerializable] public enum BodyStatus: byte { diff --git a/Robust.Shared/GameObjects/Components/Collidable/PhysicsComponent.Physics.cs b/Robust.Shared/Physics/Components/PhysicsComponent.Physics.cs similarity index 89% rename from Robust.Shared/GameObjects/Components/Collidable/PhysicsComponent.Physics.cs rename to Robust.Shared/Physics/Components/PhysicsComponent.Physics.cs index 4d646975a..86ed2e25d 100644 --- a/Robust.Shared/GameObjects/Components/Collidable/PhysicsComponent.Physics.cs +++ b/Robust.Shared/Physics/Components/PhysicsComponent.Physics.cs @@ -24,19 +24,20 @@ using System; using System.Collections.Generic; -using System.Linq; using Robust.Shared.Containers; +using Robust.Shared.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Maths; -using Robust.Shared.Physics; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Physics.Dynamics.Contacts; +using Robust.Shared.Physics.Events; +using Robust.Shared.Physics.Systems; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; -namespace Robust.Shared.GameObjects +namespace Robust.Shared.Physics.Components { [ComponentReference(typeof(ILookupWorldBox2Component))] [ComponentReference(typeof(IPhysBody))] @@ -808,85 +809,10 @@ namespace Robust.Shared.GameObjects } - /// - /// Used to prevent bodies from colliding; may lie depending on joints. - /// - /// - /// - internal bool ShouldCollide(PhysicsComponent other) - { - if ((_bodyType & (BodyType.Kinematic | BodyType.Static)) != 0 && - (other._bodyType & (BodyType.Kinematic | BodyType.Static)) != 0) - { - return false; - } - - // Does a joint prevent collision? - // if one of them doesn't have jointcomp then they can't share a common joint. - // otherwise, only need to iterate over the joints of one component as they both store the same joint. - if (_entMan.TryGetComponent(Owner, out JointComponent? jointComponentA) && - _entMan.TryGetComponent(other.Owner, out JointComponent? jointComponentB)) - { - var aUid = jointComponentA.Owner; - var bUid = jointComponentB.Owner; - - foreach (var (_, joint) in jointComponentA.Joints) - { - // Check if either: the joint even allows collisions OR the other body on the joint is actually the other body we're checking. - if (!joint.CollideConnected && - ((aUid == joint.BodyAUid && - bUid == joint.BodyBUid) || - (bUid == joint.BodyAUid && - aUid == joint.BodyBUid))) return false; - } - } - - var preventCollideMessage = new PreventCollideEvent(this, other); - _entMan.EventBus.RaiseLocalEvent(Owner, preventCollideMessage, true); - - if (preventCollideMessage.Cancelled) return false; - - preventCollideMessage = new PreventCollideEvent(other, this); - _entMan.EventBus.RaiseLocalEvent(other.Owner, preventCollideMessage, true); - - if (preventCollideMessage.Cancelled) return false; - - return true; - } - // View variables conveniences properties. [ViewVariables] private Vector2 _mapLinearVelocity => _entMan.EntitySysManager.GetEntitySystem().GetMapLinearVelocity(Owner, this); [ViewVariables] private float _mapAngularVelocity => _entMan.EntitySysManager.GetEntitySystem().GetMapAngularVelocity(Owner, this); } - - /// - /// Directed event raised when an entity's physics BodyType changes. - /// - [ByRefEvent] - public readonly struct PhysicsBodyTypeChangedEvent - { - public readonly EntityUid Entity; - - /// - /// New BodyType of the entity. - /// - public readonly BodyType New; - - /// - /// Old BodyType of the entity. - /// - public readonly BodyType Old; - - public readonly PhysicsComponent Component; - - public PhysicsBodyTypeChangedEvent(EntityUid entity, BodyType newType, BodyType oldType, PhysicsComponent component) - { - Entity = entity; - New = newType; - Old = oldType; - Component = component; - } - } } diff --git a/Robust.Shared/GameObjects/Components/Collidable/PhysicsComponentState.cs b/Robust.Shared/Physics/Components/PhysicsComponentState.cs similarity index 89% rename from Robust.Shared/GameObjects/Components/Collidable/PhysicsComponentState.cs rename to Robust.Shared/Physics/Components/PhysicsComponentState.cs index 4c7e3da37..96c00e606 100644 --- a/Robust.Shared/GameObjects/Components/Collidable/PhysicsComponentState.cs +++ b/Robust.Shared/Physics/Components/PhysicsComponentState.cs @@ -1,12 +1,9 @@ using System; -using System.Collections.Generic; +using Robust.Shared.GameObjects; using Robust.Shared.Maths; -using Robust.Shared.Physics; -using Robust.Shared.Physics.Dynamics; -using Robust.Shared.Physics.Dynamics.Joints; using Robust.Shared.Serialization; -namespace Robust.Shared.GameObjects +namespace Robust.Shared.Physics.Components { [Serializable, NetSerializable] public sealed class PhysicsComponentState : ComponentState diff --git a/Robust.Shared/Physics/Controllers/VirtualController.cs b/Robust.Shared/Physics/Controllers/VirtualController.cs index e4e7b59cc..4a37cacca 100644 --- a/Robust.Shared/Physics/Controllers/VirtualController.cs +++ b/Robust.Shared/Physics/Controllers/VirtualController.cs @@ -5,6 +5,7 @@ using Prometheus; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Systems; using Robust.Shared.Timing; namespace Robust.Shared.Physics.Controllers diff --git a/Robust.Shared/Physics/Dynamics/ContactManager.cs b/Robust.Shared/Physics/Dynamics/ContactManager.cs index 8bfa7a23d..1adf73ba1 100644 --- a/Robust.Shared/Physics/Dynamics/ContactManager.cs +++ b/Robust.Shared/Physics/Dynamics/ContactManager.cs @@ -39,7 +39,10 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics.Collision; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics.Contacts; +using Robust.Shared.Physics.Events; +using Robust.Shared.Physics.Systems; using Robust.Shared.Utility; namespace Robust.Shared.Physics.Dynamics @@ -48,6 +51,7 @@ namespace Robust.Shared.Physics.Dynamics { [Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IPhysicsManager _physicsManager = default!; + private SharedPhysicsSystem _physics = default!; private SharedTransformSystem _transform = default!; internal MapId MapId { get; set; } @@ -159,7 +163,8 @@ namespace Robust.Shared.Physics.Dynamics public void Initialize() { IoCManager.InjectDependencies(this); - _transform = IoCManager.Resolve().GetEntitySystem(); + _physics = _entityManager.EntitySysManager.GetEntitySystem(); + _transform = _entityManager.EntitySysManager.GetEntitySystem(); var configManager = IoCManager.Resolve(); configManager.OnValueChanged(CVars.ContactMultithreadThreshold, OnContactMultithreadThreshold, true); configManager.OnValueChanged(CVars.ContactMinimumThreads, OnContactMinimumThreads, true); @@ -243,7 +248,7 @@ namespace Robust.Shared.Physics.Dynamics DebugTools.Assert(!fixtureB.Contacts.ContainsKey(fixtureA)); // Does a joint override collision? Is at least one body dynamic? - if (!bodyB.ShouldCollide(bodyA)) + if (!_physics.ShouldCollide(bodyB, bodyA)) return; // Call the factory. @@ -293,8 +298,10 @@ namespace Robust.Shared.Physics.Dynamics if (contact.IsTouching) { - _entityManager.EventBus.RaiseLocalEvent(bodyA.Owner, new EndCollideEvent(fixtureA, fixtureB), true); - _entityManager.EventBus.RaiseLocalEvent(bodyB.Owner, new EndCollideEvent(fixtureB, fixtureA), true); + var ev1 = new EndCollideEvent(fixtureA, fixtureB); + var ev2 = new EndCollideEvent(fixtureB, fixtureA); + _entityManager.EventBus.RaiseLocalEvent(bodyA.Owner, ref ev1); + _entityManager.EventBus.RaiseLocalEvent(bodyB.Owner, ref ev2); } if (contact.Manifold.PointCount > 0 && contact.FixtureA?.Hard == true && contact.FixtureB?.Hard == true) @@ -364,7 +371,7 @@ namespace Robust.Shared.Physics.Dynamics if ((contact.Flags & ContactFlags.Filter) != 0x0) { // Should these bodies collide? - if (bodyB.ShouldCollide(bodyA) == false) + if (_physics.ShouldCollide(bodyB, bodyA) == false) { node = node.Next; Destroy(contact); @@ -497,8 +504,11 @@ namespace Robust.Shared.Physics.Dynamics var bodyB = fixtureB.Body; var worldPoint = Transform.Mul(_physicsManager.EnsureTransform(bodyA), contact.Manifold.LocalPoint); - _entityManager.EventBus.RaiseLocalEvent(bodyA.Owner, new StartCollideEvent(fixtureA, fixtureB, worldPoint), true); - _entityManager.EventBus.RaiseLocalEvent(bodyB.Owner, new StartCollideEvent(fixtureB, fixtureA, worldPoint), true); + var ev1 = new StartCollideEvent(fixtureA, fixtureB, worldPoint); + var ev2 = new StartCollideEvent(fixtureB, fixtureA, worldPoint); + + _entityManager.EventBus.RaiseLocalEvent(bodyA.Owner, ref ev1, true); + _entityManager.EventBus.RaiseLocalEvent(bodyB.Owner, ref ev2, true); break; } case ContactStatus.Touching: @@ -515,8 +525,11 @@ namespace Robust.Shared.Physics.Dynamics var bodyA = fixtureA.Body; var bodyB = fixtureB.Body; - _entityManager.EventBus.RaiseLocalEvent(bodyA.Owner, new EndCollideEvent(fixtureA, fixtureB), true); - _entityManager.EventBus.RaiseLocalEvent(bodyB.Owner, new EndCollideEvent(fixtureB, fixtureA), true); + var ev1 = new EndCollideEvent(fixtureA, fixtureB); + var ev2 = new EndCollideEvent(fixtureB, fixtureA); + + _entityManager.EventBus.RaiseLocalEvent(bodyA.Owner, ref ev1); + _entityManager.EventBus.RaiseLocalEvent(bodyB.Owner, ref ev2); break; } case ContactStatus.NoContact: @@ -606,60 +619,8 @@ namespace Robust.Shared.Physics.Dynamics } } } - - public void PostSolve() - { - - } } - #region Collide Events Classes - - public abstract class CollideEvent : EntityEventArgs - { - public Fixture OurFixture { get; } - public Fixture OtherFixture { get; } - - public CollideEvent(Fixture ourFixture, Fixture otherFixture) - { - OurFixture = ourFixture; - OtherFixture = otherFixture; - } - } - - public sealed class StartCollideEvent : CollideEvent - { - public Vector2 WorldPoint; - - public StartCollideEvent(Fixture ourFixture, Fixture otherFixture, Vector2 worldPoint) - : base(ourFixture, otherFixture) - { - WorldPoint = worldPoint; - } - } - - public sealed class EndCollideEvent : CollideEvent - { - public EndCollideEvent(Fixture ourFixture, Fixture otherFixture) - : base(ourFixture, otherFixture) - { - } - } - - public sealed class PreventCollideEvent : CancellableEntityEventArgs - { - public IPhysBody BodyA; - public IPhysBody BodyB; - - public PreventCollideEvent(IPhysBody ourBody, IPhysBody otherBody) - { - BodyA = ourBody; - BodyB = otherBody; - } - } - - #endregion - internal enum ContactStatus : byte { NoContact = 0, diff --git a/Robust.Shared/Physics/Dynamics/Contacts/Contact.cs b/Robust.Shared/Physics/Dynamics/Contacts/Contact.cs index 2afb7bb52..1410f4590 100644 --- a/Robust.Shared/Physics/Dynamics/Contacts/Contact.cs +++ b/Robust.Shared/Physics/Dynamics/Contacts/Contact.cs @@ -34,6 +34,7 @@ using Robust.Shared.IoC; using Robust.Shared.Maths; using Robust.Shared.Physics.Collision; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; namespace Robust.Shared.Physics.Dynamics.Contacts { diff --git a/Robust.Shared/Physics/Dynamics/Contacts/ContactSolver.cs b/Robust.Shared/Physics/Dynamics/Contacts/ContactSolver.cs index 61f52fd6b..62537dd57 100644 --- a/Robust.Shared/Physics/Dynamics/Contacts/ContactSolver.cs +++ b/Robust.Shared/Physics/Dynamics/Contacts/ContactSolver.cs @@ -26,6 +26,7 @@ using System.Threading.Tasks; using Robust.Shared.GameObjects; using Robust.Shared.Maths; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Systems; using Robust.Shared.Utility; namespace Robust.Shared.Physics.Dynamics.Contacts diff --git a/Robust.Shared/Physics/Dynamics/Fixture.cs b/Robust.Shared/Physics/Dynamics/Fixture.cs index 411a6af82..bed6deeaa 100644 --- a/Robust.Shared/Physics/Dynamics/Fixture.cs +++ b/Robust.Shared/Physics/Dynamics/Fixture.cs @@ -26,7 +26,9 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics.Contacts; +using Robust.Shared.Physics.Systems; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; diff --git a/Robust.Shared/Physics/Dynamics/Joints/DistanceJoint.cs b/Robust.Shared/Physics/Dynamics/Joints/DistanceJoint.cs index e320b42b2..4a5ce91e1 100644 --- a/Robust.Shared/Physics/Dynamics/Joints/DistanceJoint.cs +++ b/Robust.Shared/Physics/Dynamics/Joints/DistanceJoint.cs @@ -29,6 +29,7 @@ using Robust.Shared.Configuration; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; diff --git a/Robust.Shared/Physics/Dynamics/Joints/FrictionJoint.cs b/Robust.Shared/Physics/Dynamics/Joints/FrictionJoint.cs index e23ce7ff2..a24107d8b 100644 --- a/Robust.Shared/Physics/Dynamics/Joints/FrictionJoint.cs +++ b/Robust.Shared/Physics/Dynamics/Joints/FrictionJoint.cs @@ -25,6 +25,7 @@ using Robust.Shared.Configuration; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; diff --git a/Robust.Shared/Physics/Dynamics/Joints/Joint.cs b/Robust.Shared/Physics/Dynamics/Joints/Joint.cs index 15cd2d1c7..bfdba468d 100644 --- a/Robust.Shared/Physics/Dynamics/Joints/Joint.cs +++ b/Robust.Shared/Physics/Dynamics/Joints/Joint.cs @@ -26,6 +26,8 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; +using Robust.Shared.Physics.Systems; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; diff --git a/Robust.Shared/Physics/Dynamics/Joints/JointEdge.cs b/Robust.Shared/Physics/Dynamics/Joints/JointEdge.cs index a4f30053c..47a86aae4 100644 --- a/Robust.Shared/Physics/Dynamics/Joints/JointEdge.cs +++ b/Robust.Shared/Physics/Dynamics/Joints/JointEdge.cs @@ -21,6 +21,7 @@ */ using Robust.Shared.GameObjects; +using Robust.Shared.Physics.Components; namespace Robust.Shared.Physics.Dynamics.Joints { diff --git a/Robust.Shared/Physics/Dynamics/Joints/MouseJoint.cs b/Robust.Shared/Physics/Dynamics/Joints/MouseJoint.cs index 406d89194..4ccaa76ff 100644 --- a/Robust.Shared/Physics/Dynamics/Joints/MouseJoint.cs +++ b/Robust.Shared/Physics/Dynamics/Joints/MouseJoint.cs @@ -24,6 +24,7 @@ using System; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; diff --git a/Robust.Shared/Physics/Dynamics/Joints/PrismaticJoint.cs b/Robust.Shared/Physics/Dynamics/Joints/PrismaticJoint.cs index 2795680c4..4ef064f9a 100644 --- a/Robust.Shared/Physics/Dynamics/Joints/PrismaticJoint.cs +++ b/Robust.Shared/Physics/Dynamics/Joints/PrismaticJoint.cs @@ -25,6 +25,7 @@ using Robust.Shared.Configuration; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; diff --git a/Robust.Shared/Physics/Dynamics/Joints/RevoluteJoint.cs b/Robust.Shared/Physics/Dynamics/Joints/RevoluteJoint.cs index d77248f19..84689d0e2 100644 --- a/Robust.Shared/Physics/Dynamics/Joints/RevoluteJoint.cs +++ b/Robust.Shared/Physics/Dynamics/Joints/RevoluteJoint.cs @@ -24,6 +24,7 @@ using System; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; diff --git a/Robust.Shared/Physics/Dynamics/Joints/WeldJoint.cs b/Robust.Shared/Physics/Dynamics/Joints/WeldJoint.cs index d342035e5..657db9f7d 100644 --- a/Robust.Shared/Physics/Dynamics/Joints/WeldJoint.cs +++ b/Robust.Shared/Physics/Dynamics/Joints/WeldJoint.cs @@ -2,6 +2,7 @@ using System; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; diff --git a/Robust.Shared/Physics/Dynamics/PhysicsIsland.cs b/Robust.Shared/Physics/Dynamics/PhysicsIsland.cs index f15b9f708..4e0bd7174 100644 --- a/Robust.Shared/Physics/Dynamics/PhysicsIsland.cs +++ b/Robust.Shared/Physics/Dynamics/PhysicsIsland.cs @@ -27,6 +27,7 @@ using Robust.Shared.Configuration; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics.Contacts; using Robust.Shared.Physics.Dynamics.Joints; using Robust.Shared.Utility; diff --git a/Robust.Shared/Physics/Dynamics/SharedPhysicsMapComponent.cs b/Robust.Shared/Physics/Dynamics/SharedPhysicsMapComponent.cs index 3eb8734a9..042426f5b 100644 --- a/Robust.Shared/Physics/Dynamics/SharedPhysicsMapComponent.cs +++ b/Robust.Shared/Physics/Dynamics/SharedPhysicsMapComponent.cs @@ -28,8 +28,9 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics.Dynamics.Contacts; using Robust.Shared.Physics.Dynamics.Joints; +using Robust.Shared.Physics.Systems; using Robust.Shared.Utility; -using PhysicsComponent = Robust.Shared.GameObjects.PhysicsComponent; +using PhysicsComponent = Robust.Shared.Physics.Components.PhysicsComponent; namespace Robust.Shared.Physics.Dynamics { @@ -344,8 +345,6 @@ namespace Robust.Shared.Physics.Dynamics SolveIslands(frameTime, dtRatio, invDt, prediction); Cleanup(frameTime); - - ContactManager.PostSolve(); } protected virtual void Cleanup(float frameTime) diff --git a/Robust.Shared/GameObjects/Components/Collidable/CollisionChangeEvent.cs b/Robust.Shared/Physics/Events/CollisionChangeEvent.cs similarity index 74% rename from Robust.Shared/GameObjects/Components/Collidable/CollisionChangeEvent.cs rename to Robust.Shared/Physics/Events/CollisionChangeEvent.cs index a6daacc95..0e6f7dbfa 100644 --- a/Robust.Shared/GameObjects/Components/Collidable/CollisionChangeEvent.cs +++ b/Robust.Shared/Physics/Events/CollisionChangeEvent.cs @@ -1,4 +1,7 @@ -namespace Robust.Shared.GameObjects +using Robust.Shared.GameObjects; +using Robust.Shared.Physics.Components; + +namespace Robust.Shared.Physics.Events { [ByRefEvent] public readonly struct CollisionChangeEvent diff --git a/Robust.Shared/Physics/Events/EndCollideEvent.cs b/Robust.Shared/Physics/Events/EndCollideEvent.cs new file mode 100644 index 000000000..01dadd471 --- /dev/null +++ b/Robust.Shared/Physics/Events/EndCollideEvent.cs @@ -0,0 +1,17 @@ +using Robust.Shared.GameObjects; +using Robust.Shared.Physics.Dynamics; + +namespace Robust.Shared.Physics.Events; + +[ByRefEvent] +public readonly struct EndCollideEvent +{ + public readonly Fixture OurFixture; + public readonly Fixture OtherFixture; + + public EndCollideEvent(Fixture ourFixture, Fixture otherFixture) + { + OurFixture = ourFixture; + OtherFixture = otherFixture; + } +} diff --git a/Robust.Shared/Physics/Events/PhysicsBodyTypeChangedEvent.cs b/Robust.Shared/Physics/Events/PhysicsBodyTypeChangedEvent.cs new file mode 100644 index 000000000..12d81324c --- /dev/null +++ b/Robust.Shared/Physics/Events/PhysicsBodyTypeChangedEvent.cs @@ -0,0 +1,33 @@ +using Robust.Shared.GameObjects; +using Robust.Shared.Physics.Components; + +namespace Robust.Shared.Physics.Events; + +/// +/// Directed event raised when an entity's physics BodyType changes. +/// +[ByRefEvent] +public readonly struct PhysicsBodyTypeChangedEvent +{ + public readonly EntityUid Entity; + + /// + /// New BodyType of the entity. + /// + public readonly BodyType New; + + /// + /// Old BodyType of the entity. + /// + public readonly BodyType Old; + + public readonly PhysicsComponent Component; + + public PhysicsBodyTypeChangedEvent(EntityUid entity, BodyType newType, BodyType oldType, PhysicsComponent component) + { + Entity = entity; + New = newType; + Old = oldType; + Component = component; + } +} \ No newline at end of file diff --git a/Robust.Shared/Physics/Events/PreventCollideEvent.cs b/Robust.Shared/Physics/Events/PreventCollideEvent.cs new file mode 100644 index 000000000..66e771098 --- /dev/null +++ b/Robust.Shared/Physics/Events/PreventCollideEvent.cs @@ -0,0 +1,18 @@ +using Robust.Shared.GameObjects; +using Robust.Shared.Physics.Components; + +namespace Robust.Shared.Physics.Events; + +[ByRefEvent] +public struct PreventCollideEvent +{ + public PhysicsComponent BodyA; + public PhysicsComponent BodyB; + public bool Cancelled = false; + + public PreventCollideEvent(PhysicsComponent ourBody, PhysicsComponent otherBody) + { + BodyA = ourBody; + BodyB = otherBody; + } +} diff --git a/Robust.Shared/Physics/Events/StartCollideEvent.cs b/Robust.Shared/Physics/Events/StartCollideEvent.cs new file mode 100644 index 000000000..cb756d335 --- /dev/null +++ b/Robust.Shared/Physics/Events/StartCollideEvent.cs @@ -0,0 +1,18 @@ +using Robust.Shared.GameObjects; +using Robust.Shared.Maths; +using Robust.Shared.Physics.Dynamics; + +namespace Robust.Shared.Physics.Events; + +[ByRefEvent] +public readonly struct StartCollideEvent +{ + public readonly Fixture OurFixture; + public readonly Fixture OtherFixture; + + public StartCollideEvent(Fixture ourFixture, Fixture otherFixture, Vector2 worldPoint) + { + OurFixture = ourFixture; + OtherFixture = otherFixture; + } +} diff --git a/Robust.Shared/Physics/FixturesComponent.cs b/Robust.Shared/Physics/FixturesComponent.cs index 584175ba4..9ab6da1b7 100644 --- a/Robust.Shared/Physics/FixturesComponent.cs +++ b/Robust.Shared/Physics/FixturesComponent.cs @@ -4,6 +4,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Systems; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Utility; diff --git a/Robust.Shared/Physics/IPhysBody.cs b/Robust.Shared/Physics/IPhysBody.cs index 89dd4a543..8e92eb597 100644 --- a/Robust.Shared/Physics/IPhysBody.cs +++ b/Robust.Shared/Physics/IPhysBody.cs @@ -2,7 +2,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Maths; -using Robust.Shared.Physics.Broadphase; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Physics.Dynamics.Contacts; diff --git a/Robust.Shared/Physics/PhysicsHelpers.cs b/Robust.Shared/Physics/PhysicsHelpers.cs index 1b754e555..f95512ae3 100644 --- a/Robust.Shared/Physics/PhysicsHelpers.cs +++ b/Robust.Shared/Physics/PhysicsHelpers.cs @@ -1,6 +1,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; namespace Robust.Shared.Physics { diff --git a/Robust.Shared/Physics/PhysicsManager.cs b/Robust.Shared/Physics/PhysicsManager.cs index a3c9bf994..9c2cbfa56 100644 --- a/Robust.Shared/Physics/PhysicsManager.cs +++ b/Robust.Shared/Physics/PhysicsManager.cs @@ -1,6 +1,7 @@ using System.Collections.Generic; using Robust.Shared.GameObjects; using Robust.Shared.IoC; +using Robust.Shared.Physics.Components; namespace Robust.Shared.Physics { diff --git a/Robust.Shared/Physics/PhysicsWakeEvent.cs b/Robust.Shared/Physics/PhysicsWakeEvent.cs index f9271025e..30dc9db80 100644 --- a/Robust.Shared/Physics/PhysicsWakeEvent.cs +++ b/Robust.Shared/Physics/PhysicsWakeEvent.cs @@ -1,4 +1,5 @@ using Robust.Shared.GameObjects; +using Robust.Shared.Physics.Components; namespace Robust.Shared.Physics { diff --git a/Robust.Shared/Physics/FixtureSystem.Shapes.cs b/Robust.Shared/Physics/Systems/FixtureSystem.Shapes.cs similarity index 99% rename from Robust.Shared/Physics/FixtureSystem.Shapes.cs rename to Robust.Shared/Physics/Systems/FixtureSystem.Shapes.cs index 0e4b70620..20e6fc11c 100644 --- a/Robust.Shared/Physics/FixtureSystem.Shapes.cs +++ b/Robust.Shared/Physics/Systems/FixtureSystem.Shapes.cs @@ -4,7 +4,7 @@ using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Utility; -namespace Robust.Shared.Physics +namespace Robust.Shared.Physics.Systems { public partial class FixtureSystem { diff --git a/Robust.Shared/Physics/FixtureSystem.cs b/Robust.Shared/Physics/Systems/FixtureSystem.cs similarity index 99% rename from Robust.Shared/Physics/FixtureSystem.cs rename to Robust.Shared/Physics/Systems/FixtureSystem.cs index 4101d660c..905dee78b 100644 --- a/Robust.Shared/Physics/FixtureSystem.cs +++ b/Robust.Shared/Physics/Systems/FixtureSystem.cs @@ -7,11 +7,12 @@ using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Serialization; using Robust.Shared.Utility; -namespace Robust.Shared.Physics +namespace Robust.Shared.Physics.Systems { /// /// Manages physics fixtures. diff --git a/Robust.Shared/Physics/SharedBroadphaseSystem.cs b/Robust.Shared/Physics/Systems/SharedBroadphaseSystem.cs similarity index 99% rename from Robust.Shared/Physics/SharedBroadphaseSystem.cs rename to Robust.Shared/Physics/Systems/SharedBroadphaseSystem.cs index d63c495ac..2122122c1 100644 --- a/Robust.Shared/Physics/SharedBroadphaseSystem.cs +++ b/Robust.Shared/Physics/Systems/SharedBroadphaseSystem.cs @@ -1,20 +1,19 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; using Robust.Shared.Configuration; -using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; -using Robust.Shared.Physics.Broadphase; +using Robust.Shared.Physics.BroadPhase; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Physics.Dynamics.Contacts; +using Robust.Shared.Physics.Events; using Robust.Shared.Utility; -namespace Robust.Shared.Physics +namespace Robust.Shared.Physics.Systems { public abstract class SharedBroadphaseSystem : EntitySystem { diff --git a/Robust.Shared/Physics/SharedJointSystem.cs b/Robust.Shared/Physics/Systems/SharedJointSystem.cs similarity index 99% rename from Robust.Shared/Physics/SharedJointSystem.cs rename to Robust.Shared/Physics/Systems/SharedJointSystem.cs index c0d7c7ee2..aa1564698 100644 --- a/Robust.Shared/Physics/SharedJointSystem.cs +++ b/Robust.Shared/Physics/Systems/SharedJointSystem.cs @@ -1,21 +1,18 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; -using System.Net; -using Robust.Shared.Configuration; using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics.Contacts; using Robust.Shared.Physics.Dynamics.Joints; -using Robust.Shared.Timing; using Robust.Shared.Utility; -namespace Robust.Shared.Physics +namespace Robust.Shared.Physics.Systems { // These exist as a means to defer joint additions / removals so we can use HandleComponentState gracefully without // exploding for modifying components. diff --git a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Components.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Components.cs similarity index 98% rename from Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Components.cs rename to Robust.Shared/Physics/Systems/SharedPhysicsSystem.Components.cs index 9213823e4..70b0819f5 100644 --- a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Components.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Components.cs @@ -1,14 +1,16 @@ using System; using Robust.Shared.Containers; +using Robust.Shared.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; -using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Events; using Robust.Shared.Utility; -namespace Robust.Shared.GameObjects; +namespace Robust.Shared.Physics.Systems; public partial class SharedPhysicsSystem { diff --git a/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Contacts.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Contacts.cs new file mode 100644 index 000000000..b966b8fc8 --- /dev/null +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Contacts.cs @@ -0,0 +1,54 @@ +using Robust.Shared.Physics.Components; +using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Events; + +namespace Robust.Shared.Physics.Systems; + +public abstract partial class SharedPhysicsSystem +{ + /// + /// Used to prevent bodies from colliding; may lie depending on joints. + /// + /// + /// + internal bool ShouldCollide(PhysicsComponent body, PhysicsComponent other) + { + if ((body.BodyType & (BodyType.Kinematic | BodyType.Static)) != 0 && + (other.BodyType & (BodyType.Kinematic | BodyType.Static)) != 0) + { + return false; + } + + // Does a joint prevent collision? + // if one of them doesn't have jointcomp then they can't share a common joint. + // otherwise, only need to iterate over the joints of one component as they both store the same joint. + if (TryComp(body.Owner, out JointComponent? jointComponentA) && + TryComp(other.Owner, out JointComponent? jointComponentB)) + { + var aUid = jointComponentA.Owner; + var bUid = jointComponentB.Owner; + + foreach (var (_, joint) in jointComponentA.Joints) + { + // Check if either: the joint even allows collisions OR the other body on the joint is actually the other body we're checking. + if (!joint.CollideConnected && + ((aUid == joint.BodyAUid && + bUid == joint.BodyBUid) || + (bUid == joint.BodyAUid && + aUid == joint.BodyBUid))) return false; + } + } + + var preventCollideMessage = new PreventCollideEvent(body, other); + RaiseLocalEvent(body.Owner, ref preventCollideMessage); + + if (preventCollideMessage.Cancelled) return false; + + preventCollideMessage = new PreventCollideEvent(other, body); + RaiseLocalEvent(other.Owner, ref preventCollideMessage); + + if (preventCollideMessage.Cancelled) return false; + + return true; + } +} diff --git a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Fixtures.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Fixtures.cs similarity index 97% rename from Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Fixtures.cs rename to Robust.Shared/Physics/Systems/SharedPhysicsSystem.Fixtures.cs index 642ba04c9..3b3e792c2 100644 --- a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Fixtures.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Fixtures.cs @@ -1,9 +1,9 @@ using Robust.Shared.IoC; -using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Utility; -namespace Robust.Shared.GameObjects; +namespace Robust.Shared.Physics.Systems; public abstract partial class SharedPhysicsSystem { diff --git a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Queries.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Queries.cs similarity index 98% rename from Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Queries.cs rename to Robust.Shared/Physics/Systems/SharedPhysicsSystem.Queries.cs index 37a76fd65..25b2f1db2 100644 --- a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Queries.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Queries.cs @@ -1,14 +1,14 @@ using System; using System.Collections.Generic; -using System.Linq; +using Robust.Shared.Debugging; +using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; -using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; -using Robust.Shared.Debugging; -namespace Robust.Shared.GameObjects +namespace Robust.Shared.Physics.Systems { /* * Handles all of the public query methods for physics. @@ -84,7 +84,7 @@ namespace Robust.Shared.GameObjects { if (other.Fixture.Body.Deleted || other.Fixture.Body == body) return true; if ((proxy.Fixture.CollisionMask & other.Fixture.CollisionLayer) == 0x0) return true; - if (!body.ShouldCollide(other.Fixture.Body)) return true; + if (!ShouldCollide(body, other.Fixture.Body)) return true; state.entities.Add(other.Fixture.Body); return true; diff --git a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Velocities.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Velocities.cs similarity index 98% rename from Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Velocities.cs rename to Robust.Shared/Physics/Systems/SharedPhysicsSystem.Velocities.cs index 64ab62135..bb935941d 100644 --- a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.Velocities.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.Velocities.cs @@ -1,10 +1,11 @@ +using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; -using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.Shared.Timing; -namespace Robust.Shared.GameObjects; +namespace Robust.Shared.Physics.Systems; public abstract partial class SharedPhysicsSystem { diff --git a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.cs b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.cs similarity index 99% rename from Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.cs rename to Robust.Shared/Physics/Systems/SharedPhysicsSystem.cs index d575dc41c..8506be811 100644 --- a/Robust.Shared/GameObjects/Systems/SharedPhysicsSystem.cs +++ b/Robust.Shared/Physics/Systems/SharedPhysicsSystem.cs @@ -3,17 +3,19 @@ using System.Collections.Generic; using Prometheus; using Robust.Shared.Configuration; using Robust.Shared.Containers; +using Robust.Shared.GameObjects; using Robust.Shared.GameStates; using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; -using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Events; using Robust.Shared.Utility; using DependencyAttribute = Robust.Shared.IoC.DependencyAttribute; -namespace Robust.Shared.GameObjects +namespace Robust.Shared.Physics.Systems { public abstract partial class SharedPhysicsSystem : EntitySystem { diff --git a/Robust.UnitTesting/Server/GameObjects/Components/Transform_Test.cs b/Robust.UnitTesting/Server/GameObjects/Components/Transform_Test.cs index e87698688..af7d7c993 100644 --- a/Robust.UnitTesting/Server/GameObjects/Components/Transform_Test.cs +++ b/Robust.UnitTesting/Server/GameObjects/Components/Transform_Test.cs @@ -10,7 +10,6 @@ using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; -using Robust.Shared.Physics.Broadphase; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.Manager; using Robust.Shared.Timing; diff --git a/Robust.UnitTesting/Server/RobustServerSimulation.cs b/Robust.UnitTesting/Server/RobustServerSimulation.cs index 53cf64b1e..367a3ce00 100644 --- a/Robust.UnitTesting/Server/RobustServerSimulation.cs +++ b/Robust.UnitTesting/Server/RobustServerSimulation.cs @@ -26,6 +26,8 @@ using Robust.Shared.Map; using Robust.Shared.Network; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision; +using Robust.Shared.Physics.Components; +using Robust.Shared.Physics.Systems; using Robust.Shared.Profiling; using Robust.Shared.Prototypes; using Robust.Shared.Reflection; diff --git a/Robust.UnitTesting/Shared/GameObjects/Systems/AnchoredSystemTests.cs b/Robust.UnitTesting/Shared/GameObjects/Systems/AnchoredSystemTests.cs index ae3eb83cf..f9bb805ca 100644 --- a/Robust.UnitTesting/Shared/GameObjects/Systems/AnchoredSystemTests.cs +++ b/Robust.UnitTesting/Shared/GameObjects/Systems/AnchoredSystemTests.cs @@ -6,6 +6,7 @@ using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.UnitTesting.Server; // ReSharper disable AccessToStaticMemberViaDerivedType diff --git a/Robust.UnitTesting/Shared/Map/GridCollision_Test.cs b/Robust.UnitTesting/Shared/Map/GridCollision_Test.cs index 018ad128b..ca75f969a 100644 --- a/Robust.UnitTesting/Shared/Map/GridCollision_Test.cs +++ b/Robust.UnitTesting/Shared/Map/GridCollision_Test.cs @@ -5,6 +5,7 @@ using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; namespace Robust.UnitTesting.Shared.Map { diff --git a/Robust.UnitTesting/Shared/Map/GridFixtures_Tests.cs b/Robust.UnitTesting/Shared/Map/GridFixtures_Tests.cs index e4229d7d6..d610e23cc 100644 --- a/Robust.UnitTesting/Shared/Map/GridFixtures_Tests.cs +++ b/Robust.UnitTesting/Shared/Map/GridFixtures_Tests.cs @@ -5,6 +5,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; namespace Robust.UnitTesting.Shared.Map { diff --git a/Robust.UnitTesting/Shared/Physics/Broadphase_Test.cs b/Robust.UnitTesting/Shared/Physics/Broadphase_Test.cs index f42fbd78d..81069bb4e 100644 --- a/Robust.UnitTesting/Shared/Physics/Broadphase_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/Broadphase_Test.cs @@ -4,6 +4,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.UnitTesting.Server; namespace Robust.UnitTesting.Shared.Physics; diff --git a/Robust.UnitTesting/Shared/Physics/CollisionWake_Test.cs b/Robust.UnitTesting/Shared/Physics/CollisionWake_Test.cs index b62bfa461..c0f250038 100644 --- a/Robust.UnitTesting/Shared/Physics/CollisionWake_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/CollisionWake_Test.cs @@ -4,6 +4,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; +using Robust.Shared.Physics.Components; namespace Robust.UnitTesting.Shared.Physics { diff --git a/Robust.UnitTesting/Shared/Physics/Collision_Test.cs b/Robust.UnitTesting/Shared/Physics/Collision_Test.cs index ef4fd6f12..68035db49 100644 --- a/Robust.UnitTesting/Shared/Physics/Collision_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/Collision_Test.cs @@ -26,6 +26,7 @@ using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Systems; namespace Robust.UnitTesting.Shared.Physics; diff --git a/Robust.UnitTesting/Shared/Physics/FixtureShape_Test.cs b/Robust.UnitTesting/Shared/Physics/FixtureShape_Test.cs index c71dc4579..545f7647d 100644 --- a/Robust.UnitTesting/Shared/Physics/FixtureShape_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/FixtureShape_Test.cs @@ -3,6 +3,7 @@ using NUnit.Framework; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Systems; namespace Robust.UnitTesting.Shared.Physics { diff --git a/Robust.UnitTesting/Shared/Physics/GridDeletion_Test.cs b/Robust.UnitTesting/Shared/Physics/GridDeletion_Test.cs index 74981a76c..b32a9e680 100644 --- a/Robust.UnitTesting/Shared/Physics/GridDeletion_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/GridDeletion_Test.cs @@ -4,6 +4,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; namespace Robust.UnitTesting.Shared.Physics; diff --git a/Robust.UnitTesting/Shared/Physics/GridMovement_Test.cs b/Robust.UnitTesting/Shared/Physics/GridMovement_Test.cs index 1de7147cc..c6e2c25b8 100644 --- a/Robust.UnitTesting/Shared/Physics/GridMovement_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/GridMovement_Test.cs @@ -5,7 +5,9 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Systems; namespace Robust.UnitTesting.Shared.Physics; diff --git a/Robust.UnitTesting/Shared/Physics/JointDeletion_Test.cs b/Robust.UnitTesting/Shared/Physics/JointDeletion_Test.cs index b44bd4f09..d5e5d72e3 100644 --- a/Robust.UnitTesting/Shared/Physics/JointDeletion_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/JointDeletion_Test.cs @@ -5,7 +5,9 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics.Joints; +using Robust.Shared.Physics.Systems; namespace Robust.UnitTesting.Shared.Physics; diff --git a/Robust.UnitTesting/Shared/Physics/Joints_Test.cs b/Robust.UnitTesting/Shared/Physics/Joints_Test.cs index 07927a9a5..240ab3615 100644 --- a/Robust.UnitTesting/Shared/Physics/Joints_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/Joints_Test.cs @@ -8,8 +8,10 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Physics.Dynamics.Joints; +using Robust.Shared.Physics.Systems; using Robust.Shared.Reflection; using Robust.UnitTesting.Server; diff --git a/Robust.UnitTesting/Shared/Physics/MapVelocity_Test.cs b/Robust.UnitTesting/Shared/Physics/MapVelocity_Test.cs index 760821f85..643cf51eb 100644 --- a/Robust.UnitTesting/Shared/Physics/MapVelocity_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/MapVelocity_Test.cs @@ -5,6 +5,8 @@ using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; +using Robust.Shared.Physics.Systems; namespace Robust.UnitTesting.Shared.Physics { diff --git a/Robust.UnitTesting/Shared/Physics/PhysicsComponent_Test.cs b/Robust.UnitTesting/Shared/Physics/PhysicsComponent_Test.cs index 57c304d2e..89b632eb8 100644 --- a/Robust.UnitTesting/Shared/Physics/PhysicsComponent_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/PhysicsComponent_Test.cs @@ -7,7 +7,9 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Systems; namespace Robust.UnitTesting.Shared.Physics { diff --git a/Robust.UnitTesting/Shared/Physics/PhysicsMap_Test.cs b/Robust.UnitTesting/Shared/Physics/PhysicsMap_Test.cs index dbb2037bf..b2dd3abea 100644 --- a/Robust.UnitTesting/Shared/Physics/PhysicsMap_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/PhysicsMap_Test.cs @@ -4,6 +4,7 @@ using Robust.Shared.GameObjects; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; using Robust.UnitTesting.Server; diff --git a/Robust.UnitTesting/Shared/Physics/Stack_Test.cs b/Robust.UnitTesting/Shared/Physics/Stack_Test.cs index 75e4d2eb3..aae9ed82f 100644 --- a/Robust.UnitTesting/Shared/Physics/Stack_Test.cs +++ b/Robust.UnitTesting/Shared/Physics/Stack_Test.cs @@ -33,7 +33,9 @@ using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; using Robust.Shared.Physics.Collision.Shapes; +using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Physics.Systems; namespace Robust.UnitTesting.Shared.Physics {