/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include "irrlichttypes.h"
#include "irr_v3d.h"
#include <iostream>
#include <cassert>
#include "exceptions.h"
#include "mapnode.h"
#include <set>
#include <list>
#include "util/basic_macros.h"
class NodeDefManager;
// 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() = default;
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();
|