Fix incorrect loop back logic in recursive section
This commit is contained in:
parent
f0cec24cf6
commit
74228a2851
|
@ -179,8 +179,8 @@ public class PotentiallyVisibleSet
|
||||||
foreach (var edgeIndex in _portalGraph[currentCellIdx])
|
foreach (var edgeIndex in _portalGraph[currentCellIdx])
|
||||||
{
|
{
|
||||||
var edge = _edges[edgeIndex];
|
var edge = _edges[edgeIndex];
|
||||||
var destination = edge.Left == previousCellIdx ? edge.Right : edge.Left;
|
var loopsBack = edge.Left == previousCellIdx || edge.Right == previousCellIdx;
|
||||||
if (destination == previousCellIdx || previousPoly.IsCoplanar(edge.Poly))
|
if (loopsBack || previousPoly.IsCoplanar(edge.Poly))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -191,6 +191,7 @@ public class PotentiallyVisibleSet
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var destination = edge.Left == currentCellIdx ? edge.Right : edge.Left;
|
||||||
ComputeClippedVisibility(visible, sourcePoly, poly, currentCellIdx, destination, depth + 1);
|
ComputeClippedVisibility(visible, sourcePoly, poly, currentCellIdx, destination, depth + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue