151 return i >= 0 &&
static_cast<u32
>(i) <
getVolume();
202 template <
typename C>
216 const auto &take = [&result] (
v3s16 min,
v3s16 max) {
302 i += a * extent.X * extent.Y;
310 i += a.Z * extent.X * extent.Y + a.Y * extent.X + a.X;
384 (
"VoxelManipulator: getNode: inexistent");
447 m_flags[index] &= ~VOXELFLAG_NO_DATA;
468 virtual void clear();
Definition exceptions.h:108
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:545
v3s16 MinEdge
Minimum edge of the area (inclusive)
Definition voxel.h:325
void addArea(const VoxelArea &a)
Definition voxel.h:67
bool contains(s32 i) const
Definition voxel.h:149
VoxelArea intersect(const VoxelArea &a) const
Definition voxel.h:173
static void add_p(const v3s32 &extent, u32 &i, v3s16 a)
Translate index in space.
Definition voxel.h:308
static constexpr s32 MAX_EXTENT
Definition voxel.h:345
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
const v3s32 & getExtent() const
Definition voxel.h:112
static void add_z(const v3s32 &extent, u32 &i, s16 a)
Translate index in the Z coordinate.
Definition voxel.h:300
u32 getVolume() const
Definition voxel.h:122
VoxelArea operator-(const v3s16 &off) const
Definition voxel.h:165
bool contains(const VoxelArea &a) const
Definition voxel.h:128
static void add_y(const v3s32 &extent, u32 &i, s16 a)
Translate index in the Y coordinate.
Definition voxel.h:292
void cacheExtent()
Definition voxel.h:331
void addPoint(const v3s16 &p)
Definition voxel.h:83
v3s16 MaxEdge
Maximum edge of the area (inclusive)
Definition voxel.h:328
static void add_x(const v3s32 &extent, u32 &i, s16 a)
Translate index in the X coordinate.
Definition voxel.h:283
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:117
void print(std::ostream &o) const
Definition voxel.h:316
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
void pad(const v3s16 &d)
Definition voxel.h:102
bool contains(v3s16 p) const
Definition voxel.h:141
v3s32 m_cache_extent
Definition voxel.h:346
constexpr VoxelArea()=default
VoxelArea(const v3s16 &p)
Definition voxel.h:56
MapNode * m_data
Definition voxel.h:503
MapNode getNodeNoEx(const v3s16 &p)
Definition voxel.h:389
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:418
u8 * m_flags
Definition voxel.h:508
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:439
VoxelManipulator()=default
MapNode getNodeNoExNoEmerge(const v3s16 &p) const
Definition voxel.h:402
static const MapNode ContentIgnoreNode
Definition voxel.h:510
bool setNodeNoEmerge(const v3s16 &p, MapNode n)
Definition voxel.h:456
void addArea(const VoxelArea &area)
Definition voxel.cpp:116
bool exists(const v3s16 &p)
Definition voxel.h:433
u8 & getFlagsRefUnsafe(const v3s16 &p)
Definition voxel.h:428
void clearFlags(const VoxelArea &area, u8 flag)
Definition voxel.cpp:264
VoxelArea m_area
Definition voxel.h:497
MapNode & getNodeRefUnsafe(const v3s16 &p)
Definition voxel.h:413
virtual void clear()
Definition voxel.cpp:25
virtual ~VoxelManipulator()
Definition voxel.cpp:20
MapNode getNode(const v3s16 &p)
Definition voxel.h:375
core::vector3d< s32 > v3s32
Definition irr_v3d.h:15
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
#define S16_MAX
Definition irrlichttypes.h:23
#define S16_MIN
Definition irrlichttypes.h:18
#define CONTENT_IGNORE
Definition mapnode.h:58
static std::string p(std::string path)
Definition test_filesys.cpp:55
constexpr v3f x
Definition test_irr_matrix4.cpp:15
constexpr v3f y
Definition test_irr_matrix4.cpp:16
constexpr v3f z
Definition test_irr_matrix4.cpp:17
u64 emerge_load_time
Definition voxel.cpp:18
@ VOXELFLAG_NO_DATA
Definition voxel.h:350
@ VOXELFLAG_CHECKED3
Definition voxel.h:353
@ VOXELFLAG_CHECKED4
Definition voxel.h:354
@ VOXELFLAG_CHECKED1
Definition voxel.h:351
@ VOXELFLAG_CHECKED2
Definition voxel.h:352
VoxelPrintMode
Definition voxel.h:358
@ VOXELPRINT_WATERPRESSURE
Definition voxel.h:361
@ VOXELPRINT_NOTHING
Definition voxel.h:359
@ VOXELPRINT_LIGHT_DAY
Definition voxel.h:362
@ VOXELPRINT_MATERIAL
Definition voxel.h:360
u64 emerge_time
Definition voxel.cpp:17