(3dc4135ce) v0.9.5.1
This commit is contained in:
@@ -18,6 +18,51 @@ namespace Barotrauma
|
||||
|
||||
public static float DisplayToRealWorldRatio = 1.0f / 80.0f;
|
||||
|
||||
public const float DisplayToSimRation = 100.0f;
|
||||
public const float DisplayToSimRation = 100.0f;
|
||||
|
||||
public static bool TryParseCollisionCategory(string categoryName, out Category category)
|
||||
{
|
||||
category = Category.None;
|
||||
if (string.IsNullOrEmpty(categoryName))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
switch (categoryName.ToLowerInvariant())
|
||||
{
|
||||
case "all":
|
||||
category = CollisionAll;
|
||||
return true;
|
||||
case "wall":
|
||||
case "structure":
|
||||
category = CollisionWall;
|
||||
return true;
|
||||
case "character":
|
||||
category = CollisionCharacter;
|
||||
return true;
|
||||
case "platform":
|
||||
category = CollisionPlatform;
|
||||
return true;
|
||||
case "stairs":
|
||||
category = CollisionStairs;
|
||||
return true;
|
||||
case "item":
|
||||
category = CollisionItem;
|
||||
return true;
|
||||
case "itemblocking":
|
||||
category = CollisionItemBlocking;
|
||||
return true;
|
||||
case "projectile":
|
||||
category = CollisionProjectile;
|
||||
return true;
|
||||
case "level":
|
||||
category = CollisionLevel;
|
||||
return true;
|
||||
case "repair":
|
||||
category = CollisionRepair;
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -445,7 +445,7 @@ namespace Barotrauma
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
return spritesheetRotation == 0 ? pos : Vector2.Transform(pos, Matrix.CreateRotationZ(spritesheetRotation));
|
||||
return spritesheetRotation == 0 ? pos : Vector2.Transform(pos, Matrix.CreateRotationZ(-spritesheetRotation));
|
||||
}
|
||||
|
||||
public float GetMaxExtent()
|
||||
@@ -654,9 +654,9 @@ namespace Barotrauma
|
||||
if (newSpeedSqr > maxVelocity * maxVelocity)
|
||||
{
|
||||
newVelocity = newVelocity.ClampLength(maxVelocity);
|
||||
force = (newVelocity - body.LinearVelocity) * Mass / (float)Timing.Step;
|
||||
}
|
||||
|
||||
Vector2 clampedForce = (newVelocity - body.LinearVelocity) * Mass / (float)Timing.Step;
|
||||
if (!IsValidValue(force, "clamped force", -1e10f, 1e10f)) return;
|
||||
body.ApplyForce(force);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user