Search in sources :

Example 1 with DebugDrawer

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);
    }
}
Also used : DebugDrawer(com.badlogic.gdx.physics.bullet.DebugDrawer) ModelBatch(com.badlogic.gdx.graphics.g3d.ModelBatch) Camera(com.badlogic.gdx.graphics.Camera) ModelCache(com.badlogic.gdx.graphics.g3d.ModelCache)

Aggregations

Camera (com.badlogic.gdx.graphics.Camera)1 ModelBatch (com.badlogic.gdx.graphics.g3d.ModelBatch)1 ModelCache (com.badlogic.gdx.graphics.g3d.ModelCache)1 DebugDrawer (com.badlogic.gdx.physics.bullet.DebugDrawer)1