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

◆ GetFrontHandPosition()

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

Definition at line 47682 of file Player.cs.

47683 {
47684 float num = rotation + (float)Math.PI / 2f;
47685 Vector2 vector = new Vector2((float)Math.Cos(num), (float)Math.Sin(num));
47686 switch (stretch)
47687 {
47688 case CompositeArmStretchAmount.Full:
47689 vector *= 10f;
47690 break;
47691 case CompositeArmStretchAmount.None:
47692 vector *= 4f;
47693 break;
47694 case CompositeArmStretchAmount.Quarter:
47695 vector *= 6f;
47696 break;
47697 case CompositeArmStretchAmount.ThreeQuarters:
47698 vector *= 8f;
47699 break;
47700 }
47701 if (direction == -1)
47702 {
47703 vector += new Vector2(4f, -2f);
47704 vector += new Vector2(0f, -3f).RotatedBy(rotation + (float)Math.PI / 2f);
47705 }
47706 else
47707 {
47708 vector += new Vector2(-4f, -2f);
47709 vector += new Vector2(0f, 3f).RotatedBy(rotation + (float)Math.PI / 2f);
47710 }
47711 return MountedCenter + vector;
47712 }
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().