Add collision masking tags
parent
e8934ac2f3
commit
78c05fd9da
|
@ -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)\
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue