mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-11 14:21:52 +09:00
skybox: taller grad window, smooth grad clamping
This commit is contained in:
@@ -166,6 +166,19 @@ final public class FastMath {
|
||||
return ((1f - scale) * startValue) + (scale * endValue);
|
||||
}
|
||||
|
||||
public static double interpolateLinear(double scale, double startValue, double endValue) {
|
||||
if (startValue == endValue) {
|
||||
return startValue;
|
||||
}
|
||||
if (scale <= 0.0) {
|
||||
return startValue;
|
||||
}
|
||||
if (scale >= 1.0) {
|
||||
return endValue;
|
||||
}
|
||||
return ((1.0 - scale) * startValue) + (scale * endValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Linear interpolation from startValue to endValue by the given percent.
|
||||
* Basically: ((1 - percent) * startValue) + (percent * endValue)
|
||||
|
||||
Reference in New Issue
Block a user