Files
crystall-punk-14/Content.Shared/Physics/CollisionGroup.cs

89 lines
3.9 KiB
C#
Raw Permalink Normal View History

using JetBrains.Annotations;
using Robust.Shared.Map;
Physics (#3485) * Content side new physics structure * BroadPhase outline done * But we need to fix WorldAABB * Fix static pvs AABB * Fix import * Rando fixes * B is for balloon * Change human mob hitbox to circle * Decent movement * Start adding friction to player controller I think it's the best way to go about it to keep other objects somewhat consistent for physics. * This baby can fit so many physics bugs in it. * Slight mob mover optimisations. * Player mover kinda works okay. * Beginnings of testbed * More testbed * Circlestack bed * Namespaces * BB fixes * Pull WorldAABB * Joint pulling * Semi-decent movement I guess. * Pulling better * Bullet controller + old movement * im too dumb for this shit * Use kinematic mob controller again It's probably for the best TBH * Stashed shitcode * Remove SlipController * In which movement code is entirely refactored * Singularity fix * Fix ApplyLinearImpulse * MoveRelay fix * Fix door collisions * Disable subfloor collisions Saves on broadphase a fair bit * Re-implement ClimbController * Zumzum's pressure * Laggy item throwing * Minor atmos change * Some caching * Optimise controllers * Optimise CollideWith to hell and back * Re-do throwing and tile friction * Landing too * Optimise controllers * Move CCVars and other stuff swept is beautiful * Cleanup a bunch of controllers * Fix shooting and high pressure movement controller * Flashing improvements * Stuff and things * Combat collisions * Combat mode collisions * Pulling distance joint again * Cleanup physics interfaces * More like scuffedularity * Shit's fucked * Haha tests go green * Bigmoneycrab * Fix dupe pulling * Zumzum's based fix * Don't run tile friction for non-predicted bodies * Experimental pulling improvement * Everything's a poly now * Optimise AI region debugging a bit Could still be better but should improve default performance a LOT * Mover no updater * Crazy kinematic body idea * Good collisions * KinematicController * Fix aghost * Throwing refactor * Pushing cleanup * Fix throwing and footstep sounds * Frametime in ICollideBehavior * Fix stuff * Actually fix weightlessness * Optimise collision behaviors a lot * Make open lockers still collide with walls * powwweeerrrrr * Merge master proper * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA * Ch ch ch changesss * SHIP IT * Fix #if DEBUG * Fix vaulting and item locker collision * Fix throwing * Editing yaml by hand what can go wrong * on * Last yaml fixes * Okay now it's fixed * Linter Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com> Co-authored-by: Vera Aguilera Puerto <zddm@outlook.es>
2021-03-08 04:09:59 +11:00
using Robust.Shared.Physics.Dynamics;
using Robust.Shared.Serialization;
namespace Content.Shared.Physics;
/// <summary>
/// Defined collision groups for the physics system.
/// Mask is what it collides with when moving. Layer is what CollisionGroup it is part of.
/// </summary>
[Flags, PublicAPI]
[FlagsFor(typeof(CollisionLayer)), FlagsFor(typeof(CollisionMask))]
public enum CollisionGroup
{
None = 0,
Opaque = 1 << 0, // 1 Blocks light, can be hit by lasers
Impassable = 1 << 1, // 2 Walls, objects impassable by any means
MidImpassable = 1 << 2, // 4 Mobs, players, crabs, etc
HighImpassable = 1 << 3, // 8 Things on top of tables and things that block tall/large mobs.
LowImpassable = 1 << 4, // 16 For things that can fit under a table or squeeze under an airlock
GhostImpassable = 1 << 5, // 32 Things impassible by ghosts/observers, ie blessed tiles or forcefields
BulletImpassable = 1 << 6, // 64 Can be hit by bullets
InteractImpassable = 1 << 7, // 128 Blocks interaction/InRangeUnobstructed
// Y dis door passable when all the others impassable / collision.
DoorPassable = 1 << 8, // 256 Allows door to close over top, Like blast doors over conveyors for disposals rooms/cargo.
MapGrid = MapGridHelpers.CollisionGroup, // Map grids, like shuttles. This is the actual grid itself, not the walls or other entities connected to the grid.
// 32 possible groups
// Why dis exist
AllMask = -1,
SingularityLayer = Opaque | Impassable | MidImpassable | HighImpassable | LowImpassable | BulletImpassable | InteractImpassable | DoorPassable,
// Humanoids, etc.
2022-05-11 17:24:00 -07:00
MobMask = Impassable | HighImpassable | MidImpassable | LowImpassable,
MobLayer = Opaque | BulletImpassable,
// Mice, drones
SmallMobMask = Impassable | LowImpassable,
SmallMobLayer = Opaque | BulletImpassable,
// Birds/other small flyers
FlyingMobMask = Impassable | HighImpassable,
FlyingMobLayer = Opaque | BulletImpassable,
// Mechs
LargeMobMask = Impassable | HighImpassable | MidImpassable | LowImpassable,
LargeMobLayer = Opaque | HighImpassable | MidImpassable | LowImpassable | BulletImpassable,
// Machines, computers
MachineMask = Impassable | MidImpassable | LowImpassable,
MachineLayer = Opaque | MidImpassable | LowImpassable | BulletImpassable,
ConveyorMask = Impassable | MidImpassable | LowImpassable | DoorPassable,
// Crates
CrateMask = Impassable | HighImpassable | LowImpassable,
// Tables that SmallMobs can go under
TableMask = Impassable | MidImpassable,
TableLayer = MidImpassable,
// Tabletop machines, windoors, firelocks
TabletopMachineMask = Impassable | HighImpassable,
// Tabletop machines
TabletopMachineLayer = Opaque | BulletImpassable,
// Airlocks, windoors, firelocks
GlassAirlockLayer = HighImpassable | MidImpassable | BulletImpassable | InteractImpassable,
AirlockLayer = Opaque | GlassAirlockLayer,
// Airlock assembly
HumanoidBlockLayer = HighImpassable | MidImpassable,
// Soap, spills
SlipLayer = MidImpassable | LowImpassable,
ItemMask = Impassable | HighImpassable,
ThrownItem = Impassable | HighImpassable | BulletImpassable,
WallLayer = Opaque | Impassable | HighImpassable | MidImpassable | LowImpassable | BulletImpassable | InteractImpassable,
GlassLayer = Impassable | HighImpassable | MidImpassable | LowImpassable | BulletImpassable | InteractImpassable,
HalfWallLayer = MidImpassable | LowImpassable,
// Statue, monument, airlock, window
FullTileMask = Impassable | HighImpassable | MidImpassable | LowImpassable | InteractImpassable,
// FlyingMob can go past
FullTileLayer = Opaque | HighImpassable | MidImpassable | LowImpassable | BulletImpassable | InteractImpassable,
SubfloorMask = Impassable | LowImpassable
}