@@ -592,70 +592,70 @@ static void AddIfNotPresent(ref QuickList<int> list, int value, BufferPool pool)
592
592
list . Allocate ( pool ) = value ;
593
593
}
594
594
595
- public struct DebugStep
596
- {
597
- public EdgeEndpoints SourceEdge ;
598
- public List < int > Raw ;
599
- public List < int > Reduced ;
600
- public bool [ ] AllowVertex ;
601
- public Vector3 FaceNormal ;
602
- public Vector3 BasisX ;
603
- public Vector3 BasisY ;
604
- public List < int > FaceStarts ;
605
- public List < int > FaceIndices ;
606
- public bool [ ] FaceDeleted ;
607
- public int [ ] MergedFaceIndices ;
608
- public int FaceIndex ;
609
- public Vector3 [ ] FaceNormals ;
610
-
611
- internal DebugStep ( EdgeEndpoints sourceEdge , ref QuickList < int > raw , Vector3 faceNormal , Vector3 basisX , Vector3 basisY , ref QuickList < int > reduced , ref Buffer < int > allowVertex , ref QuickList < EarlyFace > faces , Span < int > mergedFaceIndices , int faceIndex )
612
- {
613
- SourceEdge = sourceEdge ;
614
- FaceNormal = faceNormal ;
615
- BasisX = basisX ;
616
- BasisY = basisY ;
617
- Raw = new List < int > ( ) ;
618
- for ( int i = 0 ; i < raw . Count ; ++ i )
619
- {
620
- Raw . Add ( raw [ i ] ) ;
621
- }
622
- Reduced = new List < int > ( ) ;
623
- for ( int i = 0 ; i < reduced . Count ; ++ i )
624
- {
625
- Reduced . Add ( reduced [ i ] ) ;
626
- }
627
- AllowVertex = new bool [ allowVertex . Length ] ;
628
- for ( int i = 0 ; i < allowVertex . Length ; ++ i )
629
- {
630
- AllowVertex [ i ] = allowVertex [ i ] != 0 ;
631
- }
632
- FaceStarts = new List < int > ( faces . Count ) ;
633
- FaceIndices = new List < int > ( ) ;
634
- FaceDeleted = new bool [ faces . Count ] ;
635
- FaceNormals = new Vector3 [ faces . Count ] ;
636
- for ( int i = 0 ; i < faces . Count ; ++ i )
637
- {
638
- ref var face = ref faces [ i ] ;
639
- FaceStarts . Add ( FaceIndices . Count ) ;
640
- for ( int j = 0 ; j < face . VertexIndices . Count ; ++ j )
641
- FaceIndices . Add ( face . VertexIndices [ j ] ) ;
642
- FaceDeleted [ i ] = face . Deleted ;
643
- FaceNormals [ i ] = face . Normal ;
644
- }
645
- MergedFaceIndices = mergedFaceIndices . ToArray ( ) ;
646
- FaceIndex = faceIndex ;
647
- }
648
- }
649
- /// <summary>
650
- /// Computes the convex hull of a set of points.
651
- /// </summary>
652
- /// <param name="points">Point set to compute the convex hull of.</param>
653
- /// <param name="pool">Buffer pool to pull memory from when creating the hull.</param>
654
- /// <param name="hullData">Convex hull of the input point set.</param>
655
- public static void ComputeHull ( Span < Vector3 > points , BufferPool pool , out HullData hullData )
656
- {
657
- ComputeHull ( points , pool , out hullData , out _ ) ;
658
- }
595
+ // public struct DebugStep
596
+ // {
597
+ // public EdgeEndpoints SourceEdge;
598
+ // public List<int> Raw;
599
+ // public List<int> Reduced;
600
+ // public bool[] AllowVertex;
601
+ // public Vector3 FaceNormal;
602
+ // public Vector3 BasisX;
603
+ // public Vector3 BasisY;
604
+ // public List<int> FaceStarts;
605
+ // public List<int> FaceIndices;
606
+ // public bool[] FaceDeleted;
607
+ // public int[] MergedFaceIndices;
608
+ // public int FaceIndex;
609
+ // public Vector3[] FaceNormals;
610
+
611
+ // internal DebugStep(EdgeEndpoints sourceEdge, ref QuickList<int> raw, Vector3 faceNormal, Vector3 basisX, Vector3 basisY, ref QuickList<int> reduced, ref Buffer<int> allowVertex, ref QuickList<EarlyFace> faces, Span<int> mergedFaceIndices, int faceIndex)
612
+ // {
613
+ // SourceEdge = sourceEdge;
614
+ // FaceNormal = faceNormal;
615
+ // BasisX = basisX;
616
+ // BasisY = basisY;
617
+ // Raw = new List<int>();
618
+ // for (int i = 0; i < raw.Count; ++i)
619
+ // {
620
+ // Raw.Add(raw[i]);
621
+ // }
622
+ // Reduced = new List<int>();
623
+ // for (int i = 0; i < reduced.Count; ++i)
624
+ // {
625
+ // Reduced.Add(reduced[i]);
626
+ // }
627
+ // AllowVertex = new bool[allowVertex.Length];
628
+ // for (int i = 0; i < allowVertex.Length; ++i)
629
+ // {
630
+ // AllowVertex[i] = allowVertex[i] != 0;
631
+ // }
632
+ // FaceStarts = new List<int>(faces.Count);
633
+ // FaceIndices = new List<int>();
634
+ // FaceDeleted = new bool[faces.Count];
635
+ // FaceNormals = new Vector3[faces.Count];
636
+ // for (int i = 0; i < faces.Count; ++i)
637
+ // {
638
+ // ref var face = ref faces[i];
639
+ // FaceStarts.Add(FaceIndices.Count);
640
+ // for (int j = 0; j < face.VertexIndices.Count; ++j)
641
+ // FaceIndices.Add(face.VertexIndices[j]);
642
+ // FaceDeleted[i] = face.Deleted;
643
+ // FaceNormals[i] = face.Normal;
644
+ // }
645
+ // MergedFaceIndices = mergedFaceIndices.ToArray();
646
+ // FaceIndex = faceIndex;
647
+ // }
648
+ // }
649
+ ///// <summary>
650
+ ///// Computes the convex hull of a set of points.
651
+ ///// </summary>
652
+ ///// <param name="points">Point set to compute the convex hull of.</param>
653
+ ///// <param name="pool">Buffer pool to pull memory from when creating the hull.</param>
654
+ ///// <param name="hullData">Convex hull of the input point set.</param>
655
+ // public static void ComputeHull(Span<Vector3> points, BufferPool pool, out HullData hullData)
656
+ // {
657
+ // ComputeHull(points, pool, out hullData, out _);
658
+ // }
659
659
660
660
661
661
/// <summary>
@@ -664,9 +664,9 @@ public static void ComputeHull(Span<Vector3> points, BufferPool pool, out HullDa
664
664
/// <param name="points">Point set to compute the convex hull of.</param>
665
665
/// <param name="pool">Buffer pool to pull memory from when creating the hull.</param>
666
666
/// <param name="hullData">Convex hull of the input point set.</param>
667
- public static void ComputeHull ( Span < Vector3 > points , BufferPool pool , out HullData hullData , out List < DebugStep > steps )
667
+ public static void ComputeHull ( Span < Vector3 > points , BufferPool pool , out HullData hullData ) // , out List<DebugStep> steps)
668
668
{
669
- steps = new List < DebugStep > ( ) ;
669
+ // steps = new List<DebugStep>();
670
670
if ( points . Length <= 0 )
671
671
{
672
672
hullData = default ;
@@ -825,7 +825,7 @@ public static void ComputeHull(Span<Vector3> points, BufferPool pool, out HullDa
825
825
}
826
826
Vector3Wide . ReadFirst ( initialBasisX , out var debugInitialBasisX ) ;
827
827
Vector3Wide . ReadFirst ( initialBasisY , out var debugInitialBasisY ) ;
828
- steps . Add ( new DebugStep ( initialSourceEdge , ref rawFaceVertexIndices , initialFaceNormal , debugInitialBasisX , debugInitialBasisY , ref reducedFaceIndices , ref allowVertices , ref faces , default , reducedFaceIndices . Count >= 3 ? 0 : - 1 ) ) ;
828
+ // steps.Add(new DebugStep(initialSourceEdge, ref rawFaceVertexIndices, initialFaceNormal, debugInitialBasisX, debugInitialBasisY, ref reducedFaceIndices, ref allowVertices, ref faces, default, reducedFaceIndices.Count >= 3 ? 0 : -1));
829
829
830
830
int facesDeletedCount = 0 ;
831
831
@@ -858,7 +858,7 @@ public static void ComputeHull(Span<Vector3> points, BufferPool pool, out HullDa
858
858
859
859
if ( reducedFaceIndices . Count < 3 )
860
860
{
861
- steps . Add ( new DebugStep ( edgeToTest . Endpoints , ref rawFaceVertexIndices , faceNormal , basisX , basisY , ref reducedFaceIndices , ref allowVertices , ref faces , default , - 1 ) ) ;
861
+ // steps.Add(new DebugStep(edgeToTest.Endpoints, ref rawFaceVertexIndices, faceNormal, basisX, basisY, ref reducedFaceIndices, ref allowVertices, ref faces, default, -1));
862
862
//Degenerate face found; don't bother creating work for it.
863
863
continue ;
864
864
}
@@ -984,7 +984,7 @@ public static void ComputeHull(Span<Vector3> points, BufferPool pool, out HullDa
984
984
985
985
AddFace ( ref faces , pool , faceNormal , reducedFaceIndices ) ;
986
986
AddFaceToEdgesAndTestList ( pool , ref reducedFaceIndices , ref edgesToTest , ref facesForEdges , faceNormal , faceCountPriorToAdd ) ;
987
- steps . Add ( new DebugStep ( edgeToTest . Endpoints , ref rawFaceVertexIndices , faceNormal , basisX , basisY , ref reducedFaceIndices , ref allowVertices , ref faces , facesNeedingMerge , faceCountPriorToAdd ) ) ;
987
+ // steps.Add(new DebugStep(edgeToTest.Endpoints, ref rawFaceVertexIndices, faceNormal, basisX, basisY, ref reducedFaceIndices, ref allowVertices, ref faces, facesNeedingMerge, faceCountPriorToAdd));
988
988
break ;
989
989
}
990
990
}
0 commit comments