/** Create a chain with isolated end vertices. * @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 createChain (float[] vertices, int offset, int length) { jniCreateChain(addr, vertices, offset, length / 2); isLooped = false; }
/** Create a chain with isolated end vertices. * @param vertices an array of vertices, these are copied */ public void createChain (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; } jniCreateChain(addr, verts, 0, vertices.length); isLooped = false; }
/** Create a chain with isolated end vertices. * @param vertices an array of floats of alternating x, y coordinates. */ public void createChain (float[] vertices) { jniCreateChain(addr, vertices, 0, vertices.length / 2); isLooped = false; }
/** Create a chain with isolated end vertices. * @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 createChain (float[] vertices, int offset, int length) { jniCreateChain(addr, vertices, offset, length / 2); isLooped = false; }
/** Create a chain with isolated end vertices. * @param vertices an array of floats of alternating x, y coordinates. */ public void createChain (float[] vertices) { jniCreateChain(addr, vertices, 0, vertices.length / 2); isLooped = false; }
/** Create a chain with isolated end vertices. * @param vertices an array of vertices, these are copied */ public void createChain (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; } jniCreateChain(addr, verts, 0, vertices.length); isLooped = false; }