FMath
is a class with static member functions, meaning you don’t need an instance of FMath
to call it.
class Example
{
static int GetStatic() { return 10; }
int GetNonStatic() { return 20; }
};
int main()
{
int V1 = Example::GetStatic(); // V == 10
int V2 = Example::GetNonStatic(); // Error! GetNonStatic needs an instance of Example
Example E;
int V2 = E.GetNonStatic(); // 👍
}
The time since the last frame.
Lerp is just a linear interpolation between 2 values.
FMath::Lerp(5, 10, 0.5);
Would return 7.5 as that is half way between 5 and 10.
FMath::Lerp(5, 10, 0.25);
Would return 6.25 as that is a quarter of the way between 5 and 10.
FMath::InterpTo
interpolates between two values using a delta time and speed to calculate the values. It starts strong and eases out. e.g. (using between 5 and 10 again and some unknown speed/deltatime)
5
7 # diff of 2
8 # diff of 1
8.5 # diff of 0.5
8.75 # diff of 0.25
FMath::InterpConstantTo
interpolates between two values with a constant step e.g.
# always +1
5
6
7
8
9
10