From 15d0f16cc0eb23ba30e480010209bc7f174715cf Mon Sep 17 00:00:00 2001 From: Jakob Date: Wed, 6 Mar 2024 20:32:07 +0100 Subject: [PATCH] Cleanup --- app/TerrainRendererItem.cpp | 5 +---- app/TerrainRendererItem.h | 1 + gl_engine/TrackManager.h | 2 +- gl_engine/Window.cpp | 1 + gl_engine/Window.h | 1 + gl_engine/shaders/compose.frag | 4 ---- gl_engine/shaders/tile.frag | 2 +- nucleus/DataQuerier.h | 2 -- nucleus/camera/Definition.cpp | 1 - nucleus/srs.cpp | 15 --------------- nucleus/srs.h | 2 -- 11 files changed, 6 insertions(+), 30 deletions(-) diff --git a/app/TerrainRendererItem.cpp b/app/TerrainRendererItem.cpp index ab59dc7d..5206cffe 100644 --- a/app/TerrainRendererItem.cpp +++ b/app/TerrainRendererItem.cpp @@ -3,6 +3,7 @@ * Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company (Giuseppe D'Angelo) * Copyright (C) 2023 Adam Celarek * Copyright (C) 2023 Gerald Kimmersdorfer + * Copyright (C) 2024 Jakob Maier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -256,8 +257,6 @@ void TerrainRendererItem::set_gl_preset(const QString& preset_b64_string) { void TerrainRendererItem::get_upload_file() { - qDebug() << "get_upload_file"; - auto fileContentReady = [this](const QString &fileName, const QByteArray &fileContent) { (void)fileContent; if (fileName.isEmpty()) { @@ -393,7 +392,6 @@ void TerrainRendererItem::set_field_of_view(float new_field_of_view) void TerrainRendererItem::set_track_width(float width) { - // qDebug() << "Set track width " << width; m_track_width = width; emit track_width_changed(width); schedule_update(); @@ -406,7 +404,6 @@ float TerrainRendererItem::track_width() const void TerrainRendererItem::set_track_shading(unsigned int shading) { - qDebug() << "Set track shading " << shading; m_track_shading = shading; emit track_shading_changed(shading); schedule_update(); diff --git a/app/TerrainRendererItem.h b/app/TerrainRendererItem.h index da10bdde..4b4c74b5 100644 --- a/app/TerrainRendererItem.h +++ b/app/TerrainRendererItem.h @@ -3,6 +3,7 @@ * Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company (Giuseppe D'Angelo) * Copyright (C) 2023 Adam Celarek * Copyright (C) 2023 Gerald Kimmersdorfer + * Copyright (C) 2024 Jakob Maier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gl_engine/TrackManager.h b/gl_engine/TrackManager.h index dede805b..9dedb2e0 100644 --- a/gl_engine/TrackManager.h +++ b/gl_engine/TrackManager.h @@ -1,6 +1,6 @@ /***************************************************************************** * Alpine Terrain Builder - * Copyright (C) 2022 alpinemaps.org + * Copyright (C) 2024 Jakob Maier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gl_engine/Window.cpp b/gl_engine/Window.cpp index 1220ba17..915b4bca 100644 --- a/gl_engine/Window.cpp +++ b/gl_engine/Window.cpp @@ -4,6 +4,7 @@ * Copyright (C) 2023 Jakob Lindner * Copyright (C) 2023 Gerald Kimmersdorfer * Copyright (C) 2024 Lucas Dworschak + * Copyright (C) 2024 Jakob Maier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gl_engine/Window.h b/gl_engine/Window.h index ea361e12..bbf7fd71 100644 --- a/gl_engine/Window.h +++ b/gl_engine/Window.h @@ -4,6 +4,7 @@ * Copyright (C) 2023 Jakob Lindner * Copyright (C) 2023 Gerald Kimmersdorfer * Copyright (C) 2024 Lucas Dworschak + * Copyright (C) 2024 Jakob Maier * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gl_engine/shaders/compose.frag b/gl_engine/shaders/compose.frag index 228d7f4e..10da2af1 100644 --- a/gl_engine/shaders/compose.frag +++ b/gl_engine/shaders/compose.frag @@ -29,7 +29,6 @@ highp float calculate_falloff(highp float dist, highp float from, highp float to #include "overlay_steepness.glsl" #include "snow.glsl" -#line 1 layout (location = 0) out lowp vec4 out_Color; in highp vec2 texcoords; @@ -47,9 +46,6 @@ uniform highp sampler2D texin_csm2; // f32vec1 uniform highp sampler2D texin_csm3; // f32vec1 uniform highp sampler2D texin_csm4; // f32vec1 -uniform highp sampler2D texin_track; // f32vec3 -uniform highp usampler2D texin_track_vert_id; - // Calculates the diffuse and specular illumination contribution for the given // parameters according to the Blinn-Phong lighting model. diff --git a/gl_engine/shaders/tile.frag b/gl_engine/shaders/tile.frag index 6fff2fe4..5acbe6d1 100644 --- a/gl_engine/shaders/tile.frag +++ b/gl_engine/shaders/tile.frag @@ -29,7 +29,7 @@ layout (location = 2) out highp uvec2 texout_normal; layout (location = 3) out lowp vec4 texout_depth; in highp vec2 uv; -in highp vec3 var_pos_cws; // camera world space? +in highp vec3 var_pos_cws; in highp vec3 var_normal; #if CURTAIN_DEBUG_MODE > 0 in lowp float is_curtain; diff --git a/nucleus/DataQuerier.h b/nucleus/DataQuerier.h index 5aebd111..4e820069 100644 --- a/nucleus/DataQuerier.h +++ b/nucleus/DataQuerier.h @@ -29,8 +29,6 @@ class DataQuerier public: DataQuerier(tile_scheduler::MemoryCache* cache); - // use this to snap height of gpx points - // needs to be reloaded if tiles change [[nodiscard]] float get_altitude(const glm::dvec2& lat_long) const; }; diff --git a/nucleus/camera/Definition.cpp b/nucleus/camera/Definition.cpp index 6493fe42..bbef55d5 100644 --- a/nucleus/camera/Definition.cpp +++ b/nucleus/camera/Definition.cpp @@ -299,7 +299,6 @@ glm::dvec2 Definition::to_ndc(const glm::dvec2& screen_space_coordinates) const return ((screen_space_coordinates / glm::dvec2(viewport_size())) * 2.0 - 1.0) * glm::dvec2 { 1.0, -1.0 }; } -// interesting float Definition::to_screen_space(float world_space_size, float world_space_distance) const { return float(m_viewport_size.y) * 0.5f * world_space_size * m_distance_scaling_factor / world_space_distance; diff --git a/nucleus/srs.cpp b/nucleus/srs.cpp index a84987cd..c6ed5f59 100644 --- a/nucleus/srs.cpp +++ b/nucleus/srs.cpp @@ -89,19 +89,4 @@ glm::dvec3 lat_long_alt_to_world(const glm::dvec3& lat_long_alt) return { world_xy.x, world_xy.y, lat_long_alt.z / std::abs(std::cos(lat_rad_)) }; } -double haversine_distance(const glm::dvec2& lat_long_1, const glm::dvec2& lat_long_2) -{ - double delta_lat = glm::radians(lat_long_2.x - lat_long_1.x); - double delta_long = glm::radians(lat_long_2.y - lat_long_1.y); - - return 2 * cSemiMajorAxis * std::asin( - std::sqrt( - std::pow(std::sin(delta_lat / 2), 2) + - std::cos(glm::radians(lat_long_1.x)) * - std::cos(glm::radians(lat_long_2.x)) * - std::pow(std::sin(delta_long / 2), 2) - ) - ); -} - } diff --git a/nucleus/srs.h b/nucleus/srs.h index 589d2bf7..b38d52f9 100644 --- a/nucleus/srs.h +++ b/nucleus/srs.h @@ -47,6 +47,4 @@ glm::dvec2 lat_long_to_world(const glm::dvec2& lat_long); glm::dvec3 lat_long_alt_to_world(const glm::dvec3& lat_long_alt); glm::dvec2 world_to_lat_long(const glm::dvec2& world_pos); glm::dvec3 world_to_lat_long_alt(const glm::dvec3& world_pos); - -double haversine_distance(const glm::dvec2& lat_long_1, const glm::dvec2& lat_long_2); }