pelicanmapping / rocky

3D Geospatial SDK (C++17 / Vulkan / VSG)
MIT License
91 stars 15 forks source link

Infinite recursion in rocky::MapManipulator #36

Closed AnyOldName3 closed 3 months ago

AnyOldName3 commented 3 months ago

I tried loading rdemo with a map containing

    "profile": {
        "extent": {
            "srs": "+proj=utm +zone=30 +datum=WGS84 +units=m +no_defs",
            "xmax": 750000.0,
            "xmin": 650000.0,
            "ymax": 4400000.0,
            "ymin": 4300000.0
        },
        "tx": 1,
        "ty": 1
    }

(which technically I'd generated with some local changes to the .earth file importer, but that's not important).

However, this gave me a stack overflow, with the backtrace full of

>   rocky.dll!rocky::MapManipulator::clearViewpoint() Line 1076 C++
    rocky.dll!rocky::MapManipulator::home() Line 1148   C++
    rocky.dll!rocky::MapManipulator::clearViewpoint() Line 1086 C++
    rocky.dll!rocky::MapManipulator::home() Line 1148   C++
    rocky.dll!rocky::MapManipulator::clearViewpoint() Line 1086 C++
    rocky.dll!rocky::MapManipulator::home() Line 1148   C++
    rocky.dll!rocky::MapManipulator::clearViewpoint() Line 1086 C++
    rocky.dll!rocky::MapManipulator::home() Line 1148   C++
    rocky.dll!rocky::MapManipulator::clearViewpoint() Line 1086 C++
    rocky.dll!rocky::MapManipulator::home() Line 1148   C++
    rocky.dll!rocky::MapManipulator::clearViewpoint() Line 1086 C++
    rocky.dll!rocky::MapManipulator::home() Line 1148   C++
        ...

I believe that this is because it's trying to intersect with the terrain, which hasn't loaded yet so won't be hit, and so can't calculate the centre and distance to intersection (the basic line/plane fallback fails as the view direction is parallel to the plane), so tries rehoming the map, which starts by clearing the viewpoint, which was the thing that tried calculating the centre and distance to intersection.

ComradeMashkov commented 3 months ago

Had the same issue with custom .mbtiles file.