Search in sources :

Example 1 with RenderableProvider

use of com.badlogic.gdx.graphics.g3d.RenderableProvider in project libgdx by libgdx.

the class BaseShadowSystem method begin.

@Override
public <T extends RenderableProvider> void begin(Camera camera, final Iterable<T> renderableProviders) {
    if (this.renderableProviders != null || this.camera != null)
        throw new GdxRuntimeException("Call end() first.");
    this.camera = camera;
    this.renderableProviders = (Iterable<RenderableProvider>) renderableProviders;
}
Also used : GdxRuntimeException(com.badlogic.gdx.utils.GdxRuntimeException) RenderableProvider(com.badlogic.gdx.graphics.g3d.RenderableProvider)

Example 2 with RenderableProvider

use of com.badlogic.gdx.graphics.g3d.RenderableProvider in project nhglib by VoidZombie.

the class GraphicsSystem method rebuildCache.

private void rebuildCache(RenderableProvider... renderableProviders) {
    Array<ModelCache> previousModelCaches = new Array<>(staticCaches);
    for (int i = 0; i < cameras.size; i++) {
        ModelCache previousModelCache = previousModelCaches.get(i);
        ModelCache staticCache = staticCaches.get(i);
        Camera camera = cameras.get(i);
        previousModelCache.begin(camera);
        previousModelCache.add(staticCache);
        previousModelCache.end();
        staticCache.begin(camera);
        staticCache.add(previousModelCache);
        for (RenderableProvider provider : renderableProviders) {
            staticCache.add(provider);
        }
        staticCache.end();
    }
}
Also used : Array(com.badlogic.gdx.utils.Array) RenderableProvider(com.badlogic.gdx.graphics.g3d.RenderableProvider) Camera(com.badlogic.gdx.graphics.Camera) ModelCache(com.badlogic.gdx.graphics.g3d.ModelCache)

Aggregations

RenderableProvider (com.badlogic.gdx.graphics.g3d.RenderableProvider)2 Camera (com.badlogic.gdx.graphics.Camera)1 ModelCache (com.badlogic.gdx.graphics.g3d.ModelCache)1 Array (com.badlogic.gdx.utils.Array)1 GdxRuntimeException (com.badlogic.gdx.utils.GdxRuntimeException)1