@Override public void index (final short value) { indices.add(value); }
@Override public void index (final short value) { indices.add(value); }
@Override public void index (short value1, short value2, short value3, short value4, short value5, short value6, short value7, short value8) { ensureIndices(8); indices.add(value1); indices.add(value2); indices.add(value3); indices.add(value4); indices.add(value5); indices.add(value6); indices.add(value7); indices.add(value8); }
@Override public void index (short value1, short value2, short value3, short value4, short value5, short value6, short value7, short value8) { ensureIndices(8); indices.add(value1); indices.add(value2); indices.add(value3); indices.add(value4); indices.add(value5); indices.add(value6); indices.add(value7); indices.add(value8); }
private void cutEarTip (int earTipIndex) { short[] indices = this.indices; ShortArray triangles = this.triangles; triangles.add(indices[previousIndex(earTipIndex)]); triangles.add(indices[earTipIndex]); triangles.add(indices[nextIndex(earTipIndex)]); indicesArray.removeIndex(earTipIndex); vertexTypes.removeIndex(earTipIndex); vertexCount--; }
private void cutEarTip (int earTipIndex) { short[] indices = this.indices; ShortArray triangles = this.triangles; triangles.add(indices[previousIndex(earTipIndex)]); triangles.add(indices[earTipIndex]); triangles.add(indices[nextIndex(earTipIndex)]); indicesArray.removeIndex(earTipIndex); vertexTypes.removeIndex(earTipIndex); vertexCount--; }
private void triangulate () { int[] vertexTypes = this.vertexTypes.items; while (vertexCount > 3) { int earTipIndex = findEarTip(); cutEarTip(earTipIndex); // The type of the two vertices adjacent to the clipped vertex may have changed. int previousIndex = previousIndex(earTipIndex); int nextIndex = earTipIndex == vertexCount ? 0 : earTipIndex; vertexTypes[previousIndex] = classifyVertex(previousIndex); vertexTypes[nextIndex] = classifyVertex(nextIndex); } if (vertexCount == 3) { ShortArray triangles = this.triangles; short[] indices = this.indices; triangles.add(indices[0]); triangles.add(indices[1]); triangles.add(indices[2]); } }
private void triangulate () { int[] vertexTypes = this.vertexTypes.items; while (vertexCount > 3) { int earTipIndex = findEarTip(); cutEarTip(earTipIndex); // The type of the two vertices adjacent to the clipped vertex may have changed. int previousIndex = previousIndex(earTipIndex); int nextIndex = earTipIndex == vertexCount ? 0 : earTipIndex; vertexTypes[previousIndex] = classifyVertex(previousIndex); vertexTypes[nextIndex] = classifyVertex(nextIndex); } if (vertexCount == 3) { ShortArray triangles = this.triangles; short[] indices = this.indices; triangles.add(indices[0]); triangles.add(indices[1]); triangles.add(indices[2]); } }