Fix the flatmap scaling issues
This commit is contained in:
parent
861ebad1ea
commit
760de4af24
@ -158,9 +158,9 @@ public class ScalableHeightMap {
|
|||||||
newData[index] = centerY;
|
newData[index] = centerY;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
raise = (yscale * raise);
|
double raisePow = Math.pow(raise, yscale);
|
||||||
int diff = targetY - height;
|
int diff = targetY - height;
|
||||||
double raiseScaled = diff * (Math.pow(raise, yscale) / sizePow);
|
double raiseScaled = diff * (raisePow / sizePow);
|
||||||
double raiseScaledAbs = Math.abs(raiseScaled);
|
double raiseScaledAbs = Math.abs(raiseScaled);
|
||||||
int random = PseudoRandom.random.random(256) < (int) ((Math.ceil(raiseScaledAbs) - Math.floor(raiseScaledAbs)) * 256) ? (diff > 0 ? 1 : -1) : 0;
|
int random = PseudoRandom.random.random(256) < (int) ((Math.ceil(raiseScaledAbs) - Math.floor(raiseScaledAbs)) * 256) ? (diff > 0 ? 1 : -1) : 0;
|
||||||
int raiseScaledInt = (int) raiseScaled + random;
|
int raiseScaledInt = (int) raiseScaled + random;
|
||||||
|
Loading…
Reference in New Issue
Block a user