Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetBackHandPosition()

Vector2 Terraria.Player.GetBackHandPosition ( CompositeArmStretchAmount stretch,
float rotation )
inline

Definition at line 47714 of file Player.cs.

47715 {
47716 float num = rotation + (float)Math.PI / 2f;
47717 Vector2 vector = new Vector2((float)Math.Cos(num), (float)Math.Sin(num));
47718 switch (stretch)
47719 {
47720 case CompositeArmStretchAmount.Full:
47721 vector *= new Vector2(10f, 12f);
47722 break;
47723 case CompositeArmStretchAmount.None:
47724 vector *= new Vector2(4f, 6f);
47725 break;
47726 case CompositeArmStretchAmount.Quarter:
47727 vector *= new Vector2(6f, 8f);
47728 break;
47729 case CompositeArmStretchAmount.ThreeQuarters:
47730 vector *= new Vector2(8f, 10f);
47731 break;
47732 }
47733 if (direction == -1)
47734 {
47735 vector += new Vector2(-6f, -2f);
47736 }
47737 else
47738 {
47739 vector += new Vector2(6f, -2f);
47740 }
47741 return MountedCenter + vector;
47742 }
static double Cos(double d)
static double Sin(double a)
const double PI
Definition Math.cs:16
Vector2 MountedCenter
Definition Player.cs:2853

References System.Math.Cos(), System.Math.PI, and System.Math.Sin().