/** * Generates new set of points suitable for use in an indexed array. * This array is your basic shape, but with the bottom part mirrored if * need be. * * @param data The data to base the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateIndexedTexture2D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("2D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] tex_coords = data.textureCoordinates; recalc2DTexture(); System.arraycopy(texCoordinates2D, 0, data.textureCoordinates, 0, numTexCoords2D); }