Controlling humanoid movement with one capsule-shaped physics body that other limbs (attempt to) follow
Broken and WIP
This commit is contained in:
@@ -383,9 +383,16 @@ namespace Barotrauma
|
||||
|
||||
float angle = MathUtils.GetShortestAngle(nextAngle, targetRotation);
|
||||
|
||||
float torque = body.Mass * angle * 60.0f * (force/100.0f);
|
||||
float torque = angle * 60.0f * (force/100.0f);
|
||||
|
||||
body.ApplyTorque(torque);
|
||||
if (body.IsKinematic)
|
||||
{
|
||||
body.AngularVelocity = torque;
|
||||
}
|
||||
else
|
||||
{
|
||||
body.ApplyTorque(body.Mass * torque);
|
||||
}
|
||||
}
|
||||
|
||||
public void Remove()
|
||||
|
||||
Reference in New Issue
Block a user