diff --git a/code/foundation/src/models/components.h b/code/foundation/src/models/components.h index ac24ea2..9df038d 100644 --- a/code/foundation/src/models/components.h +++ b/code/foundation/src/models/components.h @@ -38,6 +38,9 @@ typedef struct { typedef Vector2D Position; typedef Vector2D Velocity; +typedef struct { char _unused; } InAir; +typedef struct { char _unused; } TriggerOnly; + enum { PHYS_CIRCLE, PHYS_AABB, @@ -250,6 +253,8 @@ typedef struct { X(Vector2D)\ X(Position)\ X(Velocity)\ + X(InAir)\ + X(TriggerOnly)\ X(PhysicsBody)\ X(Chunk)\ X(Drawable)\ diff --git a/code/foundation/src/systems/systems.c b/code/foundation/src/systems/systems.c index 12bd7cf..e1addd7 100644 --- a/code/foundation/src/systems/systems.c +++ b/code/foundation/src/systems/systems.c @@ -361,10 +361,10 @@ void SystemsImport(ecs_world_t *ecs) { ECS_OBSERVER(ecs, OnDead, EcsOnAdd, components.Dead); // collisions and movement physics - ECS_SYSTEM(ecs, ApplyWorldDragOnVelocity, EcsOnUpdate, components.Position, components.Velocity); + ECS_SYSTEM(ecs, ApplyWorldDragOnVelocity, EcsOnUpdate, components.Position, components.Velocity, !components.InAir, !components.TriggerOnly); ECS_SYSTEM(ecs, VehicleHandling, EcsOnUpdate, components.Vehicle, components.Position, components.Velocity); - ECS_SYSTEM(ecs, BodyCollisions, EcsOnUpdate, components.Position, components.Velocity, components.PhysicsBody); - ECS_SYSTEM(ecs, BlockCollisions, EcsOnValidate, components.Position, components.Velocity); + ECS_SYSTEM(ecs, BodyCollisions, EcsOnUpdate, components.Position, components.Velocity, components.PhysicsBody, !components.TriggerOnly); + ECS_SYSTEM(ecs, BlockCollisions, EcsOnValidate, components.Position, components.Velocity, !components.TriggerOnly); ECS_SYSTEM(ecs, IntegratePositions, EcsOnValidate, components.Position, components.Velocity); // vehicles