mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-21 10:28:44 -05:00
Add functionality to center target on screen, when it has been lost locked somewhere for example
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user