Controlling humanoid movement with one capsule-shaped physics body that other limbs (attempt to) follow

Broken and WIP
This commit is contained in:
Regalis
2016-10-13 23:19:48 +03:00
parent e12fe29f80
commit 62c88be214
9 changed files with 306 additions and 195 deletions
@@ -1,6 +1,7 @@
using System.Xml.Linq;
using FarseerPhysics;
using Microsoft.Xna.Framework;
using System.Collections.Generic;
namespace Barotrauma
{
@@ -9,8 +10,6 @@ namespace Barotrauma
public enum Animation { None, Climbing, UsingConstruction, Struggle, CPR };
public Animation Anim;
public Direction TargetDir;
protected Character character;
protected float walkSpeed, swimSpeed;
@@ -25,6 +24,8 @@ namespace Barotrauma
protected readonly Vector2 stepSize;
protected readonly float legTorque;
public float StunTimer
{
get { return stunTimer; }
@@ -52,6 +53,8 @@ namespace Barotrauma
//impactTolerance = ToolBox.GetAttributeFloat(element, "impacttolerance", 10.0f);
legTorque = ToolBox.GetAttributeFloat(element, "legtorque", 0.0f);
}
public virtual void UpdateAnim(float deltaTime) { }
@@ -59,5 +62,7 @@ namespace Barotrauma
public virtual void HoldItem(float deltaTime, Item item, Vector2[] handlePos, Vector2 holdPos, Vector2 aimPos, bool aim, float holdAngle) { }
public virtual void DragCharacter(Character target, LimbType rightHandTarget = LimbType.RightHand, LimbType leftHandTarget = LimbType.LeftHand) { }
}
}