use of com.badlogic.gdx.physics.bullet.DebugDrawer in project nhglib by VoidZombie.
the class GraphicsSystem method begin.
@Override
protected void begin() {
super.begin();
if (physicsSystem == null) {
physicsSystem = entities.getEntitySystem(PhysicsSystem.class);
}
if (cameraSystem == null) {
cameraSystem = entities.getEntitySystem(CameraSystem.class);
}
if (physicsSystem.isPhysicsInitialized()) {
if (debugDrawer == null) {
debugDrawer = new DebugDrawer();
debugDrawer.setDebugMode(btIDebugDraw.DebugDrawModes.DBG_MAX_DEBUG_DRAW_MODE);
}
physicsSystem.setDebugDrawer(debugDrawer);
}
cameras = cameraSystem.cameras;
for (int i = 0; i < cameras.size - modelBatches.size; i++) {
modelBatches.add(new ModelBatch(shaderProvider));
dynamicCaches.add(new ModelCache());
staticCaches.add(new ModelCache());
}
for (int i = 0; i < cameras.size; i++) {
Camera camera = cameras.get(i);
ModelCache dynamicCache = dynamicCaches.get(i);
dynamicCache.begin(camera);
}
}
Aggregations