History

Split global JS Scene into Render

Zach Pomerantz committed 10 years ago

Commit 919a4b61 parent e1793269 files · +296 −280Browse files

Showing the changes to libraries/script-engine/src/SceneScriptingInterface.cpp (1 of 9 files). Show all

Unified · Split

libraries/script-engine/src/SceneScriptingInterface.cpp+16−79
@@ -1,6 +1,6 @@
11 //
22 // SceneScriptingInterface.cpp
3−// interface/src/scripting
3+// libraries/script-engine
44 //
55 // Created by Sam Gateau on 2/24/15.
66 // Copyright 2014 High Fidelity, Inc.
@@ -11,16 +11,27 @@ · 4 unmodified lines
1111
1212 #include "SceneScriptingInterface.h"
1313
14−#include <AddressManager.h>
15−
16−
1714 #include <procedural/ProceduralSkybox.h>
1815
1916 SceneScriptingInterface::SceneScriptingInterface() {
20− // Let's make sure the sunSkyStage is using a proceduralSKybox
17+ // Let's make sure the sunSkyStage is using a proceduralSkybox
2118 _skyStage->setSkybox(model::SkyboxPointer(new ProceduralSkybox()));
2219 }
2320
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+
2435 void SceneScriptingInterface::setStageOrientation(const glm::quat& orientation) {
2536 _skyStage->setOriginOrientation(orientation);
2637 }
@@ -120,77 +131,3 @@ QString SceneScriptingInterface::getBackgroundMode() const { · 93 unmodified lines
120131 model::SunSkyStagePointer SceneScriptingInterface::getSkyStage() const {
121132 return _skyStage;
122133 }
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−}