From 24d8f8c41e83bbba44c8fdbda14661389dc4a70a Mon Sep 17 00:00:00 2001 From: Joakim Kilby Date: Thu, 19 Feb 2015 10:04:02 +0100 Subject: [PATCH] Bug fixes --- src/rendering/planets/renderableplanet.cpp | 6 +++--- .../planets/renderableplanetprojection.cpp | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/rendering/planets/renderableplanet.cpp b/src/rendering/planets/renderableplanet.cpp index cd1b43b733..9ea54df6a5 100644 --- a/src/rendering/planets/renderableplanet.cpp +++ b/src/rendering/planets/renderableplanet.cpp @@ -79,7 +79,7 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) _geometry = planetgeometry::PlanetGeometry::createFromDictionary(geometryDictionary); } - dictionary.getValue(keyFrame, _target); + dictionary.getValue(keyFrame, _frame); bool b1 = dictionary.getValue(keyBody, _target); assert(b1 == true); @@ -170,9 +170,9 @@ void RenderablePlanet::render(const RenderData& data) // setup the data to the shader // _programObject->setUniform("camdir", camSpaceEye); - int shadows = (_target == "SUN") ? 0 : 1; + /*int shadows = (_target == "SUN") ? 0 : 1; _programObject->setUniform("shadows", shadows); - _programObject->setUniform("sun_pos", sun_pos.vec3()); + _programObject->setUniform("sun_pos", sun_pos.vec3());*/ _programObject->setUniform("ViewProjection", data.camera.viewProjectionMatrix()); _programObject->setUniform("ModelTransform", transform); setPscUniforms(_programObject, &data.camera, data.position); diff --git a/src/rendering/planets/renderableplanetprojection.cpp b/src/rendering/planets/renderableplanetprojection.cpp index ed79420d7c..87717904c9 100644 --- a/src/rendering/planets/renderableplanetprojection.cpp +++ b/src/rendering/planets/renderableplanetprojection.cpp @@ -35,6 +35,7 @@ #include #include +#include #include #include #include @@ -54,6 +55,11 @@ namespace { const std::string keyInstrumentNear = "Instrument.Near"; const std::string keyInstrumentFar = "Instrument.Far"; const std::string keySequenceDir = "Projection.Sequence"; + const std::string keyFrame = "Frame"; + const std::string keyGeometry = "Geometry"; + const std::string keyShading = "PerformShading"; + + const std::string keyBody = "Body"; const std::string _mainFrame = "GALACTIC"; } @@ -100,14 +106,14 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& ghoul::Dictionary geometryDictionary; success = dictionary.getValue( - constants::renderableplanet::keyGeometry, geometryDictionary); + keyGeometry, geometryDictionary); if (success) { geometryDictionary.setValue(constants::scenegraphnode::keyName, name); geometryDictionary.setValue(constants::scenegraph::keyPathModule, path); _geometry = planetgeometryprojection::PlanetGeometryProjection::createFromDictionary(geometryDictionary); } - dictionary.getValue(constants::renderableplanet::keyFrame, _target); + dictionary.getValue(keyFrame, _target); // TODO: textures need to be replaced by a good system similar to the geometry as soon // as the requirements are fixed (ab) @@ -150,11 +156,11 @@ bool RenderablePlanetProjection::initialize(){ bool completeSuccess = true; if (_programObject == nullptr) completeSuccess - &= OsEng.ref().configurationManager().getValue("projectiveProgram", _programObject); + &= OsEng.ref().configurationManager()->getValue("projectiveProgram", _programObject); if (_fboProgramObject == nullptr) completeSuccess - &= OsEng.ref().configurationManager().getValue("fboPassProgram", _fboProgramObject); + &= OsEng.ref().configurationManager()->getValue("fboPassProgram", _fboProgramObject); loadTexture(); loadProjectionTexture();