/** * Returns Fractional Brownian Motion at the given position. * * @param x Position on the x-axis * @param y Position on the y-axis * @param z Position on the z-axis * @return The noise value in the range of the base noise function */ @Override public float noise(float x, float y, float z) { float result = 0.0f; float workingX = x; float workingY = y; float workingZ = z; for (int i = 0; i < getOctaves(); i++) { result += other.noise(workingX, workingY, workingZ) * spectralWeights[i]; workingX *= (float) getLacunarity(); workingY *= (float) getLacunarity(); workingZ *= (float) getLacunarity(); } return result * scale; }
/** * Returns Fractional Brownian Motion at the given position. * * @param x Position on the x-axis * @param y Position on the y-axis * @return The noise value in the range of the base noise function */ @Override public float noise(float x, float y) { float result = 0.0f; float workingX = x; float workingY = y; for (int i = 0; i < getOctaves(); i++) { result += other.noise(workingX, workingY) * spectralWeights[i]; workingX *= (float) getLacunarity(); workingY *= (float) getLacunarity(); } return result * scale; }