mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-28 06:49:32 -05:00
Merge branch 'develop' into stars
Conflicts: include/openspace/util/constants.h shaders/pscstandard_fs.glsl shaders/pscstandard_vs.glsl src/interaction/interactionhandler.cpp src/main.cpp src/rendering/renderengine.cpp src/scenegraph/scenegraph.cpp src/scenegraph/scenegraphnode.cpp src/util/factorymanager.cpp
This commit is contained in:
@@ -47,31 +47,34 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary)
|
||||
, _texture(nullptr)
|
||||
, _geometry(nullptr)
|
||||
{
|
||||
std::string name;
|
||||
bool success = dictionary.getValue(constants::scenegraphnode::keyName, name);
|
||||
assert(success);
|
||||
|
||||
std::string path;
|
||||
dictionary.getValue(constants::scenegraph::keyPathModule, path);
|
||||
success = dictionary.getValue(constants::scenegraph::keyPathModule, path);
|
||||
assert(success);
|
||||
|
||||
if (dictionary.hasKey(constants::renderableplanet::keyGeometry)) {
|
||||
ghoul::Dictionary geometryDictionary;
|
||||
dictionary.getValue(constants::renderableplanet::keyGeometry, geometryDictionary);
|
||||
ghoul::Dictionary geometryDictionary;
|
||||
success = dictionary.getValueSafe(
|
||||
constants::renderableplanet::keyGeometry, geometryDictionary);
|
||||
if (success) {
|
||||
geometryDictionary.setValue(constants::scenegraphnode::keyName, name);
|
||||
geometryDictionary.setValue(constants::scenegraph::keyPathModule, path);
|
||||
geometryDictionary.setValue(constants::scenegraphnode::keyName, name());
|
||||
|
||||
_geometry
|
||||
= planetgeometry::PlanetGeometry::createFromDictionary(geometryDictionary);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: textures need to be replaced by a good system similar to the geometry as soon
|
||||
// as the requirements are fixed (ab)
|
||||
std::string texturePath = "";
|
||||
if (dictionary.hasKey("Textures.Color")) {
|
||||
dictionary.getValue("Textures.Color", texturePath);
|
||||
success = dictionary.getValueSafe("Textures.Color", texturePath);
|
||||
if (success)
|
||||
_colorTexturePath = path + "/" + texturePath;
|
||||
}
|
||||
|
||||
for (properties::Property* p : _geometry->properties())
|
||||
addProperty(p);
|
||||
addPropertySubOwner(_geometry);
|
||||
|
||||
addProperty(_colorTexturePath);
|
||||
addProperty(_colorTexturePath);
|
||||
_colorTexturePath.onChange(std::bind(&RenderablePlanet::loadTexture, this));
|
||||
}
|
||||
|
||||
@@ -107,10 +110,10 @@ bool RenderablePlanet::deinitialize()
|
||||
|
||||
void RenderablePlanet::render(const Camera* camera, const psc& thisPosition)
|
||||
{
|
||||
// TODO replace with more robust assert
|
||||
// check so that the shader is set
|
||||
assert(_programObject);
|
||||
assert(_texture);
|
||||
if (!_programObject)
|
||||
return;
|
||||
if (!_texture)
|
||||
return;
|
||||
|
||||
// activate shader
|
||||
_programObject->activate();
|
||||
|
||||
Reference in New Issue
Block a user