Player characters arent AICharacters in multiplayer, lighting optimization

This commit is contained in:
Regalis11
2015-12-13 18:02:43 +02:00
parent 04cfca0ede
commit c74caadc42
9 changed files with 38 additions and 34 deletions
@@ -125,6 +125,18 @@ namespace Barotrauma.Lights
vertices = points;
}
public bool Intersects(Rectangle rect)
{
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);
}
private void CalculateShadowVertices(Vector2 lightSourcePos, bool los = true)
{
//compute facing of each edge, using N*L