I’m working with a noise function that returns values between -1.0f and 1.0f. I want to Lerp this value into a new coord system from 0 to 1000. In Unity I would use the InverseLerp() like this:
// example values
float x = 0;
float y = 1000;
float xx = 0.3443;
float yy = -0.1743;
Mathf::Lerp(x, y, Mathf::InverseLerp(xx, yy, value));
The above code would basically allow me to “scale up” my values to the new coord system while keeping my ratios the same. UE4 (FMath) does not have this function, so how would I go about doing this?
Very late to this but since I had the same question, the function you want for inverse lerp is FMath::GetRangePct.
FMath::GetMappedRangeValue is effectively the result of an inverse lerp on one range, and a lerp into another range. You can use it by giving it a 0-1 range but that’s a waste since GetRangePctis what it uses internally for the first step.