2021-01-02 12:03:10 -06:00
using System ;
2019-09-03 13:14:04 -07:00
using JetBrains.Annotations ;
2020-01-09 18:29:09 -08:00
using Robust.Shared.Map ;
2021-03-08 04:09:59 +11:00
using Robust.Shared.Physics.Dynamics ;
2020-05-25 00:17:08 +01:00
using Robust.Shared.Serialization ;
2020-08-13 14:40:27 +02:00
using RobustPhysics = Robust . Shared . Physics ;
2018-10-30 01:13:10 -07:00
namespace Content.Shared.Physics
{
/// <summary>
/// Defined collision groups for the physics system.
/// </summary>
2019-09-03 13:14:04 -07:00
[Flags, PublicAPI]
2021-03-08 04:09:59 +11:00
[FlagsFor(typeof(CollisionLayer)), FlagsFor(typeof(CollisionMask))]
2018-10-30 01:13:10 -07:00
public enum CollisionGroup
{
2019-12-01 09:20:50 -05:00
None = 0 ,
Opaque = 1 < < 0 , // 1 Blocks light, for lasers
Impassable = 1 < < 1 , // 2 Walls, objects impassable by any means
MobImpassable = 1 < < 2 , // 4 Mobs, players, crabs, etc
VaultImpassable = 1 < < 3 , // 8 Things that cannot be jumped over, not half walls or tables
SmallImpassable = 1 < < 4 , // 16 Things a smaller object - a cat, a crab - can't go through - a wall, but not a computer terminal or a table
2021-04-08 11:44:20 +00:00
GhostImpassable = 1 < < 5 , // 32 Things impassible by ghosts/observers, ie blessed tiles or forcefields
Underplating = 1 < < 6 , // 64 Things that are under plating
2022-02-13 09:08:59 +11:00
[Obsolete("Don't use Passable for collision.")]
// Collision is for what things collide, not what they "don't collide with" so this makes 0 logical sense.
Passable = 1 < < 7 , // 128 Things that are passable.
2020-01-09 18:29:09 -08:00
MapGrid = MapGridHelpers . CollisionGroup , // Map grids, like shuttles. This is the actual grid itself, not the walls or other entities connected to the grid.
2019-12-01 09:20:50 -05:00
MobMask = Impassable | MobImpassable | VaultImpassable | SmallImpassable ,
2021-05-31 17:13:40 +10:00
ThrownItem = VaultImpassable ,
2020-05-25 16:32:33 +02:00
// 32 possible groups
2019-09-03 13:14:04 -07:00
AllMask = - 1 ,
2018-10-30 01:13:10 -07:00
}
}