(c5f9e6070) Fixed lighting artifacts cause by the LOS changes

This commit is contained in:
Joonas Rikkonen
2019-04-02 12:40:50 +03:00
parent b2c71e92c0
commit 6de0fa4b73
2 changed files with 3 additions and 3 deletions
@@ -407,11 +407,11 @@ namespace Barotrauma.Lights
/// <summary> /// <summary>
/// Returns the segments that are facing towards viewPosition /// Returns the segments that are facing towards viewPosition
/// </summary> /// </summary>
public void GetVisibleSegments(Vector2 viewPosition, List<Segment> visibleSegments) public void GetVisibleSegments(Vector2 viewPosition, List<Segment> visibleSegments, bool ignoreEdges)
{ {
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
if (ignoreEdge[i]) continue; if (ignoreEdge[i] && ignoreEdges) continue;
Vector2 pos1 = vertices[i].WorldPos; Vector2 pos1 = vertices[i].WorldPos;
Vector2 pos2 = vertices[(i + 1) % 4].WorldPos; Vector2 pos2 = vertices[(i + 1) % 4].WorldPos;
@@ -453,7 +453,7 @@ namespace Barotrauma.Lights
foreach (ConvexHull hull in hulls) foreach (ConvexHull hull in hulls)
{ {
hull.RefreshWorldPositions(); hull.RefreshWorldPositions();
hull.GetVisibleSegments(drawPos, visibleSegments); hull.GetVisibleSegments(drawPos, visibleSegments, ignoreEdges: false);
} }
//Generate new points at the intersections between segments //Generate new points at the intersections between segments