Changed colliders from limbs to normal physics bodies, removed RefLimb

This commit is contained in:
Regalis
2016-10-15 20:08:51 +03:00
parent 1b59d1bc21
commit db8c2b9f8e
12 changed files with 317 additions and 298 deletions
@@ -41,7 +41,7 @@ namespace Barotrauma
public Vector2 Velocity
{
get { return Character.AnimController.RefLimb.LinearVelocity; }
get { return Character.AnimController.Collider.LinearVelocity; }
}
public AiState State
@@ -139,13 +139,12 @@ namespace Barotrauma
}
}
//currentPath.CheckProgress(pos, allowedDistance);
var collider = character.AnimController.GetLimb(LimbType.Collider);
Vector2 colliderBottom = character.AnimController.GetColliderBottom();
var collider = character.AnimController.Collider;
if (Math.Abs(collider.SimPosition.X - currentPath.CurrentNode.SimPosition.X) < collider.body.radius*2 &&
Vector2 colliderBottom = character.AnimController.GetColliderBottom();
if (Math.Abs(collider.SimPosition.X - currentPath.CurrentNode.SimPosition.X) < collider.radius*2 &&
currentPath.CurrentNode.SimPosition.Y > colliderBottom.Y &&
currentPath.CurrentNode.SimPosition.Y < colliderBottom.Y + collider.body.height + collider.body.radius*2)
currentPath.CurrentNode.SimPosition.Y < colliderBottom.Y + collider.height + collider.radius*2)
{
currentPath.SkipToNextNode();
}