From 7cd0070d90f9414a95ce001a883af4ffdcc59bd1 Mon Sep 17 00:00:00 2001 From: Daniel Mills Date: Sat, 17 Jul 2021 00:28:37 -0400 Subject: [PATCH] Cancel noise boxes for now... later --- .../iris/engine/interpolation/NoiseBox.java | 59 --------------- .../iris/engine/interpolation/NoiseCube.java | 71 ------------------- 2 files changed, 130 deletions(-) delete mode 100644 src/main/java/com/volmit/iris/engine/interpolation/NoiseBox.java delete mode 100644 src/main/java/com/volmit/iris/engine/interpolation/NoiseCube.java diff --git a/src/main/java/com/volmit/iris/engine/interpolation/NoiseBox.java b/src/main/java/com/volmit/iris/engine/interpolation/NoiseBox.java deleted file mode 100644 index fa6a7daf6..000000000 --- a/src/main/java/com/volmit/iris/engine/interpolation/NoiseBox.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Iris is a World Generator for Minecraft Bukkit Servers - * Copyright (c) 2021 Arcane Arts (Volmit Software) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.volmit.iris.engine.interpolation; - -import com.volmit.iris.util.function.NoiseProvider; - -public class NoiseBox { - private final double[] noise; - private final int w; - - public NoiseBox(int offsetX, int offsetZ, int w, int d, NoiseProvider provider, InterpolationMethod method, int rad) - { - final double[] realNoise; - this.w = w; - int wrad = w/rad; - int drad = d/rad; - noise = new double[w*d]; - realNoise = new double[(wrad+1)*(drad+1)]; - - for(int i = 0; i <= wrad; i++) - { - for(int j = 0; j <= drad; j++) - { - realNoise[(j * wrad) + i] = provider.noise(i, j); - } - } - - NoiseProvider p = (x, z) -> realNoise[(int) ((z * wrad) + x)]; - - for(int i = 0; i < w; i++) - { - for(int j = 0; j < d; j++) - { - noise[(j * w) + i] = IrisInterpolation.getNoise(method, offsetX + i, offsetZ + j, rad, p); - } - } - } - - public double get(int x, int z) - { - return noise[(z * w) + x]; - } -} diff --git a/src/main/java/com/volmit/iris/engine/interpolation/NoiseCube.java b/src/main/java/com/volmit/iris/engine/interpolation/NoiseCube.java deleted file mode 100644 index 4f1609bf6..000000000 --- a/src/main/java/com/volmit/iris/engine/interpolation/NoiseCube.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Iris is a World Generator for Minecraft Bukkit Servers - * Copyright (c) 2021 Arcane Arts (Volmit Software) - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.volmit.iris.engine.interpolation; - -import com.volmit.iris.engine.hunk.Hunk; -import com.volmit.iris.engine.hunk.storage.ArrayHunk; -import com.volmit.iris.util.function.NoiseProvider; -import com.volmit.iris.util.function.NoiseProvider3; - -public class NoiseCube { - private final double[] noise; - private final int w; - private final int h; - - public NoiseCube(int offsetX, int offsetY, int offsetZ, int w, int h, int d, NoiseProvider3 provider, InterpolationMethod3D method, int rad) - { - final double[] realNoise; - this.w = w; - this.h = h; - int wrad = w/rad; - int hrad = h/rad; - int drad = d/rad; - noise = new double[w*h*d]; - realNoise = new double[(wrad+1)*(hrad+1)*(drad+1)]; - - for(int i = 0; i <= wrad; i++) - { - for(int j = 0; j <= hrad; j++) - { - for(int k = 0; k <= drad; k++) - { - realNoise[(k * w * h) + (j * w) + i] = provider.noise(i, j, k); - } - } - } - - NoiseProvider3 p = (x, y, z) -> realNoise[(int) ((z * w * h) + (y * w) + x)]; - - for(int i = 0; i < w; i++) - { - for(int j = 0; j < h; j++) - { - for(int k = 0; k < d; k++) - { - noise[(k * w * h) + (j * w) + i] = IrisInterpolation.getNoise3D(method, offsetX + i, offsetY + j,offsetZ + k, rad, p); - } - } - } - } - - public double get(int x, int y, int z) - { - return noise[(z * w * h) + (y * w) + x]; - } -}