MeshmerizerR renderer = new MeshmerizerR();
Face terrainFace = renderer.TerrainMesh(heightMap, 0f, 255f, 0f, 255f);
ColorVertex[] terrainVertices = TerrainHelper.genColorVertices(terrainFace);
newIndices = terrainFace.toIndicesArray();
byte[] data = ColorVertex.toBytes(terrainVertices);
newVertexVBO = new InterleavedVBO(data, ColorVertex.Size, 3, 3,
2, 0, 12, 24);
UUID[] textureIds = new UUID[] { sim.TerrainDetail0, sim.TerrainDetail1, sim.TerrainDetail2, sim.TerrainDetail3 };
float[] startHeights = new float[] { sim.TerrainStartHeight00, sim.TerrainStartHeight01, sim.TerrainStartHeight10, sim.TerrainStartHeight11 };
float[] heightRanges = new float[] { sim.TerrainHeightRange00, sim.TerrainHeightRange01, sim.TerrainHeightRange10, sim.TerrainHeightRange11 };