v1.4.4.1 (Blood in the Water Update)
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using FarseerPhysics.Dynamics;
|
||||
using Microsoft.Xna.Framework;
|
||||
|
||||
namespace Barotrauma
|
||||
{
|
||||
@@ -15,7 +14,7 @@ namespace Barotrauma
|
||||
public const Category CollisionItemBlocking = Category.Cat6;
|
||||
public const Category CollisionProjectile = Category.Cat7;
|
||||
public const Category CollisionLevel = Category.Cat8;
|
||||
public const Category CollisionRepair = Category.Cat9;
|
||||
public const Category CollisionRepairableWall = Category.Cat9;
|
||||
|
||||
public static float DisplayToRealWorldRatio = 1.0f / 100.0f;
|
||||
|
||||
@@ -61,7 +60,7 @@ namespace Barotrauma
|
||||
category = CollisionLevel;
|
||||
return true;
|
||||
case "repair":
|
||||
category = CollisionRepair;
|
||||
category = CollisionRepairableWall;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user