Showing the changes to libraries/script-engine/src/SceneScriptingInterface.cpp (1 of 9 files). Show all
Unified · Split
| @@ -1,6 +1,6 @@ | |||
| 1 | // | 1 | // |
| 2 | // SceneScriptingInterface.cpp | 2 | // SceneScriptingInterface.cpp |
| 3 | // interface/src/scripting | 3 | // libraries/script-engine |
| 4 | // | 4 | // |
| 5 | // Created by Sam Gateau on 2/24/15. | 5 | // Created by Sam Gateau on 2/24/15. |
| 6 | // Copyright 2014 High Fidelity, Inc. | 6 | // Copyright 2014 High Fidelity, Inc. |
| @@ -11,16 +11,27 @@ · 4 unmodified lines | |||
| 11 | 11 | ||
| 12 | #include "SceneScriptingInterface.h" | 12 | #include "SceneScriptingInterface.h" |
| 13 | 13 | ||
| 14 | #include <AddressManager.h> | ||
| 15 | |||
| 16 | |||
| 17 | #include <procedural/ProceduralSkybox.h> | 14 | #include <procedural/ProceduralSkybox.h> |
| 18 | 15 | ||
| 19 | SceneScriptingInterface::SceneScriptingInterface() { | 16 | SceneScriptingInterface::SceneScriptingInterface() { |
| 20 | // Let's make sure the sunSkyStage is using a proceduralSKybox | 17 | // Let's make sure the sunSkyStage is using a proceduralSkybox |
| 21 | _skyStage->setSkybox(model::SkyboxPointer(new ProceduralSkybox())); | 18 | _skyStage->setSkybox(model::SkyboxPointer(new ProceduralSkybox())); |
| 22 | } | 19 | } |
| 23 | 20 | ||
| 21 | void SceneScriptingInterface::setShouldRenderAvatars(bool shouldRenderAvatars) { | ||
| 22 | if (shouldRenderAvatars != _shouldRenderAvatars) { | ||
| 23 | _shouldRenderAvatars = shouldRenderAvatars; | ||
| 24 | emit shouldRenderAvatarsChanged(_shouldRenderAvatars); | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | void SceneScriptingInterface::setShouldRenderEntities(bool shouldRenderEntities) { | ||
| 29 | if (shouldRenderEntities != _shouldRenderEntities) { | ||
| 30 | _shouldRenderEntities = shouldRenderEntities; | ||
| 31 | emit shouldRenderEntitiesChanged(_shouldRenderEntities); | ||
| 32 | } | ||
| 33 | } | ||
| 34 | |||
| 24 | void SceneScriptingInterface::setStageOrientation(const glm::quat& orientation) { | 35 | void SceneScriptingInterface::setStageOrientation(const glm::quat& orientation) { |
| 25 | _skyStage->setOriginOrientation(orientation); | 36 | _skyStage->setOriginOrientation(orientation); |
| 26 | } | 37 | } |
| @@ -120,77 +131,3 @@ QString SceneScriptingInterface::getBackgroundMode() const { · 93 unmodified lines | |||
| 120 | model::SunSkyStagePointer SceneScriptingInterface::getSkyStage() const { | 131 | model::SunSkyStagePointer SceneScriptingInterface::getSkyStage() const { |
| 121 | return _skyStage; | 132 | return _skyStage; |
| 122 | } | 133 | } |
| 123 | |||
| 124 | void SceneScriptingInterface::setShouldRenderAvatars(bool shouldRenderAvatars) { | ||
| 125 | if (shouldRenderAvatars != _shouldRenderAvatars) { | ||
| 126 | _shouldRenderAvatars = shouldRenderAvatars; | ||
| 127 | emit shouldRenderAvatarsChanged(_shouldRenderAvatars); | ||
| 128 | } | ||
| 129 | } | ||
| 130 | |||
| 131 | void SceneScriptingInterface::setShouldRenderEntities(bool shouldRenderEntities) { | ||
| 132 | if (shouldRenderEntities != _shouldRenderEntities) { | ||
| 133 | _shouldRenderEntities = shouldRenderEntities; | ||
| 134 | emit shouldRenderEntitiesChanged(_shouldRenderEntities); | ||
| 135 | } | ||
| 136 | } | ||
| 137 | |||
| 138 | void SceneScriptingInterface::setEngineRenderOpaque(bool renderOpaque) { | ||
| 139 | _engineRenderOpaque = renderOpaque; | ||
| 140 | } | ||
| 141 | |||
| 142 | void SceneScriptingInterface::setEngineRenderTransparent(bool renderTransparent) { | ||
| 143 | _engineRenderTransparent = renderTransparent; | ||
| 144 | } | ||
| 145 | |||
| 146 | void SceneScriptingInterface::setEngineCullOpaque(bool cullOpaque) { | ||
| 147 | _engineCullOpaque = cullOpaque; | ||
| 148 | } | ||
| 149 | |||
| 150 | void SceneScriptingInterface::setEngineCullTransparent(bool cullTransparent) { | ||
| 151 | _engineCullTransparent = cullTransparent; | ||
| 152 | } | ||
| 153 | |||
| 154 | void SceneScriptingInterface::setEngineSortOpaque(bool sortOpaque) { | ||
| 155 | _engineSortOpaque = sortOpaque; | ||
| 156 | } | ||
| 157 | |||
| 158 | void SceneScriptingInterface::setEngineSortTransparent(bool sortTransparent) { | ||
| 159 | _engineSortOpaque = sortTransparent; | ||
| 160 | } | ||
| 161 | |||
| 162 | void SceneScriptingInterface::clearEngineCounters() { | ||
| 163 | _numFeedOpaqueItems = 0; | ||
| 164 | _numDrawnOpaqueItems = 0; | ||
| 165 | _numFeedTransparentItems = 0; | ||
| 166 | _numDrawnTransparentItems = 0; | ||
| 167 | _numFeedOverlay3DItems = 0; | ||
| 168 | _numDrawnOverlay3DItems = 0; | ||
| 169 | } | ||
| 170 | |||
| 171 | |||
| 172 | void SceneScriptingInterface::setEngineToneMappingToneCurve(const QString& toneCurve) { | ||
| 173 | if (toneCurve == QString("None")) { | ||
| 174 | _engineToneMappingToneCurve = 0; | ||
| 175 | } else if (toneCurve == QString("Gamma22")) { | ||
| 176 | _engineToneMappingToneCurve = 1; | ||
| 177 | } else if (toneCurve == QString("Reinhard")) { | ||
| 178 | _engineToneMappingToneCurve = 2; | ||
| 179 | } else if (toneCurve == QString("Filmic")) { | ||
| 180 | _engineToneMappingToneCurve = 3; | ||
| 181 | } | ||
| 182 | } | ||
| 183 | QString SceneScriptingInterface::getEngineToneMappingToneCurve() const { | ||
| 184 | switch (_engineToneMappingToneCurve) { | ||
| 185 | case 0: | ||
| 186 | return QString("None"); | ||
| 187 | case 1: | ||
| 188 | return QString("Gamma22"); | ||
| 189 | case 2: | ||
| 190 | return QString("Reinhard"); | ||
| 191 | case 3: | ||
| 192 | return QString("Filmic"); | ||
| 193 | default: | ||
| 194 | return QString("Filmic"); | ||
| 195 | }; | ||
| 196 | } | ||