Search in sources :

Example 6 with MapWritablePropertyContainer

use of com.gempukku.libgdx.graph.shader.property.MapWritablePropertyContainer in project gdx-graph by MarcinSc.

the class Episode11Scene method createModels.

private void createModels(GraphModels models) {
    ModelBuilder modelBuilder = new ModelBuilder();
    Model forceField = modelBuilder.createRect(0, 10, 10, 0, -10, 10, 0, -10, -10, 0, 10, -10, 0, 0, 1, new Material(), VertexAttributes.Usage.Position);
    disposables.add(forceField);
    Model sphere = modelBuilder.createSphere(4f, 4f, 4f, 50, 50, new Material(), VertexAttributes.Usage.Position);
    disposables.add(sphere);
    ModelInstance forceFieldInstance = new ModelInstance(forceField);
    sphereInstance = new ModelInstance(sphere);
    CommonPropertiesModelInstanceModelAdapter forceFieldAdapter = new CommonPropertiesModelInstanceModelAdapter(forceFieldInstance, models, new MapWritablePropertyContainer());
    forceFieldAdapter.addTag("force-field");
    CommonPropertiesModelInstanceModelAdapter sphereAdapter = new CommonPropertiesModelInstanceModelAdapter(sphereInstance, models, new MapWritablePropertyContainer());
    sphereAdapter.addTag("default");
    sphereInstance.transform.idt().translate(-3f, 0, 0);
}
Also used : ModelInstance(com.badlogic.gdx.graphics.g3d.ModelInstance) GraphModelInstance(com.gempukku.libgdx.graph.plugin.models.GraphModelInstance) ModelBuilder(com.badlogic.gdx.graphics.g3d.utils.ModelBuilder) CommonPropertiesModelInstanceModelAdapter(com.gempukku.libgdx.graph.util.model.CommonPropertiesModelInstanceModelAdapter) Model(com.badlogic.gdx.graphics.g3d.Model) Material(com.badlogic.gdx.graphics.g3d.Material) MapWritablePropertyContainer(com.gempukku.libgdx.graph.shader.property.MapWritablePropertyContainer)

Aggregations

MapWritablePropertyContainer (com.gempukku.libgdx.graph.shader.property.MapWritablePropertyContainer)6 OrthographicCamera (com.badlogic.gdx.graphics.OrthographicCamera)1 VertexAttribute (com.badlogic.gdx.graphics.VertexAttribute)1 VertexAttributes (com.badlogic.gdx.graphics.VertexAttributes)1 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 Material (com.badlogic.gdx.graphics.g3d.Material)1 Model (com.badlogic.gdx.graphics.g3d.Model)1 ModelInstance (com.badlogic.gdx.graphics.g3d.ModelInstance)1 ModelBuilder (com.badlogic.gdx.graphics.g3d.utils.ModelBuilder)1 FrameBuffer (com.badlogic.gdx.graphics.glutils.FrameBuffer)1 Vector2 (com.badlogic.gdx.math.Vector2)1 Vector3 (com.badlogic.gdx.math.Vector3)1 Array (com.badlogic.gdx.utils.Array)1 ObjectMap (com.badlogic.gdx.utils.ObjectMap)1 GraphProperty (com.gempukku.libgdx.graph.data.GraphProperty)1 GraphModel (com.gempukku.libgdx.graph.plugin.models.GraphModel)1 GraphModelInstance (com.gempukku.libgdx.graph.plugin.models.GraphModelInstance)1 GraphModels (com.gempukku.libgdx.graph.plugin.models.GraphModels)1 ShaderFieldType (com.gempukku.libgdx.graph.shader.field.ShaderFieldType)1 ArrayValuePerVertex (com.gempukku.libgdx.graph.util.ArrayValuePerVertex)1