summaryrefslogtreecommitdiff
path: root/src/hud.cpp
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2016-02-11 04:57:01 +0100
committerKahrl <kahrl@gmx.net>2016-02-11 13:11:25 +0100
commit9357294cfc4c73aa5ccc56a34aae8834a4766378 (patch)
tree61c754637ffeac391ffa6d9c2e5d5a37f4c808d4 /src/hud.cpp
parentc1044b9a4a2eb45a0b71566bee59e5961708bebf (diff)
downloadminetest-9357294cfc4c73aa5ccc56a34aae8834a4766378.tar.gz
minetest-9357294cfc4c73aa5ccc56a34aae8834a4766378.tar.bz2
minetest-9357294cfc4c73aa5ccc56a34aae8834a4766378.zip
Use single box for halo mesh
Diffstat (limited to 'src/hud.cpp')
-rw-r--r--src/hud.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/hud.cpp b/src/hud.cpp
index 0a77a1a28..6b28021af 100644
--- a/src/hud.cpp
+++ b/src/hud.cpp
@@ -84,6 +84,8 @@ Hud::Hud(video::IVideoDriver *driver, scene::ISceneManager* smgr,
m_selection_mesh = NULL;
m_selection_boxes.clear();
+ m_halo_boxes.clear();
+
m_selection_pos = v3f(0.0, 0.0, 0.0);
std::string mode = g_settings->get("node_highlighting");
m_selection_material.Lighting = false;
@@ -574,10 +576,23 @@ void Hud::updateSelectionMesh(const v3s16 &camera_offset)
0,0,1,1
};
- m_selection_mesh = convertNodeboxesToMesh(m_selection_boxes, texture_uv);
+ // Use single halo box instead of multiple overlapping boxes.
+ // Temporary solution - problem can be solved with multiple
+ // rendering targets, or some method to remove inner surfaces.
+ // Thats because of halo transparency.
+
+ aabb3f halo_box(100.0, 100.0, 100.0, -100.0, -100.0, -100.0);
+ m_halo_boxes.clear();
+
+ for (std::vector<aabb3f>::iterator
+ i = m_selection_boxes.begin();
+ i != m_selection_boxes.end(); ++i) {
+ halo_box.addInternalBox(*i);
+ }
- // scale final halo mesh
- scaleMesh(m_selection_mesh, v3f(1.08, 1.08, 1.08));
+ m_halo_boxes.push_back(halo_box);
+ m_selection_mesh = convertNodeboxesToMesh(
+ m_halo_boxes, texture_uv, 0.5);
}
void Hud::resizeHotbar() {