boolean hasBlock(double density, double x, double y, double z, int seed) { return density >= this.densityThreshold && Noise.gradientCoherentNoise3D(x * this.frequency, y * this.frequency, z * this.frequency, seed ^ this.seedModifier, NoiseQuality.FAST) >= this.noiseThreshold; }
double xPos = xCur + Noise.valueNoise3D(xCur, yCur, zCur, seed); double yPos = yCur + Noise.valueNoise3D(xCur, yCur, zCur, seed + 1); double zPos = zCur + Noise.valueNoise3D(xCur, yCur, zCur, seed + 2); double xDist = xPos - x1; double yDist = yPos - y1; return value + (displacement * Noise.valueNoise3D(Utils.floor(xCandidate), Utils.floor(yCandidate), Utils.floor(zCandidate), seed));
/** * Generates a value-noise value from the coordinates of a three-dimensional input value. * * @param x The @a x coordinate of the input value. * @param y The @a y coordinate of the input value. * @param z The @a z coordinate of the input value. * @param seed A random number seed. * @return The generated value-noise value. * <p/> * The return value ranges from -1.0 to +1.0. * <p/> * A noise function differs from a random-number generator because it always returns the same output value if the same input value is passed to it. */ public static double valueNoise3D(int x, int y, int z, int seed) { return 1.0 - (intValueNoise3D(x, y, z, seed) / 1073741824.0); } }
n0 = gradientNoise3D(x, y, z, x0, y0, z0, seed); n1 = gradientNoise3D(x, y, z, x1, y0, z0, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = gradientNoise3D(x, y, z, x0, y1, z0, seed); n1 = gradientNoise3D(x, y, z, x1, y1, z0, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy0 = Utils.linearInterp(ix0, ix1, ys); n0 = gradientNoise3D(x, y, z, x0, y0, z1, seed); n1 = gradientNoise3D(x, y, z, x1, y0, z1, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = gradientNoise3D(x, y, z, x0, y1, z1, seed); n1 = gradientNoise3D(x, y, z, x1, y1, z1, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy1 = Utils.linearInterp(ix0, ix1, ys);
double xPos = xCur + Noise.valueNoise3D(xCur, yCur, zCur, seed); double yPos = yCur + Noise.valueNoise3D(xCur, yCur, zCur, seed + 1); double zPos = zCur + Noise.valueNoise3D(xCur, yCur, zCur, seed + 2); double xDist = xPos - x1; double yDist = yPos - y1; return value + (displacement * Noise.valueNoise3D(Utils.floor(xCandidate), Utils.floor(yCandidate), Utils.floor(zCandidate), seed));
/** * Generates a value-noise value from the coordinates of a three-dimensional input value. * * @param x The @a x coordinate of the input value. * @param y The @a y coordinate of the input value. * @param z The @a z coordinate of the input value. * @param seed A random number seed. * @return The generated value-noise value. * <p/> * The return value ranges from 0 to 1. * <p/> * A noise function differs from a random-number generator because it always returns the same output value if the same input value is passed to it. */ public static double valueNoise3D(int x, int y, int z, int seed) { return intValueNoise3D(x, y, z, seed) / 2147483647.0; } }
n0 = gradientNoise3D(x, y, z, x0, y0, z0, seed); n1 = gradientNoise3D(x, y, z, x1, y0, z0, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = gradientNoise3D(x, y, z, x0, y1, z0, seed); n1 = gradientNoise3D(x, y, z, x1, y1, z0, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy0 = Utils.linearInterp(ix0, ix1, ys); n0 = gradientNoise3D(x, y, z, x0, y0, z1, seed); n1 = gradientNoise3D(x, y, z, x1, y0, z1, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = gradientNoise3D(x, y, z, x0, y1, z1, seed); n1 = gradientNoise3D(x, y, z, x1, y1, z1, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy1 = Utils.linearInterp(ix0, ix1, ys);
break; if (Noise.gradientCoherentNoise3D(xx * 0.01, 0, zz * 0.01, intSeed ^ layerNumber, NoiseQuality.FAST) < HOLE_THRESHOLD) { layerIteration: for (GroundCoverLayer layer : LAYERS) {
double xPos = xCur + Noise.valueNoise3D(xCur, yCur, zCur, seed); double yPos = yCur + Noise.valueNoise3D(xCur, yCur, zCur, seed + 1); double zPos = zCur + Noise.valueNoise3D(xCur, yCur, zCur, seed + 2); double xDist = xPos - x1; double yDist = yPos - y1; return value + (displacement * Noise.valueNoise3D(Utils.floor(xCandidate), Utils.floor(yCandidate), Utils.floor(zCandidate), seed));
/** * Generates a value-noise value from the coordinates of a three-dimensional input value. * * @param x The @a x coordinate of the input value. * @param y The @a y coordinate of the input value. * @param z The @a z coordinate of the input value. * @param seed A random number seed. * @return The generated value-noise value. * <p/> * The return value ranges from 0 to 1. * <p/> * A noise function differs from a random-number generator because it always returns the same output value if the same input value is passed to it. */ public static double valueNoise3D(int x, int y, int z, int seed) { return intValueNoise3D(x, y, z, seed) / 2147483647.0; } }
n0 = gradientNoise3D(x, y, z, x0, y0, z0, seed); n1 = gradientNoise3D(x, y, z, x1, y0, z0, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = gradientNoise3D(x, y, z, x0, y1, z0, seed); n1 = gradientNoise3D(x, y, z, x1, y1, z0, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy0 = Utils.linearInterp(ix0, ix1, ys); n0 = gradientNoise3D(x, y, z, x0, y0, z1, seed); n1 = gradientNoise3D(x, y, z, x1, y0, z1, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = gradientNoise3D(x, y, z, x0, y1, z1, seed); n1 = gradientNoise3D(x, y, z, x1, y1, z1, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy1 = Utils.linearInterp(ix0, ix1, ys);
boolean hasBlock(double density, double x, double y, double z, int seed) { return density >= this.densityThreshold && Noise.gradientCoherentNoise3D(x * this.frequency, y * this.frequency, z * this.frequency, seed ^ this.seedModifier, NoiseQuality.FAST) >= this.noiseThreshold; }
n0 = valueNoise3D(x0, y0, z0, seed); n1 = valueNoise3D(x1, y0, z0, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = valueNoise3D(x0, y1, z0, seed); n1 = valueNoise3D(x1, y1, z0, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy0 = Utils.linearInterp(ix0, ix1, ys); n0 = valueNoise3D(x0, y0, z1, seed); n1 = valueNoise3D(x1, y0, z1, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = valueNoise3D(x0, y1, z1, seed); n1 = valueNoise3D(x1, y1, z1, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy1 = Utils.linearInterp(ix0, ix1, ys);
signal = Noise.gradientCoherentNoise3D(nx, ny, nz, seed, quality); signal = 2.0 * Math.abs(signal) - 1.0; value += signal * curPersistence;
n0 = valueNoise3D(x0, y0, z0, seed); n1 = valueNoise3D(x1, y0, z0, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = valueNoise3D(x0, y1, z0, seed); n1 = valueNoise3D(x1, y1, z0, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy0 = Utils.linearInterp(ix0, ix1, ys); n0 = valueNoise3D(x0, y0, z1, seed); n1 = valueNoise3D(x1, y0, z1, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = valueNoise3D(x0, y1, z1, seed); n1 = valueNoise3D(x1, y1, z1, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy1 = Utils.linearInterp(ix0, ix1, ys);
signal = Noise.gradientCoherentNoise3D(nx, ny, nz, seed, quality) * 2 - 1; signal = Math.abs(signal); value += signal * curPersistence;
n0 = valueNoise3D(x0, y0, z0, seed); n1 = valueNoise3D(x1, y0, z0, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = valueNoise3D(x0, y1, z0, seed); n1 = valueNoise3D(x1, y1, z0, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy0 = Utils.linearInterp(ix0, ix1, ys); n0 = valueNoise3D(x0, y0, z1, seed); n1 = valueNoise3D(x1, y0, z1, seed); ix0 = Utils.linearInterp(n0, n1, xs); n0 = valueNoise3D(x0, y1, z1, seed); n1 = valueNoise3D(x1, y1, z1, seed); ix1 = Utils.linearInterp(n0, n1, xs); iy1 = Utils.linearInterp(ix0, ix1, ys);
signal = Noise.gradientCoherentNoise3D(nx, ny, nz, seed, quality) * 2 - 1; signal = Math.abs(signal); value += signal * curPersistence;
signal = Noise.gradientCoherentNoise3D(nx, ny, nz, seed, noiseQuality);
signal = Noise.gradientCoherentNoise3D(nx, ny, nz, seed, noiseQuality) * 2 - 1;