Bug fixes

This commit is contained in:
Joakim Kilby
2015-02-19 10:04:02 +01:00
parent d913132852
commit 24d8f8c41e
2 changed files with 13 additions and 7 deletions

View File

@@ -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);

View File

@@ -35,6 +35,7 @@
#include <openspace/util/spicemanager.h>
#include <openspace/engine/openspaceengine.h>
#include <openspace/engine/configurationmanager.h>
#include <sgct.h>
#include <iomanip>
#include <string>
@@ -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();