Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
VoxelManipulator Class Reference

#include <voxel.h>

+ Inheritance diagram for VoxelManipulator:
+ Collaboration diagram for VoxelManipulator:

Public Member Functions

 VoxelManipulator ()=default
 
virtual ~VoxelManipulator ()
 
MapNode getNode (const v3s16 &p)
 
MapNode getNodeNoEx (const v3s16 &p)
 
MapNode getNodeNoExNoEmerge (const v3s16 &p) const
 
MapNodegetNodeRefUnsafe (const v3s16 &p)
 
const MapNodegetNodeRefUnsafeCheckFlags (const v3s16 &p) const
 
u8 & getFlagsRefUnsafe (const v3s16 &p)
 
bool exists (const v3s16 &p)
 
void setNode (const v3s16 &p, const MapNode &n)
 
bool setNodeNoEmerge (const v3s16 &p, MapNode n)
 
virtual void clear ()
 
void print (std::ostream &o, const NodeDefManager *nodemgr, VoxelPrintMode mode=VOXELPRINT_MATERIAL) const
 
void addArea (const VoxelArea &area)
 
void setFlags (const VoxelArea &area, u8 flag)
 
void clearFlags (const VoxelArea &area, u8 flag)
 
void copyFrom (MapNode *src, const VoxelArea &src_area, v3s16 from_pos, v3s16 to_pos, const v3s16 &size)
 
void copyTo (MapNode *dst, const VoxelArea &dst_area, v3s16 dst_pos, v3s16 from_pos, const v3s16 &size) const
 

Public Attributes

VoxelArea m_area
 
MapNodem_data = nullptr
 
u8 * m_flags = nullptr
 

Static Public Attributes

static const MapNode ContentIgnoreNode = MapNode(CONTENT_IGNORE)
 

Constructor & Destructor Documentation

◆ VoxelManipulator()

VoxelManipulator::VoxelManipulator ( )
default

◆ ~VoxelManipulator()

VoxelManipulator::~VoxelManipulator ( )
virtual

References clear().

+ Here is the call graph for this function:

Member Function Documentation

◆ addArea()

void VoxelManipulator::addArea ( const VoxelArea & area)

References VoxelArea::addArea(), VoxelArea::contains(), VoxelArea::getVolume(), VoxelArea::hasEmptyExtent(), VoxelArea::index(), m_area, m_data, m_flags, VoxelArea::MaxEdge, VoxelArea::MinEdge, and VOXELFLAG_NO_DATA.

Referenced by MeshMakeData::fillBlockDataBegin(), getNode(), getNodeNoEx(), MMVManip::initialEmerge(), setNode(), and TestVoxelManipulator::testVoxelManipulator().

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

◆ clear()

void VoxelManipulator::clear ( )
virtual

Reimplemented in MMVManip.

References VoxelArea::getVolume(), m_area, m_data, m_flags, and porting::TrackFreedMemory().

Referenced by ~VoxelManipulator(), MMVManip::clear(), and MeshMakeData::fillBlockDataBegin().

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

◆ clearFlags()

void VoxelManipulator::clearFlags ( const VoxelArea & area,
u8 flag )

References VoxelArea::contains(), VoxelArea::getExtent(), VoxelArea::hasEmptyExtent(), VoxelArea::index(), m_area, m_flags, VoxelArea::MaxEdge, and VoxelArea::MinEdge.

Referenced by DungeonGen::generate().

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

◆ copyFrom()

void VoxelManipulator::copyFrom ( MapNode * src,
const VoxelArea & src_area,
v3s16 from_pos,
v3s16 to_pos,
const v3s16 & size )

References VoxelArea::getExtent(), VoxelArea::index(), m_area, m_data, and m_flags.

Referenced by MapBlock::copyTo(), and MeshMakeData::fillBlockData().

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

◆ copyTo()

void VoxelManipulator::copyTo ( MapNode * dst,
const VoxelArea & dst_area,
v3s16 dst_pos,
v3s16 from_pos,
const v3s16 & size ) const

References CONTENT_IGNORE, VoxelArea::index(), m_area, and m_data.

Referenced by MapBlock::copyFrom().

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

◆ exists()

bool VoxelManipulator::exists ( const v3s16 & p)
inline

References VoxelArea::contains(), getFlagsRefUnsafe(), m_area, p(), and VOXELFLAG_NO_DATA.

+ Here is the call graph for this function:

◆ getFlagsRefUnsafe()

u8 & VoxelManipulator::getFlagsRefUnsafe ( const v3s16 & p)
inline

References VoxelArea::index(), m_area, m_flags, and p().

Referenced by exists().

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

◆ getNode()

MapNode VoxelManipulator::getNode ( const v3s16 & p)
inline

References addArea(), VoxelArea::index(), m_area, m_data, m_flags, p(), and VOXELFLAG_NO_DATA.

