예제 #1
0
 public void CompleteImport()
 {
     foreach (OriFace f in surface)
     {
         f.Men.GetComponent <FaceManager>().Init(f, mat, mat2);
     }
     EdgesDP.ConectAll();
     usable = true;
 }
예제 #2
0
        public void Registerface(int[] v)
        {
            if (face_count == 0)
            {
                EdgesDP.init(vertex_count);
            }
            OriFace f = new OriFace(mat);

            f.CreateMesh(v, this.vertexs, face_count);
            face_count++;
            surface.Add(f);
        }
예제 #3
0
        public void CreateMesh(int[] num, List <OriVertex> v, int count)
        {
            index  = num;
            number = count;
            FACE_NUM++;
            OriEdge x;

            for (int i = 0; i < num.Length; i++)
            {
                vertexs.Add(v[num[i]]);

                if (i != 0)
                {
                    if (!EdgesDP.check(num[i - 1], num[i]))
                    {
                        x = new OriEdge(v[num[i - 1]], v[num[i]]);
                        EdgesDP.make(num[i], num[i - 1], x);
                    }
                    else
                    {
                        x = EdgesDP.get(num[i], num[i - 1]);
                    }
                    x.AddJointing(this, true);
                    edges.Add(x);
                }
            }

            if (!EdgesDP.check(num[num.Length - 1], num[0]))
            {
                x = new OriEdge(v[num[num.Length - 1]], v[num[0]]);
                EdgesDP.make(num[0], num[num.Length - 1], x);
            }
            else
            {
                x = EdgesDP.get(num[0], num[num.Length - 1]);
            }
            x.AddJointing(this, true);
            edges.Add(x);

            IsPlane = true;

            side = Vector3.Cross(v[num[0]].p - v[num[1]].p, v[num[2]].p - v[num[1]].p).normalized;
        }