public void BuildModel(GameObject gameObject)
        {
            CurvedPolygonsNet cpnet = GetPolylinesCPNet(asset.GetCPN());

            short[] loqs = { 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 };

            CPNTessellationProcess tessellationProcess = ProcessesKeeper.GetTessellationProcess();

            TessellationOutput output = tessellationProcess.InitProcess(cpnet, loqs, this);

            //Debug.Log("cpnet.GetGeometriesCount() " + cpnet.GetGeometriesCount());

            tessellationProcess.BuildProfile();

            int[] builtTrianglesCount = output.GetBuiltTrianglesSize();
            int   builtVerticesCount  = output.GetBuiltVerticesSize();

            Vector2[] uvs_      = new Vector2[builtVerticesCount];
            Vector3[] vertices_ = new Vector3[builtVerticesCount];
            Vector3[] normals_  = new Vector3[builtVerticesCount];
            int[][]   indices_  = new int[builtTrianglesCount.Length][];
            //Debug.Log("indices_ " + indices_.Length);
            for (int i = 0; i < builtTrianglesCount.Length; i++)
            {
                indices_[i] = new int[builtTrianglesCount[i] * 3];
                //Debug.Log("indices_[" + i + "] " + indices_[i].Length);
            }

            OutputMesh mesh = null;

            mesh = new OutputMesh(vertices_, uvs_, normals_, indices_);
            tessellationProcess.WriteMesh(mesh);

            MeshAssigner.AssignMesh(gameObject, vertices_, normals_, uvs_, indices_);
        }
コード例 #2
0
 public void Test(ITestAssert testAssert)
 {
     testAssert.CallTest(GetName());
     Execute();
     testAssert.AssertEquals(indices_.Length, asset.GetCPN().GetGeometriesCount(), "Count Geometries");
 }