Referenced by TestVoxelManipulator::testVoxelManipulator().

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

◆ getNodeNoEx()

MapNode VoxelManipulator::getNodeNoEx ( const v3s16 & p)
inline

◆ getNodeNoExNoEmerge()

MapNode VoxelManipulator::getNodeNoExNoEmerge ( const v3s16 & p) const
inline

References VoxelArea::contains(), CONTENT_IGNORE, VoxelArea::index(), m_area, m_data, m_flags, p(), and VOXELFLAG_NO_DATA.

Referenced by voxalgo::blit_back_with_light(), MapblockMeshGenerator::drawGlasslikeNode(), DungeonGen::findPlaceForDoor(), getSmoothLightCombined(), and LuaVoxelManip::l_get_node_at().

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

◆ getNodeRefUnsafe()

MapNode & VoxelManipulator::getNodeRefUnsafe ( const v3s16 & p)
inline

References VoxelArea::index(), m_area, m_data, and p().

Referenced by get_solid_sides().

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

◆ getNodeRefUnsafeCheckFlags()

const MapNode & VoxelManipulator::getNodeRefUnsafeCheckFlags ( const v3s16 & p) const
inline

References ContentIgnoreNode, VoxelArea::index(), m_area, m_data, m_flags, p(), and VOXELFLAG_NO_DATA.

+ Here is the call graph for this function:

◆ print()

void VoxelManipulator::print ( std::ostream & o,
const NodeDefManager * nodemgr,
VoxelPrintMode mode = VOXELPRINT_MATERIAL ) const

References CONTENT_AIR, NodeDefManager::get(), MapNode::getContent(), VoxelArea::getExtent(), MapNode::getLight(), NodeDefManager::getLightingFlags(), VoxelArea::index(), ContentFeatures::isLiquid(), ContentFeatures::light_propagates, ContentFeatures::light_source, LIGHTBANK_DAY, m_area, m_data, m_flags, VoxelArea::MaxEdge, VoxelArea::MinEdge, MapNode::param2, VOXELFLAG_NO_DATA, VOXELPRINT_LIGHT_DAY, VOXELPRINT_MATERIAL, and VOXELPRINT_WATERPRESSURE.

Referenced by TestVoxelManipulator::testVoxelManipulator().

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

◆ setFlags()

void VoxelManipulator::setFlags ( const VoxelArea & area,
u8 flag )

References VoxelArea::contains(), VoxelArea::getExtent(), VoxelArea::hasEmptyExtent(), VoxelArea::index(), m_area, m_flags, VoxelArea::MaxEdge, and VoxelArea::MinEdge.

Referenced by MMVManip::initialEmerge().

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

◆ setNode()

void VoxelManipulator::setNode ( const v3s16 & p,
const MapNode & n )
inline

References addArea(), VoxelArea::index(), m_area, m_data, m_flags, and p().

Referenced by TestVoxelManipulator::testVoxelManipulator().

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

◆ setNodeNoEmerge()

bool VoxelManipulator::setNodeNoEmerge ( const v3s16 & p,
MapNode n )
inline

References VoxelArea::contains(), VoxelArea::index(), m_area, m_data, and p().

Referenced by LuaVoxelManip::l_set_node_at(), TEST_CASE(), and TestVoxelAlgorithms::testLighting().

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

Member Data Documentation

◆ ContentIgnoreNode

const MapNode VoxelManipulator::ContentIgnoreNode = MapNode(CONTENT_IGNORE)
static

◆ m_area

VoxelArea VoxelManipulator::m_area

