Package com.badlogic.gdx.graphics

Examples of com.badlogic.gdx.graphics.VertexAttributes$Usage


  /** Constructs a new interleaved VertexArray
   *
   * @param numVertices the maximum number of vertices
   * @param attributes the {@link VertexAttribute}s */
  public VertexArray (int numVertices, VertexAttribute... attributes) {
    this(numVertices, new VertexAttributes(attributes));
  }
View Full Code Here


   *
   * @param isStatic whether the vertex data is static.
   * @param numVertices the maximum number of vertices
   * @param attributes the {@link VertexAttribute}s. */
  public VertexBufferObject (boolean isStatic, int numVertices, VertexAttribute... attributes) {
    this(isStatic, numVertices, new VertexAttributes(attributes));
  }
View Full Code Here

  /** Calculate the weights of each triangle of the wrapped mesh.
   * If the mesh has indices: the function will calculate the weight of those triangles.
   * If the mesh has not indices: the function will consider the vertices as a triangle strip.*/
  public void calculateWeights(){
    distribution.clear();
    VertexAttributes attributes = mesh.getVertexAttributes();
    int indicesCount = mesh.getNumIndices();
    int vertexCount = mesh.getNumVertices();
    int vertexSize = (short)(attributes.vertexSize / 4),
       positionOffset = (short)(attributes.findByUsage(Usage.Position).offset/4);
    float[] vertices = new float[vertexCount*vertexSize];
    mesh.getVertices(vertices);
    if(indicesCount > 0){
      short[] indices = new short[indicesCount];
      mesh.getIndices(indices);
View Full Code Here

      if (attributeType.equals("uv")) {
        numUvs++;
      }
    }
    VertexAttribute[] vertexAttributes = createVertexAttributes(hasNormals, numUvs);
    int vertexSize = new VertexAttributes(vertexAttributes).vertexSize / 4;
    float[] vertices = new float[numVertices * vertexSize];
    int idx = 0;
    int uvOffset = hasNormals ? 6 : 3;
    for (int i = 0; i < numVertices; i++) {
      readFloatArray(in, vertices, idx);
View Full Code Here

TOP

Related Classes of com.badlogic.gdx.graphics.VertexAttributes$Usage

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.