mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-09 05:00:42 -06:00
Change skybrowser module to work with one localhost and change variable names to ra and dec
This commit is contained in:
@@ -140,9 +140,8 @@ void SkybrowserModule::WWTfollowCamera() const {
|
||||
|
||||
// Execute javascript on browser
|
||||
ScreenSpaceBrowser* browser = dynamic_cast<ScreenSpaceBrowser*>(global::renderEngine->screenSpaceRenderable("ScreenSpaceBowser"));
|
||||
std::string script = "vm.onMessage({event: 'center_on_coordinates', ra : Number(" + std::to_string(celestCoords[0]) + "), dec : Number(" + std::to_string(celestCoords[1]) + "), fov : Number(" + std::to_string(_zoomFactor) + "), instant : false})";
|
||||
std::string script = "window.frames[0].postMessage({event: 'center_on_coordinates', ra : Number(" + std::to_string(celestCoords[0]) + "), dec : Number(" + std::to_string(celestCoords[1]) + "), fov : Number(" + std::to_string(_zoomFactor) + "), instant : false})";
|
||||
browser->executeJavascript(script);
|
||||
|
||||
}
|
||||
|
||||
glm::dvec2 SkybrowserModule::convertGalacticToCelestial(glm::dvec3 rGal) const {
|
||||
@@ -156,10 +155,12 @@ glm::dvec2 SkybrowserModule::convertGalacticToCelestial(glm::dvec3 rGal) const {
|
||||
});
|
||||
|
||||
glm::dvec3 rICRS = glm::transpose(conversionMatrix) * rGal;
|
||||
float l = atan2(rICRS[1], rICRS[0]);
|
||||
float b = atan2(rICRS[2], glm::sqrt((rICRS[0] * rICRS[0]) + (rICRS[1] * rICRS[1])));
|
||||
float ra = atan2(rICRS[1], rICRS[0]);
|
||||
float dec = atan2(rICRS[2], glm::sqrt((rICRS[0] * rICRS[0]) + (rICRS[1] * rICRS[1])));
|
||||
|
||||
return glm::dvec2(glm::degrees(l), glm::degrees(b));
|
||||
std::cout << glm::degrees(dec) << std::endl;
|
||||
|
||||
return glm::dvec2(glm::degrees(ra), glm::degrees(dec));
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace openspace::skybrowser::luascriptfunctions {
|
||||
node.setValue("Type", "ScreenSpaceBrowser"s);
|
||||
node.setValue("Identifier", "ScreenSpaceBowser"s);
|
||||
node.setValue("Name", "Screen Space Bowser"s);
|
||||
node.setValue("Url", "http://localhost:8080/?origin=localhost:4690"s);
|
||||
node.setValue("Url", "http://localhost:7800/sky_browser/index.html"s);
|
||||
// node.setValue("Dimensions", "glm::ivec2(1000, 1000)");
|
||||
|
||||
openspace::global::scriptEngine->queueScript(
|
||||
|
||||
Reference in New Issue
Block a user