paysages3d/src/interface/modeler/AtmosphereModeler.cpp

26 lines
1.1 KiB
C++
Raw Normal View History

2014-08-28 13:09:47 +00:00
#include "AtmosphereModeler.h"
#include "MainModelerWindow.h"
#include "Scenery.h"
#include "AtmosphereDefinition.h"
#include "DefinitionNode.h"
#include "ModelerCameras.h"
2014-08-28 13:09:47 +00:00
AtmosphereModeler::AtmosphereModeler(MainModelerWindow *ui) : BaseModelerTool(ui) {
addFloatBinding("atmosphere_humidity", "value", "/atmosphere/humidity");
addFloatBinding("atmosphere_sun_direction", "phi", "/atmosphere/sun/phi", true);
addFloatBinding("atmosphere_sun_direction", "theta", "/atmosphere/sun/theta", true);
addFloatBinding("atmosphere_sun_radius", "value", "/atmosphere/sun/radius");
addFloatBinding("atmosphere_moon_direction", "phi", "/atmosphere/moon/phi", true);
addFloatBinding("atmosphere_moon_direction", "theta", "/atmosphere/moon/theta", true);
// addFloatBinding("atmosphere_moon_radius", "value", "/atmosphere/moon/radius");
2014-08-28 13:09:47 +00:00
ui->setQmlProperty("atmosphere_daytime", "value", ui->getScenery()->getAtmosphere()->getDaytime());
2014-08-28 13:09:47 +00:00
}
void AtmosphereModeler::nodeChanged(const DefinitionNode *node, const DefinitionDiff *) {
if (node->getPath().find("/atmosphere/sun/") == 0) {
getWindow()->getCamera()->startSunTool(1000);
}
}