Beispiel #1
0
        private static void BuildFace(OpenCog.BlockSet.BaseBlockSet.OCCubeBlock.CubeFace face, OpenCog.BlockSet.BaseBlockSet.OCCactusBlock cactus, Vector3 localPos, OpenCog.Builder.OCMeshBuilder mesh)
        {
            int iFace = (int)face;

            mesh.AddFaceIndices(cactus.AtlasID);
            mesh.AddVertices(vertices[iFace], localPos);
            mesh.AddNormals(normals[iFace]);
            mesh.AddTexCoords(cactus.GetFaceUV(face));
        }
Beispiel #2
0
        //---------------------------------------------------------------------------

        #region Private Member Data

        //---------------------------------------------------------------------------



        //---------------------------------------------------------------------------

        #endregion

        //---------------------------------------------------------------------------

        #region Accessors and Mutators

        //---------------------------------------------------------------------------



        //---------------------------------------------------------------------------

        #endregion

        //---------------------------------------------------------------------------

        #region Public Member Functions

        //---------------------------------------------------------------------------

        public static OpenCog.Builder.OCMeshBuilder Build(OpenCog.BlockSet.BaseBlockSet.OCCactusBlock cactus)
        {
            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 = cactus.GetFaceUV((OCCubeBlock.CubeFace)i);
                mesh.AddTexCoords(texCoords);
                mesh.AddFaceColor(new Color(0, 0, 0, 1));
            }
            return(mesh);
        }