mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-06 20:38:44 -06:00
Fix anchor-and-aim related errors
This commit is contained in:
@@ -645,6 +645,8 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) {
|
||||
}
|
||||
|
||||
_scene = std::make_unique<Scene>(std::move(sceneInitializer));
|
||||
global::renderEngine.setScene(_scene.get());
|
||||
|
||||
global::rootPropertyOwner.addPropertySubOwner(_scene.get());
|
||||
_scene->setCamera(std::make_unique<Camera>());
|
||||
Camera* camera = _scene->camera();
|
||||
@@ -661,8 +663,6 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) {
|
||||
);
|
||||
}
|
||||
|
||||
global::renderEngine.setScene(_scene.get());
|
||||
|
||||
_assetManager->removeAll();
|
||||
_assetManager->add(assetPath);
|
||||
|
||||
|
||||
@@ -581,6 +581,9 @@ void OrbitalNavigator::setAimNode(const std::string& aimNode) {
|
||||
}
|
||||
|
||||
void OrbitalNavigator::startRetargetAnchor() {
|
||||
if (!_anchorNode) {
|
||||
return;
|
||||
}
|
||||
const glm::dvec3 camPos = _camera->positionVec3();
|
||||
const glm::dvec3 camDir = _camera->viewDirectionWorldSpace();
|
||||
|
||||
@@ -600,6 +603,10 @@ void OrbitalNavigator::startRetargetAnchor() {
|
||||
}
|
||||
|
||||
void OrbitalNavigator::startRetargetAim() {
|
||||
if (!_aimNode) {
|
||||
return;
|
||||
}
|
||||
|
||||
const glm::dvec3 camPos = _camera->positionVec3();
|
||||
const glm::dvec3 camDir = _camera->viewDirectionWorldSpace();
|
||||
const glm::dvec3 centerPos = _aimNode->worldPosition();
|
||||
|
||||
Reference in New Issue
Block a user