better walk control

This commit is contained in:
2019-05-19 15:54:46 +02:00
parent c91b885b17
commit 3572c9761a
3 changed files with 5 additions and 0 deletions
Binary file not shown.
Binary file not shown.
+5
View File
@@ -91,6 +91,11 @@ public class Serial3 : MonoBehaviour{
walk.centerRotation = rotation < 0.5f && rotation > -0.5f ? 0 : rotation;
walk.walkDirection = (-1 * ConvertRadiansToDegrees((float) Math.Atan2(b2, b1)));
float rotationabs = Math.Abs(walk.centerRotation);
float speed2 = ((6 / 3) * walk.walkspeed) + ((6/5) * rotationabs);
speed2 = speed2 < 6 ? speed2 : 6;
walk.speed2 = (int)(10 - speed2);
}
}
}