Fixed hatch issue with shadows

Added per segment visibility/collision
This commit is contained in:
Sebastian Broberg
2016-03-03 20:18:21 +01:00
parent b081891dc6
commit 467a99f79d
8 changed files with 151 additions and 72 deletions
+2 -1
View File
@@ -175,13 +175,14 @@ namespace Barotrauma.Lights
public bool Intersects(Rectangle rect)
{
if (!Enabled)
return false;
Rectangle transformedBounds = boundingBox;
if (parentEntity != null && parentEntity.Submarine != null)
{
transformedBounds.X += (int)parentEntity.Submarine.Position.X;
transformedBounds.Y += (int)parentEntity.Submarine.Position.Y;
}
return transformedBounds.Intersects(rect);
}