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

◆ AngleTowards()

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

Definition at line 1947 of file Utils.cs.

1948 {
1949 curAngle = MathHelper.WrapAngle(curAngle);
1950 targetAngle = MathHelper.WrapAngle(targetAngle);
1951 if (curAngle < targetAngle)
1952 {
1953 if (targetAngle - curAngle > (float)Math.PI)
1954 {
1955 curAngle += (float)Math.PI * 2f;
1956 }
1957 }
1958 else if (curAngle - targetAngle > (float)Math.PI)
1959 {
1960 curAngle -= (float)Math.PI * 2f;
1961 }
1963 return MathHelper.WrapAngle(curAngle);
1964 }