Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
CavesRandomWalk Class Reference

#include <cavegen.h>

+ Collaboration diagram for CavesRandomWalk:

Public Member Functions

 CavesRandomWalk (const NodeDefManager *ndef, GenerateNotifier *gennotify=NULL, s32 seed=0, int water_level=1, content_t water_source=CONTENT_IGNORE, content_t lava_source=CONTENT_IGNORE, float large_cave_flooded=0.5f, BiomeGen *biomegen=NULL)
 
void makeCave (MMVManip *vm, v3s16 nmin, v3s16 nmax, PseudoRandom *ps, bool is_large_cave, int max_stone_height, s16 *heightmap)
 

Public Attributes

MMVManipvm
 
const NodeDefManagerndef
 
GenerateNotifiergennotify
 
s16 * heightmap
 
BiomeGenbmgn
 
s32 seed
 
int water_level
 
float large_cave_flooded
 
NoiseParamsnp_caveliquids
 
u16 ystride
 
s16 min_tunnel_diameter
 
s16 max_tunnel_diameter
 
u16 tunnel_routepoints
 
int part_max_length_rs
 
bool large_cave
 
bool large_cave_is_flat
 
bool flooded
 
bool use_biome_liquid
 
v3s16 node_min
 
v3s16 node_max
 
v3f orp
 
v3s16 of
 
v3s16 ar
 
s16 rs
 
v3f main_direction
 
s16 route_y_min
 
s16 route_y_max
 
PseudoRandomps
 
content_t c_water_source
 
content_t c_lava_source
 
content_t c_biome_liquid
 

Private Member Functions

void makeTunnel (bool dirswitch)
 
void carveRoute (v3f vec, float f, bool randomize_xz)
 
bool isPosAboveSurface (v3s16 p)
 

Constructor & Destructor Documentation

◆ CavesRandomWalk()

CavesRandomWalk::CavesRandomWalk ( const NodeDefManager * ndef,
GenerateNotifier * gennotify = NULL,
s32 seed = 0,
int water_level = 1,
content_t water_source = CONTENT_IGNORE,
content_t lava_source = CONTENT_IGNORE,
float large_cave_flooded = 0.5f,
BiomeGen * biomegen = NULL )

References bmgn, c_lava_source, c_water_source, CONTENT_AIR, CONTENT_IGNORE, gennotify, NodeDefManager::getId(), large_cave_flooded, ndef, np_caveliquids, nparams_caveliquids, seed, and water_level.

+ Here is the call graph for this function:

Member Function Documentation

◆ carveRoute()

void CavesRandomWalk::carveRoute ( v3f vec,
float f,
bool randomize_xz )
private

References c_biome_liquid, c_lava_source, c_water_source, VoxelArea::contains(), CONTENT_AIR, CONTENT_IGNORE, flooded, NodeDefManager::get(), MapNode::getContent(), VoxelArea::index(), ContentFeatures::is_ground_content, large_cave, large_cave_is_flat, VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, MAP_BLOCKSIZE, MYMAX, ndef, node_max, node_min, NoisePerlin3D(), np_caveliquids, of, orp, p(), ps, PseudoRandom::range(), rs, seed, use_biome_liquid, vm, VMANIP_FLAG_CAVE, and water_level.

Referenced by makeTunnel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isPosAboveSurface()

bool CavesRandomWalk::isPosAboveSurface ( v3s16 p)
inlineprivate

References heightmap, node_max, node_min, p(), water_level, and ystride.

Referenced by makeTunnel().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeCave()

void CavesRandomWalk::makeCave ( MMVManip * vm,
v3s16 nmin,
v3s16 nmax,
PseudoRandom * ps,
bool is_large_cave,
int max_stone_height,
s16 * heightmap )

References GenerateNotifier::addEvent(), ar, bmgn, c_biome_liquid, Biome::c_cave_liquid, CONTENT_AIR, CONTENT_IGNORE, flooded, gennotify, GENNOTIFY_CAVE_BEGIN, GENNOTIFY_CAVE_END, GENNOTIFY_LARGECAVE_BEGIN, GENNOTIFY_LARGECAVE_END, BiomeGen::getBiomeAtPoint(), heightmap, large_cave, large_cave_flooded, large_cave_is_flat, main_direction, makeTunnel(), MAP_BLOCKSIZE, max_tunnel_diameter, min_tunnel_diameter, MYMAX, PseudoRandom::next(), node_max, node_min, of, orp, part_max_length_rs, ps, PseudoRandom::range(), rangelim, route_y_max, route_y_min, tunnel_routepoints, use_biome_liquid, vm, water_level, and ystride.

