Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.Mesh


  @Override
  protected void allocParticlesData(int capacity){
    vertices = new float[capacity * CPU_VERTEX_SIZE];
    if(renderable.mesh != null)
      renderable.mesh.dispose();
    renderable.mesh = new Mesh(false, capacity, 0, CPU_ATTRIBUTES);
  }
View Full Code Here


    sin = new float[rays];
    cos = new float[rays];
    endX = new float[rays];
    endY = new float[rays];

    lightMesh = new Mesh(VertexDataType.VertexArray, false, vertexNum, 0, new VertexAttribute(Usage.Position, 2,
      "vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
      new VertexAttribute(Usage.Generic, 1, "s"));
    softShadowMesh = new Mesh(VertexDataType.VertexArray, false, vertexNum * 2, 0, new VertexAttribute(Usage.Position, 2,
      "vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
      new VertexAttribute(Usage.Generic, 1, "s"));
    setMesh();
  }
View Full Code Here

      start[i] = new Vector2();
      end[i] = new Vector2();
    }
    setDirection(direction);

    lightMesh = new Mesh(VertexDataType.VertexArray, staticLight, vertexNum, 0, new VertexAttribute(Usage.Position, 2,
      "vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
      new VertexAttribute(Usage.Generic, 1, "s"));
    softShadowMesh = new Mesh(VertexDataType.VertexArray, staticLight, vertexNum, 0, new VertexAttribute(Usage.Position, 2,
      "vertex_positions"), new VertexAttribute(Usage.ColorPacked, 4, "quad_colors"),
      new VertexAttribute(Usage.Generic, 1, "s"));
    update();
  }
View Full Code Here

    verts[i++] = 1f; // y4

    verts[i++] = 0f; // u4
    verts[i++] = 1f; // v4

    Mesh tmpMesh = new Mesh(true, 4, 0, new VertexAttribute(
        Usage.Position, 2, "a_position"), new VertexAttribute(
        Usage.TextureCoordinates, 2, "a_texCoord0"));

    tmpMesh.setVertices(verts);
    return tmpMesh;

  }
View Full Code Here

    verts[i++] = 1f; // y4

    verts[i++] = 0f; // u4
    verts[i++] = 1f; // v4

    Mesh tmpMesh = new Mesh(true, 4, 0, new VertexAttribute(
        Usage.Position, 2, "a_position"), new VertexAttribute(
        Usage.TextureCoordinates, 2, "a_texCoord0"));

    tmpMesh.setVertices(verts);
    return tmpMesh;

  }
View Full Code Here

   * @param defaultShader the default shader to use. This is not owned by the SpriteBatch and must be disposed separately. */
  public SpriteBatch (int size, int buffers, ShaderProgram defaultShader) {
    this.buffers = new Mesh[buffers];

    for (int i = 0; i < buffers; i++) {
      this.buffers[i] = new Mesh(VertexDataType.VertexArray, false, size * 4, size * 6, new VertexAttribute(Usage.Position, 2,
        ShaderProgram.POSITION_ATTRIBUTE), new VertexAttribute(Usage.ColorPacked, 4, ShaderProgram.COLOR_ATTRIBUTE),
        new VertexAttribute(Usage.TextureCoordinates, 2, ShaderProgram.TEXCOORD_ATTRIBUTE + "0"));
    }

    projectionMatrix.setToOrtho2D(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
View Full Code Here

        }
      }
      idx += vertexSize;
    }

    Mesh mesh = new Mesh(true, numVertices, indices.size, vertexAttributes);
    mesh.setVertices(vertices);
    mesh.setIndices(convertToShortArray(indices));
    return new StillSubMesh(name, mesh, GL10.GL_TRIANGLES);
  }
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.Mesh

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.