Isosurface.ManifoldDC.OctreeNode.GatherVertices C# (CSharp) Method

GatherVertices() public static method

public static GatherVertices ( OctreeNode n, List dest, int &surface_index ) : void
n OctreeNode
dest List
surface_index int
return void
        public static void GatherVertices(OctreeNode n, List<Vertex> dest, ref int surface_index)
        {
            if (n == null)
                return;
            if (n.size > 1)
            {
                for (int i = 0; i < 8; i++)
                    GatherVertices(n.children[i], dest, ref surface_index);
            }
            else
            {
                foreach (Vertex v in n.vertices)
                {
                    if (v.surface_index == -1)
                    {
                        v.surface_index = surface_index++;
                        dest.Add(v);
                    }
                }
            }
        }