Feature/anchor and aim (#799)

Introduce the ability to navigate using an anchor and aim.
Example use: Set spacecraft as anchor and planet as aim to always look down at a planet, while followin the spacecraft in its orbit.
This commit is contained in:
Emil Axelsson
2019-02-19 18:46:58 +01:00
committed by GitHub
parent df9fbf8195
commit 2e71eaa4cb
45 changed files with 972 additions and 490 deletions
@@ -28,6 +28,7 @@
#include <openspace/documentation/verifier.h>
#include <openspace/engine/globals.h>
#include <openspace/interaction/navigationhandler.h>
#include <openspace/interaction/orbitalnavigator.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/scene/scene.h>
#include <openspace/scene/scenegraphnode.h>
@@ -380,7 +381,14 @@ std::pair<glm::dvec3, std::string> DashboardItemAngle::positionAndLabel(
case Type::Node:
return { comp.node->worldPosition(), comp.node->guiName() };
case Type::Focus:
return { global::navigationHandler.focusNode()->worldPosition(), "focus" };
{
const SceneGraphNode* node =
global::navigationHandler.orbitalNavigator().anchorNode();
return {
node->worldPosition(),
"focus"
};
}
case Type::Camera:
return { global::renderEngine.scene()->camera()->positionVec3(), "camera" };
default:
@@ -28,6 +28,7 @@
#include <openspace/documentation/verifier.h>
#include <openspace/engine/globals.h>
#include <openspace/interaction/navigationhandler.h>
#include <openspace/interaction/orbitalnavigator.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/scene/scene.h>
#include <openspace/scene/scenegraphnode.h>
@@ -402,7 +403,7 @@ std::pair<glm::dvec3, std::string> DashboardItemDistance::positionAndLabel(
}
case Type::Focus:
return {
global::navigationHandler.focusNode()->worldPosition(),
global::navigationHandler.orbitalNavigator().anchorNode()->worldPosition(),
"focus"
};
case Type::Camera: