예제 #1
0
    private void TriangulateCase12(int i, Voxel a, Voxel b, Voxel c, Voxel d)
    {
        Vector2 n1 = a.yNormal;
        Vector2 n2 = b.yNormal;

        if (IsSharpFeature(n1, n2))
        {
            Vector2 point = ComputeIntersection(a.YEdgePoint, n1, b.YEdgePoint, n2);
            if (IsInsideCell(point, a, d))
            {
                surface.AddPentagonCD(i, point);
                wall.AddBDAC(i, point);
                return;
            }
        }
        surface.AddQuadCD(i);
        wall.AddBDAC(i);
    }
예제 #2
0
 public void FillCD(VoxelCell cell, FeaturePoint f)
 {
     if (f.exists)
     {
         surface.AddPentagonCD(cell.i, f.position);
         if (!cell.b.Filled)
         {
             wall.AddFromBD(cell.i, f.position);
         }
         if (!cell.a.Filled)
         {
             wall.AddToAC(cell.i, f.position);
         }
     }
     else
     {
         surface.AddQuadCD(cell.i);
         if (!cell.a.Filled)
         {
             wall.AddBDAC(cell.i);
         }
     }
 }