Esempio n. 1
0
        private PolyTree PostProcessPunchedLand(PolyTree punchedLand)
        {
            void TagSectorSnapshotAndGeometryContext(PolyNode node)
            {
                node.visibilityGraphNodeData.LocalGeometryView = this;
                node.Childs.ForEach(TagSectorSnapshotAndGeometryContext);
            }

            void TagBoundingVolumeHierarchies(PolyNode node)
            {
                var contourEdges = node.Contour.Zip(node.Contour.RotateLeft(), IntLineSegment2.Create).ToArray();
                var bvh          = BvhILS2.Build(contourEdges);

                node.visibilityGraphNodeData.ContourBvh = bvh;
                node.Childs.ForEach(TagBoundingVolumeHierarchies);
            }

            punchedLand.Prune(HoleDilationRadius);
            TagSectorSnapshotAndGeometryContext(punchedLand);
            TagBoundingVolumeHierarchies(punchedLand);
            return(punchedLand);
        }