Camera retargets and focuses on pointdatas sgn - does not reset the camera state when removing sgn

This commit is contained in:
aniisaaden
2020-10-13 15:33:43 +02:00
parent 42889906cc
commit b2e837dc5f
2 changed files with 10 additions and 3 deletions

View File

@@ -27,6 +27,7 @@
#include <modules/softwareintegration/rendering/renderablepointscloud.h>
#include <openspace/documentation/documentation.h>
#include <openspace/engine/globals.h>
#include <openspace/interaction/navigationhandler.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/scene/scene.h>
#include <openspace/scripting/scriptengine.h>
@@ -217,7 +218,7 @@ namespace openspace {
bool hasLuminosityData = !luminosityData.empty();
bool hasVelocityData = !velocityData.empty();
if (hasLuminosityData && hasVelocityData) {
/*if (hasLuminosityData && hasVelocityData) {
ghoul::Dictionary renderable = {
{ "Type", "RenderablePointsCloud"s },
{ "Color", static_cast<glm::dvec3>(color)},
@@ -248,7 +249,7 @@ namespace openspace {
{ "Velocity", velocityData }
};
}
else {
else {*/
ghoul::Dictionary renderable = {
{ "Type", "RenderablePointsCloud"s },
{ "Color", static_cast<glm::dvec3>(color)},
@@ -256,7 +257,7 @@ namespace openspace {
{ "Opacity", static_cast<double>(opacity) },
{ "Size", static_cast<double>(size)},
};
}
ghoul::Dictionary gui = {
{ "Name", guiName },
@@ -273,8 +274,12 @@ namespace openspace {
SceneGraphNode* sgn = global::renderEngine.scene()->loadNode(node);
if (!sgn) {
LERROR("Scene", "Could not load scene graph node");
break;
}
global::renderEngine.scene()->initializeNode(sgn);
global::navigationHandler.orbitalNavigator().setFocusNode(sgn);
global::navigationHandler.orbitalNavigator().startRetargetAnchor();
global::navigationHandler.orbitalNavigator().startRetargetAim();
}
catch (const documentation::SpecificationError& e) {
return LERROR(fmt::format("Documentation SpecificationError: Error loading scene graph node {}",
@@ -293,6 +298,8 @@ namespace openspace {
case SoftwareConnection::MessageType::RemoveSceneGraphNode: {
std::string identifier(message.begin(), message.end());
global::navigationHandler.orbitalNavigator().setFocusNode("Earth");
openspace::global::scriptEngine.queueScript(
"openspace.removeSceneGraphNode('" + identifier + "');",
scripting::ScriptEngine::RemoteScripting::Yes

0
unistd.h Normal file
View File