-
Notifications
You must be signed in to change notification settings - Fork 5
/
PhysicsDebugSystem.java
36 lines (29 loc) · 1018 Bytes
/
PhysicsDebugSystem.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package com.roaringcatgames.testgame.systems;
import com.badlogic.ashley.core.Entity;
import com.badlogic.ashley.core.Family;
import com.badlogic.ashley.systems.IteratingSystem;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.physics.box2d.Box2DDebugRenderer;
import com.badlogic.gdx.physics.box2d.World;
/**
* Created by barry on 12/8/15 @ 10:58 PM.
*/
public class PhysicsDebugSystem extends IteratingSystem {
private Box2DDebugRenderer debugRenderer;
private World world;
private OrthographicCamera camera;
public PhysicsDebugSystem(World world, OrthographicCamera camera){
super(Family.all().get());
debugRenderer = new Box2DDebugRenderer();
this.world = world;
this.camera = camera;
}
@Override
public void update(float deltaTime) {
super.update(deltaTime);
debugRenderer.render(world, camera.combined);
}
@Override
protected void processEntity(Entity entity, float deltaTime) {
}
}