예제 #1
0
 public void GetNextFace()
 {
     Seg      = Next.edge.segments[edgeDirs[Dir][Next.dir]];
     Dir      = cubeDirs[Next.dir];
     Next     = Seg.GetOppositeEdge(Next.edge);
     EndFound = false;
 }
예제 #2
0
            public int TryGetStart(ref Side left, ref Side right)
            {
                Side    center = this;
                DirEdge opp    = Seg.GetOppositeEdge(Next.edge);

                if (center.CanGetEnd())
                {
                    left = center;

                    right.Seg      = opp.edge.segments[edgeDirs[Dir][opp.dir]];
                    right.Next     = right.Seg.GetOppositeEdge(opp.edge);
                    right.Dir      = cubeDirs[opp.dir];
                    right.EndFound = false;

                    return(right.CanGetEnd() ? 2 : 1);
                }

                center.Next = opp;

                if (center.CanGetEnd())
                {
                    left.Seg      = Next.edge.segments[edgeDirs[Dir][Next.dir]];
                    left.Next     = left.Seg.GetOppositeEdge(Next.edge);
                    left.Dir      = cubeDirs[Next.dir];
                    left.EndFound = false;

                    right = center;

                    return(left.CanGetEnd() ? 2 : 1);
                }

                return(0);
            }