コード例 #1
0
ファイル: VoxelGrid.cs プロジェクト: KasparasK/SBRemake
    private void TriangulateCase1(int i, Voxel a, Voxel b, Voxel c, Voxel d)
    {
        Vector2 n1 = a.xNormal;
        Vector2 n2 = a.yNormal;

        if (IsSharpFeature(n1, n2))
        {
            Vector2 point = ComputeIntersection(a.XEdgePoint, n1, a.YEdgePoint, n2);
            if (ClampToCellMaxMax(ref point, a, d))
            {
                surface.AddQuadA(i, point);
                wall.AddACAB(i, point);
                return;
            }
        }
        surface.AddTriangleA(i);
        wall.AddACAB(i);
    }
コード例 #2
0
 public void FillA(VoxelCell cell, FeaturePoint f)
 {
     if (f.exists)
     {
         surface.AddQuadA(cell.i, f.position);
         if (!cell.c.Filled)
         {
             wall.AddFromAC(cell.i, f.position);
         }
         if (!cell.b.Filled)
         {
             wall.AddToAB(cell.i, f.position);
         }
     }
     else
     {
         surface.AddTriangleA(cell.i);
         if (!cell.b.Filled)
         {
             wall.AddACAB(cell.i);
         }
     }
 }