| 83 | } |
| 84 | |
| 85 | @Injectable() |
| 86 | @ECSSystem('Physics') |
| 87 | class PhysicsSystem extends EntitySystem implements IService { |
| 88 | @InjectProperty(CollisionSystem) |
| 89 | public collision!: CollisionSystem; |
| 90 | |
| 91 | constructor() { |
| 92 | super(Matcher.empty().all(Transform, Velocity)); |
| 93 | } |
| 94 | |
| 95 | protected override process(entities: readonly Entity[]): void { |
| 96 | this.collision.checkCollisions(); |
| 97 | } |
| 98 | |
| 99 | override dispose() {} |
| 100 | } |
| 101 | |
| 102 | scene.addEntityProcessor(CollisionSystem); |
| 103 | const physics = scene.addEntityProcessor(PhysicsSystem); |
nothing calls this directly
no test coverage detected