Showing the changes to libraries/script-engine/src/SceneScriptingInterface.cpp (1 of 15 files). Show all
Unified · Split
| @@ -13,6 +13,9 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | #include "SceneScriptingInterface.h" |
| 15 | 15 | |
| 16 | +#include "SceneScriptingInterface.h" | |
| 17 | + | |
| 18 | + | |
| 16 | 19 | void SceneScriptingInterface::setStageOrientation(const glm::quat& orientation) { |
| 17 | 20 | _skyStage->setOriginOrientation(orientation); |
| 18 | 21 | } |
| @@ -86,6 +89,29 @@ bool SceneScriptingInterface::isStageSunModelEnabled() const { · 67 unmodified lines | ||
| 86 | 89 | return _skyStage->isSunModelEnabled(); |
| 87 | 90 | } |
| 88 | 91 | |
| 92 | +void SceneScriptingInterface::setBackgroundMode(const QString& mode) { | |
| 93 | + if (mode == QString("inherit")) { | |
| 94 | + _skyStage->setBackgroundMode(model::SunSkyStage::NO_BACKGROUND); | |
| 95 | + } else if (mode == QString("atmosphere")) { | |
| 96 | + _skyStage->setBackgroundMode(model::SunSkyStage::SKY_DOME); | |
| 97 | + } else if (mode == QString("skybox")) { | |
| 98 | + _skyStage->setBackgroundMode(model::SunSkyStage::SKY_BOX); | |
| 99 | + } | |
| 100 | +} | |
| 101 | + | |
| 102 | +QString SceneScriptingInterface::getBackgroundMode() const { | |
| 103 | + switch (_skyStage->getBackgroundMode()) { | |
| 104 | + case model::SunSkyStage::NO_BACKGROUND: | |
| 105 | + return QString("inherit"); | |
| 106 | + case model::SunSkyStage::SKY_DOME: | |
| 107 | + return QString("atmosphere"); | |
| 108 | + case model::SunSkyStage::SKY_BOX: | |
| 109 | + return QString("skybox"); | |
| 110 | + default: | |
| 111 | + return QString("inherit"); | |
| 112 | + }; | |
| 113 | +} | |
| 114 | + | |
| 89 | 115 | model::SunSkyStagePointer SceneScriptingInterface::getSkyStage() const { |
| 90 | 116 | return _skyStage; |
| 91 | 117 | } |