202 template <
typename C>
216 const auto &take = [&result] (
v3s16 min,
v3s16 max) {
268 s32
index(s16 x, s16 y, s16 z)
const
301 i += a * extent.X * extent.Y;
309 i += a.Z * extent.X * extent.Y + a.Y * extent.X + a.X;
378 (
"VoxelManipulator: getNode: inexistent");
441 m_flags[index] &= ~VOXELFLAG_NO_DATA;
462 virtual void clear();
Definition exceptions.h:108
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:541
v3s16 MinEdge
Minimum edge of the area (inclusive)
Definition voxel.h:324
void addArea(const VoxelArea &a)
Definition voxel.h:67
bool contains(s32 i) const
Definition voxel.h:150
static void add_z(const v3s16 &extent, u32 &i, s16 a)
Translate index in the Z coordinate.
Definition voxel.h:299
VoxelArea intersect(const VoxelArea &a) const
Definition voxel.h:173
static void add_y(const v3s16 &extent, u32 &i, s16 a)
Translate index in the Y coordinate.
Definition voxel.h:291
static void add_p(const v3s16 &extent, u32 &i, v3s16 a)
Translate index in space.
Definition voxel.h:307
s32 index(s16 x, s16 y, s16 z) const
Definition voxel.h:268
VoxelArea(const v3s16 &min_edge, const v3s16 &max_edge)
Definition voxel.h:49
static void add_x(const v3s16 &extent, u32 &i, s16 a)
Translate index in the X coordinate.
Definition voxel.h:283
VoxelArea operator-(const v3s16 &off) const
Definition voxel.h:165
bool contains(const VoxelArea &a) const
Definition voxel.h:129
void cacheExtent()
Definition voxel.h:330
void addPoint(const v3s16 &p)
Definition voxel.h:83
v3s16 MaxEdge
Maximum edge of the area (inclusive)
Definition voxel.h:327
v3s16 m_cache_extent
Definition voxel.h:340
VoxelArea operator+(const v3s16 &off) const
Definition voxel.h:160
bool operator==(const VoxelArea &other) const
Definition voxel.h:154
s32 index(v3s16 p) const
Definition voxel.h:275
bool hasEmptyExtent() const
Definition voxel.h:118
void print(std::ostream &o) const
Definition voxel.h:315
const v3s16 & getExtent() const
Definition voxel.h:112
void diff(const VoxelArea &a, C &result) const
Returns 0-6 non-overlapping areas that can be added to a to make up this area.
Definition voxel.h:203
s32 getVolume() const
Definition voxel.h:124
void pad(const v3s16 &d)
Definition voxel.h:102
bool contains(v3s16 p) const
Definition voxel.h:142
constexpr VoxelArea()=default
VoxelArea(const v3s16 &p)
Definition voxel.h:56
MapNode * m_data
Definition voxel.h:497
MapNode getNodeNoEx(const v3s16 &p)
Definition voxel.h:383
void print(std::ostream &o, const NodeDefManager *nodemgr, VoxelPrintMode mode=VOXELPRINT_MATERIAL) const
Definition voxel.cpp:38
const MapNode & getNodeRefUnsafeCheckFlags(const v3s16 &p) const
Definition voxel.h:412
u8 * m_flags
Definition voxel.h:502
void setFlags(const VoxelArea &area, u8 flag)
Definition voxel.cpp:247
void copyFrom(MapNode *src, const VoxelArea &src_area, v3s16 from_pos, v3s16 to_pos, const v3s16 &size)
Definition voxel.cpp:177
void copyTo(MapNode *dst, const VoxelArea &dst_area, v3s16 dst_pos, v3s16 from_pos, const v3s16 &size) const
Definition voxel.cpp:225
void setNode(const v3s16 &p, const MapNode &n)
Definition voxel.h:433
VoxelManipulator()=default
MapNode getNodeNoExNoEmerge(const v3s16 &p) const
Definition voxel.h:396
static const MapNode ContentIgnoreNode
Definition voxel.h:504
bool setNodeNoEmerge(const v3s16 &p, MapNode n)
Definition voxel.h:450
void addArea(const VoxelArea &area)
Definition voxel.cpp:116
bool exists(const v3s16 &p)
Definition voxel.h:427
u8 & getFlagsRefUnsafe(const v3s16 &p)
Definition voxel.h:422
void clearFlags(const VoxelArea &area, u8 flag)
Definition voxel.cpp:264
VoxelArea m_area
Definition voxel.h:491
MapNode & getNodeRefUnsafe(const v3s16 &p)
Definition voxel.h:407
virtual void clear()
Definition voxel.cpp:25
virtual ~VoxelManipulator()
Definition voxel.cpp:20
MapNode getNode(const v3s16 &p)
Definition voxel.h:369
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
#define CONTENT_IGNORE
Definition mapnode.h:58
static std::string p(std::string path)
Definition test_filesys.cpp:53
u64 emerge_load_time
Definition voxel.cpp:18
@ VOXELFLAG_NO_DATA
Definition voxel.h:344
@ VOXELFLAG_CHECKED3
Definition voxel.h:347
@ VOXELFLAG_CHECKED4
Definition voxel.h:348
@ VOXELFLAG_CHECKED1
Definition voxel.h:345
@ VOXELFLAG_CHECKED2
Definition voxel.h:346
VoxelPrintMode
Definition voxel.h:352
@ VOXELPRINT_WATERPRESSURE
Definition voxel.h:355
@ VOXELPRINT_NOTHING
Definition voxel.h:353
@ VOXELPRINT_LIGHT_DAY
Definition voxel.h:356
@ VOXELPRINT_MATERIAL
Definition voxel.h:354
u64 emerge_time
Definition voxel.cpp:17