AI combat, misc AI improvements, characters can't get stuck inside doors

This commit is contained in:
Regalis
2015-12-03 18:34:35 +02:00
parent 11857f894b
commit 5bcdfa2b56
36 changed files with 461 additions and 292 deletions

View File

@@ -250,10 +250,13 @@ namespace Barotrauma
float shortestAngle = leg.Rotation - torso.Rotation;
if (Math.Abs(shortestAngle)<2.5f) continue;
//leg = GetLimb((i == 0) ? LimbType.LeftLeg : LimbType.RightLeg);
if (Math.Abs(shortestAngle)<2.4f) continue;
leg.body.ApplyTorque(-shortestAngle*10.0f);
leg = GetLimb((i == 0) ? LimbType.LeftThigh : LimbType.RightThigh);
leg.body.ApplyTorque(-shortestAngle * 5.0f);
// float torsoRot = MathHelper.WrapAngle(torso.Rotation);
// torsoRot = MathHelper.ToDegrees(torsoRot);