Mountains

This commit is contained in:
paulevsGitch 2020-10-07 04:48:49 +03:00
parent 20bb6379bf
commit 466dd6604d
10 changed files with 198 additions and 39 deletions

View file

@ -100,4 +100,16 @@ public class MHelper {
public static float dot(float x1, float y1, float x2, float y2) {
return x1 * x2 + y1 * y2;
}
public static int getSeed(int seed, int x, int y) {
int h = seed + x * 374761393 + y * 668265263;
h = (h ^ (h >> 13)) * 1274126177;
return h ^ (h >> 16);
}
public static int getSeed(int seed, int x, int y, int z) {
int h = seed + x * 374761393 + y * 668265263 + z;
h = (h ^ (h >> 13)) * 1274126177;
return h ^ (h >> 16);
}
}

View file

@ -156,8 +156,6 @@ public abstract class SDF {
}
public void fillRecursive(StructureWorld world, BlockPos start) {
long t = System.currentTimeMillis();
Map<BlockPos, PosInfo> mapWorld = Maps.newHashMap();
Map<BlockPos, PosInfo> addInfo = Maps.newHashMap();
Set<BlockPos> blocks = Sets.newHashSet();
@ -206,8 +204,5 @@ public abstract class SDF {
BlockState state = postProcess.apply(info);
world.setBlock(info.getPos(), state);
});
t = System.currentTimeMillis() - t;
System.out.println("SDF " + t + " ms");
}
}