Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ GetPointOnSwungItemPath()

void Terraria.Player.GetPointOnSwungItemPath ( float spriteWidth,
float spriteHeight,
float normalizedPointOnPath,
float itemScale,
out Vector2 location,
out Vector2 outwardDirection )
inlineprivate

Definition at line 42553 of file Player.cs.

42554 {
42555 float num = (float)Math.Sqrt(spriteWidth * spriteWidth + spriteHeight * spriteHeight);
42556 float num2 = (float)(direction == 1).ToInt() * ((float)Math.PI / 2f);
42557 if (gravDir == -1f)
42558 {
42559 num2 += (float)Math.PI / 2f * (float)direction;
42560 }
42561 outwardDirection = itemRotation.ToRotationVector2().RotatedBy(3.926991f + num2);
42563 }
static double Sqrt(double d)
const double PI
Definition Math.cs:16
float itemRotation
Definition Player.cs:1177
Vector2 RotatedRelativePoint(Vector2 pos, bool reverseRotation=false, bool addGfxOffY=true)
Definition Player.cs:3618
Vector2 itemLocation
Definition Player.cs:1183

References System.Math.PI, and System.Math.Sqrt().