aboutsummaryrefslogtreecommitdiff
path: root/assets/manual.html.LyXconv
ModeNameSize
-rw-r--r--0_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_09-43-29.png9345logplain
-rw-r--r--10_home_moritz_Home_Projekte_Minetest_minetest____nual_img_Bildschirmfoto_2016-09-17_09-48-54.png14032logplain
-rw-r--r--11_home_moritz_Home_Projekte_Minetest_minetest____nual_img_Bildschirmfoto_2016-09-17_09-50-27.png4246logplain
-rw-r--r--12_home_moritz_Home_Projekte_Minetest_minetest____nual_img_Bildschirmfoto_2016-09-17_09-51-02.png3704logplain
-rw-r--r--13_home_moritz_Home_Projekte_Minetest_minetest____nual_img_Bildschirmfoto_2016-09-17_09-58-39.png6880logplain
-rw-r--r--14_home_moritz_Home_Projekte_Minetest_minetest____nual_img_Bildschirmfoto_2016-09-17_09-58-20.png10375logplain
-rw-r--r--15_home_moritz_Home_Projekte_Minetest_minetest____nual_img_Bildschirmfoto_2017-03-09_11-33-09.png3496logplain
-rw-r--r--16_home_moritz_Home_Projekte_Minetest_minetest____nual_img_Bildschirmfoto_2017-03-09_11-42-49.png25657logplain
-rw-r--r--17_home_moritz_Home_Projekte_Minetest_minetest____ssets_manual_img_screenshot_20161203_231622.png108256logplain
-rw-r--r--1_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_10-04-12.png72813logplain
-rw-r--r--2_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_10-04-57.png105448logplain
-rw-r--r--3_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_10-05-51.png93538logplain
-rw-r--r--4_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_10-07-13.png83521logplain
-rw-r--r--5_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_09-56-34.png2789logplain
-rw-r--r--6_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_10-08-02.png107762logplain
-rw-r--r--7_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_10-09-01.png112579logplain
-rw-r--r--8_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_10-10-15.png114075logplain
-rw-r--r--9_home_moritz_Home_Projekte_Minetest_minetest_m___nual_img_Bildschirmfoto_2016-09-17_09-45-38.png16695logplain
-rw-r--r--manual.css5100logplain
-rw-r--r--manual.html14609logplain
s="hl ppc"> #include <iostream> #include <cassert> #include "exceptions.h" #include "mapnode.h" #include <set> #include <list> #include "util/basic_macros.h" class INodeDefManager; // For VC++ #undef min #undef max /* A fast voxel manipulator class. In normal operation, it fetches more map when it is requested. It can also be used so that all allowed area is fetched at the start, using ManualMapVoxelManipulator. Not thread-safe. */ /* Debug stuff */ extern u64 emerge_time; extern u64 emerge_load_time; /* This class resembles aabbox3d<s16> a lot, but has inclusive edges for saner handling of integer sizes */ class VoxelArea { public: // Starts as zero sized VoxelArea() {} VoxelArea(const v3s16 &min_edge, const v3s16 &max_edge): MinEdge(min_edge), MaxEdge(max_edge) { cacheExtent(); } VoxelArea(const v3s16 &p): MinEdge(p), MaxEdge(p) { cacheExtent(); } /* Modifying methods */ void addArea(const VoxelArea &a) { if (hasEmptyExtent()) { *this = a; return; } if(a.MinEdge.X < MinEdge.X) MinEdge.X = a.MinEdge.X; if(a.MinEdge.Y < MinEdge.Y) MinEdge.Y = a.MinEdge.Y; if(a.MinEdge.Z < MinEdge.Z) MinEdge.Z = a.MinEdge.Z; if(a.MaxEdge.X > MaxEdge.X) MaxEdge.X = a.MaxEdge.X; if(a.MaxEdge.Y > MaxEdge.Y) MaxEdge.Y = a.MaxEdge.Y; if(a.MaxEdge.Z > MaxEdge.Z) MaxEdge.Z = a.MaxEdge.Z; cacheExtent(); } void addPoint(const v3s16 &p) { if(hasEmptyExtent()) { MinEdge = p; MaxEdge = p; cacheExtent(); return; } if(p.X < MinEdge.X) MinEdge.X = p.X; if(p.Y < MinEdge.Y) MinEdge.Y = p.Y; if(p.Z < MinEdge.Z) MinEdge.Z = p.Z; if(p.X > MaxEdge.X) MaxEdge.X = p.X; if(p.Y > MaxEdge.Y) MaxEdge.Y = p.Y; if(p.Z > MaxEdge.Z) MaxEdge.Z = p.Z; cacheExtent(); } // Pad with d nodes void pad(const v3s16 &d) { MinEdge -= d; MaxEdge += d; } /* const methods */ const v3s16 &getExtent() const { return m_cache_extent; } /* Because MaxEdge and MinEdge are included in the voxel area an empty extent * is not represented by (0, 0, 0), but instead (-1, -1, -1) */ bool hasEmptyExtent() const { return MaxEdge - MinEdge == v3s16(-1, -1, -1); } s32 getVolume() const { return (s32)m_cache_extent.X * (s32)m_cache_extent.Y * (s32)m_cache_extent.Z; } bool contains(const VoxelArea &a) const { // No area contains an empty area // NOTE: Algorithms depend on this, so do not change. if(a.hasEmptyExtent()) return false; return( a.MinEdge.X >= MinEdge.X && a.MaxEdge.X <= MaxEdge.X && a.MinEdge.Y >= MinEdge.Y && a.MaxEdge.Y <= MaxEdge.Y && a.MinEdge.Z >= MinEdge.Z && a.MaxEdge.Z <= MaxEdge.Z ); } bool contains(v3s16 p) const { return( p.X >= MinEdge.X && p.X <= MaxEdge.X && p.Y >= MinEdge.Y && p.Y <= MaxEdge.Y && p.Z >= MinEdge.Z && p.Z <= MaxEdge.Z ); } bool contains(s32 i) const { return (i >= 0 && i < getVolume()); } bool operator==(const VoxelArea &other) const { return (MinEdge == other.MinEdge && MaxEdge == other.MaxEdge); } VoxelArea operator+(const v3s16 &off) const { return VoxelArea(MinEdge+off, MaxEdge+off); } VoxelArea operator-(const v3s16 &off) const { return VoxelArea(MinEdge-off, MaxEdge-off); } /* Returns 0-6 non-overlapping areas that can be added to a to make up this area. a: area inside *this */ void diff(const VoxelArea &a, std::list<VoxelArea> &result) { /* This can result in a maximum of 6 areas */ // If a is an empty area, return the current area as a whole if(a.getExtent() == v3s16(0,0,0)) { VoxelArea b = *this; if(b.getVolume() != 0) result.push_back(b); return; } assert(contains(a)); // pre-condition // Take back area, XY inclusive { v3s16 min(MinEdge.X, MinEdge.Y, a.MaxEdge.Z+1); v3s16 max(MaxEdge.X, MaxEdge.Y, MaxEdge.Z); VoxelArea b(min, max); if(b.getVolume() != 0) result.push_back(b); } // Take front area, XY inclusive { v3s16 min(MinEdge.X, MinEdge.Y, MinEdge.Z); v3s16 max(MaxEdge.X, MaxEdge.Y, a.MinEdge.Z-1); VoxelArea b(min, max); if(b.getVolume() != 0) result.push_back(b); } // Take top area, X inclusive { v3s16 min(MinEdge.X, a.MaxEdge.Y+1, a.MinEdge.Z); v3s16 max(MaxEdge.X, MaxEdge.Y, a.MaxEdge.Z); VoxelArea b(min, max); if(b.getVolume() != 0) result.push_back(b); } // Take bottom area, X inclusive { v3s16 min(MinEdge.X, MinEdge.Y, a.MinEdge.Z); v3s16 max(MaxEdge.X, a.MinEdge.Y-1, a.MaxEdge.Z); VoxelArea b(min, max); if(b.getVolume() != 0) result.push_back(b); }