From 0e8795b159378f15dcd15afeb81416611fdc7d6f Mon Sep 17 00:00:00 2001 From: Lovisa Hassler Date: Mon, 29 Oct 2018 17:35:07 -0400 Subject: [PATCH] added check for getting a scenegraphnode for dish, error if it is not in asset file --- modules/dsn/rendering/communicationlines.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/dsn/rendering/communicationlines.cpp b/modules/dsn/rendering/communicationlines.cpp index 87c6e4ec4b..c975e79f41 100644 --- a/modules/dsn/rendering/communicationlines.cpp +++ b/modules/dsn/rendering/communicationlines.cpp @@ -91,7 +91,10 @@ namespace openspace { int activeFileIndex = findFileIndexForCurrentTime(currentTime); //parse data for that file if (!DsnManager::_dsnData.isLoaded) + { DsnManager::jsonParser(activeFileIndex); + + } else return; } @@ -237,9 +240,18 @@ namespace openspace { RenderableCommunicationPackage::PositionVBOLayout CommunicationLines::getPositionForGeocentricSceneGraphNode(const char* id) { - - glm::vec3 nodePos = global::renderEngine.scene()->sceneGraphNode(id)->position(); + RenderableCommunicationPackage::PositionVBOLayout position; + glm::dvec3 nodePos; + + if (global::renderEngine.scene()->sceneGraphNode(id)) { + nodePos = global::renderEngine.scene()->sceneGraphNode(id)->position(); + } + else { + LERROR(fmt::format("No position data for the station dish {}, drawing line from center of Earth", id)); + nodePos = glm::vec3(0, 0, 0); + } + position.x = nodePos.x; position.y = nodePos.y; position.z = nodePos.z;