Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
voxelalgorithms.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include "voxel.h"
8#include "mapnode.h"
9#include "util/container.h"
10
11class Map;
12class MapBlock;
13class MMVManip;
14
15namespace voxalgo
16{
17
31 Map *map,
32 const std::vector<std::pair<v3s16, MapNode>> &oldnodes,
33 std::map<v3s16, MapBlock*> &modified_blocks);
34
45 std::map<v3s16, MapBlock*> &modified_blocks);
46
55void blit_back_with_light(Map *map, MMVManip *vm,
56 std::map<v3s16, MapBlock*> *modified_blocks);
57
64void repair_block_light(Map *map, MapBlock *block,
65 std::map<v3s16, MapBlock*> *modified_blocks);
66
74{
75public:
85 v3f m_next_intersection_multi { 10000.0f, 10000.0f, 10000.0f };
90 v3f m_intersection_multi_inc { 10000.0f, 10000.0f, 10000.0f };
104
113 VoxelLineIterator(const v3f &start_position,const v3f &line_vector);
114
122 void next();
123
127 inline bool hasNext() const
128 {
130 }
131
138 s16 getIndex(v3s16 voxel);
139};
140
141} // namespace voxalgo
Definition map.h:305
Definition mapblock.h:58
Definition map.h:101
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
core::vector3df v3f
Definition irr_v3d.h:11
Definition voxelalgorithms.cpp:13
void blit_back_with_light(Map *map, MMVManip *vm, std::map< v3s16, MapBlock * > *modified_blocks)
Definition voxelalgorithms.cpp:1030
void repair_block_light(Map *map, MapBlock *block, std::map< v3s16, MapBlock * > *modified_blocks)
Definition voxelalgorithms.cpp:1169
void update_block_border_lighting(Map *map, MapBlock *block, std::map< v3s16, MapBlock * > &modified_blocks)
Definition voxelalgorithms.cpp:677
void update_lighting_nodes(Map *map, const std::vector< std::pair< v3s16, MapNode > > &oldnodes, std::map< v3s16, MapBlock * > &modified_blocks)
Definition voxelalgorithms.cpp:454
Definition voxelalgorithms.h:74
v3f m_intersection_multi_inc
Definition voxelalgorithms.h:90
bool hasNext() const
Definition voxelalgorithms.h:127
v3s16 m_current_node_pos
Position of the current node.
Definition voxelalgorithms.h:97
v3f m_line_vector
Direction and length of the line in world coordinates.
Definition voxelalgorithms.h:79
s16 getIndex(v3s16 voxel)
Definition voxelalgorithms.cpp:1301
VoxelLineIterator(const v3f &start_position, const v3f &line_vector)
Definition voxelalgorithms.cpp:1243
v3f m_start_position
Starting position of the line in world coordinates.
Definition voxelalgorithms.h:77
s16 m_current_index
Index of the current node.
Definition voxelalgorithms.h:99
v3f m_next_intersection_multi
Definition voxelalgorithms.h:85
s16 m_last_index
Index of the last node.
Definition voxelalgorithms.h:103
void next()
Definition voxelalgorithms.cpp:1285
v3s16 m_step_directions
Definition voxelalgorithms.h:95
v3s16 m_start_node_pos
Position of the start node.
Definition voxelalgorithms.h:101