#include <cmath>
#include "noise.h"
#include <iostream>
#include <cstring>
#include "debug.h"
#include "util/numeric.h"
#include "util/string.h"
#include "exceptions.h"
Macros | |
#define | NOISE_MAGIC_X 1619 |
#define | NOISE_MAGIC_Y 31337 |
#define | NOISE_MAGIC_Z 52591 |
#define | NOISE_MAGIC_SEED 1013U |
#define | idx(x, y) ((y) * nlx + (x)) |
#define | idx(x, y, z) ((z) * nly * nlx + (y) * nlx + (x)) |
Functions | |
float | noise2d (int x, int y, s32 seed) |
float | noise3d (int x, int y, int z, s32 seed) |
float | dotProduct (float vx, float vy, float wx, float wy) |
float | linearInterpolation (float v0, float v1, float t) |
float | biLinearInterpolation (float v00, float v10, float v01, float v11, float x, float y, bool eased) |
float | triLinearInterpolation (float v000, float v100, float v010, float v110, float v001, float v101, float v011, float v111, float x, float y, float z, bool eased) |
float | noise2d_gradient (float x, float y, s32 seed, bool eased) |
float | noise3d_gradient (float x, float y, float z, s32 seed, bool eased) |
float | noise2d_perlin (float x, float y, s32 seed, int octaves, float persistence, bool eased) |
float | contour (float v) |
float | NoisePerlin2D (const NoiseParams *np, float x, float y, s32 seed) |
float | NoisePerlin3D (const NoiseParams *np, float x, float y, float z, s32 seed) |
Variables | |
FlagDesc | flagdesc_noiseparams [] |
#define idx | ( | x, | |
y ) ((y) * nlx + (x)) |
Referenced by absidx(), call_string_dump(), ModApiEnvBase::collectNodeIds(), find_packer(), ModApiEnvBase::findNodesInArea(), GUIEditBoxWithScrollBar::getCursorPos(), Noise::gradientMap2D(), Noise::gradientMap3D(), LBMManager::loadIntroductionTimes(), ReflowScan::lookupBlock(), pack_inner(), LuaItemStack::packIn(), LuaPerlinNoise::packIn(), LuaPerlinNoiseMap::packIn(), LuaVoxelManip::packIn(), ScriptApiEnv::read_nodenames(), read_pv(), read_tree_def(), record_object(), script_pack(), GUIScene::setTexture(), suitable_key(), and ServerMap::updateVManip().
#define idx | ( | x, | |
y, | |||
z ) ((z) * nly * nlx + (y) * nlx + (x)) |
#define NOISE_MAGIC_Z 52591 |
Referenced by noise3d().
|
inline |
References easeCurve(), and linearInterpolation().
Referenced by Noise::gradientMap2D(), noise2d_gradient(), and triLinearInterpolation().
float contour | ( | float | v | ) |
Referenced by OreVein::generate(), and CavesNoiseIntersection::generateCaves().
|
inline |
|
inline |
Referenced by biLinearInterpolation(), and triLinearInterpolation().
float noise2d | ( | int | x, |
int | y, | ||
s32 | seed ) |
References NOISE_MAGIC_SEED, NOISE_MAGIC_X, and NOISE_MAGIC_Y.
Referenced by MapgenV6::getBiome(), Noise::gradientMap2D(), noise2d_gradient(), TestNoise::testNoise2dAtOriginWithZeroSeed(), TestNoise::testNoise2dWithFunPrimes(), TestNoise::testNoise2dWithMaxSeed(), TestNoise::testNoise3dAtOriginWithZeroSeed(), and TestNoise::testNoise3dWithFunPrimes().
float noise2d_gradient | ( | float | x, |
float | y, | ||
s32 | seed, | ||
bool | eased ) |
References biLinearInterpolation(), myfloor, and noise2d().
Referenced by noise2d_perlin(), and NoisePerlin2D().
float noise2d_perlin | ( | float | x, |
float | y, | ||
s32 | seed, | ||
int | octaves, | ||
float | persistence, | ||
bool | eased ) |
References noise2d_gradient().
Referenced by Clouds::gridFilled().
float noise3d | ( | int | x, |
int | y, | ||
int | z, | ||
s32 | seed ) |
References NOISE_MAGIC_SEED, NOISE_MAGIC_X, NOISE_MAGIC_Y, and NOISE_MAGIC_Z.
Referenced by MapBlockMesh::MapBlockMesh(), Noise::gradientMap3D(), noise3d_gradient(), and TestNoise::testNoise3dWithMaxSeed().
float noise3d_gradient | ( | float | x, |
float | y, | ||
float | z, | ||
s32 | seed, | ||
bool | eased ) |
References myfloor, noise3d(), and triLinearInterpolation().
Referenced by NoisePerlin3D().
float NoisePerlin2D | ( | const NoiseParams * | np, |
float | x, | ||
float | y, | ||
s32 | seed ) |
References NoiseParams::flags, NoiseParams::lacunarity, noise2d_gradient(), NOISE_FLAG_ABSVALUE, NOISE_FLAG_DEFAULTS, NOISE_FLAG_EASED, NoiseParams::octaves, NoiseParams::offset, NoiseParams::persist, NoiseParams::scale, NoiseParams::seed, and NoiseParams::spread.
Referenced by MapgenV7::baseTerrainLevelAtPoint(), BiomeGenOriginal::calcHeatAtPoint(), BiomeGenOriginal::calcHumidityAtPoint(), MapgenV6::generateCaves(), MapgenV6::getHaveAppleTree(), MapgenV7::getMountainTerrainAtPoint(), MapgenCarpathian::getSpawnLevelAtPoint(), MapgenFlat::getSpawnLevelAtPoint(), MapgenFractal::getSpawnLevelAtPoint(), MapgenV5::getSpawnLevelAtPoint(), MapgenV7::getSpawnLevelAtPoint(), MapgenValleys::getSpawnLevelAtPoint(), MapgenV6::getTreeAmount(), LuaPerlinNoise::l_get_2d(), NoisePerlin2D_PO(), Decoration::placeDeco(), and TestNoise::testNoise2dPoint().
float NoisePerlin3D | ( | const NoiseParams * | np, |
float | x, | ||
float | y, | ||
float | z, | ||
s32 | seed ) |
References NoiseParams::flags, NoiseParams::lacunarity, noise3d_gradient(), NOISE_FLAG_ABSVALUE, NOISE_FLAG_EASED, NoiseParams::octaves, NoiseParams::offset, NoiseParams::persist, NoiseParams::scale, NoiseParams::seed, and NoiseParams::spread.
Referenced by CavesRandomWalk::carveRoute(), DungeonGen::generate(), OreScatter::generate(), MapgenBasic::generateDungeons(), MapgenV7::getMountainTerrainAtPoint(), MapgenCarpathian::getSpawnLevelAtPoint(), MapgenV5::getSpawnLevelAtPoint(), MapgenValleys::getSpawnLevelAtPoint(), LuaPerlinNoise::l_get_3d(), MapgenV6::makeChunk(), NoisePerlin3D_PO(), and TestNoise::testNoise3dPoint().
|
inline |
References biLinearInterpolation(), easeCurve(), and linearInterpolation().
Referenced by Noise::gradientMap3D(), and noise3d_gradient().
FlagDesc flagdesc_noiseparams[] |
Referenced by Settings::getNoiseParamsFromGroup(), push_noiseparams(), read_noiseparams(), and Settings::setNoiseParams().