Characters using FishAnimController twitch for a few seconds after dying

This commit is contained in:
Joonas Rikkonen
2017-06-14 16:27:12 +03:00
parent 680204b2cc
commit f6425a7229
2 changed files with 15 additions and 5 deletions
@@ -702,13 +702,15 @@ namespace Barotrauma
public Vector2 GetCenterOfMass()
{
Vector2 centerOfMass = Vector2.Zero;
float totalMass = 0.0f;
foreach (Limb limb in Limbs)
{
if (limb.IsSevered) continue;
centerOfMass += limb.Mass * limb.SimPosition;
totalMass += limb.Mass;
}
centerOfMass /= Mass;
centerOfMass /= totalMass;
return centerOfMass;
}