From 4653d3d7c65e991c87a26f1f4880626b34b50455 Mon Sep 17 00:00:00 2001 From: antar420 Date: Tue, 10 Mar 2015 12:22:52 -0400 Subject: [PATCH] Minor fixes in renderablemodel Added _performShading as a property and modified a spicemanager call to be able to work with models with different names for the rotation source frame and ephemeris body (such as 67p). --- include/openspace/rendering/model/renderablemodel.h | 1 + src/rendering/model/renderablemodel.cpp | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/openspace/rendering/model/renderablemodel.h b/include/openspace/rendering/model/renderablemodel.h index 4dd721cc16..41b22dea0e 100644 --- a/include/openspace/rendering/model/renderablemodel.h +++ b/include/openspace/rendering/model/renderablemodel.h @@ -66,6 +66,7 @@ private: std::string _source; std::string _destination; + std::string _target; psc _sunPosition; diff --git a/src/rendering/model/renderablemodel.cpp b/src/rendering/model/renderablemodel.cpp index fa1b7dabba..2e33dcc240 100644 --- a/src/rendering/model/renderablemodel.cpp +++ b/src/rendering/model/renderablemodel.cpp @@ -45,6 +45,7 @@ namespace { const std::string _loggerCat = "RenderableModel"; const std::string keySource = "Rotation.Source"; const std::string keyDestination = "Rotation.Destination"; + const std::string keyBody = "Body"; } namespace openspace { @@ -85,8 +86,10 @@ RenderableModel::RenderableModel(const ghoul::Dictionary& dictionary) dictionary.getValue(keySource, _source); dictionary.getValue(keyDestination, _destination); + dictionary.getValue(keyBody, _target); setBoundingSphere(pss(1.f, 9.f)); + addProperty(_performShading); } bool RenderableModel::isReady() const { @@ -144,7 +147,7 @@ void RenderableModel::render(const RenderData& data) { _programObject->setUniform("ModelTransform", transform); setPscUniforms(_programObject, &data.camera, data.position); - _programObject->setUniform("_performShading", true); + _programObject->setUniform("_performShading", _performShading); // Bind texture ghoul::opengl::TextureUnit unit; @@ -164,7 +167,7 @@ void RenderableModel::update(const UpdateData& data) { openspace::SpiceManager::ref().getPositionTransformMatrix(_source, _destination, data.time, _stateMatrix); double lt; - openspace::SpiceManager::ref().getTargetPosition("SUN", _source, "GALACTIC", "NONE", data.time, _sunPosition, lt); + openspace::SpiceManager::ref().getTargetPosition("SUN", _target, "GALACTIC", "NONE", data.time, _sunPosition, lt); } void RenderableModel::loadTexture() {