Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
voxelalgorithms.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation; either version 2.1 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License along
16with this program; if not, write to the Free Software Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20#pragma once
21
22#include "voxel.h"
23#include "mapnode.h"
24#include "util/container.h"
25
26class Map;
27class MapBlock;
28class MMVManip;
29
30namespace voxalgo
31{
32
46 Map *map,
47 const std::vector<std::pair<v3s16, MapNode>> &oldnodes,
48 std::map<v3s16, MapBlock*> &modified_blocks);
49
60 std::map<v3s16, MapBlock*> &modified_blocks);
61
70void blit_back_with_light(Map *map, MMVManip *vm,
71 std::map<v3s16, MapBlock*> *modified_blocks);
72
79void repair_block_light(Map *map, MapBlock *block,
80 std::map<v3s16, MapBlock*> *modified_blocks);
81
89{
90public:
100 v3f m_next_intersection_multi { 10000.0f, 10000.0f, 10000.0f };
105 v3f m_intersection_multi_inc { 10000.0f, 10000.0f, 10000.0f };
119
128 VoxelLineIterator(const v3f &start_position,const v3f &line_vector);
129
137 void next();
138
142 inline bool hasNext() const
143 {
145 }
146
153 s16 getIndex(v3s16 voxel);
154};
155
156} // namespace voxalgo
Definition: map.h:320
Definition: mapblock.h:73
Definition: map.h:116
core::vector3d< s16 > v3s16
Definition: irr_v3d.h:28
core::vector3df v3f
Definition: irr_v3d.h:26
Definition: voxelalgorithms.cpp:28
void blit_back_with_light(Map *map, MMVManip *vm, std::map< v3s16, MapBlock * > *modified_blocks)
Definition: voxelalgorithms.cpp:1041
void repair_block_light(Map *map, MapBlock *block, std::map< v3s16, MapBlock * > *modified_blocks)
Definition: voxelalgorithms.cpp:1180
void update_block_border_lighting(Map *map, MapBlock *block, std::map< v3s16, MapBlock * > &modified_blocks)
Definition: voxelalgorithms.cpp:692
void update_lighting_nodes(Map *map, const std::vector< std::pair< v3s16, MapNode > > &oldnodes, std::map< v3s16, MapBlock * > &modified_blocks)
Definition: voxelalgorithms.cpp:469
Definition: voxelalgorithms.h:89
v3f m_intersection_multi_inc
Definition: voxelalgorithms.h:105
bool hasNext() const
Definition: voxelalgorithms.h:142
v3s16 m_current_node_pos
Position of the current node.
Definition: voxelalgorithms.h:112
v3f m_line_vector
Direction and length of the line in world coordinates.
Definition: voxelalgorithms.h:94
s16 getIndex(v3s16 voxel)
Definition: voxelalgorithms.cpp:1312
v3f m_start_position
Starting position of the line in world coordinates.
Definition: voxelalgorithms.h:92
s16 m_current_index
Index of the current node.
Definition: voxelalgorithms.h:114
v3f m_next_intersection_multi
Definition: voxelalgorithms.h:100
s16 m_last_index
Index of the last node.
Definition: voxelalgorithms.h:118
void next()
Definition: voxelalgorithms.cpp:1296
v3s16 m_step_directions
Definition: voxelalgorithms.h:110
v3s16 m_start_node_pos
Position of the start node.
Definition: voxelalgorithms.h:116