Пример #1
0
        private List <BspSegment> ReadLinesFrom(MapData map)
        {
            List <BspSegment> segments = new List <BspSegment>();

            foreach (MapLinedef line in map.Linedefs)
            {
                MapVertex startMapVertex = map.Vertices[line.StartVertex];
                MapVertex endMapVertex   = map.Vertices[line.EndVertex];

                BspVertex start = VertexAllocator[startMapVertex.Struct()];
                BspVertex end   = VertexAllocator[endMapVertex.Struct()];

                BspSegment segment = SegmentAllocator.GetOrCreate(start, end, line);
                segments.Add(segment);
            }

            return(segments);
        }
Пример #2
0
        protected void HandleMinisegGeneration(BspVertex first, BspVertex second)
        {
            States.VoidStatus = VoidStatus.NotInVoid;

            // If a segment exists for the vertices then we're walking along a
            // segment that was collinear with the splitter, so we don't need a
            // miniseg.
            if (SegmentAllocator.ContainsSegment(first, second))
            {
                return;
            }

            if (JunctionClassifier.CheckCrossingVoid(first, second))
            {
                States.VoidStatus = VoidStatus.InVoid;
            }
            else
            {
                BspSegment miniseg = SegmentAllocator.GetOrCreate(first, second);
                States.Minisegs.Add(miniseg);
            }
        }