(7e3aa6097) Merge remote-tracking branch 'origin/docking-interface' into dev

This commit is contained in:
Joonas Rikkonen
2019-05-03 13:48:31 +03:00
parent 8d3a48584b
commit 3701f0e957
12 changed files with 603 additions and 622 deletions
@@ -795,6 +795,18 @@ namespace Barotrauma
return new Vector2((float)x, (float)y);
}
/// <summary>
/// Rotates a point in 2d space around the origin
/// </summary>
public static Vector2 RotatePoint(Vector2 point, float radians)
{
var sin = Math.Sin(radians);
var cos = Math.Cos(radians);
var x = (cos * point.X) - (sin * point.Y);
var y = (sin * point.X) + (cos * point.Y);
return new Vector2((float)x, (float)y);
}
/// <summary>
/// Returns the corners of an imaginary rectangle.
/// Unlike the XNA rectangle, this can be rotated with the up parameter.