Search in sources :

Example 11 with GraphModel

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

the class MaterialModelInstanceModelAdapter method removeTag.

public void removeTag(String tag) {
    if (!hasTag(tag))
        throw new IllegalArgumentException("This model instance does not have this tag");
    ObjectSet<GraphModel> models = graphModelsByTag.get(tag);
    for (GraphModel graphModel : models) {
        graphModels.removeModel(graphModel);
    }
    graphModelsByTag.remove(tag);
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel)

Example 12 with GraphModel

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

the class MultiPageSpriteBatchModel method addSprite.

@Override
public boolean addSprite(RenderableSprite sprite) {
    for (SpriteBatchModelPage page : pages) {
        if (page.addSprite(sprite))
            return true;
    }
    SpriteBatchModelPage newPage = new SpriteBatchModelPage();
    newPage.addSprite(sprite);
    pages.add(newPage);
    GraphModel model = graphModels.addModel(tag, newPage);
    modelMap.put(newPage, model);
    return true;
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel)

Example 13 with GraphModel

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

the class ShaderFrontToBackModelRenderingStrategy 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)

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