mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-29 15:29:26 -05:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user