mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 03:48:44 +02:00
Interim JSDoc for Scene
This commit is contained in:
parent
62930eb576
commit
2c39f2dbad
1 changed files with 57 additions and 1 deletions
|
@ -19,6 +19,13 @@
|
||||||
|
|
||||||
// TODO: if QT moc ever supports nested classes, subclass these to the interface instead of namespacing
|
// TODO: if QT moc ever supports nested classes, subclass these to the interface instead of namespacing
|
||||||
namespace SceneScripting {
|
namespace SceneScripting {
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* @typedef Scene.Stage.Location
|
||||||
|
* @property {number} longitude
|
||||||
|
* @property {number} latitude
|
||||||
|
* @property {number} altitude
|
||||||
|
*/
|
||||||
class Location : public QObject {
|
class Location : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -41,6 +48,11 @@ namespace SceneScripting {
|
||||||
};
|
};
|
||||||
using LocationPointer = std::unique_ptr<Location>;
|
using LocationPointer = std::unique_ptr<Location>;
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* @typedef Scene.Stage.Time
|
||||||
|
* @property {number} hour
|
||||||
|
* @property {number} day
|
||||||
|
*/
|
||||||
class Time : public QObject {
|
class Time : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -60,6 +72,13 @@ namespace SceneScripting {
|
||||||
};
|
};
|
||||||
using TimePointer = std::unique_ptr<Time>;
|
using TimePointer = std::unique_ptr<Time>;
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* @typedef Scene.Stage.KeyLight
|
||||||
|
* @property {Vec3} color
|
||||||
|
* @property {number} intensity
|
||||||
|
* @property {number} ambientIntensity
|
||||||
|
* @property {Vec3} direction
|
||||||
|
*/
|
||||||
class KeyLight : public QObject {
|
class KeyLight : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -91,6 +110,14 @@ namespace SceneScripting {
|
||||||
};
|
};
|
||||||
using KeyLightPointer = std::unique_ptr<KeyLight>;
|
using KeyLightPointer = std::unique_ptr<KeyLight>;
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* @class Scene.Stage
|
||||||
|
* @property {string} backgroundMode
|
||||||
|
* @property {Scene.Stage.KeyLight} keyLight
|
||||||
|
* @property {Scene.Stage.Location} location
|
||||||
|
* @property {boolean} sunModel
|
||||||
|
* @property {Scene.Stage.Time} time
|
||||||
|
*/
|
||||||
class Stage : public QObject {
|
class Stage : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -99,10 +126,22 @@ namespace SceneScripting {
|
||||||
: _skyStage{ skyStage },
|
: _skyStage{ skyStage },
|
||||||
_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
|
||||||
|
* @function Scene.Stage.setOrientation
|
||||||
|
* @param {Quat} orientation
|
||||||
|
*/
|
||||||
Q_INVOKABLE void setOrientation(const glm::quat& orientation) const;
|
Q_INVOKABLE void setOrientation(const glm::quat& orientation) const;
|
||||||
|
|
||||||
Q_PROPERTY(Location* location READ getLocation)
|
Q_PROPERTY(Location* location READ getLocation)
|
||||||
|
|
||||||
Location* getLocation() const { return _location.get(); }
|
Location* getLocation() const { return _location.get(); }
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* @function Scene.Stage.setLocation
|
||||||
|
* @param {number} longitude
|
||||||
|
* @param {number} latitude
|
||||||
|
* @param {number} altitude
|
||||||
|
*/
|
||||||
Q_INVOKABLE void setLocation(float longitude, float latitude, float altitude);
|
Q_INVOKABLE void setLocation(float longitude, float latitude, float altitude);
|
||||||
|
|
||||||
Q_PROPERTY(Time* time READ getTime)
|
Q_PROPERTY(Time* time READ getTime)
|
||||||
|
@ -130,10 +169,15 @@ namespace SceneScripting {
|
||||||
using StagePointer = std::unique_ptr<Stage>;
|
using StagePointer = std::unique_ptr<Stage>;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* @namespace Scene
|
||||||
|
* @property {boolean} shouldRenderAvatars
|
||||||
|
* @property {boolean} shouldRenderEntities
|
||||||
|
* @property {Scene.Stage} stage
|
||||||
|
*/
|
||||||
class SceneScriptingInterface : public QObject, public Dependency {
|
class SceneScriptingInterface : public QObject, public Dependency {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
SINGLETON_DEPENDENCY
|
SINGLETON_DEPENDENCY
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_PROPERTY(bool shouldRenderAvatars READ shouldRenderAvatars WRITE setShouldRenderAvatars)
|
Q_PROPERTY(bool shouldRenderAvatars READ shouldRenderAvatars WRITE setShouldRenderAvatars)
|
||||||
|
@ -149,7 +193,19 @@ public:
|
||||||
graphics::SunSkyStagePointer getSkyStage() const;
|
graphics::SunSkyStagePointer getSkyStage() const;
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* @function Scene.shouldRenderAvatarsChanged
|
||||||
|
* @param {boolean} shouldRenderAvatars
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
void shouldRenderAvatarsChanged(bool shouldRenderAvatars);
|
void shouldRenderAvatarsChanged(bool shouldRenderAvatars);
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* @function Scene.shouldRenderEntitiesChanged
|
||||||
|
* @param {boolean} shouldRenderEntities
|
||||||
|
* @returns {Signal}
|
||||||
|
*/
|
||||||
void shouldRenderEntitiesChanged(bool shouldRenderEntities);
|
void shouldRenderEntitiesChanged(bool shouldRenderEntities);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Reference in a new issue