diff --git a/modules/server/src/topics/skybrowsertopic.cpp b/modules/server/src/topics/skybrowsertopic.cpp index aa86d78531..6b8ff7a51f 100644 --- a/modules/server/src/topics/skybrowsertopic.cpp +++ b/modules/server/src/topics/skybrowsertopic.cpp @@ -40,6 +40,7 @@ namespace { constexpr std::string_view SendImageCollection = "send_image_collection"; constexpr std::string_view MoveHoverCircle = "move_hover_circle"; constexpr std::string_view DisableHoverCircle = "disable_hover_circle"; + constexpr std::string_view FineTuneTarget = "fine_tune_target"; } // namespace using nlohmann::json; @@ -92,6 +93,17 @@ void SkyBrowserTopic::handleJson(const nlohmann::json& json) { if (event == DisableHoverCircle) { global::moduleEngine->module()->disableHoverCircle(false); } + if (event == FineTuneTarget) { + const std::string identifier = json.at("identifier").get(); + std::vector vec = json.at("translation").get>(); + glm::vec2 translation = glm::vec2(vec[0], vec[1]); + + SkyBrowserModule* module = global::moduleEngine->module(); + TargetBrowserPair* pair = module->pair(identifier); + if (pair) { + pair->fineTuneTarget(translation); + } + } if (event == SubscribeEvent) { ServerModule* module = global::moduleEngine->module(); _targetDataCallbackHandle = module->addPreSyncCallback(