public static OpenCog.Builder.OCMeshBuilder Build(OpenCog.BlockSet.BaseBlockSet.OCCubeBlock cube) { OpenCog.Builder.OCMeshBuilder mesh = new OpenCog.Builder.OCMeshBuilder(); for (int i = 0; i < vertices.Length; i++) { mesh.AddFaceIndices(0); mesh.AddVertices(vertices[i], Vector3.zero); mesh.AddNormals(normals[i]); Vector2[] texCoords = cube.GetFaceUV((OCCubeBlock.CubeFace)i, OpenCog.Map.OCBlockDirection.Z_PLUS); mesh.AddTexCoords(texCoords); mesh.AddFaceColor(new Color(0, 0, 0, 1)); } return(mesh); }
private static void BuildFace(OpenCog.BlockSet.BaseBlockSet.OCCubeBlock.CubeFace face, OpenCog.BlockSet.BaseBlockSet.OCCubeBlock cube, OpenCog.Map.OCBlockDirection direction, Vector3 localPos, OpenCog.Builder.OCMeshBuilder mesh) { int iFace = (int)face; mesh.AddFaceIndices(cube.AtlasID); mesh.AddVertices(vertices[iFace], localPos); mesh.AddNormals(normals[iFace]); mesh.AddTexCoords(cube.GetFaceUV(face, direction)); }