Merge branch 'master' of https://github.com/zpl-c/eco2d
commit
5473ca3c46
|
@ -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,
|
||||
|
@ -261,6 +264,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