Referenced by MapgenBasic::generateCavesRandomWalk().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ makeTunnel()

void CavesRandomWalk::makeTunnel ( bool dirswitch)
private

References ar, carveRoute(), isPosAboveSurface(), large_cave, main_direction, max_tunnel_diameter, min_tunnel_diameter, PseudoRandom::next(), of, orp, part_max_length_rs, ps, PseudoRandom::range(), route_y_max, route_y_min, and rs.

Referenced by makeCave().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ ar

v3s16 CavesRandomWalk::ar

Referenced by makeCave(), and makeTunnel().

◆ bmgn

BiomeGen* CavesRandomWalk::bmgn

Referenced by CavesRandomWalk(), and makeCave().

◆ c_biome_liquid

content_t CavesRandomWalk::c_biome_liquid

Referenced by carveRoute(), and makeCave().

◆ c_lava_source

content_t CavesRandomWalk::c_lava_source

Referenced by CavesRandomWalk(), and carveRoute().

◆ c_water_source

content_t CavesRandomWalk::c_water_source

Referenced by CavesRandomWalk(), and carveRoute().

◆ flooded

bool CavesRandomWalk::flooded

Referenced by carveRoute(), and makeCave().

◆ gennotify

GenerateNotifier* CavesRandomWalk::gennotify

Referenced by CavesRandomWalk(), and makeCave().

◆ heightmap

s16* CavesRandomWalk::heightmap

Referenced by isPosAboveSurface(), and makeCave().

◆ large_cave

bool CavesRandomWalk::large_cave

Referenced by carveRoute(), makeCave(), and makeTunnel().

◆ large_cave_flooded

float CavesRandomWalk::large_cave_flooded

Referenced by CavesRandomWalk(), and makeCave().

◆ large_cave_is_flat

bool CavesRandomWalk::large_cave_is_flat

Referenced by carveRoute(), and makeCave().

◆ main_direction

v3f CavesRandomWalk::main_direction

Referenced by makeCave(), and makeTunnel().

◆ max_tunnel_diameter

s16 CavesRandomWalk::max_tunnel_diameter

Referenced by makeCave(), and makeTunnel().

◆ min_tunnel_diameter

s16 CavesRandomWalk::min_tunnel_diameter

Referenced by makeCave(), and makeTunnel().

◆ ndef

const NodeDefManager* CavesRandomWalk::ndef

Referenced by CavesRandomWalk(), and carveRoute().

◆ node_max

v3s16 CavesRandomWalk::node_max

◆ node_min

v3s16 CavesRandomWalk::node_min

◆ np_caveliquids

NoiseParams* CavesRandomWalk::np_caveliquids

Referenced by CavesRandomWalk(), and carveRoute().

◆ of

v3s16 CavesRandomWalk::of

Referenced by carveRoute(), makeCave(), and makeTunnel().

◆ orp

v3f CavesRandomWalk::orp

Referenced by carveRoute(), makeCave(), and makeTunnel().

◆ part_max_length_rs

int CavesRandomWalk::part_max_length_rs

Referenced by makeCave(), and makeTunnel().

◆ ps

PseudoRandom* CavesRandomWalk::ps

Referenced by carveRoute(), makeCave(), and makeTunnel().

◆ route_y_max

s16 CavesRandomWalk::route_y_max

Referenced by makeCave(), and makeTunnel().

◆ route_y_min

s16 CavesRandomWalk::route_y_min

Referenced by makeCave(), and makeTunnel().

◆ rs

s16 CavesRandomWalk::rs

Referenced by carveRoute(), and makeTunnel().

◆ seed

s32 CavesRandomWalk::seed

Referenced by CavesRandomWalk(), and carveRoute().

◆ tunnel_routepoints

u16 CavesRandomWalk::tunnel_routepoints

Referenced by makeCave().

◆ use_biome_liquid

bool CavesRandomWalk::use_biome_liquid

Referenced by carveRoute(), and makeCave().

◆ vm

MMVManip* CavesRandomWalk::vm

Referenced by carveRoute(), and makeCave().

◆ water_level

int CavesRandomWalk::water_level

◆ ystride

u16 CavesRandomWalk::ystride

Referenced by isPosAboveSurface(), and makeCave().


The documentation for this class was generated from the following files: