mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-23 04:30:15 -06: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:
@@ -39,6 +39,7 @@
|
||||
#include <openspace/interaction/keybindingmanager.h>
|
||||
#include <openspace/interaction/sessionrecording.h>
|
||||
#include <openspace/interaction/navigationhandler.h>
|
||||
#include <openspace/interaction/orbitalnavigator.h>
|
||||
#include <openspace/network/networkengine.h>
|
||||
#include <openspace/network/parallelpeer.h>
|
||||
#include <openspace/performance/performancemeasurement.h>
|
||||
@@ -651,7 +652,14 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) {
|
||||
|
||||
global::renderEngine.setCamera(camera);
|
||||
global::navigationHandler.setCamera(camera);
|
||||
global::navigationHandler.setFocusNode(camera->parent());
|
||||
const SceneGraphNode* parent = camera->parent();
|
||||
if (parent) {
|
||||
global::navigationHandler.orbitalNavigator().setFocusNode(parent->identifier());
|
||||
} else {
|
||||
global::navigationHandler.orbitalNavigator().setFocusNode(
|
||||
_scene->root()->identifier()
|
||||
);
|
||||
}
|
||||
|
||||
global::renderEngine.setScene(_scene.get());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user