Merge pull request #15521 from ctrlaltdavid/M22489

Case 22489: Scene JSDoc
This commit is contained in:
Shannon Romano 2019-05-13 15:49:44 -07:00 committed by GitHub
commit 72d000a76d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,10 +21,11 @@
namespace SceneScripting { namespace SceneScripting {
/**jsdoc /**jsdoc
* @typedef {object} Scene.Stage.Location * Stage location.
* @property {number} longitude * @typedef {object} Stage.Location
* @property {number} latitude * @property {number} longitude - Longitude.
* @property {number} altitude * @property {number} latitude - Latitude.
* @property {number} altitude - Altitude.
*/ */
class Location : public QObject { class Location : public QObject {
Q_OBJECT Q_OBJECT
@ -49,9 +50,10 @@ namespace SceneScripting {
using LocationPointer = std::unique_ptr<Location>; using LocationPointer = std::unique_ptr<Location>;
/**jsdoc /**jsdoc
* @typedef {object} Scene.Stage.Time * Stage time.
* @property {number} hour * @typedef {object} Stage.Time
* @property {number} day * @property {number} hour - Hour.
* @property {number} day - Day.
*/ */
class Time : public QObject { class Time : public QObject {
Q_OBJECT Q_OBJECT
@ -73,11 +75,12 @@ namespace SceneScripting {
using TimePointer = std::unique_ptr<Time>; using TimePointer = std::unique_ptr<Time>;
/**jsdoc /**jsdoc
* @typedef {object} Scene.Stage.KeyLight * Stage key light.
* @property {Vec3} color * @typedef {object} Stage.KeyLight
* @property {number} intensity * @property {Vec3} color - Color.
* @property {number} ambientIntensity * @property {number} intensity - Intensity.
* @property {Vec3} direction * @property {number} ambientIntensity - Ambient intensity.
* @property {Vec3} direction - Direction.
*/ */
class KeyLight : public QObject { class KeyLight : public QObject {
Q_OBJECT Q_OBJECT
@ -111,17 +114,28 @@ namespace SceneScripting {
using KeyLightPointer = std::unique_ptr<KeyLight>; using KeyLightPointer = std::unique_ptr<KeyLight>;
/**jsdoc /**jsdoc
* @class Scene.Stage * The <code>Stage</code> class is no longer used.
*
* <p>Provided as a property in the {@link Scene} API.</p>
*
* <p class="important">Deprecated: This class is deprecated and will be removed.</p>
*
* @class Stage
* *
* @hifi-interface * @hifi-interface
* @hifi-client-entity * @hifi-client-entity
* @hifi-avatar * @hifi-avatar
* *
* @property {string} backgroundMode * @property {string} backgroundMode - Background mode.
* @property {Scene.Stage.KeyLight} keyLight * <p class="important">Deprecated: This property is deprecated and will be removed.</p>
* @property {Scene.Stage.Location} location * @property {Stage.KeyLight} keyLight - Key light.
* @property {boolean} sunModel * <p class="important">Deprecated: This property is deprecated and will be removed.</p>
* @property {Scene.Stage.Time} time * @property {Stage.Location} location - Location.
* <p class="important">Deprecated: This property is deprecated and will be removed.</p>
* @property {boolean} sunModel - Sun model.
* <p class="important">Deprecated: This property is deprecated and will be removed.</p>
* @property {Stage.Time} time - Time.
* <p class="important">Deprecated: This property is deprecated and will be removed.</p>
*/ */
class Stage : public QObject { class Stage : public QObject {
Q_OBJECT Q_OBJECT
@ -132,8 +146,9 @@ namespace SceneScripting {
_location{ new Location{ skyStage } }, _time{ new Time{ skyStage } }, _keyLight{ new KeyLight{ skyStage } }{} _location{ new Location{ skyStage } }, _time{ new Time{ skyStage } }, _keyLight{ new KeyLight{ skyStage } }{}
/**jsdoc /**jsdoc
* @function Scene.Stage.setOrientation * @function Stage.setOrientation
* @param {Quat} orientation * @param {Quat} orientation - Orientation.
* @deprecated This method is deprecated and will be removed.
*/ */
Q_INVOKABLE void setOrientation(const glm::quat& orientation) const; Q_INVOKABLE void setOrientation(const glm::quat& orientation) const;
@ -142,10 +157,11 @@ namespace SceneScripting {
Location* getLocation() const { return _location.get(); } Location* getLocation() const { return _location.get(); }
/**jsdoc /**jsdoc
* @function Scene.Stage.setLocation * @function Stage.setLocation
* @param {number} longitude * @param {number} longitude - Longitude.
* @param {number} latitude * @param {number} latitude - Latitude.
* @param {number} altitude * @param {number} altitude - Altitude.
* @deprecated This method is deprecated and will be removed.
*/ */
Q_INVOKABLE void setLocation(float longitude, float latitude, float altitude); Q_INVOKABLE void setLocation(float longitude, float latitude, float altitude);
@ -175,15 +191,20 @@ namespace SceneScripting {
}; };
/**jsdoc /**jsdoc
* The <code>Scene</code> API provides some control over what is rendered.
*
* @namespace Scene * @namespace Scene
* *
* @hifi-interface * @hifi-interface
* @hifi-client-entity * @hifi-client-entity
* @hifi-avatar * @hifi-avatar
* *
* @property {boolean} shouldRenderAvatars * @property {boolean} shouldRenderAvatars - <code>true</code> if avatars are rendered, <code>false</code> if they aren't.
* @property {boolean} shouldRenderEntities * @property {boolean} shouldRenderEntities - <code>true</code> if entities (domain, avatar, and local) are rendered,
* @property {Scene.Stage} stage * <code>false</code> if they aren't.
* @property {Stage} stage - Stage. <em>Read-only.</em>
* <p class="important">Deprecated: This property is deprecated and will be removed. Use {@link Entities| Zone entities}
* for lighting instead.</p>
*/ */
class SceneScriptingInterface : public QObject, public Dependency { class SceneScriptingInterface : public QObject, public Dependency {
Q_OBJECT Q_OBJECT
@ -205,15 +226,22 @@ public:
signals: signals:
/**jsdoc /**jsdoc
* Triggered when whether or not avatars are rendered changes.
* @function Scene.shouldRenderAvatarsChanged * @function Scene.shouldRenderAvatarsChanged
* @param {boolean} shouldRenderAvatars * @param {boolean} shouldRenderAvatars - <code>true</code> if avatars are rendered, <code>false</code> if they aren't.
* @returns {Signal} * @returns {Signal}
* @example <caption>Report when the rendering of avatars changes.</caption>
* Scene.shouldRenderAvatarsChanged.connect(function (shouldRenderAvatars) {
* print("Should render avatars changed to: " + shouldRenderAvatars);
* });
*/ */
void shouldRenderAvatarsChanged(bool shouldRenderAvatars); void shouldRenderAvatarsChanged(bool shouldRenderAvatars);
/**jsdoc /**jsdoc
* Triggered when whether or not entities are rendered changes.
* @function Scene.shouldRenderEntitiesChanged * @function Scene.shouldRenderEntitiesChanged
* @param {boolean} shouldRenderEntities * @param {boolean} shouldRenderEntities - <code>true</code> if entities (domain, avatar, and local) are rendered,
* <code>false</code> if they aren't.
* @returns {Signal} * @returns {Signal}
*/ */
void shouldRenderEntitiesChanged(bool shouldRenderEntities); void shouldRenderEntitiesChanged(bool shouldRenderEntities);