Пример #1
0
        private void WriteMesh(Mesh storedMesh, OutputMesh output /*,bool useUnityNormals*/)
        {
            if (output.GetVertices().Length > CPNTessellationProcess.MAX_VERTICES_SIZE)
            {
                return;
            }

            storedMesh.Clear();
            storedMesh.vertices = output.GetVertices();
            storedMesh.uv       = output.GetUVs();
            storedMesh.normals  = output.GetNormals();

            int[][] triangles = output.GetTriangles();
            if (triangles.Length == 0)
            {
                storedMesh.SetTriangles(new int[0], 0);
            }
            else
            {
                storedMesh.subMeshCount = triangles.Length;
                for (int i = 0; i < triangles.Length; i++)
                {
                    storedMesh.SetTriangles(triangles[i], i);
                }
            }
        }
Пример #2
0
 public void Test(ITestAssert testAssert)
 {
     testAssert.CallTest(GetName());
     Execute();
     testAssert.AssertEquals(mesh.GetVertices().Length, 10, "Mesh Vertices");
     testAssert.AssertEquals(mesh.GetNormals().Length, 10, "Mesh Normals");
     //testAssert.AssertEquals(mesh.GetUVs().Length, 0, "Mesh UVs");
     //testAssert.AssertEquals(mesh.GetTangents().Length, 0, "Mesh Tangents");
     testAssert.AssertEquals(mesh.GetTriangles()[0].Length, 27, "Mesh Indices");
 }
Пример #3
0
 public void BuildModel(GameObject gameObject)
 {
     Execute();
     MeshAssigner.AssignMesh(gameObject, mesh2.GetVertices(), mesh2.GetNormals(),
                             mesh2.GetUVs(), outMesh.GetTriangles());
 }
Пример #4
0
 public static void AssignMesh(GameObject gameObject, OutputMesh outputMesh)
 {
     AssignMesh(gameObject, outputMesh.GetVertices(), outputMesh.GetNormals(),
                outputMesh.GetUVs(), outputMesh.GetTriangles());
 }