Package com.badlogic.gdx.utils

Examples of com.badlogic.gdx.utils.ShortArray.ensureCapacity()


    this.vertices = vertices;
    int vertexCount = this.vertexCount = count / 2;

    ShortArray indicesArray = this.indicesArray;
    indicesArray.clear();
    indicesArray.ensureCapacity(vertexCount);
    indicesArray.size = vertexCount;
    short[] indices = this.indices = indicesArray.items;
    if (areVerticesClockwise(vertices, offset, count)) {
      for (short i = 0; i < vertexCount; i++)
        indices[i] = i;
View Full Code Here


      vertexTypes.add(classifyVertex(i));

    // A polygon with n vertices has a triangulation of n-2 triangles.
    ShortArray triangles = this.triangles;
    triangles.clear();
    triangles.ensureCapacity(Math.max(0, vertexCount - 2) * 3);
    triangulate();
    return triangles;
  }

  private void triangulate () {
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.