Examples of VertexAttributes


Examples of com.badlogic.gdx.graphics.VertexAttributes

  /** 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

Examples of com.badlogic.gdx.graphics.VertexAttributes

   *
   * @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

Examples of com.badlogic.gdx.graphics.VertexAttributes

  /** 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

Examples of com.badlogic.gdx.graphics.VertexAttributes

      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
Copyright © 2018 www.massapi.com. 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.