Search in sources :

Example 6 with GraphModel

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

the class CommonPropertiesModelInstanceModelAdapter method registerNodeForTag.

private void registerNodeForTag(ObjectSet<GraphModel> models, Node node, String tag) {
    if (node.parts.size > 0) {
        for (NodePart nodePart : node.parts) {
            NodePartRenderableModel renderableModel = new NodePartRenderableModel(node, nodePart);
            GraphModel graphModel = graphModels.addModel(tag, renderableModel);
            models.add(graphModel);
        }
    }
    for (Node child : node.getChildren()) {
        registerNodeForTag(models, child, tag);
    }
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel) Node(com.badlogic.gdx.graphics.g3d.model.Node) NodePart(com.badlogic.gdx.graphics.g3d.model.NodePart)

Example 7 with GraphModel

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

the class CommonPropertiesModelInstanceModelAdapter 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 8 with GraphModel

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

the class CommonPropertiesModelInstanceModelAdapter method addTag.

public void addTag(String tag) {
    if (graphModelsByTag.containsKey(tag))
        throw new IllegalArgumentException("This model instance is already registered for this tag");
    ObjectSet<GraphModel> models = new ObjectSet<>();
    for (Node node : modelInstance.nodes) {
        registerNodeForTag(models, node, tag);
    }
    graphModelsByTag.put(tag, models);
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel) Node(com.badlogic.gdx.graphics.g3d.model.Node) ObjectSet(com.badlogic.gdx.utils.ObjectSet)

Example 9 with GraphModel

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

the class MaterialModelInstanceModelAdapter method registerNodeForTag.

private void registerNodeForTag(ObjectSet<GraphModel> models, Node node, String tag) {
    if (node.parts.size > 0) {
        for (NodePart nodePart : node.parts) {
            NodePartRenderableModel renderableModel = new NodePartRenderableModel(node, nodePart);
            GraphModel graphModel = graphModels.addModel(tag, renderableModel);
            models.add(graphModel);
        }
    }
    for (Node child : node.getChildren()) {
        registerNodeForTag(models, child, tag);
    }
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel) Node(com.badlogic.gdx.graphics.g3d.model.Node) NodePart(com.badlogic.gdx.graphics.g3d.model.NodePart)

Example 10 with GraphModel

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

the class MaterialModelInstanceModelAdapter method addTag.

public void addTag(String tag) {
    if (graphModelsByTag.containsKey(tag))
        throw new IllegalArgumentException("This model instance is already registered for this tag");
    ObjectSet<GraphModel> models = new ObjectSet<>();
    for (Node node : modelInstance.nodes) {
        registerNodeForTag(models, node, tag);
    }
    graphModelsByTag.put(tag, models);
}
Also used : GraphModel(com.gempukku.libgdx.graph.plugin.models.GraphModel) Node(com.badlogic.gdx.graphics.g3d.model.Node) ObjectSet(com.badlogic.gdx.utils.ObjectSet)

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