v1.4.4.1 (Blood in the Water Update)

This commit is contained in:
Regalis11
2024-04-24 18:09:05 +03:00
parent 89b91d1c3e
commit ff1b8951a7
397 changed files with 15250 additions and 6479 deletions
@@ -248,6 +248,11 @@ namespace Barotrauma
get { return ConvertUnits.ToDisplayUnits(FarseerBody.Position); }
}
/// <summary>
/// Offset of the DrawPosition from the Position (i.e. how much the interpolated draw position is offset from the "actual position"). In display units.
/// </summary>
public Vector2 DrawPositionOffset => DrawPosition - Position;
public Vector2 PrevPosition
{
get { return prevPosition; }
@@ -936,6 +941,24 @@ namespace Barotrauma
ApplyTorque(FarseerBody.Mass * torque);
}
}
/// <summary>
/// Wraps the angle so it has "has the same number of revolutions" as this body, i.e. that the angles are at most 180 degrees apart.
/// For example, if the angle of this body was 720, an angle of 5 would get wrapped to 725.
/// </summary>
public float WrapAngleToSameNumberOfRevolutions(float angle)
{
if (float.IsInfinity(angle)) { return angle; }
while (Rotation - angle > MathHelper.TwoPi)
{
angle += MathHelper.TwoPi;
}
while (Rotation - angle < -MathHelper.TwoPi)
{
angle -= MathHelper.TwoPi;
}
return angle;
}
public void Remove()
{