Minetest  5.4.0
VoxelArea Class Reference

#include <voxel.h>

Public Member Functions

 VoxelArea ()=default
 
 VoxelArea (const v3s16 &min_edge, const v3s16 &max_edge)
 
 VoxelArea (const v3s16 &p)
 
void addArea (const VoxelArea &a)
 
void addPoint (const v3s16 &p)
 
void pad (const v3s16 &d)
 
const v3s16getExtent () const
 
bool hasEmptyExtent () const
 
s32 getVolume () const
 
bool contains (const VoxelArea &a) const
 
bool contains (v3s16 p) const
 
bool contains (s32 i) const
 
bool operator== (const VoxelArea &other) const
 
VoxelArea operator+ (const v3s16 &off) const
 
VoxelArea operator- (const v3s16 &off) const
 
void diff (const VoxelArea &a, std::list< VoxelArea > &result)
 
s32 index (s16 x, s16 y, s16 z) const
 
s32 index (v3s16 p) const
 
void print (std::ostream &o) const
 

Static Public Member Functions

static void add_x (const v3s16 &extent, u32 &i, s16 a)
 Translate index in the X coordinate. More...
 
static void add_y (const v3s16 &extent, u32 &i, s16 a)
 Translate index in the Y coordinate. More...
 
static void add_z (const v3s16 &extent, u32 &i, s16 a)
 Translate index in the Z coordinate. More...
 
static void add_p (const v3s16 &extent, u32 &i, v3s16 a)
 Translate index in space. More...
 

Public Attributes

v3s16 MinEdge = v3s16(1,1,1)
 
v3s16 MaxEdge
 

Private Member Functions

void cacheExtent ()
 

Private Attributes

v3s16 m_cache_extent = v3s16(0,0,0)
 

Constructor & Destructor Documentation

◆ VoxelArea() [1/3]

VoxelArea::VoxelArea ( )
default

◆ VoxelArea() [2/3]

VoxelArea::VoxelArea ( const v3s16 min_edge,
const v3s16 max_edge 
)
inline

References cacheExtent().

+ Here is the call graph for this function:

◆ VoxelArea() [3/3]

VoxelArea::VoxelArea ( const v3s16 p)
inline

References cacheExtent().

+ Here is the call graph for this function:

Member Function Documentation

◆ add_p()

static void VoxelArea::add_p ( const v3s16 extent,
u32 &  i,
v3s16  a 
)
inlinestatic

Translate index in space.

Referenced by MapgenV6::flowMud(), and TestVoxelArea::test_add_p().

+ Here is the caller graph for this function:

◆ add_x()

static void VoxelArea::add_x ( const v3s16 extent,
u32 &  i,
s16  a 
)
inlinestatic

Translate index in the X coordinate.

Referenced by Mapgen::isLiquidHorizontallyFlowable(), and TestVoxelArea::test_add_x().

+ Here is the caller graph for this function:

◆ add_y()

◆ add_z()

static void VoxelArea::add_z ( const v3s16 extent,
u32 &  i,
s16  a 
)
inlinestatic

Translate index in the Z coordinate.

Referenced by Mapgen::isLiquidHorizontallyFlowable(), and TestVoxelArea::test_add_z().

+ Here is the caller graph for this function:

◆ addArea()

void VoxelArea::addArea ( const VoxelArea a)
inline

References cacheExtent(), hasEmptyExtent(), MaxEdge, and MinEdge.

Referenced by VoxelManipulator::addArea(), and TestVoxelArea::test_addarea().

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

◆ addPoint()

void VoxelArea::addPoint ( const v3s16 p)
inline

References cacheExtent(), hasEmptyExtent(), MaxEdge, MinEdge, and p().

Referenced by MapEditEvent::getArea().

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

◆ cacheExtent()

void VoxelArea::cacheExtent ( )
inlineprivate

References m_cache_extent, MaxEdge, and MinEdge.

Referenced by VoxelArea(), addArea(), and addPoint().

+ Here is the caller graph for this function:

◆ contains() [1/3]

◆ contains() [2/3]

bool VoxelArea::contains ( s32  i) const
inline

References getVolume().

+ Here is the call graph for this function:

◆ contains() [3/3]

bool VoxelArea::contains ( v3s16  p) const
inline

References MaxEdge, MinEdge, and p().

+ Here is the call graph for this function:

◆ diff()

void VoxelArea::diff ( const VoxelArea a,
std::list< VoxelArea > &  result 
)
inline

References contains(), getExtent(), getVolume(), MaxEdge, and MinEdge.

Referenced by TestVoxelManipulator::testVoxelArea().

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

◆ getExtent()

◆ getVolume()

◆ hasEmptyExtent()

