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

◆ AngleTowards()

static float Terraria.Utils.AngleTowards ( this float curAngle,
float targetAngle,
float maxChange )
inlinestatic

Definition at line 1459 of file Utils.cs.

1460 {
1463 if (curAngle < targetAngle)
1464 {
1465 if (targetAngle - curAngle > (float)Math.PI)
1466 {
1467 curAngle += (float)Math.PI * 2f;
1468 }
1469 }
1470 else if (curAngle - targetAngle > (float)Math.PI)
1471 {
1472 curAngle -= (float)Math.PI * 2f;
1473 }
1476 }
static float WrapAngle(float angle)
Definition MathHelper.cs:87
static float Clamp(float value, float min, float max)
Definition MathHelper.cs:46
const double PI
Definition Math.cs:16

References Microsoft.Xna.Framework.MathHelper.Clamp(), System.Math.PI, and Microsoft.Xna.Framework.MathHelper.WrapAngle().