Referenced by addArea(), MapgenV6::addMud(), voxalgo::blit_back_with_light(), MMVManip::blitBackAll(), Schematic::blitToVManip(), ModApiMapgen::calc_lighting(), Decoration::canPlaceDecoration(), CavesRandomWalk::carveRoute(), CavesV6::carveRoute(), clear(), clearFlags(), MMVManip::clone(), copyFrom(), copyTo(), MapgenBasic::dustTopNodes(), exists(), voxalgo::fill_with_sunlight(), MapgenV6::find_stone_level(), Mapgen::findGroundLevel(), Mapgen::findLiquidSurface(), DungeonGen::findPlaceForDoor(), DungeonGen::findPlaceForRoomDoor(), MapgenV6::flowMud(), DecoSchematic::generate(), DecoSimple::generate(), DungeonGen::generate(), OreBlob::generate(), OrePuff::generate(), OreScatter::generate(), OreSheet::generate(), OreStratum::generate(), OreVein::generate(), MapgenV5::generateBaseTerrain(), MapgenBasic::generateBiomes(), CavernsNoise::generateCaverns(), CavesNoiseIntersection::generateCaves(), MapgenV6::generateGround(), MapgenCarpathian::generateTerrain(), MapgenFlat::generateTerrain(), MapgenFractal::generateTerrain(), MapgenV7::generateTerrain(), MapgenValleys::generateTerrain(), getFlagsRefUnsafe(), getNode(), getNodeNoEx(), getNodeNoExNoEmerge(), getNodeRefUnsafe(), getNodeRefUnsafeCheckFlags(), Schematic::getSchematicFromMap(), Mapgen::getSurfaces(), MapgenV6::growGrass(), LuaVoxelManip::l_calc_lighting(), ModApiMapgen::l_generate_decorations(), ModApiMapgen::l_generate_ores(), LuaVoxelManip::l_get_data(), LuaVoxelManip::l_get_emerged_area(), LuaVoxelManip::l_get_light_data(), ModApiMapgen::l_get_mapgen_object(), LuaVoxelManip::l_get_param2_data(), LuaVoxelManip::l_read_from_map(), LuaVoxelManip::l_set_data(), LuaVoxelManip::l_set_light_data(), LuaVoxelManip::l_set_lighting(), LuaVoxelManip::l_set_param2_data(), Mapgen::lightSpread(), treegen::make_jungletree(), treegen::make_pine_tree(), treegen::make_tree(), MapgenSinglenode::makeChunk(), DungeonGen::makeCorridor(), DungeonGen::makeDoor(), DungeonGen::makeDungeon(), DungeonGen::makeFill(), DungeonGen::makeRoom(), MapgenV6::moveMud(), Schematic::placeOnVManip(), MapgenV6::placeTreesAndJungleGrass(), print(), Mapgen::propagateSunlight(), ModApiMapgen::set_lighting(), setFlags(), Mapgen::setLighting(), setNode(), setNodeNoEmerge(), Mapgen::spreadLight(), TEST_CASE(), TestVoxelAlgorithms::testLighting(), treegen::tree_fruit_placement(), treegen::tree_leaves_placement(), treegen::tree_single_leaves_placement(), treegen::tree_trunk_placement(), ModApiMapgen::update_liquids(), Mapgen::updateLiquid(), and ServerMap::updateVManip().

◆ m_data

MapNode* VoxelManipulator::m_data = nullptr

Referenced by addArea(), MapgenV6::addMud(), Schematic::blitToVManip(), Decoration::canPlaceDecoration(), CavesRandomWalk::carveRoute(), CavesV6::carveRoute(), clear(), MMVManip::clone(), copyFrom(), copyTo(), MapgenBasic::dustTopNodes(), voxalgo::fill_with_sunlight(), MapgenV6::find_stone_level(), Mapgen::findGroundLevel(), Mapgen::findLiquidSurface(), MapgenV6::flowMud(), DecoSimple::generate(), DungeonGen::generate(), OreBlob::generate(), OrePuff::generate(), OreScatter::generate(), OreSheet::generate(), OreStratum::generate(), OreVein::generate(), MapgenV5::generateBaseTerrain(), MapgenBasic::generateBiomes(), CavernsNoise::generateCaverns(), CavesNoiseIntersection::generateCaves(), MapgenV6::generateGround(), MapgenCarpathian::generateTerrain(), MapgenFlat::generateTerrain(), MapgenFractal::generateTerrain(), MapgenV7::generateTerrain(), MapgenValleys::generateTerrain(), getNode(), getNodeNoEx(), getNodeNoExNoEmerge(), getNodeRefUnsafe(), getNodeRefUnsafeCheckFlags(), Schematic::getSchematicFromMap(), Mapgen::getSurfaces(), MapgenV6::growGrass(), Mapgen::isLiquidHorizontallyFlowable(), LuaVoxelManip::l_get_data(), LuaVoxelManip::l_get_light_data(), LuaVoxelManip::l_get_param2_data(), LuaVoxelManip::l_set_data(), LuaVoxelManip::l_set_light_data(), LuaVoxelManip::l_set_param2_data(), Mapgen::lightSpread(), treegen::make_jungletree(), treegen::make_pine_tree(), treegen::make_tree(), MapgenSinglenode::makeChunk(), DungeonGen::makeCorridor(), DungeonGen::makeDoor(), DungeonGen::makeDungeon(), DungeonGen::makeFill(), DungeonGen::makeRoom(), MapgenV6::moveMud(), MapgenV6::placeTreesAndJungleGrass(), print(), Mapgen::propagateSunlight(), Mapgen::setLighting(), setNode(), setNodeNoEmerge(), Mapgen::spreadLight(), TEST_CASE(), TestVoxelAlgorithms::testLighting(), treegen::tree_fruit_placement(), treegen::tree_leaves_placement(), treegen::tree_single_leaves_placement(), treegen::tree_trunk_placement(), Mapgen::updateLiquid(), and ServerMap::updateVManip().

◆ m_flags


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