Showing the changes to libraries/script-engine/src/SceneScriptingInterface.h (1 of 1 file). Show all
Unified · Split
| @@ -19,6 +19,13 @@ · 18 unmodified lines | ||
| 19 | 19 | |
| 20 | 20 | // TODO: if QT moc ever supports nested classes, subclass these to the interface instead of namespacing |
| 21 | 21 | namespace SceneScripting { |
| 22 | + | |
| 23 | + /**jsdoc | |
| 24 | + * @typedef Scene.Stage.Location | |
| 25 | + * @property {number} longitude | |
| 26 | + * @property {number} latitude | |
| 27 | + * @property {number} altitude | |
| 28 | + */ | |
| 22 | 29 | class Location : public QObject { |
| 23 | 30 | Q_OBJECT |
| 24 | 31 | |
| @@ -41,6 +48,11 @@ namespace SceneScripting { · 16 unmodified lines | ||
| 41 | 48 | }; |
| 42 | 49 | using LocationPointer = std::unique_ptr<Location>; |
| 43 | 50 | |
| 51 | + /**jsdoc | |
| 52 | + * @typedef Scene.Stage.Time | |
| 53 | + * @property {number} hour | |
| 54 | + * @property {number} day | |
| 55 | + */ | |
| 44 | 56 | class Time : public QObject { |
| 45 | 57 | Q_OBJECT |
| 46 | 58 | |
| @@ -60,6 +72,13 @@ namespace SceneScripting { · 13 unmodified lines | ||
| 60 | 72 | }; |
| 61 | 73 | using TimePointer = std::unique_ptr<Time>; |
| 62 | 74 | |
| 75 | + /**jsdoc | |
| 76 | + * @typedef Scene.Stage.KeyLight | |
| 77 | + * @property {Vec3} color | |
| 78 | + * @property {number} intensity | |
| 79 | + * @property {number} ambientIntensity | |
| 80 | + * @property {Vec3} direction | |
| 81 | + */ | |
| 63 | 82 | class KeyLight : public QObject { |
| 64 | 83 | Q_OBJECT |
| 65 | 84 | |
| @@ -91,6 +110,14 @@ namespace SceneScripting { · 25 unmodified lines | ||
| 91 | 110 | }; |
| 92 | 111 | using KeyLightPointer = std::unique_ptr<KeyLight>; |
| 93 | 112 | |
| 113 | + /**jsdoc | |
| 114 | + * @class Scene.Stage | |
| 115 | + * @property {string} backgroundMode | |
| 116 | + * @property {Scene.Stage.KeyLight} keyLight | |
| 117 | + * @property {Scene.Stage.Location} location | |
| 118 | + * @property {boolean} sunModel | |
| 119 | + * @property {Scene.Stage.Time} time | |
| 120 | + */ | |
| 94 | 121 | class Stage : public QObject { |
| 95 | 122 | Q_OBJECT |
| 96 | 123 | |
| @@ -99,10 +126,22 @@ namespace SceneScripting { · 2 unmodified lines | ||
| 99 | 126 | : _skyStage{ skyStage }, |
| 100 | 127 | _location{ new Location{ skyStage } }, _time{ new Time{ skyStage } }, _keyLight{ new KeyLight{ skyStage } }{} |
| 101 | 128 | |
| 129 | + /**jsdoc | |
| 130 | + * @function Scene.Stage.setOrientation | |
| 131 | + * @param {Quat} orientation | |
| 132 | + */ | |
| 102 | 133 | Q_INVOKABLE void setOrientation(const glm::quat& orientation) const; |
| 103 | 134 | |
| 104 | 135 | Q_PROPERTY(Location* location READ getLocation) |
| 136 | + | |
| 105 | 137 | Location* getLocation() const { return _location.get(); } |
| 138 | + | |
| 139 | + /**jsdoc | |
| 140 | + * @function Scene.Stage.setLocation | |
| 141 | + * @param {number} longitude | |
| 142 | + * @param {number} latitude | |
| 143 | + * @param {number} altitude | |
| 144 | + */ | |
| 106 | 145 | Q_INVOKABLE void setLocation(float longitude, float latitude, float altitude); |
| 107 | 146 | |
| 108 | 147 | Q_PROPERTY(Time* time READ getTime) |
| @@ -130,10 +169,15 @@ namespace SceneScripting { · 21 unmodified lines | ||
| 130 | 169 | using StagePointer = std::unique_ptr<Stage>; |
| 131 | 170 | }; |
| 132 | 171 | |
| 172 | +/**jsdoc | |
| 173 | + * @namespace Scene | |
| 174 | + * @property {boolean} shouldRenderAvatars | |
| 175 | + * @property {boolean} shouldRenderEntities | |
| 176 | + * @property {Scene.Stage} stage | |
| 177 | + */ | |
| 133 | 178 | class SceneScriptingInterface : public QObject, public Dependency { |
| 134 | 179 | Q_OBJECT |
| 135 | 180 | SINGLETON_DEPENDENCY |
| 136 | − | |
| 137 | 181 | |
| 138 | 182 | public: |
| 139 | 183 | Q_PROPERTY(bool shouldRenderAvatars READ shouldRenderAvatars WRITE setShouldRenderAvatars) |
| @@ -149,7 +193,19 @@ public: · 9 unmodified lines | ||
| 149 | 193 | graphics::SunSkyStagePointer getSkyStage() const; |
| 150 | 194 | |
| 151 | 195 | signals: |
| 196 | + | |
| 197 | + /**jsdoc | |
| 198 | + * @function Scene.shouldRenderAvatarsChanged | |
| 199 | + * @param {boolean} shouldRenderAvatars | |
| 200 | + * @returns {Signal} | |
| 201 | + */ | |
| 152 | 202 | void shouldRenderAvatarsChanged(bool shouldRenderAvatars); |
| 203 | + | |
| 204 | + /**jsdoc | |
| 205 | + * @function Scene.shouldRenderEntitiesChanged | |
| 206 | + * @param {boolean} shouldRenderEntities | |
| 207 | + * @returns {Signal} | |
| 208 | + */ | |
| 153 | 209 | void shouldRenderEntitiesChanged(bool shouldRenderEntities); |
| 154 | 210 | |
| 155 | 211 | protected: |