/** Create a loop. This automatically adjusts connectivity. * @param vertices an array of floats of alternating x, y coordinates. */ public void createLoop (float[] vertices) { jniCreateLoop(addr, vertices, 0, vertices.length / 2); isLooped = true; }
/** Create a loop. This automatically adjusts connectivity. * @param vertices an array of vertices, these are copied */ public void createLoop (Vector2[] vertices) { float[] verts = new float[vertices.length * 2]; for (int i = 0, j = 0; i < vertices.length * 2; i += 2, j++) { verts[i] = vertices[j].x; verts[i + 1] = vertices[j].y; } jniCreateLoop(addr, verts, 0, verts.length / 2); isLooped = true; }
/** Create a loop. This automatically adjusts connectivity. * @param vertices an array of floats of alternating x, y coordinates. * @param offset into the vertices array * @param length after offset (in floats, not float-pairs, so even number) */ public void createLoop (float[] vertices, int offset, int length) { jniCreateLoop(addr, vertices, offset, length / 2); isLooped = true; }
/** Create a loop. This automatically adjusts connectivity. * @param vertices an array of floats of alternating x, y coordinates. */ public void createLoop (float[] vertices) { jniCreateLoop(addr, vertices, 0, vertices.length / 2); isLooped = true; }
/** Create a loop. This automatically adjusts connectivity. * @param vertices an array of floats of alternating x, y coordinates. * @param offset into the vertices array * @param length after offset (in floats, not float-pairs, so even number) */ public void createLoop (float[] vertices, int offset, int length) { jniCreateLoop(addr, vertices, offset, length / 2); isLooped = true; }
/** Create a loop. This automatically adjusts connectivity. * @param vertices an array of vertices, these are copied */ public void createLoop (Vector2[] vertices) { float[] verts = new float[vertices.length * 2]; for (int i = 0, j = 0; i < vertices.length * 2; i += 2, j++) { verts[i] = vertices[j].x; verts[i + 1] = vertices[j].y; } jniCreateLoop(addr, verts, 0, verts.length / 2); isLooped = true; }