/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to base the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateTriTexture2D(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); recalc2DTexture(); System.arraycopy(texCoordinates2D, 0, data.textureCoordinates, 0, vtx_cnt); float[] texCoords = data.textureCoordinates; }