yarn
yarn copied to clipboard
MathHelper.lerpFromProgress -> map
and clampedLerpFromProgress
-> clampedMap
.
These functions take five values lerpValue, lerpStart, lerpEnd, start, end
and map the lerpValue
from the first range (lerpStart..lerpEnd
) to the second (start..end
). Additionally, clampedLerpFromProgress
clamps it to the new range.
lerpFromProgress
is a very confusing name for this method and doesn't really describe what it does. Processing has an equivalent method, which they call map
, and I think that is much more descriptive. In any case, we should document the method to clarify it.
Also, MathHelper.getLerpProgress(value, from, to)
can be considered normalising a number from a range from..to
to 0..1. (Processing calls this norm
for that reason.)
Though I'm not sure whether renaming it is that useful since you can also think of it as the lerp delta between from
and to
.
I support this rename. "lerp from progress" is really confusing, and I have to look up the method to see in what order the parameters are each time. map
sounds a lot simpler.