public boolean removeValue (short value) { short[] items = this.items; for (int i = 0, n = size; i < n; i++) { if (items[i] == value) { removeIndex(i); return true; } } return false; }
public boolean removeValue (short value) { short[] items = this.items; for (int i = 0, n = size; i < n; i++) { if (items[i] == value) { removeIndex(i); return true; } } return false; }
/** Removes all triangles with a centroid outside the specified hull, which may be concave. Note some triangulations may have * triangles whose centroid is inside the hull but a portion is outside. */ public void trim (ShortArray triangles, float[] points, float[] hull, int offset, int count) { short[] trianglesArray = triangles.items; for (int i = triangles.size - 1; i >= 0; i -= 3) { int p1 = trianglesArray[i - 2] * 2; int p2 = trianglesArray[i - 1] * 2; int p3 = trianglesArray[i] * 2; GeometryUtils.triangleCentroid(points[p1], points[p1 + 1], points[p2], points[p2 + 1], points[p3], points[p3 + 1], centroid); if (!Intersector.isPointInPolygon(hull, offset, count, centroid.x, centroid.y)) { triangles.removeIndex(i); triangles.removeIndex(i - 1); triangles.removeIndex(i - 2); } } } }
/** Removes all triangles with a centroid outside the specified hull, which may be concave. Note some triangulations may have * triangles whose centroid is inside the hull but a portion is outside. */ public void trim (ShortArray triangles, float[] points, float[] hull, int offset, int count) { short[] trianglesArray = triangles.items; for (int i = triangles.size - 1; i >= 0; i -= 3) { int p1 = trianglesArray[i - 2] * 2; int p2 = trianglesArray[i - 1] * 2; int p3 = trianglesArray[i] * 2; GeometryUtils.triangleCentroid(points[p1], points[p1 + 1], points[p2], points[p2 + 1], points[p3], points[p3 + 1], centroid); if (!Intersector.isPointInPolygon(hull, offset, count, centroid.x, centroid.y)) { triangles.removeIndex(i); triangles.removeIndex(i - 1); triangles.removeIndex(i - 2); } } } }
/** Removes from this array all of elements contained in the specified array. * @return true if this array was modified. */ public boolean removeAll (ShortArray array) { int size = this.size; int startSize = size; short[] items = this.items; for (int i = 0, n = array.size; i < n; i++) { short item = array.get(i); for (int ii = 0; ii < size; ii++) { if (item == items[ii]) { removeIndex(ii); size--; break; } } } return size != startSize; }
/** Removes from this array all of elements contained in the specified array. * @return true if this array was modified. */ public boolean removeAll (ShortArray array) { int size = this.size; int startSize = size; short[] items = this.items; for (int i = 0, n = array.size; i < n; i++) { short item = array.get(i); for (int ii = 0; ii < size; ii++) { if (item == items[ii]) { removeIndex(ii); size--; break; } } } return size != startSize; }
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--; }
edges.add(p1); triangles.removeIndex(triangleIndex); triangles.removeIndex(triangleIndex - 1); triangles.removeIndex(triangleIndex - 2); complete.removeIndex(completeIndex); break; for (int i = triangles.size - 1; i >= 0; i -= 3) { if (trianglesArray[i] >= end || trianglesArray[i - 1] >= end || trianglesArray[i - 2] >= end) { triangles.removeIndex(i); triangles.removeIndex(i - 1); triangles.removeIndex(i - 2);
edges.add(p1); triangles.removeIndex(triangleIndex); triangles.removeIndex(triangleIndex - 1); triangles.removeIndex(triangleIndex - 2); complete.removeIndex(completeIndex); break; for (int i = triangles.size - 1; i >= 0; i -= 3) { if (trianglesArray[i] >= end || trianglesArray[i - 1] >= end || trianglesArray[i - 2] >= end) { triangles.removeIndex(i); triangles.removeIndex(i - 1); triangles.removeIndex(i - 2);
public boolean removeValue (short value) { short[] items = this.items; for (int i = 0, n = size; i < n; i++) { if (items[i] == value) { removeIndex(i); return true; } } return false; }
/** Removes all triangles with a centroid outside the specified hull, which may be concave. Note some triangulations may have * triangles whose centroid is inside the hull but a portion is outside. */ public void trim (ShortArray triangles, float[] points, float[] hull, int offset, int count) { short[] trianglesArray = triangles.items; for (int i = triangles.size - 1; i >= 0; i -= 3) { int p1 = trianglesArray[i - 2] * 2; int p2 = trianglesArray[i - 1] * 2; int p3 = trianglesArray[i] * 2; GeometryUtils.triangleCentroid(points[p1], points[p1 + 1], points[p2], points[p2 + 1], points[p3], points[p3 + 1], centroid); if (!Intersector.isPointInPolygon(hull, offset, count, centroid.x, centroid.y)) { triangles.removeIndex(i); triangles.removeIndex(i - 1); triangles.removeIndex(i - 2); } } } }
/** Removes from this array all of elements contained in the specified array. * @return true if this array was modified. */ public boolean removeAll (ShortArray array) { int size = this.size; int startSize = size; short[] items = this.items; for (int i = 0, n = array.size; i < n; i++) { short item = array.get(i); for (int ii = 0; ii < size; ii++) { if (item == items[ii]) { removeIndex(ii); size--; break; } } } return size != startSize; }
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--; }
edges.add(p1); triangles.removeIndex(triangleIndex); triangles.removeIndex(triangleIndex - 1); triangles.removeIndex(triangleIndex - 2); complete.removeIndex(completeIndex); break; for (int i = triangles.size - 1; i >= 0; i -= 3) { if (trianglesArray[i] >= end || trianglesArray[i - 1] >= end || trianglesArray[i - 2] >= end) { triangles.removeIndex(i); triangles.removeIndex(i - 1); triangles.removeIndex(i - 2);