akUV[i] = new Vector2f();
    public static TriMesh createIcosahedronMesh(        TriMesh rpkMesh,        boolean bWantNormals,        boolean bWantColors,        boolean bWantUVs,        boolean bOutsideView) {        float fGoldenRatio = 0.5f * (1.0f + FastMath.sqrt(5.0f));        float fInvRoot =            1.0f / FastMath.sqrt(1.0f + fGoldenRatio * fGoldenRatio);        float fU = fGoldenRatio * fInvRoot;        float fV = fInvRoot;        int i;        // allocate vertices        int iVQuantity = 12;        Vector3f[] akVertex = new Vector3f[iVQuantity];        akVertex[0] = new Vector3f(fU, fV, 0.0f);        akVertex[1] = new Vector3f(-fU, fV, 0.0f);        akVertex[2] = new Vector3f(fU, -fV, 0.0f);        akVertex[3] = new Vector3f(-fU, -fV, 0.0f);        akVertex[4] = new Vector3f(fV, 0.0f, fU);        akVertex[5] = new Vector3f(fV, 0.0f, -fU);        akVertex[6] = new Vector3f(-fV, 0.0f, fU);        akVertex[7] = new Vector3f(-fV, 0.0f, -fU);        akVertex[8] = new Vector3f(0.0f, fU, fV);        akVertex[9] = new Vector3f(0.0f, -fU, fV);        akVertex[10] = new Vector3f(0.0f, fU, -fV);        akVertex[11] = new Vector3f(0.0f, -fU, -fV);        FloatBuffer vertBuf = BufferUtils.createFloatBuffer(akVertex);                // allocate normals if requested        FloatBuffer normBuf = null;        if (bWantNormals)            normBuf = BufferUtils.createFloatBuffer(akVertex);        // allocate texture coordinates if requested        Vector2f[] akUV = null;        if (bWantUVs) {            akUV = new Vector2f[iVQuantity];            for (i = 0; i < iVQuantity; i++) {                if (FastMath.abs(akVertex[i].z) < 1.0f) {                    akUV[i].x =                        0.5f                            * (1.0f                                + FastMath.atan2(akVertex[i].y, akVertex[i].x)                                    * FastMath.INV_PI);                } else {                    akUV[i].x = 0.5f;                }                akUV[i].y = FastMath.acos(akVertex[i].z) * FastMath.INV_PI;            }        }        FloatBuffer texBuf = BufferUtils.createFloatBuffer(akUV);        // allocate connectivity        int iTQuantity = 20;        int[] aiConnect = new int[3 * iTQuantity];        aiConnect[0] = 0;        aiConnect[1] = 8;        aiConnect[2] = 4;        aiConnect[3] = 0;        aiConnect[4] = 5;        aiConnect[5] = 10;        aiConnect[6] = 2;        aiConnect[7] = 4;        aiConnect[8] = 9;        aiConnect[9] = 2;        aiConnect[10] = 11;        aiConnect[11] = 5;        aiConnect[12] = 1;        aiConnect[13] = 6;        aiConnect[14] = 8;        aiConnect[15] = 1;        aiConnect[16] = 10;        aiConnect[17] = 7;        aiConnect[18] = 3;        aiConnect[19] = 9;        aiConnect[20] = 6;        aiConnect[21] = 3;        aiConnect[22] = 7;        aiConnect[23] = 11;        aiConnect[24] = 0;        aiConnect[25] = 10;        aiConnect[26] = 8;        aiConnect[27] = 1;        aiConnect[28] = 8;        aiConnect[29] = 10;        aiConnect[30] = 2;        aiConnect[31] = 9;        aiConnect[32] = 11;        aiConnect[33] = 3;        aiConnect[34] = 11;        aiConnect[35] = 9;        aiConnect[36] = 4;        aiConnect[37] = 2;        aiConnect[38] = 0;        aiConnect[39] = 5;        aiConnect[40] = 0;        aiConnect[41] = 2;        aiConnect[42] = 6;        aiConnect[43] = 1;        aiConnect[44] = 3;        aiConnect[45] = 7;        aiConnect[46] = 3;        aiConnect[47] = 1;        aiConnect[48] = 8;        aiConnect[49] = 6;        aiConnect[50] = 4;        aiConnect[51] = 9;        aiConnect[52] = 4;        aiConnect[53] = 6;        aiConnect[54] = 10;        aiConnect[55] = 5;        aiConnect[56] = 7;        aiConnect[57] = 11;        aiConnect[58] = 7;        aiConnect[59] = 5;        IntBuffer indBuf = BufferUtils.createIntBuffer(aiConnect);        if (!bOutsideView) {            for (i = 0; i < iTQuantity; i++) {                int iSave = aiConnect[3 * i + 1];                aiConnect[3 * i + 1] = aiConnect[3 * i + 2];                aiConnect[3 * i + 2] = iSave;            }        }        if (rpkMesh != null) {            rpkMesh.reconstruct(vertBuf, normBuf, null, texBuf, indBuf);        } else {            rpkMesh =                new TriMesh(                    "icosahedron",                    vertBuf,                    normBuf,                    null,                    texBuf,                    indBuf);        }        if (bWantColors)            rpkMesh.setDefaultColor(ColorRGBA.white);        return rpkMesh;    }