mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
replace ChunkInterpolator mod by 4 with and by 3
This commit is contained in:
@@ -133,6 +133,10 @@ public class ChunkInterpolator {
|
||||
}
|
||||
|
||||
public double getNoise(int x, int y, int z) {
|
||||
return interpGrid[x / 4][(y - min) / 4][z / 4].trilerp((double) (x % 4) / 4, (double) (y % 4) / 4, (double) (z % 4) / 4);
|
||||
return interpGrid[x / 4][(y - min) / 4][z / 4].trilerp(
|
||||
(double) (x & 3) / 4, // x & 3 == x % 4
|
||||
(double) (y & 3) / 4, // x & 3 == x % 4
|
||||
(double) (z & 3) / 4 // x & 3 == x % 4
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user