diff --git a/modules/base/rendering/renderablepath.cpp b/modules/base/rendering/renderablepath.cpp index 4321bcccf5..9ccdf8622b 100644 --- a/modules/base/rendering/renderablepath.cpp +++ b/modules/base/rendering/renderablepath.cpp @@ -212,7 +212,7 @@ void RenderablePath::calculatePath(std::string observer) { return; double lightTime; - bool correctPosition = true; +// bool correctPosition = true; psc pscPos; double currentTime = _start; @@ -222,7 +222,7 @@ void RenderablePath::calculatePath(std::string observer) { //float g = _lineColor[1]; //float b = _lineColor[2]; for (int i = 0; i < segments; i++) { - correctPosition = SpiceManager::ref().getTargetPosition(_target, observer, _frame, "NONE", currentTime, pscPos, lightTime); + SpiceManager::ref().getTargetPosition(_target, observer, _frame, "NONE", currentTime, pscPos, lightTime); pscPos[3] += 3; //if (!correctPosition) { diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index f4677942f7..d915d3d1bb 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -138,14 +138,15 @@ RenderEngine::~RenderEngine() { bool RenderEngine::initialize() { std::string renderingMethod = DefaultRenderingMethod; - bool overwritingDefaultRenderingMethod = false; - if (OsEng.configurationManager()->hasKeyAndValue(KeyRenderingMethod)) { + + // If the user specified a rendering method that he would like to use, use that + if (OsEng.configurationManager()->hasKeyAndValue(KeyRenderingMethod)) renderingMethod = OsEng.configurationManager()->value(KeyRenderingMethod); - overwritingDefaultRenderingMethod = true; - } else { using Version = ghoul::systemcapabilities::OpenGLCapabilitiesComponent::Version; - + + // The default rendering method has a requirement of OpenGL 4.3, so if we are + // below that, we will fall back to frame buffer operation if (OpenGLCap.openGLVersion() < Version(4,3)) { LINFO("Falling back to framebuffer implementation due to OpenGL limitations"); renderingMethod = "ABufferFrameBuffer"; @@ -329,7 +330,8 @@ void RenderEngine::postSynchronizationPreDraw() { } // converts the quaternion used to rotation matrices - _mainCamera->compileViewRotationMatrix(); + if (_mainCamera) + _mainCamera->compileViewRotationMatrix(); // update and evaluate the scene starting from the root node _sceneGraph->update({ diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp index 1e5219021c..9ac6933b6b 100644 --- a/src/util/spicemanager.cpp +++ b/src/util/spicemanager.cpp @@ -316,9 +316,9 @@ bool SpiceManager::getNaifId(const std::string& body, int& id) const { } else { SpiceBoolean success; - SpiceInt sid = id; - bods2c_c(body.c_str(), &sid, &success); - id = sid; +// SpiceInt sid = id; + bods2c_c(body.c_str(), &id, &success); +// id = sid; if (success == SPICEFALSE) LERROR("Could not find NAIF ID of body '" + body + "'"); return (success == SPICETRUE); @@ -331,9 +331,7 @@ bool SpiceManager::getFrameId(const std::string& frame, int& id) const { return false; } else { - SpiceInt sid = id; - namfrm_c(frame.c_str(), &sid); - id = sid; + namfrm_c(frame.c_str(), &id); bool hasError = SpiceManager::checkForError("Error getting id for frame '" + frame + "'"); return !hasError; } @@ -403,7 +401,7 @@ bool SpiceManager::getValue(const std::string& body, const std::string& value, } bool SpiceManager::spacecraftClockToET(const std::string& craftIdCode, double& craftTicks, double& et){ - int craftID; + int craftID = -1; getNaifId(craftIdCode, craftID); sct2e_c(craftID, craftTicks, &et); bool hasError = checkForError("Error transforming spacecraft clock of '" + craftIdCode + "' at time " + std::to_string(craftTicks)); @@ -1010,8 +1008,8 @@ bool SpiceManager::checkForError(std::string errorMessage) { bool SpiceManager::getPlanetEllipsoid(std::string planetName, float &a, float &b, float &c) { SpiceDouble radii[3]; - SpiceInt n; - int id; + SpiceInt n = -1; + int id = -1; getNaifId(planetName, id); if (bodfnd_c(id, "RADII")) {