bool VoxelArea::hasEmptyExtent ( ) const
inline

References MaxEdge, and MinEdge.

Referenced by addArea(), VoxelManipulator::addArea(), addPoint(), and contains().

+ Here is the caller graph for this function:

◆ index() [1/2]

s32 VoxelArea::index ( s16  x,
s16  y,
s16  z 
) const
inline

References m_cache_extent, and MinEdge.

Referenced by VoxelManipulator::addArea(), MapgenV6::addMud(), Schematic::blitToVManip(), Decoration::canPlaceDecoration(), CavesRandomWalk::carveRoute(), CavesV6::carveRoute(), VoxelManipulator::copyFrom(), VoxelManipulator::copyTo(), MapgenBasic::dustTopNodes(), voxalgo::fill_with_sunlight(), MapgenV6::find_stone_level(), Mapgen::findGroundLevel(), Mapgen::findLiquidSurface(), DungeonGen::findPlaceForRoomDoor(), MapgenV6::flowMud(), OreScatter::generate(), OreSheet::generate(), OrePuff::generate(), OreBlob::generate(), OreVein::generate(), OreStratum::generate(), DecoSimple::generate(), DungeonGen::generate(), MapgenV5::generateBaseTerrain(), MapgenBasic::generateBiomes(), CavernsNoise::generateCaverns(), CavesNoiseIntersection::generateCaves(), MapgenV6::generateGround(), MapgenCarpathian::generateTerrain(), MapgenFlat::generateTerrain(), MapgenFractal::generateTerrain(), MapgenV7::generateTerrain(), MapgenValleys::generateTerrain(), VoxelManipulator::getFlagsRefUnsafe(), VoxelManipulator::getNode(), VoxelManipulator::getNodeNoEx(), VoxelManipulator::getNodeNoExNoEmerge(), VoxelManipulator::getNodeRefUnsafe(), VoxelManipulator::getNodeRefUnsafeCheckFlags(), Schematic::getSchematicFromMap(), Mapgen::getSurfaces(), MapgenV6::growGrass(), index(), MMVManip::initialEmerge(), 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::placeTreesAndJungleGrass(), VoxelManipulator::print(), Mapgen::propagateSunlight(), Mapgen::setLighting(), VoxelManipulator::setNode(), VoxelManipulator::setNodeNoEmerge(), Mapgen::spreadLight(), TestVoxelArea::test_index_v3s16_all_neg(), TestVoxelArea::test_index_v3s16_all_pos(), TestVoxelArea::test_index_v3s16_x_neg(), TestVoxelArea::test_index_v3s16_xy_neg(), TestVoxelArea::test_index_v3s16_xz_neg(), TestVoxelArea::test_index_v3s16_y_neg(), TestVoxelArea::test_index_v3s16_yz_neg(), TestVoxelArea::test_index_v3s16_z_neg(), TestVoxelArea::test_index_xyz_all_neg(), TestVoxelArea::test_index_xyz_all_pos(), TestVoxelArea::test_index_xyz_x_neg(), TestVoxelArea::test_index_xyz_xy_neg(), TestVoxelArea::test_index_xyz_xz_neg(), TestVoxelArea::test_index_xyz_y_neg(), TestVoxelArea::test_index_xyz_yz_neg(), TestVoxelArea::test_index_xyz_z_neg(), TestVoxelManipulator::testVoxelArea(), treegen::tree_fruit_placement(), treegen::tree_leaves_placement(), treegen::tree_single_leaves_placement(), treegen::tree_trunk_placement(), Mapgen::updateLiquid(), and ServerMap::updateVManip().

◆ index() [2/2]

s32 VoxelArea::index ( v3s16  p) const
inline

References index(), and p().

+ Here is the call graph for this function:

◆ operator+()

VoxelArea VoxelArea::operator+ ( const v3s16 off) const
inline

References MaxEdge, and MinEdge.

◆ operator-()

VoxelArea VoxelArea::operator- ( const v3s16 off) const
inline

References MaxEdge, and MinEdge.

◆ operator==()

bool VoxelArea::operator== ( const VoxelArea other) const
inline

References MaxEdge, and MinEdge.

◆ pad()

void VoxelArea::pad ( const v3s16 d)
inline

References MaxEdge, and MinEdge.

Referenced by TestVoxelArea::test_pad().

+ Here is the caller graph for this function:

◆ print()

void VoxelArea::print ( std::ostream &  o) const
inline

References getVolume(), m_cache_extent, MaxEdge, MinEdge, and PP.

Referenced by MMVManip::initialEmerge().

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

Member Data Documentation

◆ m_cache_extent

v3s16 VoxelArea::m_cache_extent = v3s16(0,0,0)
private

◆ MaxEdge

◆ MinEdge


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