Add functionality to center target on screen, when it has been lost locked somewhere for example

This commit is contained in:
Ylva Selling
2021-06-03 10:03:27 +02:00
parent 0221ca1c20
commit e3c0e286fe
6 changed files with 54 additions and 14 deletions
+9
View File
@@ -101,6 +101,15 @@ namespace openspace::skybrowser {
double roll = glm::degrees(atan2(dotCrossUpNorthForward, dotNorthUp));
return roll;
}
glm::dvec3 cameraDirectionJ2000Cartesian() {
// Get the view direction of the screen in cartesian J2000 coordinates
glm::dvec3 camPos = global::navigationHandler->camera()->positionVec3();
constexpr double infinity = std::numeric_limits<float>::max();
glm::dvec3 galCoord = camPos + (infinity * global::navigationHandler->camera()->viewDirectionWorldSpace());
glm::dvec3 cartesianJ2000 = skybrowser::galacticCartesianToJ2000Cartesian(galCoord);
return cartesianJ2000;
}
}
// WWT messages