17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-31 05:20:52 +01:00

feat(editor): the chunks waiting for the terrain model and the tiles of the orthophoto asked for and not shown yet outlined on the ground where they will be, pulsing, blue and orange, named where the name fits: at the heights of the terrain beside them or of the model, else level with the nearest chunk or track

This commit is contained in:
maj00r
2026-10-24 18:31:24 +02:00
parent 336c940c28
commit 2ae10f5901
6 changed files with 120 additions and 0 deletions

View File

@@ -853,6 +853,20 @@ std::pair<std::size_t, std::size_t> editor_orthophoto::grounded() const
return result;
}
std::vector<std::pair<glm::dvec2, glm::dvec2>> editor_orthophoto::waiting() const
{
std::vector<std::pair<glm::dvec2, glm::dvec2>> result;
if (false == m_enabled || m_map_level > 0)
return result;
for (auto const &entry : m_tiles)
if (entry.second.level == 0 && entry.second.requested > 0 && false == entry.second.empty)
{
glm::dvec2 const corner = tile_corner(entry.first);
result.emplace_back(corner - glm::dvec2{tile_size}, corner);
}
return result;
}
bool editor_orthophoto::sampled_height(tile_key const &Own, double const X, double const Z, float &Height) const
{
auto const key{camera_tile({X, 0.0, Z})};

View File

@@ -108,6 +108,8 @@ class editor_orthophoto
void ground_arrived();
// the tiles with the ground sampled under them, and of these the ones at guessed heights
std::pair<std::size_t, std::size_t> grounded() const;
// the rectangles (x, z) of the tiles of the imagery asked for and not shown yet
std::vector<std::pair<glm::dvec2, glm::dvec2>> waiting() const;
// takes the scene geometry out of the region (e.g. when the editor is left); it's re-created on the next update
void detach_scene();
// true for geometry created by the layer, so ground queries can skip it