/** @return {@link #CONCAVE} or {@link #CONVEX} */ private int classifyVertex (int index) { short[] indices = this.indices; int previous = indices[previousIndex(index)] * 2; int current = indices[index] * 2; int next = indices[nextIndex(index)] * 2; float[] vertices = this.vertices; return computeSpannedAreaSign(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); }
/** @return {@link #CONCAVE} or {@link #CONVEX} */ private int classifyVertex (int index) { short[] indices = this.indices; int previous = indices[previousIndex(index)] * 2; int current = indices[index] * 2; int next = indices[nextIndex(index)] * 2; float[] vertices = this.vertices; return computeSpannedAreaSign(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); }
if (computeSpannedAreaSign(p3x, p3y, p1x, p1y, vx, vy) >= 0) { if (computeSpannedAreaSign(p1x, p1y, p2x, p2y, vx, vy) >= 0) { if (computeSpannedAreaSign(p2x, p2y, p3x, p3y, vx, vy) >= 0) return false;
if (computeSpannedAreaSign(p3x, p3y, p1x, p1y, vx, vy) >= 0) { if (computeSpannedAreaSign(p1x, p1y, p2x, p2y, vx, vy) >= 0) { if (computeSpannedAreaSign(p2x, p2y, p3x, p3y, vx, vy) >= 0) return false;
/** @return {@link #CONCAVE} or {@link #CONVEX} */ private int classifyVertex (int index) { short[] indices = this.indices; int previous = indices[previousIndex(index)] * 2; int current = indices[index] * 2; int next = indices[nextIndex(index)] * 2; float[] vertices = this.vertices; return computeSpannedAreaSign(vertices[previous], vertices[previous + 1], vertices[current], vertices[current + 1], vertices[next], vertices[next + 1]); }
if (computeSpannedAreaSign(p3x, p3y, p1x, p1y, vx, vy) >= 0) { if (computeSpannedAreaSign(p1x, p1y, p2x, p2y, vx, vy) >= 0) { if (computeSpannedAreaSign(p2x, p2y, p3x, p3y, vx, vy) >= 0) return false;