コード例 #1
0
ファイル: VoxelGrid.cs プロジェクト: KasparasK/SBRemake
    private void TriangulateCase3(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.AddPentagonAB(i, point);
                wall.AddACBD(i, point);
                return;
            }
        }
        surface.AddQuadAB(i);
        wall.AddACBD(i);
    }
コード例 #2
0
 public void FillAB(VoxelCell cell, FeaturePoint f)
 {
     if (f.exists)
     {
         surface.AddPentagonAB(cell.i, f.position);
         if (!cell.c.Filled)
         {
             wall.AddFromAC(cell.i, f.position);
         }
         if (!cell.d.Filled)
         {
             wall.AddToBD(cell.i, f.position);
         }
     }
     else
     {
         surface.AddQuadAB(cell.i);
         if (!cell.c.Filled)
         {
             wall.AddACBD(cell.i);
         }
     }
 }