diff options
author | pacien | 2018-02-01 16:04:39 +0100 |
---|---|---|
committer | pacien | 2018-02-01 16:04:39 +0100 |
commit | 558af8c25aee52aad4edeaa998511a77704c2c97 (patch) | |
tree | 2720b5495fe0cc7d5802571312b0db7a29c92449 /src/main/java/fr/umlv | |
parent | a9bfd43fffabe4df21429976bb5dd4e2fb93d2db (diff) | |
download | wallj-558af8c25aee52aad4edeaa998511a77704c2c97.tar.gz |
Dedup
Signed-off-by: pacien <pacien.trangirard@pacien.net>
Diffstat (limited to 'src/main/java/fr/umlv')
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java b/src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java index 0846584..6719302 100644 --- a/src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java +++ b/src/main/java/fr/umlv/java/wallj/controller/StagePhysicsController.java | |||
@@ -17,17 +17,15 @@ public class StagePhysicsController implements Controller { | |||
17 | private static final int POSITION_TICK_PER_MS = 2; | 17 | private static final int POSITION_TICK_PER_MS = 2; |
18 | 18 | ||
19 | private final Stage stage; | 19 | private final Stage stage; |
20 | private final World world; | ||
21 | 20 | ||
22 | public StagePhysicsController(Stage stage) { | 21 | public StagePhysicsController(Stage stage) { |
23 | this.stage = Objects.requireNonNull(stage); | 22 | this.stage = Objects.requireNonNull(stage); |
24 | this.world = new World(new Vec2()); | ||
25 | } | 23 | } |
26 | 24 | ||
27 | @Override | 25 | @Override |
28 | public List<Event> update(Context context) { | 26 | public List<Event> update(Context context) { |
29 | int dt = (int) context.getTimeDelta().toMillis(); | 27 | int dt = (int) context.getTimeDelta().toMillis(); |
30 | world.step(dt, dt * VELOCITY_TICK_PER_MS, dt * POSITION_TICK_PER_MS); | 28 | stage.getWorld().step(dt, dt * VELOCITY_TICK_PER_MS, dt * POSITION_TICK_PER_MS); |
31 | return null; | 29 | return null; |
32 | } | 30 | } |
33 | 31 | ||