Search in sources :

Example 1 with GraphModel

use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.

the class BackToFrontModelRenderingStrategy method processModels.

@Override
public void processModels(GraphModelsImpl models, Array<String> tags, Camera camera, StrategyCallback callback) {
    callback.begin();
    orderingArray.clear();
    for (String tag : tags) {
        for (GraphModel model : models.getModels(tag)) if (model.getRenderableModel().isRendered(camera))
            orderingArray.add(model);
    }
    modelSorter.sort(camera.position, orderingArray);
    for (GraphModel graphModel : orderingArray) {
        callback.process(graphModel.getRenderableModel(), graphModel.getTag());
    }
    callback.end();
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel)

Example 2 with GraphModel

use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.

the class FrontToBackModelRenderingStrategy method processModels.

@Override
public void processModels(GraphModelsImpl models, Array<String> tags, Camera camera, ModelRenderingStrategy.StrategyCallback callback) {
    callback.begin();
    orderingArray.clear();
    for (String tag : tags) {
        for (GraphModel model : models.getModels(tag)) if (model.getRenderableModel().isRendered(camera))
            orderingArray.add(model);
    }
    modelSorter.sort(camera.position, orderingArray);
    for (GraphModel graphModel : orderingArray) {
        callback.process(graphModel.getRenderableModel(), graphModel.getTag());
    }
    callback.end();
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel)

Example 3 with GraphModel

use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.

the class ShaderBackToFrontModelRenderingStrategy method processModels.

@Override
public void processModels(GraphModelsImpl models, Array<String> tags, Camera camera, StrategyCallback callback) {
    callback.begin();
    for (String tag : tags) {
        orderingArray.clear();
        for (GraphModel model : models.getModels(tag)) if (model.getRenderableModel().isRendered(camera))
            orderingArray.add(model);
        modelSorter.sort(camera.position, orderingArray);
        for (GraphModel graphModel : orderingArray) {
            callback.process(graphModel.getRenderableModel(), tag);
        }
    }
    callback.end();
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel)

Example 4 with GraphModel

use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.

the class ShaderUnorderedModelRenderingStrategy method processModels.

@Override
public void processModels(GraphModelsImpl models, Array<String> tags, Camera camera, StrategyCallback callback) {
    callback.begin();
    for (String tag : tags) {
        for (GraphModel model : models.getModels(tag)) {
            if (model.getRenderableModel().isRendered(camera)) {
                callback.process(model.getRenderableModel(), tag);
            }
        }
    }
    callback.end();
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel)

Example 5 with GraphModel

use of com.gempukku.libgdx.graph.plugin.models.GraphModel in project gdx-graph by MarcinSc.

the class GraphModelsImpl method registerTag.

public void registerTag(String tag, GraphShader shader) {
    if (modelsByTag.containsKey(tag))
        throw new IllegalStateException("There is already a shader with tag: " + tag);
    modelsByTag.put(tag, new ObjectSet<GraphModel>());
    propertiesByTag.put(tag, shader.getProperties());
    propertiesForTag.put(tag, new MapWritablePropertyContainer());
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel) MapWritablePropertyContainer(com.gempukku.libgdx.graph.shader.property.MapWritablePropertyContainer)

Aggregations

GraphModel (com.gempukku.libgdx.graph.plugin.models.GraphModel)13 Node (com.badlogic.gdx.graphics.g3d.model.Node)4 NodePart (com.badlogic.gdx.graphics.g3d.model.NodePart)2 ObjectSet (com.badlogic.gdx.utils.ObjectSet)2 MapWritablePropertyContainer (com.gempukku.libgdx.graph.shader.property.MapWritablePropertyContainer)1