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
)
inline
static
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 * 2
f
;
1956
}
1957
}
1958
else
if
(
curAngle
-
targetAngle
> (
float
)
Math
.PI)
1959
{
1960
curAngle
-= (float)
Math
.PI * 2
f
;
1961
}
1962
curAngle
+=
MathHelper
.Clamp(
targetAngle
-
curAngle
, 0
f
-
maxChange
,
maxChange
);
1963
return
MathHelper
.WrapAngle(
curAngle
);
1964
}
List
Terraria
Utils
Generated by
1.10.0