paysages3d/src/interface/modeler/AtmosphereModeler.cpp
2016-07-23 22:58:32 +02:00

26 lines
1.2 KiB
C++

#include "AtmosphereModeler.h"
#include "AtmosphereDefinition.h"
#include "DefinitionNode.h"
#include "MainModelerWindow.h"
#include "ModelerCameras.h"
#include "Scenery.h"
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");
ui->setQmlProperty("atmosphere_daytime", "value", ui->getScenery()->getAtmosphere()->getDaytime());
}
void AtmosphereModeler::nodeChanged(const DefinitionNode *node, const DefinitionDiff *, const DefinitionNode *) {
if (node->getPath().find("/atmosphere/sun/") == 0) {
getWindow()->getCamera()->startSunTool(1000);
}
}