Optimized lightsource raycasts

This commit is contained in:
Regalis
2017-03-03 00:02:43 +02:00
parent f04a00f6e1
commit e059a08688
3 changed files with 84 additions and 68 deletions
+2 -2
View File
@@ -377,10 +377,10 @@ namespace Barotrauma.Lights
{
float closestDist = 0.0f;
Vector2? closestIntersection = null;
foreach (Segment s in segments)
{
Vector2? intersection = MathUtils.GetAxisAlignedLineIntersection(rayStart, rayEnd, s.Start.WorldPos, s.End.WorldPos);
Vector2? intersection = MathUtils.GetAxisAlignedLineIntersection(rayStart, rayEnd, s.Start.WorldPos, s.End.WorldPos, s.IsHorizontal);
if (intersection != null)
{