Exemple #1
0
 public static OpenCog.Builder.OCMeshBuilder Build(OpenCog.BlockSet.BaseBlockSet.OCFluidBlock fluid)
 {
     OpenCog.Builder.OCMeshBuilder mesh = new OpenCog.Builder.OCMeshBuilder();
     for (int i = 0; i < OpenCog.Builder.OCCubeBuilder.vertices.Length; i++)
     {
         mesh.AddFaceIndices(0);
         mesh.AddVertices(OpenCog.Builder.OCCubeBuilder.vertices[i], UnityEngine.Vector3.zero);
         mesh.AddNormals(OpenCog.Builder.OCCubeBuilder.normals[i]);
         mesh.AddTexCoords(fluid.GetFaceUV());
         mesh.AddFaceColor(new UnityEngine.Color(0, 0, 0, 1));
     }
     return(mesh);
 }
Exemple #2
0
        private static void BuildFace(OpenCog.BlockSet.BaseBlockSet.OCCubeBlock.CubeFace face, OpenCog.BlockSet.BaseBlockSet.OCFluidBlock fluid, UnityEngine.Vector3 localPos, OpenCog.Builder.OCMeshBuilder mesh)
        {
            int iFace = (int)face;

            mesh.AddFaceIndices(fluid.AtlasID);
            mesh.AddVertices(OpenCog.Builder.OCCubeBuilder.vertices[iFace], localPos);
            mesh.AddNormals(OpenCog.Builder.OCCubeBuilder.normals[iFace]);
            mesh.AddTexCoords(fluid.GetFaceUV());
        }