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);
}
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;
}
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();
}
Aggregations