Skip to content

Commit

Permalink
Fixed|Resources|BSP Builder: Uncaught exception loading HYMN_BV2.wad …
Browse files Browse the repository at this point in the history
…E1M6

This map contains several instances of a particularly nasty construct
from the point of view of a BSP builder -- two-sided lines facing out
into the void. Such constructs will invariably result in degenerate
BSP leafs.

Should such a degenerate (i.e., zero-area) leaf consist of multiple
line segments the angle-sorted order cannot be trusted and so overlap
splitting should not be attempted.

For now we will simply skip splitting of each segment if the would-be
coordinates are equal to those of either of the segment's vertexes.

Todo for later: Implement an algorithm to detect and exclude these at
an earlier point.
  • Loading branch information
danij-deng committed Jul 17, 2013
1 parent 3cf688c commit 8ea59ed
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions doomsday/client/src/world/bsp/partitioner.cpp
Expand Up @@ -1219,8 +1219,20 @@ DENG2_PIMPL(Partitioner)
if(de::fequal(b.segment->length(), a.segment->length()))
continue;

splitLineSegment(*a.segment, b.segment->to().origin(),
false /*don't update edge tips*/);
// Do not attempt to split at an existing vertex.
/// @todo fixme: For this to happen we *must* be dealing with
/// an invalid mapping construct such as a two-sided line in
/// the void. These cannot be dealt with here as they require
/// a detection algorithm ran prior to splitting overlaps (so
/// that we can skip them here). Presently it is sufficient to
/// simply not split if the would-be split point is equal to
/// either of the segment's existing vertexes.
Vector2d const &point = b.segment->to().origin();
if(point == a.segment->from().origin() ||
point == a.segment->to().origin())
continue;

splitLineSegment(*a.segment, point, false /*don't update edge tips*/);
}
}

Expand Down

0 comments on commit 8ea59ed

Please sign in to comment.