mirror of
https://github.com/lubosz/overte.git
synced 2025-04-09 05:03:52 +02:00
Merge pull request #13165 from ctrlaltdavid/21872-b
JSDoc stubs for various APIs
This commit is contained in:
commit
40ff3f966f
49 changed files with 2723 additions and 176 deletions
|
@ -33,6 +33,19 @@
|
|||
#include "entities/EntityTreeHeadlessViewer.h"
|
||||
#include "avatars/ScriptableAvatar.h"
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Agent
|
||||
*
|
||||
* @hifi-assignment-client
|
||||
*
|
||||
* @property {boolean} isAvatar
|
||||
* @property {boolean} isPlayingAvatarSound <em>Read-only.</em>
|
||||
* @property {boolean} isListeningToAudioStream
|
||||
* @property {boolean} isNoiseGateEnabled
|
||||
* @property {number} lastReceivedAudioLoudness <em>Read-only.</em>
|
||||
* @property {Uuid} sessionUUID <em>Read-only.</em>
|
||||
*/
|
||||
|
||||
class Agent : public ThreadedAssignment {
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -60,10 +73,28 @@ public:
|
|||
virtual void aboutToFinish() override;
|
||||
|
||||
public slots:
|
||||
/**jsdoc
|
||||
* @function Agent.run
|
||||
* @deprecated This function is being removed from the API.
|
||||
*/
|
||||
void run() override;
|
||||
|
||||
/**jsdoc
|
||||
* @function Agent.playAvatarSound
|
||||
* @param {object} avatarSound
|
||||
*/
|
||||
void playAvatarSound(SharedSoundPointer avatarSound);
|
||||
|
||||
/**jsdoc
|
||||
* @function Agent.setIsAvatar
|
||||
* @param {boolean} isAvatar
|
||||
*/
|
||||
void setIsAvatar(bool isAvatar);
|
||||
|
||||
/**jsdoc
|
||||
* @function Agent.isAvatar
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bool isAvatar() const { return _isAvatar; }
|
||||
|
||||
private slots:
|
||||
|
|
|
@ -17,20 +17,144 @@
|
|||
#include <AvatarData.h>
|
||||
#include <ScriptEngine.h>
|
||||
|
||||
/**jsdoc
|
||||
* The <code>Avatar</code> API is used to manipulate scriptable avatars on the domain. This API is a subset of the
|
||||
* {@link MyAvatar} API.
|
||||
*
|
||||
* <p><strong>Note:</strong> In the examples, use "<code>Avatar</code>" instead of "<code>MyAvatar</code>".</p>
|
||||
*
|
||||
* @namespace Avatar
|
||||
*
|
||||
* @hifi-assignment-client
|
||||
*
|
||||
* @property {Vec3} position
|
||||
* @property {number} scale
|
||||
* @property {number} density <em>Read-only.</em>
|
||||
* @property {Vec3} handPosition
|
||||
* @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
|
||||
* Yaw is sometimes called "heading".
|
||||
* @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is
|
||||
* sometimes called "elevation".
|
||||
* @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is
|
||||
* sometimes called "bank".
|
||||
* @property {Quat} orientation
|
||||
* @property {Quat} headOrientation - The orientation of the avatar's head.
|
||||
* @property {number} headPitch - The rotation about an axis running from ear to ear of the avatar's head. Pitch is
|
||||
* sometimes called "elevation".
|
||||
* @property {number} headYaw - The rotation left or right about an axis running from the base to the crown of the avatar's
|
||||
* head. Yaw is sometimes called "heading".
|
||||
* @property {number} headRoll - The rotation about an axis running from the nose to the back of the avatar's head. Roll is
|
||||
* sometimes called "bank".
|
||||
* @property {Vec3} velocity
|
||||
* @property {Vec3} angularVelocity
|
||||
* @property {number} audioLoudness
|
||||
* @property {number} audioAverageLoudness
|
||||
* @property {string} displayName
|
||||
* @property {string} sessionDisplayName - Sanitized, defaulted version displayName that is defined by the AvatarMixer
|
||||
* rather than by Interface clients. The result is unique among all avatars present at the time.
|
||||
* @property {boolean} lookAtSnappingEnabled
|
||||
* @property {string} skeletonModelURL
|
||||
* @property {AttachmentData[]} attachmentData
|
||||
* @property {string[]} jointNames - The list of joints in the current avatar model. <em>Read-only.</em>
|
||||
* @property {Uuid} sessionUUID <em>Read-only.</em>
|
||||
* @property {Mat4} sensorToWorldMatrix <em>Read-only.</em>
|
||||
* @property {Mat4} controllerLeftHandMatrix <em>Read-only.</em>
|
||||
* @property {Mat4} controllerRightHandMatrix <em>Read-only.</em>
|
||||
* @property {number} sensorToWorldScale <em>Read-only.</em>
|
||||
*
|
||||
* @borrows MyAvatar.getDomainMinScale as getDomainMinScale
|
||||
* @borrows MyAvatar.getDomainMaxScale as getDomainMaxScale
|
||||
* @borrows MyAvatar.canMeasureEyeHeight as canMeasureEyeHeight
|
||||
* @borrows MyAvatar.getEyeHeight as getEyeHeight
|
||||
* @borrows MyAvatar.getHeight as getHeight
|
||||
* @borrows MyAvatar.setHandState as setHandState
|
||||
* @borrows MyAvatar.getHandState as getHandState
|
||||
* @borrows MyAvatar.setRawJointData as setRawJointData
|
||||
* @borrows MyAvatar.setJointData as setJointData
|
||||
* @borrows MyAvatar.setJointRotation as setJointRotation
|
||||
* @borrows MyAvatar.setJointTranslation as setJointTranslation
|
||||
* @borrows MyAvatar.clearJointData as clearJointData
|
||||
* @borrows MyAvatar.isJointDataValid as isJointDataValid
|
||||
* @borrows MyAvatar.getJointRotation as getJointRotation
|
||||
* @borrows MyAvatar.getJointTranslation as getJointTranslation
|
||||
* @borrows MyAvatar.getJointRotations as getJointRotations
|
||||
* @borrows MyAvatar.getJointTranslations as getJointTranslations
|
||||
* @borrows MyAvatar.setJointRotations as setJointRotations
|
||||
* @borrows MyAvatar.setJointTranslations as setJointTranslations
|
||||
* @borrows MyAvatar.clearJointsData as clearJointsData
|
||||
* @borrows MyAvatar.getJointIndex as getJointIndex
|
||||
* @borrows MyAvatar.getJointNames as getJointNames
|
||||
* @borrows MyAvatar.setBlendshape as setBlendshape
|
||||
* @borrows MyAvatar.getAttachmentsVariant as getAttachmentsVariant
|
||||
* @borrows MyAvatar.setAttachmentsVariant as setAttachmentsVariant
|
||||
* @borrows MyAvatar.updateAvatarEntity as updateAvatarEntity
|
||||
* @borrows MyAvatar.clearAvatarEntity as clearAvatarEntity
|
||||
* @borrows MyAvatar.setForceFaceTrackerConnected as setForceFaceTrackerConnected
|
||||
* @borrows MyAvatar.getAttachmentData as getAttachmentData
|
||||
* @borrows MyAvatar.setAttachmentData as setAttachmentData
|
||||
* @borrows MyAvatar.attach as attach
|
||||
* @borrows MyAvatar.detachOne as detachOne
|
||||
* @borrows MyAvatar.detachAll as detachAll
|
||||
* @borrows MyAvatar.getAvatarEntityData as getAvatarEntityData
|
||||
* @borrows MyAvatar.setAvatarEntityData as setAvatarEntityData
|
||||
* @borrows MyAvatar.getSensorToWorldMatrix as getSensorToWorldMatrix
|
||||
* @borrows MyAvatar.getSensorToWorldScale as getSensorToWorldScale
|
||||
* @borrows MyAvatar.getControllerLeftHandMatrix as getControllerLeftHandMatrix
|
||||
* @borrows MyAvatar.getControllerRightHandMatrix as getControllerRightHandMatrix
|
||||
* @borrows MyAvatar.getDataRate as getDataRate
|
||||
* @borrows MyAvatar.getUpdateRate as getUpdateRate
|
||||
* @borrows MyAvatar.displayNameChanged as displayNameChanged
|
||||
* @borrows MyAvatar.sessionDisplayNameChanged as sessionDisplayNameChanged
|
||||
* @borrows MyAvatar.skeletonModelURLChanged as skeletonModelURLChanged
|
||||
* @borrows MyAvatar.lookAtSnappingChanged as lookAtSnappingChanged
|
||||
* @borrows MyAvatar.sessionUUIDChanged as sessionUUIDChanged
|
||||
* @borrows MyAvatar.sendAvatarDataPacket as sendAvatarDataPacket
|
||||
* @borrows MyAvatar.sendIdentityPacket as sendIdentityPacket
|
||||
* @borrows MyAvatar.setJointMappingsFromNetworkReply as setJointMappingsFromNetworkReply
|
||||
* @borrows MyAvatar.setSessionUUID as setSessionUUID
|
||||
* @borrows MyAvatar.getAbsoluteJointRotationInObjectFrame as getAbsoluteJointRotationInObjectFrame
|
||||
* @borrows MyAvatar.getAbsoluteJointTranslationInObjectFrame as getAbsoluteJointTranslationInObjectFrame
|
||||
* @borrows MyAvatar.setAbsoluteJointRotationInObjectFrame as setAbsoluteJointRotationInObjectFrame
|
||||
* @borrows MyAvatar.setAbsoluteJointTranslationInObjectFrame as setAbsoluteJointTranslationInObjectFrame
|
||||
* @borrows MyAvatar.getTargetScale as getTargetScale
|
||||
* @borrows MyAvatar.resetLastSent as resetLastSent
|
||||
*/
|
||||
|
||||
class ScriptableAvatar : public AvatarData, public Dependency {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function Avatar.startAnimation
|
||||
* @param {string} url
|
||||
* @param {number} [fps=30]
|
||||
* @param {number} [priority=1]
|
||||
* @param {boolean} [loop=false]
|
||||
* @param {boolean} [hold=false]
|
||||
* @param {number} [firstFrame=0]
|
||||
* @param {number} [lastFrame=3.403e+38]
|
||||
* @param {string[]} [maskedJoints=[]]
|
||||
*/
|
||||
/// Allows scripts to run animations.
|
||||
Q_INVOKABLE void startAnimation(const QString& url, float fps = 30.0f, float priority = 1.0f, bool loop = false,
|
||||
bool hold = false, float firstFrame = 0.0f, float lastFrame = FLT_MAX, const QStringList& maskedJoints = QStringList());
|
||||
bool hold = false, float firstFrame = 0.0f, float lastFrame = FLT_MAX,
|
||||
const QStringList& maskedJoints = QStringList());
|
||||
|
||||
/**jsdoc
|
||||
* @function Avatar.stopAnimation
|
||||
*/
|
||||
Q_INVOKABLE void stopAnimation();
|
||||
|
||||
/**jsdoc
|
||||
* @function Avatar.getAnimationDetails
|
||||
* @returns {Avatar.AnimationDetails}
|
||||
*/
|
||||
Q_INVOKABLE AnimationDetails getAnimationDetails();
|
||||
|
||||
virtual void setSkeletonModelURL(const QUrl& skeletonModelURL) override;
|
||||
|
||||
virtual QByteArray toByteArrayStateful(AvatarDataDetail dataDetail, bool dropFaceTracking = false) override;
|
||||
|
||||
|
||||
private slots:
|
||||
void update(float deltatime);
|
||||
|
||||
|
|
|
@ -23,6 +23,13 @@
|
|||
|
||||
class EntitySimulation;
|
||||
|
||||
/**jsdoc
|
||||
* @namespace EntityViewer
|
||||
*
|
||||
* @hifi-assignment-client
|
||||
*/
|
||||
// API functions are defined in OctreeHeadlessViewer.
|
||||
|
||||
// Generic client side Octree renderer class.
|
||||
class EntityTreeHeadlessViewer : public OctreeHeadlessViewer {
|
||||
Q_OBJECT
|
||||
|
|
|
@ -26,28 +26,101 @@ public:
|
|||
static void trackIncomingOctreePacket(const QByteArray& packet, const SharedNodePointer& sendingNode, bool wasStatsPacket);
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.queryOctree
|
||||
*/
|
||||
void queryOctree();
|
||||
|
||||
|
||||
// setters for camera attributes
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.setPosition
|
||||
* @param {Vec3} position
|
||||
*/
|
||||
void setPosition(const glm::vec3& position) { _hasViewFrustum = true; _viewFrustum.setPosition(position); }
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.setOrientation
|
||||
* @param {Quat} orientation
|
||||
*/
|
||||
void setOrientation(const glm::quat& orientation) { _hasViewFrustum = true; _viewFrustum.setOrientation(orientation); }
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.setCenterRadius
|
||||
* @param {number} radius
|
||||
*/
|
||||
void setCenterRadius(float radius) { _hasViewFrustum = true; _viewFrustum.setCenterRadius(radius); }
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.setKeyholeRadius
|
||||
* @param {number} radius
|
||||
* @deprecated Use {@link EntityViewer.setCenterRadius|setCenterRadius} instead.
|
||||
*/
|
||||
void setKeyholeRadius(float radius) { _hasViewFrustum = true; _viewFrustum.setCenterRadius(radius); } // TODO: remove this legacy support
|
||||
|
||||
|
||||
// setters for LOD and PPS
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.setVoxelSizeScale
|
||||
* @param {number} sizeScale
|
||||
*/
|
||||
void setVoxelSizeScale(float sizeScale) { _octreeQuery.setOctreeSizeScale(sizeScale) ; }
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.setBoundaryLevelAdjust
|
||||
* @param {number} boundaryLevelAdjust
|
||||
*/
|
||||
void setBoundaryLevelAdjust(int boundaryLevelAdjust) { _octreeQuery.setBoundaryLevelAdjust(boundaryLevelAdjust); }
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.setMaxPacketsPerSecond
|
||||
* @param {number} maxPacketsPerSecond
|
||||
*/
|
||||
void setMaxPacketsPerSecond(int maxPacketsPerSecond) { _octreeQuery.setMaxQueryPacketsPerSecond(maxPacketsPerSecond); }
|
||||
|
||||
// getters for camera attributes
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.getPosition
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
const glm::vec3& getPosition() const { return _viewFrustum.getPosition(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.getOrientation
|
||||
* @returns {Quat}
|
||||
*/
|
||||
const glm::quat& getOrientation() const { return _viewFrustum.getOrientation(); }
|
||||
|
||||
|
||||
// getters for LOD and PPS
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.getVoxelSizeScale
|
||||
* @returns {number}
|
||||
*/
|
||||
float getVoxelSizeScale() const { return _octreeQuery.getOctreeSizeScale(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.getBoundaryLevelAdjust
|
||||
* @returns {number}
|
||||
*/
|
||||
int getBoundaryLevelAdjust() const { return _octreeQuery.getBoundaryLevelAdjust(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.getMaxPacketsPerSecond
|
||||
* @returns {number}
|
||||
*/
|
||||
int getMaxPacketsPerSecond() const { return _octreeQuery.getMaxQueryPacketsPerSecond(); }
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function EntityViewer.getOctreeElementsCount
|
||||
* @returns {number}
|
||||
*/
|
||||
unsigned getOctreeElementsCount() const { return _tree->getOctreeElementsCount(); }
|
||||
|
||||
private:
|
||||
|
|
|
@ -51,6 +51,9 @@ protected slots:
|
|||
/**jsdoc
|
||||
* @function AvatarBookmarks.deleteBookmark
|
||||
*/
|
||||
/**jsdoc
|
||||
* @function LocationBookmarks.deleteBookmark
|
||||
*/
|
||||
void deleteBookmark();
|
||||
|
||||
private:
|
||||
|
|
|
@ -16,6 +16,13 @@
|
|||
|
||||
#include "Bookmarks.h"
|
||||
|
||||
/**jsdoc
|
||||
* @namespace LocationBookmarks
|
||||
*
|
||||
* @hifi-client-entity
|
||||
* @hifi-interface
|
||||
*/
|
||||
|
||||
class LocationBookmarks : public Bookmarks, public Dependency {
|
||||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
|
@ -27,7 +34,16 @@ public:
|
|||
static const QString HOME_BOOKMARK;
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function LocationBookmarks.addBookmark
|
||||
*/
|
||||
void addBookmark();
|
||||
|
||||
/**jsdoc
|
||||
* @function LocationBookmarks.setHomeLocationToAddress
|
||||
* @param {string} address
|
||||
*/
|
||||
void setHomeLocationToAddress(const QVariant& address);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -29,10 +29,25 @@
|
|||
|
||||
/**jsdoc
|
||||
* The AvatarManager API has properties and methods which manage Avatars within the same domain.
|
||||
*
|
||||
* <p><strong>Note:</strong> This API is also provided to Interface and client entity scripts as the synonym,
|
||||
* <code>AvatarList</code>. For assignment client scripts, see the separate {@link AvatarList} API.
|
||||
*
|
||||
* @namespace AvatarManager
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*
|
||||
* @borrows AvatarList.getAvatarIdentifiers as getAvatarIdentifiers
|
||||
* @borrows AvatarList.getAvatarsInRange as getAvatarsInRange
|
||||
* @borrows AvatarList.avatarAddedEvent as avatarAddedEvent
|
||||
* @borrows AvatarList.avatarRemovedEvent as avatarRemovedEvent
|
||||
* @borrows AvatarList.avatarSessionChangedEvent as avatarSessionChangedEvent
|
||||
* @borrows AvatarList.isAvatarInRange as isAvatarInRange
|
||||
* @borrows AvatarList.sessionUUIDChanged as sessionUUIDChanged
|
||||
* @borrows AvatarList.processAvatarDataPacket as processAvatarDataPacket
|
||||
* @borrows AvatarList.processAvatarIdentityPacket as processAvatarIdentityPacket
|
||||
* @borrows AvatarList.processKillAvatar as processKillAvatar
|
||||
*/
|
||||
|
||||
class AvatarManager : public AvatarHashMap {
|
||||
|
|
|
@ -137,9 +137,9 @@ class MyAvatar : public Avatar {
|
|||
* @property {number} scale
|
||||
* @property {number} density <em>Read-only.</em>
|
||||
* @property {Vec3} handPosition
|
||||
* @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of MyAvatar. Yaw
|
||||
* is sometimes called "heading".
|
||||
* @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of MyAvatar. Pitch is
|
||||
* @property {number} bodyYaw - The rotation left or right about an axis running from the head to the feet of the avatar.
|
||||
* Yaw is sometimes called "heading".
|
||||
* @property {number} bodyPitch - The rotation about an axis running from shoulder to shoulder of the avatar. Pitch is
|
||||
* sometimes called "elevation".
|
||||
* @property {number} bodyRoll - The rotation about an axis running from the chest to the back of the avatar. Roll is
|
||||
* sometimes called "bank".
|
||||
|
|
|
@ -20,24 +20,122 @@ class LaserPointerScriptingInterface : public QObject, public Dependency {
|
|||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
|
||||
/**jsdoc
|
||||
* Synonym for {@link Pointers} as used for laser pointers.
|
||||
*
|
||||
* @namespace LaserPointers
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*/
|
||||
public:
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.createLaserPointer
|
||||
* @param {Pointers.LaserPointerProperties} properties
|
||||
* @returns {number}
|
||||
*/
|
||||
Q_INVOKABLE unsigned int createLaserPointer(const QVariant& properties) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.enableLaserPointer
|
||||
* @param {number} id
|
||||
*/
|
||||
Q_INVOKABLE void enableLaserPointer(unsigned int uid) const { DependencyManager::get<PointerManager>()->enablePointer(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.disableLaserPointer
|
||||
* @param {number} id
|
||||
*/
|
||||
Q_INVOKABLE void disableLaserPointer(unsigned int uid) const { DependencyManager::get<PointerManager>()->disablePointer(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.removeLaserPointer
|
||||
* @param {number} id
|
||||
*/
|
||||
Q_INVOKABLE void removeLaserPointer(unsigned int uid) const { DependencyManager::get<PointerManager>()->removePointer(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.editRenderState
|
||||
* @param {number} id
|
||||
* @param {string} renderState
|
||||
* @param {Pointers.RayPointerRenderState} properties
|
||||
*/
|
||||
Q_INVOKABLE void editRenderState(unsigned int uid, const QString& renderState, const QVariant& properties) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.setRenderState
|
||||
* @param {string} renderState
|
||||
* @param {number} id
|
||||
*/
|
||||
Q_INVOKABLE void setRenderState(unsigned int uid, const QString& renderState) const { DependencyManager::get<PointerManager>()->setRenderState(uid, renderState.toStdString()); }
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.getPrevRayPickResult
|
||||
* @param {number} id
|
||||
* @returns {RayPickResult}
|
||||
*/
|
||||
Q_INVOKABLE QVariantMap getPrevRayPickResult(unsigned int uid) const;
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.setPrecisionPicking
|
||||
* @param {number} id
|
||||
* @param {boolean} precisionPicking
|
||||
*/
|
||||
Q_INVOKABLE void setPrecisionPicking(unsigned int uid, bool precisionPicking) const { DependencyManager::get<PointerManager>()->setPrecisionPicking(uid, precisionPicking); }
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.setLaserLength
|
||||
* @param {number} id
|
||||
* @param {number} laserLength
|
||||
*/
|
||||
Q_INVOKABLE void setLaserLength(unsigned int uid, float laserLength) const { DependencyManager::get<PointerManager>()->setLength(uid, laserLength); }
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.setIgnoreItems
|
||||
* @param {number} id
|
||||
* @param {Uuid[]} ignoreItems
|
||||
*/
|
||||
Q_INVOKABLE void setIgnoreItems(unsigned int uid, const QScriptValue& ignoreEntities) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.setIncludeItems
|
||||
* @param {number} id
|
||||
* @param {Uuid[]} includeItems
|
||||
*/
|
||||
Q_INVOKABLE void setIncludeItems(unsigned int uid, const QScriptValue& includeEntities) const;
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.setLockEndUUID
|
||||
* @param {number} id
|
||||
* @param {Uuid} itemID
|
||||
* @param {boolean} isOverlay
|
||||
* @param {Mat4} [offsetMat]
|
||||
*/
|
||||
Q_INVOKABLE void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const { DependencyManager::get<PointerManager>()->setLockEndUUID(uid, objectID, isOverlay, offsetMat); }
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.isLeftHand
|
||||
* @param {number} id
|
||||
* @returns {boolean}
|
||||
*/
|
||||
Q_INVOKABLE bool isLeftHand(unsigned int uid) { return DependencyManager::get<PointerManager>()->isLeftHand(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.isRightHand
|
||||
* @param {number} id
|
||||
* @returns {boolean}
|
||||
*/
|
||||
Q_INVOKABLE bool isRightHand(unsigned int uid) { return DependencyManager::get<PointerManager>()->isRightHand(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* @function LaserPointers.isMouse
|
||||
* @param {number} id
|
||||
* @returns {boolean}
|
||||
*/
|
||||
Q_INVOKABLE bool isMouse(unsigned int uid) { return DependencyManager::get<PointerManager>()->isMouse(uid); }
|
||||
};
|
||||
|
||||
|
|
|
@ -31,6 +31,20 @@ unsigned int PickScriptingInterface::createPick(const PickQuery::PickType type,
|
|||
}
|
||||
}
|
||||
|
||||
/**jsdoc
|
||||
* A set of properties that can be passed to {@link Picks.createPick} to create a new Ray Pick.
|
||||
* @typedef {object} Picks.RayPickProperties
|
||||
* @property {boolean} [enabled=false] If this Pick should start enabled or not. Disabled Picks do not updated their pick results.
|
||||
* @property {number} [filter=Picks.PICK_NOTHING] The filter for this Pick to use, constructed using filter flags combined using bitwise OR.
|
||||
* @property {float} [maxDistance=0.0] The max distance at which this Pick will intersect. 0.0 = no max. < 0.0 is invalid.
|
||||
* @property {string} [joint] Only for Joint or Mouse Ray Picks. If "Mouse", it will create a Ray Pick that follows the system mouse, in desktop or HMD.
|
||||
* If "Avatar", it will create a Joint Ray Pick that follows your avatar's head. Otherwise, it will create a Joint Ray Pick that follows the given joint, if it
|
||||
* exists on your current avatar.
|
||||
* @property {Vec3} [posOffset=Vec3.ZERO] Only for Joint Ray Picks. A local joint position offset, in meters. x = upward, y = forward, z = lateral
|
||||
* @property {Vec3} [dirOffset=Vec3.UP] Only for Joint Ray Picks. A local joint direction offset. x = upward, y = forward, z = lateral
|
||||
* @property {Vec3} [position] Only for Static Ray Picks. The world-space origin of the ray.
|
||||
* @property {Vec3} [direction=-Vec3.UP] Only for Static Ray Picks. The world-space direction of the ray.
|
||||
*/
|
||||
unsigned int PickScriptingInterface::createRayPick(const QVariant& properties) {
|
||||
QVariantMap propMap = properties.toMap();
|
||||
|
||||
|
@ -83,6 +97,14 @@ unsigned int PickScriptingInterface::createRayPick(const QVariant& properties) {
|
|||
return PickManager::INVALID_PICK_ID;
|
||||
}
|
||||
|
||||
/**jsdoc
|
||||
* A set of properties that can be passed to {@link Picks.createPick} to create a new Stylus Pick.
|
||||
* @typedef {object} Picks.StylusPickProperties
|
||||
* @property {number} [hand=-1] An integer. 0 == left, 1 == right. Invalid otherwise.
|
||||
* @property {boolean} [enabled=false] If this Pick should start enabled or not. Disabled Picks do not updated their pick results.
|
||||
* @property {number} [filter=Picks.PICK_NOTHING] The filter for this Pick to use, constructed using filter flags combined using bitwise OR.
|
||||
* @property {float} [maxDistance=0.0] The max distance at which this Pick will intersect. 0.0 = no max. < 0.0 is invalid.
|
||||
*/
|
||||
unsigned int PickScriptingInterface::createStylusPick(const QVariant& properties) {
|
||||
QVariantMap propMap = properties.toMap();
|
||||
|
||||
|
|
|
@ -22,19 +22,22 @@
|
|||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*
|
||||
* @property PICK_NOTHING {number} A filter flag. Don't intersect with anything.
|
||||
* @property PICK_ENTITIES {number} A filter flag. Include entities when intersecting.
|
||||
* @property PICK_OVERLAYS {number} A filter flag. Include overlays when intersecting.
|
||||
* @property PICK_AVATARS {number} A filter flag. Include avatars when intersecting.
|
||||
* @property PICK_HUD {number} A filter flag. Include the HUD sphere when intersecting in HMD mode.
|
||||
* @property PICK_COARSE {number} A filter flag. Pick against coarse meshes, instead of exact meshes.
|
||||
* @property PICK_INCLUDE_INVISIBLE {number} A filter flag. Include invisible objects when intersecting.
|
||||
* @property PICK_INCLUDE_NONCOLLIDABLE {number} A filter flag. Include non-collidable objects when intersecting.
|
||||
* @property INTERSECTED_NONE {number} An intersection type. Intersected nothing with the given filter flags.
|
||||
* @property INTERSECTED_ENTITY {number} An intersection type. Intersected an entity.
|
||||
* @property INTERSECTED_OVERLAY {number} An intersection type. Intersected an overlay.
|
||||
* @property INTERSECTED_AVATAR {number} An intersection type. Intersected an avatar.
|
||||
* @property INTERSECTED_HUD {number} An intersection type. Intersected the HUD sphere.
|
||||
* @property PICK_NOTHING {number} A filter flag. Don't intersect with anything. <em>Read-only.</em>
|
||||
* @property PICK_ENTITIES {number} A filter flag. Include entities when intersecting. <em>Read-only.</em>
|
||||
* @property PICK_OVERLAYS {number} A filter flag. Include overlays when intersecting. <em>Read-only.</em>
|
||||
* @property PICK_AVATARS {number} A filter flag. Include avatars when intersecting. <em>Read-only.</em>
|
||||
* @property PICK_HUD {number} A filter flag. Include the HUD sphere when intersecting in HMD mode. <em>Read-only.</em>
|
||||
* @property PICK_COARSE {number} A filter flag. Pick against coarse meshes, instead of exact meshes. <em>Read-only.</em>
|
||||
* @property PICK_INCLUDE_INVISIBLE {number} A filter flag. Include invisible objects when intersecting. <em>Read-only.</em>
|
||||
* @property PICK_INCLUDE_NONCOLLIDABLE {number} A filter flag. Include non-collidable objects when intersecting.
|
||||
* <em>Read-only.</em>
|
||||
* @property PICK_ALL_INTERSECTIONS {number} <em>Read-only.</em>
|
||||
* @property INTERSECTED_NONE {number} An intersection type. Intersected nothing with the given filter flags. <em>Read-only.</em>
|
||||
* @property INTERSECTED_ENTITY {number} An intersection type. Intersected an entity. <em>Read-only.</em>
|
||||
* @property INTERSECTED_OVERLAY {number} An intersection type. Intersected an overlay. <em>Read-only.</em>
|
||||
* @property INTERSECTED_AVATAR {number} An intersection type. Intersected an avatar. <em>Read-only.</em>
|
||||
* @property INTERSECTED_HUD {number} An intersection type. Intersected the HUD sphere. <em>Read-only.</em>
|
||||
* @property {number} perFrameTimeBudget - The max number of usec to spend per frame updating Pick results. <em>Read-only.</em>
|
||||
*/
|
||||
|
||||
class PickScriptingInterface : public QObject, public Dependency {
|
||||
|
@ -61,46 +64,31 @@ public:
|
|||
|
||||
void registerMetaTypes(QScriptEngine* engine);
|
||||
|
||||
/**jsdoc
|
||||
* A set of properties that can be passed to {@link Picks.createPick} to create a new Pick.
|
||||
*
|
||||
* Different {@link Picks.PickType}s use different properties, and within one PickType, the properties you choose can lead to a wide range of behaviors. For example,
|
||||
* with PickType.Ray, depending on which optional parameters you pass, you could create a Static Ray Pick, a Mouse Ray Pick, or a Joint Ray Pick.
|
||||
*
|
||||
* @typedef {Object} Picks.PickProperties
|
||||
* @property {boolean} [enabled=false] If this Pick should start enabled or not. Disabled Picks do not updated their pick results.
|
||||
* @property {number} [filter=Picks.PICK_NOTHING] The filter for this Pick to use, constructed using filter flags combined using bitwise OR.
|
||||
* @property {float} [maxDistance=0.0] The max distance at which this Pick will intersect. 0.0 = no max. < 0.0 is invalid.
|
||||
* @property {string} [joint] Only for Joint or Mouse Ray Picks. If "Mouse", it will create a Ray Pick that follows the system mouse, in desktop or HMD.
|
||||
* If "Avatar", it will create a Joint Ray Pick that follows your avatar's head. Otherwise, it will create a Joint Ray Pick that follows the given joint, if it
|
||||
* exists on your current avatar.
|
||||
* @property {Vec3} [posOffset=Vec3.ZERO] Only for Joint Ray Picks. A local joint position offset, in meters. x = upward, y = forward, z = lateral
|
||||
* @property {Vec3} [dirOffset=Vec3.UP] Only for Joint Ray Picks. A local joint direction offset. x = upward, y = forward, z = lateral
|
||||
* @property {Vec3} [position] Only for Static Ray Picks. The world-space origin of the ray.
|
||||
* @property {Vec3} [direction=-Vec3.UP] Only for Static Ray Picks. The world-space direction of the ray.
|
||||
* @property {number} [hand=-1] Only for Stylus Picks. An integer. 0 == left, 1 == right. Invalid otherwise.
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* Adds a new Pick.
|
||||
* Different {@link PickType}s use different properties, and within one PickType, the properties you choose can lead to a wide range of behaviors. For example,
|
||||
* with PickType.Ray, depending on which optional parameters you pass, you could create a Static Ray Pick, a Mouse Ray Pick, or a Joint Ray Pick.
|
||||
* @function Picks.createPick
|
||||
* @param {Picks.PickType} type A PickType that specifies the method of picking to use
|
||||
* @param {Picks.PickProperties} properties A PickProperties object, containing all the properties for initializing this Pick
|
||||
* @param {PickType} type A PickType that specifies the method of picking to use
|
||||
* @param {Picks.RayPickProperties|Picks.StylusPickProperties} properties A PickProperties object, containing all the properties for initializing this Pick
|
||||
* @returns {number} The ID of the created Pick. Used for managing the Pick. 0 if invalid.
|
||||
*/
|
||||
Q_INVOKABLE unsigned int createPick(const PickQuery::PickType type, const QVariant& properties);
|
||||
|
||||
/**jsdoc
|
||||
* Enables a Pick.
|
||||
* @function Picks.enablePick
|
||||
* @param {number} uid The ID of the Pick, as returned by {@link Picks.createPick}.
|
||||
*/
|
||||
Q_INVOKABLE void enablePick(unsigned int uid);
|
||||
|
||||
/**jsdoc
|
||||
* Disables a Pick.
|
||||
* @function Picks.disablePick
|
||||
* @param {number} uid The ID of the Pick, as returned by {@link Picks.createPick}.
|
||||
*/
|
||||
Q_INVOKABLE void disablePick(unsigned int uid);
|
||||
|
||||
/**jsdoc
|
||||
* Removes a Pick.
|
||||
* @function Picks.removePick
|
||||
|
@ -111,7 +99,7 @@ public:
|
|||
/**jsdoc
|
||||
* An intersection result for a Ray Pick.
|
||||
*
|
||||
* @typedef {Object} Picks.RayPickResult
|
||||
* @typedef {Object} RayPickResult
|
||||
* @property {number} type The intersection type.
|
||||
* @property {boolean} intersects If there was a valid intersection (type != INTERSECTED_NONE)
|
||||
* @property {Uuid} objectID The ID of the intersected object. Uuid.NULL for the HUD or invalid intersections.
|
||||
|
@ -125,7 +113,7 @@ public:
|
|||
/**jsdoc
|
||||
* An intersection result for a Stylus Pick.
|
||||
*
|
||||
* @typedef {Object} Picks.StylusPickResult
|
||||
* @typedef {Object} StylusPickResult
|
||||
* @property {number} type The intersection type.
|
||||
* @property {boolean} intersects If there was a valid intersection (type != INTERSECTED_NONE)
|
||||
* @property {Uuid} objectID The ID of the intersected object. Uuid.NULL for the HUD or invalid intersections.
|
||||
|
@ -140,7 +128,7 @@ public:
|
|||
* Get the most recent pick result from this Pick. This will be updated as long as the Pick is enabled.
|
||||
* @function Picks.getPrevPickResult
|
||||
* @param {number} uid The ID of the Pick, as returned by {@link Picks.createPick}.
|
||||
* @returns {PickResult} The most recent intersection result. This will be slightly different for different PickTypes. See {@link Picks.RayPickResult} and {@link Picks.StylusPickResult}.
|
||||
* @returns {RayPickResult|StylusPickResult} The most recent intersection result. This will be different for different PickTypes.
|
||||
*/
|
||||
Q_INVOKABLE QVariantMap getPrevPickResult(unsigned int uid);
|
||||
|
||||
|
@ -151,6 +139,7 @@ public:
|
|||
* @param {boolean} precisionPicking Whether or not to use precision picking
|
||||
*/
|
||||
Q_INVOKABLE void setPrecisionPicking(unsigned int uid, bool precisionPicking);
|
||||
|
||||
/**jsdoc
|
||||
* Sets a list of Entity IDs, Overlay IDs, and/or Avatar IDs to ignore during intersection. Not used by Stylus Picks.
|
||||
* @function Picks.setIgnoreItems
|
||||
|
@ -158,6 +147,7 @@ public:
|
|||
* @param {Uuid[]} ignoreItems A list of IDs to ignore.
|
||||
*/
|
||||
Q_INVOKABLE void setIgnoreItems(unsigned int uid, const QScriptValue& ignoreItems);
|
||||
|
||||
/**jsdoc
|
||||
* Sets a list of Entity IDs, Overlay IDs, and/or Avatar IDs to include during intersection, instead of intersecting with everything. Stylus
|
||||
* Picks <b>only</b> intersect with objects in their include list.
|
||||
|
@ -174,6 +164,7 @@ public:
|
|||
* @returns {boolean} True if the Pick is a Joint Ray Pick with joint == "_CONTROLLER_LEFTHAND" or "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND", or a Stylus Pick with hand == 0.
|
||||
*/
|
||||
Q_INVOKABLE bool isLeftHand(unsigned int uid);
|
||||
|
||||
/**jsdoc
|
||||
* Check if a Pick is associated with the right hand.
|
||||
* @function Picks.isRightHand
|
||||
|
@ -181,6 +172,7 @@ public:
|
|||
* @returns {boolean} True if the Pick is a Joint Ray Pick with joint == "_CONTROLLER_RIGHTHAND" or "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND", or a Stylus Pick with hand == 1.
|
||||
*/
|
||||
Q_INVOKABLE bool isRightHand(unsigned int uid);
|
||||
|
||||
/**jsdoc
|
||||
* Check if a Pick is associated with the system mouse.
|
||||
* @function Picks.isMouse
|
||||
|
@ -189,28 +181,96 @@ public:
|
|||
*/
|
||||
Q_INVOKABLE bool isMouse(unsigned int uid);
|
||||
|
||||
// FIXME: Move to other property definitions.
|
||||
Q_PROPERTY(unsigned int perFrameTimeBudget READ getPerFrameTimeBudget WRITE setPerFrameTimeBudget)
|
||||
/**jsdoc
|
||||
* The max number of usec to spend per frame updating Pick results.
|
||||
* @typedef {number} Picks.perFrameTimeBudget
|
||||
*/
|
||||
|
||||
unsigned int getPerFrameTimeBudget() const;
|
||||
void setPerFrameTimeBudget(unsigned int numUsecs);
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.PICK_NOTHING
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int PICK_NOTHING() { return 0; }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.PICK_ENTITIES
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int PICK_ENTITIES() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_ENTITIES); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.PICK_OVERLAYS
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int PICK_OVERLAYS() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_OVERLAYS); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.PICK_AVATARS
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int PICK_AVATARS() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_AVATARS); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.PICK_HUD
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int PICK_HUD() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_HUD); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.PICK_COARSE
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int PICK_COARSE() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_COARSE); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.PICK_INCLUDE_INVISIBLE
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int PICK_INCLUDE_INVISIBLE() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_INCLUDE_INVISIBLE); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.PICK_INCLUDE_NONCOLLIDABLE
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int PICK_INCLUDE_NONCOLLIDABLE() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_INCLUDE_NONCOLLIDABLE); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.PICK_ALL_INTERSECTIONS
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int PICK_ALL_INTERSECTIONS() { return PickFilter::getBitMask(PickFilter::FlagBit::PICK_ALL_INTERSECTIONS); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.INTERSECTED_NONE
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int INTERSECTED_NONE() { return IntersectionType::NONE; }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.INTERSECTED_ENTITY
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int INTERSECTED_ENTITY() { return IntersectionType::ENTITY; }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.INTERSECTED_OVERLAY
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int INTERSECTED_OVERLAY() { return IntersectionType::OVERLAY; }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.INTERSECTED_AVATAR
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int INTERSECTED_AVATAR() { return IntersectionType::AVATAR; }
|
||||
|
||||
/**jsdoc
|
||||
* @function Picks.INTERSECTED_HUD
|
||||
* @returns {number}
|
||||
*/
|
||||
static constexpr unsigned int INTERSECTED_HUD() { return IntersectionType::HUD; }
|
||||
};
|
||||
|
||||
|
|
|
@ -42,6 +42,12 @@ unsigned int PointerScriptingInterface::createPointer(const PickQuery::PickType&
|
|||
}
|
||||
}
|
||||
|
||||
/**jsdoc
|
||||
* A set of properties that can be passed to {@link Pointers.createPointer} to create a new Pointer. Contains the relevant {@link Picks.PickProperties} to define the underlying Pick.
|
||||
* @typedef {object} Pointers.StylusPointerProperties
|
||||
* @property {boolean} [hover=false] If this pointer should generate hover events.
|
||||
* @property {boolean} [enabled=false]
|
||||
*/
|
||||
unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) const {
|
||||
QVariantMap propertyMap = properties.toMap();
|
||||
|
||||
|
@ -58,6 +64,48 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties)
|
|||
return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<StylusPointer>(properties, StylusPointer::buildStylusOverlay(propertyMap), hover, enabled));
|
||||
}
|
||||
|
||||
/**jsdoc
|
||||
* A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is not intersecting something. Same as a {@link Pointers.RayPointerRenderState},
|
||||
* but with an additional distance field.
|
||||
*
|
||||
* @typedef {Object} Pointers.DefaultRayPointerRenderState
|
||||
* @augments Pointers.RayPointerRenderState
|
||||
* @property {number} distance The distance at which to render the end of this Ray Pointer, if one is defined.
|
||||
*/
|
||||
/**jsdoc
|
||||
* A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is intersecting something.
|
||||
*
|
||||
* @typedef {Object} Pointers.RayPointerRenderState
|
||||
* @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState}
|
||||
* @property {Overlays.OverlayProperties} [start] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
|
||||
* An overlay to represent the beginning of the Ray Pointer, if desired.
|
||||
* @property {Overlays.OverlayProperties} [path] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field), which <b>must</b> be <code>"line3d"</code>.
|
||||
* An overlay to represent the path of the Ray Pointer, if desired.
|
||||
* @property {Overlays.OverlayProperties} [end] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
|
||||
* An overlay to represent the end of the Ray Pointer, if desired.
|
||||
*/
|
||||
/**jsdoc
|
||||
* A trigger mechanism for Ray Pointers.
|
||||
*
|
||||
* @typedef {Object} Pointers.Trigger
|
||||
* @property {Controller.Standard|Controller.Actions|function} action This can be a built-in Controller action, like Controller.Standard.LTClick, or a function that evaluates to >= 1.0 when you want to trigger <code>button</code>.
|
||||
* @property {string} button Which button to trigger. "Primary", "Secondary", "Tertiary", and "Focus" are currently supported. Only "Primary" will trigger clicks on web surfaces. If "Focus" is triggered,
|
||||
* it will try to set the entity or overlay focus to the object at which the Pointer is aimed. Buttons besides the first three will still trigger events, but event.button will be "None".
|
||||
*/
|
||||
/**jsdoc
|
||||
* A set of properties that can be passed to {@link Pointers.createPointer} to create a new Pointer. Contains the relevant {@link Picks.PickProperties} to define the underlying Pick.
|
||||
* @typedef {object} Pointers.LaserPointerProperties
|
||||
* @property {boolean} [faceAvatar=false] Ray Pointers only. If true, the end of the Pointer will always rotate to face the avatar.
|
||||
* @property {boolean} [centerEndY=true] Ray Pointers only. If false, the end of the Pointer will be moved up by half of its height.
|
||||
* @property {boolean} [lockEnd=false] Ray Pointers only. If true, the end of the Pointer will lock on to the center of the object at which the laser is pointing.
|
||||
* @property {boolean} [distanceScaleEnd=false] Ray Pointers only. If true, the dimensions of the end of the Pointer will scale linearly with distance.
|
||||
* @property {boolean} [scaleWithAvatar=false] Ray Pointers only. If true, the width of the Pointer's path will scale linearly with your avatar's scale.
|
||||
* @property {boolean} [enabled=false]
|
||||
* @property {Pointers.RayPointerRenderState[]} [renderStates] Ray Pointers only. A list of different visual states to switch between.
|
||||
* @property {Pointers.DefaultRayPointerRenderState[]} [defaultRenderStates] Ray Pointers only. A list of different visual states to use if there is no intersection.
|
||||
* @property {boolean} [hover=false] If this Pointer should generate hover events.
|
||||
* @property {Pointers.Trigger[]} [triggers] Ray Pointers only. A list of different triggers mechanisms that control this Pointer's click event generation.
|
||||
*/
|
||||
unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& properties) const {
|
||||
QVariantMap propertyMap = properties.toMap();
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
/**jsdoc
|
||||
* The Pointers API lets you create and manage objects for repeatedly calculating intersections in different ways, as well as the visual representation of those objects.
|
||||
* Pointers can also be configured to automatically generate PointerEvents.
|
||||
* Pointers can also be configured to automatically generate {@link PointerEvent}s on {@link Entities} and {@link Overlays}.
|
||||
*
|
||||
* @namespace Pointers
|
||||
*
|
||||
|
@ -33,59 +33,12 @@ public:
|
|||
unsigned int createStylus(const QVariant& properties) const;
|
||||
|
||||
/**jsdoc
|
||||
* A set of properties that can be passed to {@link Pointers.createPointer} to create a new Pointer. Also contains the relevant {@link Picks.PickProperties} to define the underlying Pick.
|
||||
*
|
||||
* Adds a new Pointer
|
||||
* Different {@link PickType}s use different properties, and within one PickType, the properties you choose can lead to a wide range of behaviors. For example,
|
||||
* with PickType.Ray, depending on which optional parameters you pass, you could create a Static Ray Pointer, a Mouse Ray Pointer, or a Joint Ray Pointer.
|
||||
*
|
||||
* @typedef {Object} Pointers.PointerProperties
|
||||
* @property {boolean} [hover=false] If this Pointer should generate hover events.
|
||||
* @property {boolean} [faceAvatar=false] Ray Pointers only. If true, the end of the Pointer will always rotate to face the avatar.
|
||||
* @property {boolean} [centerEndY=true] Ray Pointers only. If false, the end of the Pointer will be moved up by half of its height.
|
||||
* @property {boolean} [lockEnd=false] Ray Pointers only. If true, the end of the Pointer will lock on to the center of the object at which the laser is pointing.
|
||||
* @property {boolean} [distanceScaleEnd=false] Ray Pointers only. If true, the dimensions of the end of the Pointer will scale linearly with distance.
|
||||
* @property {boolean} [scaleWithAvatar=false] Ray Pointers only. If true, the width of the Pointer's path will scale linearly with your avatar's scale.
|
||||
* @property {Pointers.RayPointerRenderState[]} [renderStates] Ray Pointers only. A list of different visual states to switch between.
|
||||
* @property {Pointers.DefaultRayPointerRenderState[]} [defaultRenderStates] Ray Pointers only. A list of different visual states to use if there is no intersection.
|
||||
* @property {Pointers.Trigger[]} [triggers] Ray Pointers only. A list of different triggers mechanisms that control this Pointer's click event generation.
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is intersecting something.
|
||||
*
|
||||
* @typedef {Object} Pointers.RayPointerRenderState
|
||||
* @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState}
|
||||
* @property {OverlayProperties} [start] All of the properties you would normally pass to {@Overlays.addOverlay}, plus the type (as a <code>type</code> field).
|
||||
* An overlay to represent the beginning of the Ray Pointer, if desired.
|
||||
* @property {OverlayProperties} [path] All of the properties you would normally pass to {@Overlays.addOverlay}, plus the type (as a <code>type</code> field), which <b>must</b> be "line3d".
|
||||
* An overlay to represent the path of the Ray Pointer, if desired.
|
||||
* @property {OverlayProperties} [end] All of the properties you would normally pass to {@Overlays.addOverlay}, plus the type (as a <code>type</code> field).
|
||||
* An overlay to represent the end of the Ray Pointer, if desired.
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is not intersecting something. Same as a {@link Pointers.RayPointerRenderState},
|
||||
* but with an additional distance field.
|
||||
*
|
||||
* @typedef {Object} Pointers.DefaultRayPointerRenderState
|
||||
* @augments Pointers.RayPointerRenderState
|
||||
* @property {number} distance The distance at which to render the end of this Ray Pointer, if one is defined.
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* A trigger mechanism for Ray Pointers.
|
||||
*
|
||||
* @typedef {Object} Pointers.Trigger
|
||||
* @property {Controller.Action} action This can be a built-in Controller action, like Controller.Standard.LTClick, or a function that evaluates to >= 1.0 when you want to trigger <code>button</code>.
|
||||
* @property {string} button Which button to trigger. "Primary", "Secondary", "Tertiary", and "Focus" are currently supported. Only "Primary" will trigger clicks on web surfaces. If "Focus" is triggered,
|
||||
* it will try to set the entity or overlay focus to the object at which the Pointer is aimed. Buttons besides the first three will still trigger events, but event.button will be "None".
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* Adds a new Pointer
|
||||
* @function Pointers.createPointer
|
||||
* @param {Picks.PickType} type A PickType that specifies the method of picking to use
|
||||
* @param {Pointers.PointerProperties} properties A PointerProperties object, containing all the properties for initializing this Pointer <b>and</b> the {@link Picks.PickProperties} for the Pick that
|
||||
* @param {PickType} type A PickType that specifies the method of picking to use
|
||||
* @param {Pointers.LaserPointerProperties|Pointers.StylusPointerProperties} properties A PointerProperties object, containing all the properties for initializing this Pointer <b>and</b> the {@link Picks.PickProperties} for the Pick that
|
||||
* this Pointer will use to do its picking.
|
||||
* @returns {number} The ID of the created Pointer. Used for managing the Pointer. 0 if invalid.
|
||||
*
|
||||
|
@ -121,32 +74,37 @@ public:
|
|||
* Pointers.setRenderState(pointer, "test");
|
||||
*/
|
||||
Q_INVOKABLE unsigned int createPointer(const PickQuery::PickType& type, const QVariant& properties);
|
||||
|
||||
/**jsdoc
|
||||
* Enables a Pointer.
|
||||
* @function Pointers.enablePointer
|
||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
||||
*/
|
||||
Q_INVOKABLE void enablePointer(unsigned int uid) const { DependencyManager::get<PointerManager>()->enablePointer(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* Disables a Pointer.
|
||||
* @function Pointers.disablePointer
|
||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
||||
*/
|
||||
Q_INVOKABLE void disablePointer(unsigned int uid) const { DependencyManager::get<PointerManager>()->disablePointer(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* Removes a Pointer.
|
||||
* @function Pointers.removePointer
|
||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
||||
*/
|
||||
Q_INVOKABLE void removePointer(unsigned int uid) const { DependencyManager::get<PointerManager>()->removePointer(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* Edit some visual aspect of a Pointer. Currently only supported for Ray Pointers.
|
||||
* @function Pointers.editRenderState
|
||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
||||
* @param {string} renderState The name of the render state you want to edit.
|
||||
* @param {RenderState} properties The new properties for <code>renderState</code>. For Ray Pointers, a {@link Pointers.RayPointerRenderState}.
|
||||
* @param {Pointers.RayPointerRenderState} properties The new properties for <code>renderStates</code> item.
|
||||
*/
|
||||
Q_INVOKABLE void editRenderState(unsigned int uid, const QString& renderState, const QVariant& properties) const;
|
||||
|
||||
/**jsdoc
|
||||
* Set the render state of a Pointer. For Ray Pointers, this means switching between their {@link Pointers.RayPointerRenderState}s, or "" to turn off rendering and hover/trigger events.
|
||||
* For Stylus Pointers, there are three built-in options: "events on" (render and send events, the default), "events off" (render but don't send events), and "disabled" (don't render, don't send events).
|
||||
|
@ -156,14 +114,16 @@ public:
|
|||
*/
|
||||
Q_INVOKABLE void setRenderState(unsigned int uid, const QString& renderState) const { DependencyManager::get<PointerManager>()->setRenderState(uid, renderState.toStdString()); }
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* Get the most recent pick result from this Pointer. This will be updated as long as the Pointer is enabled, regardless of the render state.
|
||||
* @function Pointers.getPrevPickResult
|
||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
||||
* @returns {PickResult} The most recent intersection result. This will be slightly different for different PickTypes. See {@link Picks.RayPickResult} and {@link Picks.StylusPickResult}.
|
||||
* @returns {RayPickResult|StylusPickResult} The most recent intersection result. This will be slightly different for different PickTypes.
|
||||
*/
|
||||
Q_INVOKABLE QVariantMap getPrevPickResult(unsigned int uid) const;
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* Sets whether or not to use precision picking.
|
||||
* @function Pointers.setPrecisionPicking
|
||||
|
@ -171,6 +131,7 @@ public:
|
|||
* @param {boolean} precisionPicking Whether or not to use precision picking
|
||||
*/
|
||||
Q_INVOKABLE void setPrecisionPicking(unsigned int uid, bool precisionPicking) const { DependencyManager::get<PointerManager>()->setPrecisionPicking(uid, precisionPicking); }
|
||||
|
||||
/**jsdoc
|
||||
* Sets the length of this Pointer. No effect on Stylus Pointers.
|
||||
* @function Pointers.setLength
|
||||
|
@ -178,6 +139,7 @@ public:
|
|||
* @param {float} length The desired length of the Pointer.
|
||||
*/
|
||||
Q_INVOKABLE void setLength(unsigned int uid, float length) const { DependencyManager::get<PointerManager>()->setLength(uid, length); }
|
||||
|
||||
/**jsdoc
|
||||
* Sets a list of Entity IDs, Overlay IDs, and/or Avatar IDs to ignore during intersection. Not used by Stylus Pointers.
|
||||
* @function Pointers.setIgnoreItems
|
||||
|
@ -185,6 +147,7 @@ public:
|
|||
* @param {Uuid[]} ignoreItems A list of IDs to ignore.
|
||||
*/
|
||||
Q_INVOKABLE void setIgnoreItems(unsigned int uid, const QScriptValue& ignoreEntities) const;
|
||||
|
||||
/**jsdoc
|
||||
* Sets a list of Entity IDs, Overlay IDs, and/or Avatar IDs to include during intersection, instead of intersecting with everything. Stylus
|
||||
* Pointers <b>only</b> intersect with objects in their include list.
|
||||
|
@ -194,17 +157,19 @@ public:
|
|||
*/
|
||||
Q_INVOKABLE void setIncludeItems(unsigned int uid, const QScriptValue& includeEntities) const;
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* Lock a Pointer onto a specific object (overlay, entity, or avatar). Optionally, provide an offset in object-space, otherwise the Pointer will lock on to the center of the object.
|
||||
* Not used by Stylus Pointers.
|
||||
* @function Pointers.setLockEndUUID
|
||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
||||
* @param {QUuid} objectID The ID of the object to which to lock on.
|
||||
* @param {Uuid} objectID The ID of the object to which to lock on.
|
||||
* @param {boolean} isOverlay False for entities or avatars, true for overlays
|
||||
* @param {Mat4} [offsetMat] The offset matrix to use if you do not want to lock on to the center of the object.
|
||||
*/
|
||||
Q_INVOKABLE void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const { DependencyManager::get<PointerManager>()->setLockEndUUID(uid, objectID, isOverlay, offsetMat); }
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* Check if a Pointer is associated with the left hand.
|
||||
* @function Pointers.isLeftHand
|
||||
|
@ -212,6 +177,7 @@ public:
|
|||
* @returns {boolean} True if the Pointer is a Joint Ray Pointer with joint == "_CONTROLLER_LEFTHAND" or "_CAMERA_RELATIVE_CONTROLLER_LEFTHAND", or a Stylus Pointer with hand == 0
|
||||
*/
|
||||
Q_INVOKABLE bool isLeftHand(unsigned int uid) { return DependencyManager::get<PointerManager>()->isLeftHand(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* Check if a Pointer is associated with the right hand.
|
||||
* @function Pointers.isRightHand
|
||||
|
@ -219,6 +185,7 @@ public:
|
|||
* @returns {boolean} True if the Pointer is a Joint Ray Pointer with joint == "_CONTROLLER_RIGHTHAND" or "_CAMERA_RELATIVE_CONTROLLER_RIGHTHAND", or a Stylus Pointer with hand == 1
|
||||
*/
|
||||
Q_INVOKABLE bool isRightHand(unsigned int uid) { return DependencyManager::get<PointerManager>()->isRightHand(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* Check if a Pointer is associated with the system mouse.
|
||||
* @function Pointers.isMouse
|
||||
|
|
|
@ -18,6 +18,30 @@
|
|||
|
||||
#include "PickScriptingInterface.h"
|
||||
|
||||
/**jsdoc
|
||||
* Synonym for {@link Picks} as used for ray picks.
|
||||
*
|
||||
* @namespace RayPick
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*
|
||||
* @property {number} PICK_NOTHING <em>Read-only.</em>
|
||||
* @property {number} PICK_ENTITIES <em>Read-only.</em>
|
||||
* @property {number} PICK_OVERLAYS <em>Read-only.</em>
|
||||
* @property {number} PICK_AVATARS <em>Read-only.</em>
|
||||
* @property {number} PICK_HUD <em>Read-only.</em>
|
||||
* @property {number} PICK_COARSE <em>Read-only.</em>
|
||||
* @property {number} PICK_INCLUDE_INVISIBLE <em>Read-only.</em>
|
||||
* @property {number} PICK_INCLUDE_NONCOLLIDABLE <em>Read-only.</em>
|
||||
* @property {number} PICK_ALL_INTERSECTIONS <em>Read-only.</em>
|
||||
* @property {number} INTERSECTED_NONE <em>Read-only.</em>
|
||||
* @property {number} INTERSECTED_ENTITY <em>Read-only.</em>
|
||||
* @property {number} INTERSECTED_OVERLAY <em>Read-only.</em>
|
||||
* @property {number} INTERSECTED_AVATAR <em>Read-only.</em>
|
||||
* @property {number} INTERSECTED_HUD <em>Read-only.</em>
|
||||
*/
|
||||
|
||||
class RayPickScriptingInterface : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(unsigned int PICK_NOTHING READ PICK_NOTHING CONSTANT)
|
||||
|
@ -37,34 +61,167 @@ class RayPickScriptingInterface : public QObject, public Dependency {
|
|||
SINGLETON_DEPENDENCY
|
||||
|
||||
public:
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.createRayPick
|
||||
* @param {Picks.RayPickProperties}
|
||||
* @returns {number}
|
||||
*/
|
||||
Q_INVOKABLE unsigned int createRayPick(const QVariant& properties);
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.enableRayPick
|
||||
* @param {number} id
|
||||
*/
|
||||
Q_INVOKABLE void enableRayPick(unsigned int uid);
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.disableRayPick
|
||||
* @param {number} id
|
||||
*/
|
||||
Q_INVOKABLE void disableRayPick(unsigned int uid);
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.removeRayPick
|
||||
* @param {number} id
|
||||
*/
|
||||
Q_INVOKABLE void removeRayPick(unsigned int uid);
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.getPrevRayPickResult
|
||||
* @param {number} id
|
||||
* @returns {RayPickResult}
|
||||
*/
|
||||
Q_INVOKABLE QVariantMap getPrevRayPickResult(unsigned int uid);
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.setPrecisionPicking
|
||||
* @param {number} id
|
||||
* @param {boolean} precisionPicking
|
||||
*/
|
||||
Q_INVOKABLE void setPrecisionPicking(unsigned int uid, bool precisionPicking);
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.setIgnoreItems
|
||||
* @param {number} id
|
||||
* @param {Uuid[]) ignoreEntities
|
||||
*/
|
||||
Q_INVOKABLE void setIgnoreItems(unsigned int uid, const QScriptValue& ignoreEntities);
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.setIncludeItems
|
||||
* @param {number} id
|
||||
* @param {Uuid[]) includeEntities
|
||||
*/
|
||||
Q_INVOKABLE void setIncludeItems(unsigned int uid, const QScriptValue& includeEntities);
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.isLeftHand
|
||||
* @param {number} id
|
||||
* @returns {boolean}
|
||||
*/
|
||||
Q_INVOKABLE bool isLeftHand(unsigned int uid);
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.isRightHand
|
||||
* @param {number} id
|
||||
* @returns {boolean}
|
||||
*/
|
||||
Q_INVOKABLE bool isRightHand(unsigned int uid);
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.isMouse
|
||||
* @param {number} id
|
||||
* @returns {boolean}
|
||||
*/
|
||||
Q_INVOKABLE bool isMouse(unsigned int uid);
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.PICK_NOTHING
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int PICK_NOTHING() { return PickScriptingInterface::PICK_NOTHING(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.PICK_ENTITIES
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int PICK_ENTITIES() { return PickScriptingInterface::PICK_ENTITIES(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.PICK_OVERLAYS
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int PICK_OVERLAYS() { return PickScriptingInterface::PICK_OVERLAYS(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.PICK_AVATARS
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int PICK_AVATARS() { return PickScriptingInterface::PICK_AVATARS(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.PICK_HUD
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int PICK_HUD() { return PickScriptingInterface::PICK_HUD(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.PICK_COARSE
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int PICK_COARSE() { return PickScriptingInterface::PICK_COARSE(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.PICK_INCLUDE_INVISIBLE
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int PICK_INCLUDE_INVISIBLE() { return PickScriptingInterface::PICK_INCLUDE_INVISIBLE(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.PICK_INCLUDE_NONCOLLIDABLE
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int PICK_INCLUDE_NONCOLLIDABLE() { return PickScriptingInterface::PICK_INCLUDE_NONCOLLIDABLE(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.PICK_ALL_INTERSECTIONS
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int PICK_ALL_INTERSECTIONS() { return PickScriptingInterface::PICK_ALL_INTERSECTIONS(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.INTERSECTED_NONE
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int INTERSECTED_NONE() { return PickScriptingInterface::INTERSECTED_NONE(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.INTERSECTED_ENTITY
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int INTERSECTED_ENTITY() { return PickScriptingInterface::INTERSECTED_ENTITY(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.INTERSECTED_OVERLAY
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int INTERSECTED_OVERLAY() { return PickScriptingInterface::INTERSECTED_OVERLAY(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.INTERSECTED_AVATAR
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int INTERSECTED_AVATAR() { return PickScriptingInterface::INTERSECTED_AVATAR(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function RayPick.INTERSECTED_HUD
|
||||
* @returns {number}
|
||||
*/
|
||||
static unsigned int INTERSECTED_HUD() { return PickScriptingInterface::INTERSECTED_HUD(); }
|
||||
};
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ public:
|
|||
|
||||
/**jsdoc
|
||||
* @function Audio.setReverbOptions
|
||||
* @param {} options
|
||||
* @param {AudioEffectOptions} options
|
||||
*/
|
||||
Q_INVOKABLE void setReverbOptions(const AudioEffectOptions* options);
|
||||
|
||||
|
|
|
@ -30,6 +30,14 @@ public:
|
|||
};
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Wallet
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*
|
||||
* @property {number} walletStatus
|
||||
*/
|
||||
class WalletScriptingInterface : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -38,17 +46,53 @@ class WalletScriptingInterface : public QObject, public Dependency {
|
|||
public:
|
||||
WalletScriptingInterface();
|
||||
|
||||
/**jsdoc
|
||||
* @function Wallet.refreshWalletStatus
|
||||
*/
|
||||
Q_INVOKABLE void refreshWalletStatus();
|
||||
|
||||
/**jsdoc
|
||||
* @function Wallet.getWalletStatus
|
||||
* @returns {number}
|
||||
*/
|
||||
Q_INVOKABLE uint getWalletStatus() { return _walletStatus; }
|
||||
|
||||
/**jsdoc
|
||||
* @function Wallet.proveAvatarEntityOwnershipVerification
|
||||
* @param {Uuid} entityID
|
||||
*/
|
||||
Q_INVOKABLE void proveAvatarEntityOwnershipVerification(const QUuid& entityID);
|
||||
|
||||
// setWalletStatus() should never be made Q_INVOKABLE. If it were,
|
||||
// scripts could cause the Wallet to incorrectly report its status.
|
||||
void setWalletStatus(const uint& status);
|
||||
|
||||
signals:
|
||||
|
||||
/**jsdoc
|
||||
* @function Wallet.walletStatusChanged
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void walletStatusChanged();
|
||||
|
||||
/**jsdoc
|
||||
* @function Wallet.walletNotSetup
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void walletNotSetup();
|
||||
|
||||
/**jsdoc
|
||||
* @function Wallet.ownershipVerificationSuccess
|
||||
* @param {Uuid} entityID
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void ownershipVerificationSuccess(const QUuid& entityID);
|
||||
|
||||
/**jsdoc
|
||||
* @function Wallet.ownershipVerificationFailed
|
||||
* @param {Uuid} entityID
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void ownershipVerificationFailed(const QUuid& entityID);
|
||||
|
||||
private:
|
||||
|
|
|
@ -374,6 +374,8 @@ public slots:
|
|||
* Takes a 360 snapshot given a position of the secondary camera (which does not need to have been previously set up).
|
||||
* @function Window.takeSecondaryCameraSnapshot
|
||||
* @param {vec3} [cameraPosition] - The (x, y, z) position of the camera for the 360 snapshot
|
||||
* @param {boolean} [cubemapOutputFormat=false] - If <code>true</code> then the snapshot is saved as a cube map image,
|
||||
* otherwise is saved as an equirectangular image.
|
||||
* @param {string} [filename=""] - If this parameter is not given, the image will be saved as 'hifi-snap-by-<user name>-YYYY-MM-DD_HH-MM-SS'.
|
||||
* If this parameter is <code>""</code> then the image will be saved as ".jpg".
|
||||
* Otherwise, the image will be saved to this filename, with an appended ".jpg".
|
||||
|
|
|
@ -36,6 +36,14 @@ private:
|
|||
QUrl _URL;
|
||||
};
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Snapshot
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*/
|
||||
|
||||
class Snapshot : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
|
@ -50,10 +58,26 @@ public:
|
|||
void uploadSnapshot(const QString& filename, const QUrl& href = QUrl(""));
|
||||
|
||||
signals:
|
||||
|
||||
/**jsdoc
|
||||
* @function Snapshot.snapshotLocationSet
|
||||
* @param {string} location
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void snapshotLocationSet(const QString& value);
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function Snapshot.getSnapshotsLocation
|
||||
* @returns {string}
|
||||
*/
|
||||
Q_INVOKABLE QString getSnapshotsLocation();
|
||||
|
||||
/**jsdoc
|
||||
* @function Snapshot.setSnapshotsLocation
|
||||
* @param {String} location
|
||||
*/
|
||||
Q_INVOKABLE void setSnapshotsLocation(const QString& location);
|
||||
|
||||
private slots:
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -58,6 +58,30 @@ static void setOption(QScriptValue arguments, const QString name, float defaultV
|
|||
variable = arguments.property(name).isNumber() ? (float)arguments.property(name).toNumber() : defaultValue;
|
||||
}
|
||||
|
||||
/**jsdoc
|
||||
* @typedef {object} AudioEffectOptions.ReverbOptions
|
||||
* @property {number} bandwidth
|
||||
* @property {number} preDelay
|
||||
* @property {number} lateDelay
|
||||
* @property {number} reverbTime
|
||||
* @property {number} earlyDiffusion
|
||||
* @property {number} lateDiffusion
|
||||
* @property {number} roomSize
|
||||
* @property {number} density
|
||||
* @property {number} bassMult
|
||||
* @property {number} bassFreq
|
||||
* @property {number} highGain
|
||||
* @property {number} highFreq
|
||||
* @property {number} modRate
|
||||
* @property {number} modDepth
|
||||
* @property {number} earlyGain
|
||||
* @property {number} lateGain
|
||||
* @property {number} earlyMixLeft
|
||||
* @property {number} earlyMixRight
|
||||
* @property {number} lateMixLeft
|
||||
* @property {number} lateMixRight
|
||||
* @property {number} wetDryMix
|
||||
*/
|
||||
AudioEffectOptions::AudioEffectOptions(QScriptValue arguments) {
|
||||
setOption(arguments, BANDWIDTH_HANDLE, BANDWIDTH_DEFAULT, _bandwidth);
|
||||
setOption(arguments, PRE_DELAY_HANDLE, PRE_DELAY_DEFAULT, _preDelay);
|
||||
|
|
|
@ -15,6 +15,38 @@
|
|||
#include <QtScript/QScriptContext>
|
||||
#include <QtScript/QScriptEngine>
|
||||
|
||||
/**jsdoc
|
||||
* @class AudioEffectOptions
|
||||
* @param {AudioEffectOptions.ReverbOptions} [reverbOptions=null]
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
* @hifi-server-entity
|
||||
* @hifi-assignment-client
|
||||
*
|
||||
* @property {number} bandwidth=10000
|
||||
* @property {number} preDelay=20
|
||||
* @property {number} lateDelay=0
|
||||
* @property {number} reverbTime=2
|
||||
* @property {number} earlyDiffusion=100
|
||||
* @property {number} lateDiffusion=100
|
||||
* @property {number} roomSize=50
|
||||
* @property {number} density=100
|
||||
* @property {number} bassMult=1.5
|
||||
* @property {number} bassFreq=250
|
||||
* @property {number} highGain=-6
|
||||
* @property {number} highFreq=3000
|
||||
* @property {number} modRate=2.3
|
||||
* @property {number} modDepth=50
|
||||
* @property {number} earlyGain=0
|
||||
* @property {number} lateGain=0
|
||||
* @property {number} earlyMixLeft=20
|
||||
* @property {number} earlyMixRight=20
|
||||
* @property {number} lateMixLeft=90
|
||||
* @property {number} lateMixRight=90
|
||||
* @property {number} wetDryMix=50
|
||||
*/
|
||||
|
||||
class AudioEffectOptions : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
@ -2363,7 +2363,7 @@ glm::vec3 AvatarData::getAbsoluteJointTranslationInObjectFrame(int index) const
|
|||
}
|
||||
|
||||
/**jsdoc
|
||||
* @typedef MyAvatar.AttachmentData
|
||||
* @typedef AttachmentData
|
||||
* @property {string} modelUrl
|
||||
* @property {string} jointName
|
||||
* @property {Vec3} translation
|
||||
|
|
|
@ -351,7 +351,7 @@ public:
|
|||
class AvatarData : public QObject, public SpatiallyNestable {
|
||||
Q_OBJECT
|
||||
|
||||
// The following properties have JSDoc in MyAvatar.h.
|
||||
// The following properties have JSDoc in MyAvatar.h and ScriptableAvatar.h
|
||||
Q_PROPERTY(glm::vec3 position READ getWorldPosition WRITE setPositionViaScript)
|
||||
Q_PROPERTY(float scale READ getTargetScale WRITE setTargetScale)
|
||||
Q_PROPERTY(float density READ getDensity)
|
||||
|
@ -502,7 +502,7 @@ public:
|
|||
float getDomainLimitedScale() const;
|
||||
|
||||
/**jsdoc
|
||||
* returns the minimum scale allowed for this avatar in the current domain.
|
||||
* Returns the minimum scale allowed for this avatar in the current domain.
|
||||
* This value can change as the user changes avatars or when changing domains.
|
||||
* @function MyAvatar.getDomainMinScale
|
||||
* @returns {number} minimum scale allowed for this avatar in the current domain.
|
||||
|
@ -510,14 +510,14 @@ public:
|
|||
Q_INVOKABLE float getDomainMinScale() const;
|
||||
|
||||
/**jsdoc
|
||||
* returns the maximum scale allowed for this avatar in the current domain.
|
||||
* Returns the maximum scale allowed for this avatar in the current domain.
|
||||
* This value can change as the user changes avatars or when changing domains.
|
||||
* @function MyAvatar.getDomainMaxScale
|
||||
* @returns {number} maximum scale allowed for this avatar in the current domain.
|
||||
*/
|
||||
Q_INVOKABLE float getDomainMaxScale() const;
|
||||
|
||||
// returns eye height of avatar in meters, ignoreing avatar scale.
|
||||
// Returns eye height of avatar in meters, ignoring avatar scale.
|
||||
// if _targetScale is 1 then this will be identical to getEyeHeight;
|
||||
virtual float getUnscaledEyeHeight() const { return DEFAULT_AVATAR_EYE_HEIGHT; }
|
||||
|
||||
|
@ -775,7 +775,7 @@ public:
|
|||
* Get the rotations of all joints in the current avatar. Each joint's rotation is relative to its parent joint.
|
||||
* @function MyAvatar.getJointRotations
|
||||
* @returns {Quat[]} The rotations of all joints relative to each's parent. The values are in the same order as the array
|
||||
* returned by {@link MyAvatar.getJointNames}.
|
||||
* returned by {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}.
|
||||
* @example <caption>Report the rotations of all your avatar's joints.</caption>
|
||||
* print(JSON.stringify(MyAvatar.getJointRotations()));
|
||||
*/
|
||||
|
@ -796,7 +796,7 @@ public:
|
|||
* the rotation of the elbow, the hand inverse kinematics position won't end up in the right place.</p>
|
||||
* @function MyAvatar.setJointRotations
|
||||
* @param {Quat[]} jointRotations - The rotations for all joints in the avatar. The values are in the same order as the
|
||||
* array returned by {@link MyAvatar.getJointNames}.
|
||||
* array returned by {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}.
|
||||
* @example <caption>Set your avatar to its default T-pose then rotate its right arm.<br />
|
||||
* <img alt="Avatar in T-pose" src="https://docs.highfidelity.com/user/pages/06.api-reference/25.myavatar/armpose.png" />
|
||||
* </caption>
|
||||
|
@ -852,7 +852,7 @@ public:
|
|||
|
||||
/**jsdoc
|
||||
* Get the joint index for a named joint. The joint index value is the position of the joint in the array returned by
|
||||
* {@link MyAvatar.getJointNames}.
|
||||
* {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}.
|
||||
* @function MyAvatar.getJointIndex
|
||||
* @param {string} name - The name of the joint.
|
||||
* @returns {number} The index of the joint.
|
||||
|
@ -952,7 +952,7 @@ public:
|
|||
/**jsdoc
|
||||
* Get information about all models currently attached to your avatar.
|
||||
* @function MyAvatar.getAttachmentData
|
||||
* @returns {MyAvatar.AttachmentData[]} Information about all models attached to your avatar.
|
||||
* @returns {AttachmentData[]} Information about all models attached to your avatar.
|
||||
* @example <caption>Report the URLs of all current attachments.</caption>
|
||||
* var attachments = MyAvatar.getaAttachmentData();
|
||||
* for (var i = 0; i < attachments.length; i++) {
|
||||
|
@ -963,10 +963,10 @@ public:
|
|||
|
||||
/**jsdoc
|
||||
* Set all models currently attached to your avatar. For example, if you retrieve attachment data using
|
||||
* {@link MyAvatar.getAttachmentData}, make changes to it, and then want to update your avatar's attachments per the
|
||||
* {@link MyAvatar.getAttachmentData} or {@link Avatar.getAttachmentData}, make changes to it, and then want to update your avatar's attachments per the
|
||||
* changed data. You can also remove all attachments by using setting <code>attachmentData</code> to <code>null</code>.
|
||||
* @function MyAvatar.setAttachmentData
|
||||
* @param {MyAvatar.AttachmentData[]} attachmentData - The attachment data defining the models to have attached to your avatar. Use
|
||||
* @param {AttachmentData[]} attachmentData - The attachment data defining the models to have attached to your avatar. Use
|
||||
* <code>null</code> to remove all attachments.
|
||||
* @example <caption>Remove a hat attachment if your avatar is wearing it.</caption>
|
||||
* var hatURL = "https://s3.amazonaws.com/hifi-public/tony/cowboy-hat.fbx";
|
||||
|
@ -989,7 +989,7 @@ public:
|
|||
* Nor can you use this function to attach an entity (such as a sphere or a box) to your avatar.</p>
|
||||
* @function MyAvatar.attach
|
||||
* @param {string} modelURL - The URL of the model to attach. Models can be .FBX or .OBJ format.
|
||||
* @param {string} [jointName=""] - The name of the avatar joint (see {@link MyAvatar.getJointNames}) to attach the model
|
||||
* @param {string} [jointName=""] - The name of the avatar joint (see {@link MyAvatar.getJointNames} or {@link Avatar.getJointNames}) to attach the model
|
||||
* to.
|
||||
* @param {Vec3} [translation=Vec3.ZERO] - The offset to apply to the model relative to the joint position.
|
||||
* @param {Quat} [rotation=Quat.IDENTITY] - The rotation to apply to the model relative to the joint orientation.
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
|
||||
#include "AvatarData.h"
|
||||
|
||||
/**jsdoc
|
||||
* <strong>Note:</strong> An <code>AvatarList</code> API is also provided for Interface and client entity scripts: it is a
|
||||
* synonym for the {@link AvatarManager} API.
|
||||
*
|
||||
* @namespace AvatarList
|
||||
*
|
||||
* @hifi-assignment-client
|
||||
*/
|
||||
|
||||
class AvatarHashMap : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
|
@ -42,20 +51,24 @@ public:
|
|||
// Currently, your own avatar will be included as the null avatar id.
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.getAvatarIdentifiers
|
||||
* @function AvatarList.getAvatarIdentifiers
|
||||
* @returns {Uuid[]}
|
||||
*/
|
||||
Q_INVOKABLE QVector<QUuid> getAvatarIdentifiers();
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.getAvatarsInRange
|
||||
* @function AvatarList.getAvatarsInRange
|
||||
* @param {Vec3} position
|
||||
* @param {number} range
|
||||
* @returns {Uuid[]}
|
||||
*/
|
||||
Q_INVOKABLE QVector<QUuid> getAvatarsInRange(const glm::vec3& position, float rangeMeters) const;
|
||||
|
||||
// No JSDod because it's documwented in AvatarManager.
|
||||
/**jsdoc
|
||||
* @function AvatarList.getAvatar
|
||||
* @param {Uuid} avatarID
|
||||
* @returns {AvatarData}
|
||||
*/
|
||||
// Null/Default-constructed QUuids will return MyAvatar
|
||||
Q_INVOKABLE virtual ScriptAvatarData* getAvatar(QUuid avatarID) { return new ScriptAvatarData(getAvatarBySessionID(avatarID)); }
|
||||
|
||||
|
@ -65,21 +78,21 @@ public:
|
|||
signals:
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.avatarAddedEvent
|
||||
* @function AvatarList.avatarAddedEvent
|
||||
* @param {Uuid} sessionUUID
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void avatarAddedEvent(const QUuid& sessionUUID);
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.avatarRemovedEvent
|
||||
* @function AvatarList.avatarRemovedEvent
|
||||
* @param {Uuid} sessionUUID
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void avatarRemovedEvent(const QUuid& sessionUUID);
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.avatarSessionChangedEvent
|
||||
* @function AvatarList.avatarSessionChangedEvent
|
||||
* @param {Uuid} sessionUUID
|
||||
* @param {Uuid} oldSessionUUID
|
||||
* @returns {Signal}
|
||||
|
@ -89,7 +102,7 @@ signals:
|
|||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.isAvatarInRange
|
||||
* @function AvatarList.isAvatarInRange
|
||||
* @param {string} position
|
||||
* @param {string} range
|
||||
* @returns {boolean}
|
||||
|
@ -99,28 +112,28 @@ public slots:
|
|||
protected slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.sessionUUIDChanged
|
||||
* @function AvatarList.sessionUUIDChanged
|
||||
* @param {Uuid} sessionUUID
|
||||
* @param {Uuid} oldSessionUUID
|
||||
*/
|
||||
void sessionUUIDChanged(const QUuid& sessionUUID, const QUuid& oldUUID);
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.processAvatarDataPacket
|
||||
* @function AvatarList.processAvatarDataPacket
|
||||
* @param {} message
|
||||
* @param {} sendingNode
|
||||
*/
|
||||
void processAvatarDataPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.processAvatarIdentityPacket
|
||||
* @function AvatarList.processAvatarIdentityPacket
|
||||
* @param {} message
|
||||
* @param {} sendingNode
|
||||
*/
|
||||
void processAvatarIdentityPacket(QSharedPointer<ReceivedMessage> message, SharedNodePointer sendingNode);
|
||||
|
||||
/**jsdoc
|
||||
* @function AvatarManager.processKillAvatar
|
||||
* @function AvatarList.processKillAvatar
|
||||
* @param {} message
|
||||
* @param {} sendingNode
|
||||
*/
|
||||
|
|
|
@ -36,6 +36,30 @@ namespace scriptable {
|
|||
using ModelProviderPointer = std::shared_ptr<scriptable::ModelProvider>;
|
||||
using WeakModelProviderPointer = std::weak_ptr<scriptable::ModelProvider>;
|
||||
|
||||
/**jsdoc
|
||||
* @typedef {object} Graphics.Material
|
||||
* @property {string} name
|
||||
* @property {string} model
|
||||
* @property {number} opacity
|
||||
* @property {number} roughness
|
||||
* @property {number} metallic
|
||||
* @property {number} scattering
|
||||
* @property {boolean} unlit
|
||||
* @propety {Vec3} emissive
|
||||
* @propety {Vec3} albedo
|
||||
* @property {string} emissiveMap
|
||||
* @property {string} albedoMap
|
||||
* @property {string} opacityMap
|
||||
* @property {string} metallicMap
|
||||
* @property {string} specularMap
|
||||
* @property {string} roughnessMap
|
||||
* @property {string} glossMap
|
||||
* @property {string} normalMap
|
||||
* @property {string} bumpMap
|
||||
* @property {string} occlusionMap
|
||||
* @property {string} lightmapMap
|
||||
* @property {string} scatteringMap
|
||||
*/
|
||||
class ScriptableMaterial {
|
||||
public:
|
||||
ScriptableMaterial() {}
|
||||
|
@ -68,7 +92,7 @@ namespace scriptable {
|
|||
|
||||
/**jsdoc
|
||||
* @typedef {object} Graphics.MaterialLayer
|
||||
* @property {Material} material - This layer's material.
|
||||
* @property {Graphics.Material} material - This layer's material.
|
||||
* @property {number} priority - The priority of this layer. If multiple materials are applied to a mesh part, only the highest priority layer is used.
|
||||
*/
|
||||
class ScriptableMaterialLayer {
|
||||
|
|
|
@ -166,6 +166,17 @@ bool GraphicsScriptingInterface::updateMeshPart(scriptable::ScriptableMeshPointe
|
|||
scriptable::ScriptableMeshPointer GraphicsScriptingInterface::newMesh(const QVariantMap& ifsMeshData) {
|
||||
// TODO: this is bare-bones way for now to improvise a new mesh from the scripting side
|
||||
// in the future we want to support a formal C++ structure data type here instead
|
||||
|
||||
/**jsdoc
|
||||
* @typedef {object} Graphics.IFSData
|
||||
* @property {string} [name=""] - mesh name (useful for debugging / debug prints).
|
||||
* @property {string} [topology=""]
|
||||
* @property {number[]} indices - vertex indices to use for the mesh faces.
|
||||
* @property {Vec3[]} vertices - vertex positions (model space)
|
||||
* @property {Vec3[]} [normals=[]] - vertex normals (normalized)
|
||||
* @property {Vec3[]} [colors=[]] - vertex colors (normalized)
|
||||
* @property {Vec2[]} [texCoords0=[]] - vertex texture coordinates (normalized)
|
||||
*/
|
||||
QString meshName = ifsMeshData.value("name").toString();
|
||||
QString topologyName = ifsMeshData.value("topology").toString();
|
||||
QVector<glm::uint32> indices = buffer_helpers::variantToVector<glm::uint32>(ifsMeshData.value("indices"));
|
||||
|
|
|
@ -46,10 +46,28 @@ public slots:
|
|||
*/
|
||||
scriptable::ScriptableModelPointer getModel(QUuid uuid);
|
||||
|
||||
/**jsdoc
|
||||
* @function Graphics.updateModel
|
||||
* @param {Uuid} id
|
||||
* @param {Graphics.Model} model
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bool updateModel(QUuid uuid, const scriptable::ScriptableModelPointer& model);
|
||||
|
||||
/**jsdoc
|
||||
* @function Graphics.canUpdateModel
|
||||
* @param {Uuid} id
|
||||
* @param {number} [meshIndex=-1]
|
||||
* @param {number} [partNumber=-1]
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bool canUpdateModel(QUuid uuid, int meshIndex = -1, int partNumber = -1);
|
||||
|
||||
/**jsdoc
|
||||
* @function Graphics.newModel
|
||||
* @param {Graphics.Mesh[]} meshes
|
||||
* @returns {Graphics.Model}
|
||||
*/
|
||||
scriptable::ScriptableModelPointer newModel(const scriptable::ScriptableMeshes& meshes);
|
||||
|
||||
/**jsdoc
|
||||
|
@ -59,15 +77,6 @@ public slots:
|
|||
* @param {Graphics.IFSData} ifsMeshData Index-Faced Set (IFS) arrays used to create the new mesh.
|
||||
* @returns {Graphics.Mesh} the resulting Mesh / Mesh Part object
|
||||
*/
|
||||
/**jsdoc
|
||||
* @typedef {object} Graphics.IFSData
|
||||
* @property {string} [name] - mesh name (useful for debugging / debug prints).
|
||||
* @property {number[]} indices - vertex indices to use for the mesh faces.
|
||||
* @property {Vec3[]} vertices - vertex positions (model space)
|
||||
* @property {Vec3[]} [normals] - vertex normals (normalized)
|
||||
* @property {Vec3[]} [colors] - vertex colors (normalized)
|
||||
* @property {Vec2[]} [texCoords0] - vertex texture coordinates (normalized)
|
||||
*/
|
||||
scriptable::ScriptableMeshPointer newMesh(const QVariantMap& ifsMeshData);
|
||||
|
||||
#ifdef SCRIPTABLE_MESH_TODO
|
||||
|
@ -77,6 +86,11 @@ public slots:
|
|||
bool updateMeshPart(scriptable::ScriptableMeshPointer mesh, scriptable::ScriptableMeshPartPointer part);
|
||||
#endif
|
||||
|
||||
/**jsdoc
|
||||
* @function Graphics.exportModelToOBJ
|
||||
* @param {Graphics.Model} model
|
||||
* @returns {string}
|
||||
*/
|
||||
QString exportModelToOBJ(const scriptable::ScriptableModel& in);
|
||||
|
||||
private:
|
||||
|
|
|
@ -36,6 +36,10 @@ namespace scriptable {
|
|||
* @property {number} numIndices - Total number of vertex indices in the mesh.
|
||||
* @property {number} numVertices - Total number of vertices in the Mesh.
|
||||
* @property {number} numAttributes - Number of currently defined vertex attributes.
|
||||
* @property {boolean} valid
|
||||
* @property {boolean} strong
|
||||
* @property {object} extents
|
||||
* @property {object} bufferFormats
|
||||
*/
|
||||
class ScriptableMesh : public ScriptableMeshBase, QScriptable {
|
||||
Q_OBJECT
|
||||
|
|
|
@ -12,7 +12,11 @@
|
|||
namespace scriptable {
|
||||
/**jsdoc
|
||||
* @typedef {object} Graphics.MeshPart
|
||||
* @property {boolean} valid
|
||||
* @property {number} partIndex - The part index (within the containing Mesh).
|
||||
* @property {number} firstVertexIndex
|
||||
* @property {number} baseVertexIndex
|
||||
* @property {number} lastVertexIndex
|
||||
* @property {Graphics.Topology} topology - element interpretation (currently only 'triangles' is supported).
|
||||
* @property {string[]} attributeNames - Vertex attribute names (color, normal, etc.)
|
||||
* @property {number} numIndices - Number of vertex indices that this mesh part refers to.
|
||||
|
@ -20,6 +24,8 @@ namespace scriptable {
|
|||
* @property {number} numFaces - Number of faces represented by the mesh part (numIndices / numVerticesPerFace).
|
||||
* @property {number} numVertices - Total number of vertices in the containing Mesh.
|
||||
* @property {number} numAttributes - Number of currently defined vertex attributes.
|
||||
* @property {object} extents
|
||||
* @property {object} bufferFormats
|
||||
*/
|
||||
|
||||
class ScriptableMeshPart : public QObject, QScriptable {
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace scriptable {
|
|||
* @property {Uuid} objectID - UUID of corresponding inworld object (if model is associated)
|
||||
* @property {number} numMeshes - The number of submeshes contained in the model.
|
||||
* @property {Graphics.Mesh[]} meshes - Array of submesh references.
|
||||
* @property {Object.<string, Graphics.MaterialLayer[]>} materialLayers - Map of materials layer lists. You can look up a material layer list by mesh part number or by material name.
|
||||
* @property {Object.<string,Graphics.MaterialLayer[]>} materialLayers - Map of materials layer lists. You can look up a material layer list by mesh part number or by material name.
|
||||
* @property {string[]} materialNames - Array of all the material names used by the mesh parts of this model, in order (e.g. materialNames[0] is the name of the first mesh part's material).
|
||||
*/
|
||||
|
||||
|
|
|
@ -76,6 +76,23 @@ public:
|
|||
// Access vertex position value
|
||||
const Vec3& getPos(Index index) const { return _vertexBuffer.get<Vec3>(index); }
|
||||
|
||||
/**jsdoc
|
||||
* <table>
|
||||
* <thead>
|
||||
* <tr><th>Value</th><th>Description</th></tr>
|
||||
* </thead>
|
||||
* <tbody>
|
||||
* <tr><td><code>0</code></td><td>Points.</td></tr>
|
||||
* <tr><td><code>1</code></td><td>Lines.</td></tr>
|
||||
* <tr><td><code>2</code></td><td>Line strip.</td></tr>
|
||||
* <tr><td><code>3</code></td><td>Triangles.</td></tr>
|
||||
* <tr><td><code>4</code></td><td>Triangle strip.</td></tr>
|
||||
* <tr><td><code>5</code></td><td>Quads.</td></tr>
|
||||
* <tr><td><code>6</code></td><td>Quad strip.</td></tr>
|
||||
* </tbody>
|
||||
* </table>
|
||||
* @typedef {number} Graphics.Topology
|
||||
*/
|
||||
enum Topology {
|
||||
POINTS = 0,
|
||||
LINES,
|
||||
|
|
|
@ -20,6 +20,13 @@
|
|||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Midi
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*/
|
||||
|
||||
class Midi : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
SINGLETON_DEPENDENCY
|
||||
|
@ -46,57 +53,135 @@ signals:
|
|||
void midiReset();
|
||||
|
||||
public slots:
|
||||
// Send Raw Midi Packet to all connected devices
|
||||
|
||||
/**jsdoc
|
||||
* Send Raw MIDI packet to a particular device.
|
||||
* @function Midi.sendRawDword
|
||||
* @param {number} device - Integer device number.
|
||||
* @param {number} raw - Integer (DWORD) raw MIDI message.
|
||||
*/
|
||||
Q_INVOKABLE void sendRawDword(int device, int raw);
|
||||
/// Send Raw Midi message to selected device
|
||||
/// @param {int} device: device number
|
||||
/// @param {int} raw: raw midi message (DWORD)
|
||||
|
||||
// Send Midi Message to all connected devices
|
||||
/**jsdoc
|
||||
* Send MIDI message to a particular device.
|
||||
* @function Midi.sendMidiMessage
|
||||
* @param {number} device - Integer device number.
|
||||
* @param {number} channel - Integer channel number.
|
||||
* @param {number} type - 0x8 is note off, 0x9 is note on (if velocity=0, note off), etc.
|
||||
* @param {number} note - MIDI note number.
|
||||
* @param {number} velocity - Note velocity (0 means note off).
|
||||
*/
|
||||
Q_INVOKABLE void sendMidiMessage(int device, int channel, int type, int note, int velocity);
|
||||
/// Send midi message to selected device/devices
|
||||
/// @param {int} device: device number
|
||||
/// @param {int} channel: channel number
|
||||
/// @param {int} type: 0x8 is noteoff, 0x9 is noteon (if velocity=0, noteoff), etc
|
||||
/// @param {int} note: midi note number
|
||||
/// @param {int} velocity: note velocity (0 means noteoff)
|
||||
|
||||
// Send Midi Message to all connected devices
|
||||
/**jsdoc
|
||||
* Play a note on all connected devices.
|
||||
* @function Midi.playMidiNote
|
||||
* @param {number} status - 0x80 is note off, 0x90 is note on (if velocity=0, note off), etc.
|
||||
* @param {number} note - MIDI note number.
|
||||
* @param {number} velocity - Note velocity (0 means note off).
|
||||
*/
|
||||
Q_INVOKABLE void playMidiNote(int status, int note, int velocity);
|
||||
/// play a note on all connected devices
|
||||
/// @param {int} status: 0x80 is noteoff, 0x90 is noteon (if velocity=0, noteoff), etc
|
||||
/// @param {int} note: midi note number
|
||||
/// @param {int} velocity: note velocity (0 means noteoff)
|
||||
|
||||
/// turn off all notes on all connected devices
|
||||
/**jsdoc
|
||||
* Turn off all notes on all connected devices.
|
||||
* @function Midi.allNotesOff
|
||||
*/
|
||||
Q_INVOKABLE void allNotesOff();
|
||||
|
||||
/// clean up and re-discover attached devices
|
||||
/**jsdoc
|
||||
* Clean up and re-discover attached devices.
|
||||
* @function Midi.resetDevices
|
||||
*/
|
||||
Q_INVOKABLE void resetDevices();
|
||||
|
||||
/// ask for a list of inputs/outputs
|
||||
/**jsdoc
|
||||
* Get a list of inputs/outputs.
|
||||
* @function Midi.listMidiDevices
|
||||
* @param {boolean} output
|
||||
* @returns {string[]}
|
||||
*/
|
||||
Q_INVOKABLE QStringList listMidiDevices(bool output);
|
||||
|
||||
/// block an input/output by name
|
||||
/**jsdoc
|
||||
* Block an input/output by name.
|
||||
* @function Midi.blockMidiDevice
|
||||
* @param {string} name
|
||||
* @param {boolean} output
|
||||
*/
|
||||
Q_INVOKABLE void blockMidiDevice(QString name, bool output);
|
||||
|
||||
/// unblock an input/output by name
|
||||
/**jsdoc
|
||||
* Unblock an input/output by name.
|
||||
* @function Midi.unblockMidiDevice
|
||||
* @param {string} name
|
||||
* @param {boolean} output
|
||||
*/
|
||||
Q_INVOKABLE void unblockMidiDevice(QString name, bool output);
|
||||
|
||||
/// repeat all incoming notes to all outputs (default disabled)
|
||||
/**jsdoc
|
||||
* Repeat all incoming notes to all outputs (default disabled).
|
||||
* @function Midi.thruModeEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void thruModeEnable(bool enable);
|
||||
|
||||
/// broadcast on all unblocked devices
|
||||
|
||||
/**jsdoc
|
||||
* Broadcast on all unblocked devices.
|
||||
* @function Midi.broadcastEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void broadcastEnable(bool enable);
|
||||
|
||||
|
||||
/// filter by event types
|
||||
|
||||
/**jsdoc
|
||||
* @function Midi.typeNoteOffEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void typeNoteOffEnable(bool enable);
|
||||
|
||||
/**jsdoc
|
||||
* @function Midi.typeNoteOnEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void typeNoteOnEnable(bool enable);
|
||||
|
||||
/**jsdoc
|
||||
* @function Midi.typePolyKeyPressureEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void typePolyKeyPressureEnable(bool enable);
|
||||
|
||||
/**jsdoc
|
||||
* @function Midi.typeControlChangeEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void typeControlChangeEnable(bool enable);
|
||||
|
||||
/**jsdoc
|
||||
* @function Midi.typeProgramChangeEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void typeProgramChangeEnable(bool enable);
|
||||
|
||||
/**jsdoc
|
||||
* @function Midi.typeChanPressureEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void typeChanPressureEnable(bool enable);
|
||||
|
||||
/**jsdoc
|
||||
* @function Midi.typePitchBendEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void typePitchBendEnable(bool enable);
|
||||
|
||||
/**jsdoc
|
||||
* @function Midi.typeSystemMessageEnable
|
||||
* @param {boolean} enable
|
||||
*/
|
||||
Q_INVOKABLE void typeSystemMessageEnable(bool enable);
|
||||
|
||||
|
||||
|
|
|
@ -32,6 +32,11 @@ const QString GET_PLACE = "/api/v1/places/%1";
|
|||
/**jsdoc
|
||||
* The location API provides facilities related to your current location in the metaverse.
|
||||
*
|
||||
* <h5>Getter/Setter</h5>
|
||||
* <p>You can get and set your current metaverse address by directly reading a string value from and writing a string value to
|
||||
* the <code>location</code> object. This is an alternative to using the <code>location.href</code> property or this object's
|
||||
* functions.</p>
|
||||
*
|
||||
* @namespace location
|
||||
*
|
||||
* @hifi-interface
|
||||
|
|
|
@ -86,7 +86,6 @@ private:
|
|||
/// Wrapper to expose resources to JS/QML
|
||||
class ScriptableResource : public QObject {
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @constructor Resource
|
||||
*
|
||||
|
@ -98,12 +97,15 @@ class ScriptableResource : public QObject {
|
|||
* @property {string} url - URL of this resource.
|
||||
* @property {Resource.State} state - Current loading state.
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Resource
|
||||
* @variation 0
|
||||
* @property {Resource.State} State
|
||||
*/
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QUrl url READ getURL)
|
||||
Q_PROPERTY(int state READ getState NOTIFY stateChanged)
|
||||
|
||||
|
||||
public:
|
||||
|
||||
/**jsdoc
|
||||
|
@ -115,7 +117,6 @@ public:
|
|||
* @property {number} FINISHED - The resource has completely finished loading and is ready.
|
||||
* @property {number} FAILED - Downloading the resource has failed.
|
||||
*/
|
||||
|
||||
enum State {
|
||||
QUEUED,
|
||||
LOADING,
|
||||
|
|
|
@ -17,11 +17,30 @@
|
|||
|
||||
#include <DependencyManager.h>
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Resources
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
* @hifi-server-entity
|
||||
* @hifi-assignment-client
|
||||
*/
|
||||
|
||||
class ResourceScriptingInterface : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
/**jsdoc
|
||||
* @function Resources.overrideUrlPrefix
|
||||
* @param {string} prefix
|
||||
* @param {string} replacement
|
||||
*/
|
||||
Q_INVOKABLE void overrideUrlPrefix(const QString& prefix, const QString& replacement);
|
||||
|
||||
/**jsdoc
|
||||
* @function Resources.restoreUrlPrefix
|
||||
* @param {string} prefix
|
||||
*/
|
||||
Q_INVOKABLE void restoreUrlPrefix(const QString& prefix) {
|
||||
overrideUrlPrefix(prefix, "");
|
||||
}
|
||||
|
|
|
@ -29,13 +29,34 @@ public:
|
|||
void addPacketStatsAndSendStatsPacket(QJsonObject statsObject);
|
||||
|
||||
public slots:
|
||||
// JSDoc: Overridden in Agent.h.
|
||||
/// threaded run of assignment
|
||||
virtual void run() = 0;
|
||||
|
||||
/**jsdoc
|
||||
* @function Agent.stop
|
||||
* @deprecated This function is being removed from the API.
|
||||
*/
|
||||
Q_INVOKABLE virtual void stop() { setFinished(true); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Agent.sendStatsPacket
|
||||
* @deprecated This function is being removed from the API.
|
||||
*/
|
||||
virtual void sendStatsPacket();
|
||||
|
||||
/**jsdoc
|
||||
* @function Agent.clearQueuedCheckIns
|
||||
* @deprecated This function is being removed from the API.
|
||||
*/
|
||||
void clearQueuedCheckIns() { _numQueuedCheckIns = 0; }
|
||||
|
||||
signals:
|
||||
/**jsdoc
|
||||
* @function Agent.finished
|
||||
* @returns {Signal}
|
||||
* @deprecated This function is being removed from the API.
|
||||
*/
|
||||
void finished();
|
||||
|
||||
protected:
|
||||
|
@ -47,6 +68,10 @@ protected:
|
|||
int _numQueuedCheckIns { 0 };
|
||||
|
||||
protected slots:
|
||||
/**jsdoc
|
||||
* @function Agent.domainSettingsRequestFailed
|
||||
* @deprecated This function is being removed from the API.
|
||||
*/
|
||||
void domainSettingsRequestFailed();
|
||||
|
||||
private slots:
|
||||
|
|
|
@ -40,6 +40,15 @@ public:
|
|||
virtual int getSteamVRBuildID() = 0;
|
||||
};
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Steam
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*
|
||||
* @property {boolean} running - <em>Read-only.</em>
|
||||
*/
|
||||
|
||||
class SteamScriptingInterface : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -49,7 +58,16 @@ public:
|
|||
SteamScriptingInterface(QObject* parent, SteamClientPlugin* plugin) : QObject(parent), _plugin(plugin) {}
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function Steam.isRunning
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bool isRunning() const { return _plugin && _plugin->isRunning(); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Steam.openInviteOverlay
|
||||
*/
|
||||
void openInviteOverlay() const { if (_plugin) { _plugin->openInviteOverlay(); } }
|
||||
|
||||
private:
|
||||
|
|
|
@ -135,15 +135,29 @@ public:
|
|||
PickQuery(const PickFilter& filter, const float maxDistance, const bool enabled);
|
||||
|
||||
/**jsdoc
|
||||
* @namespace
|
||||
* @augments Picks
|
||||
*
|
||||
* Enum for different types of Picks and Pointers.
|
||||
*
|
||||
* @typedef {enum} Picks.PickType
|
||||
* @namespace PickType
|
||||
* @variation 0
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*
|
||||
* @property {number} Ray Ray Picks intersect a ray with the nearest object in front of them, along a given direction.
|
||||
* @property {number} Stylus Stylus Picks provide "tapping" functionality on/into flat surfaces.
|
||||
*/
|
||||
/**jsdoc
|
||||
* <table>
|
||||
* <thead>
|
||||
* <tr><th>Value</th><th>Description</th></tr>
|
||||
* </thead>
|
||||
* <tbody>
|
||||
* <tr><td><code>{@link PickType(0)|PickType.Ray}</code></td><td></td></tr>
|
||||
* <tr><td><code>{@link PickType(0)|PickType.Stylus}</code></td><td></td></tr>
|
||||
* </tbody>
|
||||
* </table>
|
||||
* @typedef {number} PickType
|
||||
*/
|
||||
enum PickType {
|
||||
Ray = 0,
|
||||
Stylus,
|
||||
|
|
|
@ -16,6 +16,15 @@
|
|||
#include <QFileInfo>
|
||||
#include <QString>
|
||||
|
||||
/**jsdoc
|
||||
* @namespace File
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
* @hifi-server-entity
|
||||
* @hifi-assignment-client
|
||||
*/
|
||||
|
||||
class FileScriptingInterface : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -23,11 +32,41 @@ public:
|
|||
FileScriptingInterface(QObject* parent);
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function File.convertUrlToPath
|
||||
* @param {string} url
|
||||
* @returns {string}
|
||||
*/
|
||||
QString convertUrlToPath(QUrl url);
|
||||
|
||||
/**jsdoc
|
||||
* @function File.runUnzip
|
||||
* @param {string} path
|
||||
* @param {string} url
|
||||
* @param {boolean} autoAdd
|
||||
* @param {boolean} isZip
|
||||
* @param {boolean} isBlocks
|
||||
*/
|
||||
void runUnzip(QString path, QUrl url, bool autoAdd, bool isZip, bool isBlocks);
|
||||
|
||||
/**jsdoc
|
||||
* @function File.getTempDir
|
||||
* @returns {string}
|
||||
*/
|
||||
QString getTempDir();
|
||||
|
||||
signals:
|
||||
|
||||
/**jsdoc
|
||||
* @function File.unzipResult
|
||||
* @param {string} zipFile
|
||||
* @param {string} unzipFile
|
||||
* @param {boolean} autoAdd
|
||||
* @param {boolean} isZip
|
||||
* @param {boolean} isBlocks
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void unzipResult(QString zipFile, QStringList unzipFile, bool autoAdd, bool isZip, bool isBlocks);
|
||||
|
||||
private:
|
||||
|
|
|
@ -21,33 +21,147 @@
|
|||
#include <glm/glm.hpp>
|
||||
#include "RegisteredMetaTypes.h"
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Mat4
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
* @hifi-server-entity
|
||||
* @hifi-assignment-client
|
||||
*/
|
||||
|
||||
/// Scriptable Mat4 object. Used exclusively in the JavaScript API
|
||||
class Mat4 : public QObject, protected QScriptable {
|
||||
Q_OBJECT
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.multiply
|
||||
* @param {Mat4} m1
|
||||
* @param {Mat4} m2
|
||||
* @returns {Mat4}
|
||||
*/
|
||||
glm::mat4 multiply(const glm::mat4& m1, const glm::mat4& m2) const;
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.createFromRotAndTrans
|
||||
* @param {Quat} rot
|
||||
* @param {Vec3} trans
|
||||
* @returns {Mat4}
|
||||
*/
|
||||
glm::mat4 createFromRotAndTrans(const glm::quat& rot, const glm::vec3& trans) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.createFromScaleRotAndTrans
|
||||
* @param {Vec3} scale
|
||||
* @param {Quat} rot
|
||||
* @param {Vec3} trans
|
||||
* @returns {Mat4}
|
||||
*/
|
||||
glm::mat4 createFromScaleRotAndTrans(const glm::vec3& scale, const glm::quat& rot, const glm::vec3& trans) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.createFromColumns
|
||||
* @param {Vec4} col0
|
||||
* @param {Vec4} col1
|
||||
* @param {Vec4} col2
|
||||
* @param {Vec4} col
|
||||
* @returns {Mat4}
|
||||
*/
|
||||
glm::mat4 createFromColumns(const glm::vec4& col0, const glm::vec4& col1, const glm::vec4& col2, const glm::vec4& col3) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.createFromArray
|
||||
* @param {number[]} numbers
|
||||
* @returns {Mat4}
|
||||
*/
|
||||
glm::mat4 createFromArray(const QVector<float>& floats) const;
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.extractTranslation
|
||||
* @param {Mat4} m
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
glm::vec3 extractTranslation(const glm::mat4& m) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.extractRotation
|
||||
* @param {Mat4} m
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
glm::quat extractRotation(const glm::mat4& m) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.extractScale
|
||||
* @param {Mat4} m
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
glm::vec3 extractScale(const glm::mat4& m) const;
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.transformPoint
|
||||
* @param {Mat4} m
|
||||
* @param {Vec3} point
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
glm::vec3 transformPoint(const glm::mat4& m, const glm::vec3& point) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.transformVector
|
||||
* @param {Mat4} m
|
||||
* @param {Vec3} vector
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
glm::vec3 transformVector(const glm::mat4& m, const glm::vec3& vector) const;
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.inverse
|
||||
* @param {Mat4} m
|
||||
* @returns {Mat4}
|
||||
*/
|
||||
glm::mat4 inverse(const glm::mat4& m) const;
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.getFront
|
||||
* @param {Mat4} m
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
// redundant, calls getForward which better describes the returned vector as a direction
|
||||
glm::vec3 getFront(const glm::mat4& m) const { return getForward(m); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.getForward
|
||||
* @param {Mat4} m
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
glm::vec3 getForward(const glm::mat4& m) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.getRight
|
||||
* @param {Mat4} m
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
glm::vec3 getRight(const glm::mat4& m) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.getUp
|
||||
* @param {Mat4} m
|
||||
* @returns {Vec3}
|
||||
*/
|
||||
glm::vec3 getUp(const glm::mat4& m) const;
|
||||
|
||||
/**jsdoc
|
||||
* @function Mat4.print
|
||||
* @param {string} label
|
||||
* @param {Mat4} m
|
||||
* @param {boolean} [transpose=false]
|
||||
*/
|
||||
void print(const QString& label, const glm::mat4& m, bool transpose = false) const;
|
||||
};
|
||||
|
||||
|
|
|
@ -852,7 +852,21 @@ AnimationDetails::AnimationDetails(QString role, QUrl url, float fps, float prio
|
|||
running(running), currentFrame(currentFrame), allowTranslation(allowTranslation) {
|
||||
}
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @typedef {object} Avatar.AnimationDetails
|
||||
* @property {string} role
|
||||
* @property {string} url
|
||||
* @property {number} fps
|
||||
* @property {number} priority
|
||||
* @property {boolean} loop
|
||||
* @property {boolean} hold
|
||||
* @property {boolean} startAutomatically
|
||||
* @property {number} firstFrame
|
||||
* @property {number} lastFrame
|
||||
* @property {boolean} running
|
||||
* @property {number} currentFrame
|
||||
* @property {boolean} allowTranslation
|
||||
*/
|
||||
QScriptValue animationDetailsToScriptValue(QScriptEngine* engine, const AnimationDetails& details) {
|
||||
QScriptValue obj = engine->newObject();
|
||||
obj.setProperty("role", details.role);
|
||||
|
|
|
@ -104,8 +104,17 @@ public:
|
|||
|
||||
virtual void setPresetList(const QJsonObject& object);
|
||||
|
||||
/**jsdoc
|
||||
* @function Render.toJSON
|
||||
* @returns {string}
|
||||
*/
|
||||
// This must be named toJSON to integrate with the global scripting JSON object
|
||||
Q_INVOKABLE QString toJSON() { return QJsonDocument(toJsonValue(*this).toObject()).toJson(QJsonDocument::Compact); }
|
||||
|
||||
/**jsdoc
|
||||
* @function Render.load
|
||||
* @param {object} map
|
||||
*/
|
||||
Q_INVOKABLE void load(const QVariantMap& map) { qObjectFromJsonValue(QJsonObject::fromVariantMap(map), *this); emit loaded(); }
|
||||
|
||||
// Running Time measurement
|
||||
|
@ -114,11 +123,31 @@ public:
|
|||
double getCPURunTime() const { return _msCPURunTime; }
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function Render.load
|
||||
* @param {object} map
|
||||
*/
|
||||
void load(const QJsonObject& val) { qObjectFromJsonValue(val, *this); emit loaded(); }
|
||||
|
||||
signals:
|
||||
|
||||
/**jsdoc
|
||||
* @function Render.loaded
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void loaded();
|
||||
|
||||
/**jsdoc
|
||||
* @function Render.newStats
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void newStats();
|
||||
|
||||
/**jsdoc
|
||||
* @function Render.dirtyEnabled
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void dirtyEnabled();
|
||||
};
|
||||
|
||||
|
@ -127,6 +156,16 @@ public:
|
|||
using Config = JobConfig;
|
||||
};
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Render
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*
|
||||
* @property {number} cpuRunTime - <em>Read-only.</em>
|
||||
* @property {boolean} enabled
|
||||
*/
|
||||
class TaskConfig : public JobConfig {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -137,8 +176,11 @@ public:
|
|||
TaskConfig() = default ;
|
||||
TaskConfig(bool enabled) : JobConfig(enabled) {}
|
||||
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function Render.getConfig
|
||||
* @param {string} name
|
||||
* @returns {object}
|
||||
*/
|
||||
// Get a sub job config through task.getConfig(path)
|
||||
// where path can be:
|
||||
// - <job_name> search for the first job named job_name traversing the the sub graph of task and jobs (from this task as root)
|
||||
|
@ -176,6 +218,10 @@ public:
|
|||
JobConcept* _task;
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function Render.refresh
|
||||
*/
|
||||
void refresh();
|
||||
};
|
||||
|
||||
|
|
|
@ -30,6 +30,15 @@
|
|||
|
||||
#include <PointerManager.h>
|
||||
|
||||
/**jsdoc
|
||||
* @namespace OffscreenFlags
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
* @property {boolean} navigationFocused
|
||||
* @property {boolean} navigationFocusDisabled
|
||||
*/
|
||||
|
||||
// Needs to match the constants in resources/qml/Global.js
|
||||
class OffscreenFlags : public QObject {
|
||||
Q_OBJECT
|
||||
|
@ -58,7 +67,17 @@ public:
|
|||
}
|
||||
|
||||
signals:
|
||||
|
||||
/**jsdoc
|
||||
* @function OffscreenFlags.navigationFocusedChanged
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void navigationFocusedChanged();
|
||||
|
||||
/**jsdoc
|
||||
* @function OffscreenFlags.navigationFocusDisabledChanged
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void navigationFocusDisabledChanged();
|
||||
|
||||
private:
|
||||
|
|
|
@ -11,6 +11,47 @@
|
|||
|
||||
#include "QmlWindowClass.h"
|
||||
|
||||
/**jsdoc
|
||||
* @class OverlayWebWindow
|
||||
* @param {OverlayWindow.Properties} [properties=null]
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*
|
||||
* @property {string} url - <em>Read-only.</em>
|
||||
* @property {Vec2} position
|
||||
* @property {Vec2} size
|
||||
* @property {boolean} visible
|
||||
*
|
||||
* @borrows OverlayWindow.initQml as initQml
|
||||
* @borrows OverlayWindow.isVisible as isVisible
|
||||
* @borrows OverlayWindow.setVisible as setVisible
|
||||
* @borrows OverlayWindow.getPosition as getPosition
|
||||
* @borrows OverlayWindow.setPosition as setPosition
|
||||
* @borrows OverlayWindow.getSize as getSize
|
||||
* @borrows OverlayWindow.setSize as setSize
|
||||
* @borrows OverlayWindow.setTitle as setTitle
|
||||
* @borrows OverlayWindow.raise as raise
|
||||
* @borrows OverlayWindow.close as close
|
||||
* @borrows OverlayWindow.getEventBridge as getEventBridge
|
||||
* @borrows OverlayWindow.sendToQml as sendToQml
|
||||
* @borrows OverlayWindow.clearDebugWindow as clearDebugWindow
|
||||
* @borrows OverlayWindow.emitScriptEvent as emitScriptEvent
|
||||
* @borrows OverlayWindow.emitWebEvent as emitWebEvent
|
||||
* @borrows OverlayWindow.visibleChanged as visibleChanged
|
||||
* @borrows OverlayWindow.positionChanged as positionChanged
|
||||
* @borrows OverlayWindow.sizeChanged as sizeChanged
|
||||
* @borrows OverlayWindow.moved as moved
|
||||
* @borrows OverlayWindow.resized as resized
|
||||
* @borrows OverlayWindow.closed as closed
|
||||
* @borrows OverlayWindow.fromQml as fromQml
|
||||
* @borrows OverlayWindow.scriptEventReceived as scriptEventReceived
|
||||
* @borrows OverlayWindow.webEventReceived as webEventReceived
|
||||
* @borrows OverlayWindow.hasMoved as hasMoved
|
||||
* @borrows OverlayWindow.hasClosed as hasClosed
|
||||
* @borrows OverlayWindow.qmlToScript as qmlToScript
|
||||
*/
|
||||
|
||||
// FIXME refactor this class to be a QQuickItem derived type and eliminate the needless wrapping
|
||||
class QmlWebWindowClass : public QmlWindowClass {
|
||||
Q_OBJECT
|
||||
|
@ -20,11 +61,29 @@ public:
|
|||
static QScriptValue constructor(QScriptContext* context, QScriptEngine* engine);
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWebWindow.getURL
|
||||
* @returns {string}
|
||||
*/
|
||||
QString getURL();
|
||||
/**jsdoc
|
||||
* @function OverlayWebWindow.setURL
|
||||
* @param {string} url
|
||||
*/
|
||||
void setURL(const QString& url);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWebWindow.setScriptURL
|
||||
* @param {string} script
|
||||
*/
|
||||
void setScriptURL(const QString& script);
|
||||
|
||||
signals:
|
||||
/**jsdoc
|
||||
* @function OverlayWebWindow.urlChanged
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void urlChanged();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -87,6 +87,14 @@ QmlWindowClass::QmlWindowClass() {
|
|||
|
||||
}
|
||||
|
||||
/**jsdoc
|
||||
* @typedef {object} OverlayWindow.Properties
|
||||
* @property {string} title
|
||||
* @property {string} source
|
||||
* @property {number} width
|
||||
* @property {number} height
|
||||
* @property {boolean} visible
|
||||
*/
|
||||
void QmlWindowClass::initQml(QVariantMap properties) {
|
||||
auto offscreenUi = DependencyManager::get<OffscreenUi>();
|
||||
_source = properties[SOURCE_PROPERTY].toString();
|
||||
|
|
|
@ -19,6 +19,18 @@
|
|||
class QScriptEngine;
|
||||
class QScriptContext;
|
||||
|
||||
/**jsdoc
|
||||
* @class OverlayWindow
|
||||
* @param {OverlayWindow.Properties} [properties=null]
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-en
|
||||
*
|
||||
* @property {Vec2} position
|
||||
* @property {Vec2} size
|
||||
* @property {boolean} visible
|
||||
*/
|
||||
|
||||
// FIXME refactor this class to be a QQuickItem derived type and eliminate the needless wrapping
|
||||
class QmlWindowClass : public QObject {
|
||||
Q_OBJECT
|
||||
|
@ -31,51 +43,202 @@ public:
|
|||
QmlWindowClass();
|
||||
~QmlWindowClass();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.initQml
|
||||
* @param {OverlayWindow.Properties} properties
|
||||
*/
|
||||
Q_INVOKABLE virtual void initQml(QVariantMap properties);
|
||||
|
||||
QQuickItem* asQuickItem() const;
|
||||
|
||||
public slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.isVisible
|
||||
* @returns {boolean}
|
||||
*/
|
||||
bool isVisible();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.setVisible
|
||||
* @param {boolean} visible
|
||||
*/
|
||||
void setVisible(bool visible);
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.getPosition
|
||||
* @returns {Vec2}
|
||||
*/
|
||||
glm::vec2 getPosition();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.setPosition
|
||||
* @param {Vec2} position
|
||||
*/
|
||||
void setPosition(const glm::vec2& position);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.setPosition
|
||||
* @param {number} x
|
||||
* @param {number} y
|
||||
*/
|
||||
void setPosition(int x, int y);
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.getSize
|
||||
* @returns {Vec2}
|
||||
*/
|
||||
glm::vec2 getSize();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.setSize
|
||||
* @param {Vec2} size
|
||||
*/
|
||||
void setSize(const glm::vec2& size);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.setSize
|
||||
* @param {number} width
|
||||
* @param {number} height
|
||||
*/
|
||||
void setSize(int width, int height);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.setTitle
|
||||
* @param {string} title
|
||||
*/
|
||||
void setTitle(const QString& title);
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.raise
|
||||
*/
|
||||
Q_INVOKABLE void raise();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.close
|
||||
*/
|
||||
Q_INVOKABLE void close();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.getEventBridge
|
||||
* @returns {object}
|
||||
*/
|
||||
Q_INVOKABLE QObject* getEventBridge() { return this; };
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.sendToQml
|
||||
* @param {object} message
|
||||
*/
|
||||
// Scripts can use this to send a message to the QML object
|
||||
void sendToQml(const QVariant& message);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.clearDebugWindow
|
||||
*/
|
||||
void clearDebugWindow();
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.emitScriptEvent
|
||||
* @param {object} message
|
||||
*/
|
||||
// QmlWindow content may include WebView requiring EventBridge.
|
||||
void emitScriptEvent(const QVariant& scriptMessage);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.emitWebEvent
|
||||
* @param {object} message
|
||||
*/
|
||||
void emitWebEvent(const QVariant& webMessage);
|
||||
|
||||
signals:
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.visibleChanged
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void visibleChanged();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.positionChanged
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void positionChanged();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.sizeChanged
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void sizeChanged();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.moved
|
||||
* @param {Vec2} position
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void moved(glm::vec2 position);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.resized
|
||||
* @param {Size} size
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void resized(QSizeF size);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.closed
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void closed();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.fromQml
|
||||
* @param {object} message
|
||||
* @returns {Signal}
|
||||
*/
|
||||
// Scripts can connect to this signal to receive messages from the QML object
|
||||
void fromQml(const QVariant& message);
|
||||
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.scriptEventReceived
|
||||
* @param {object} message
|
||||
* @returns {Signal}
|
||||
*/
|
||||
// QmlWindow content may include WebView requiring EventBridge.
|
||||
void scriptEventReceived(const QVariant& message);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.webEventReceived
|
||||
* @param {object} message
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void webEventReceived(const QVariant& message);
|
||||
|
||||
protected slots:
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.hasMoved
|
||||
* @param {Vec2} position
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void hasMoved(QVector2D);
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.hasClosed
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void hasClosed();
|
||||
|
||||
/**jsdoc
|
||||
* @function OverlayWindow.qmlToScript
|
||||
* @param {object} message
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void qmlToScript(const QVariant& message);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -44,6 +44,14 @@ class OffscreenQmlSurface;
|
|||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*/
|
||||
/**jsdoc
|
||||
* @namespace tabletInterface
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*
|
||||
* @deprecated This API is deprecated and will be removed. Use {@link Tablet} instead.
|
||||
*/
|
||||
class TabletScriptingInterface : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
@ -83,6 +91,13 @@ public:
|
|||
* @param {string} name - Tablet name.
|
||||
* @returns {TabletProxy} Tablet instance.
|
||||
*/
|
||||
/**jsdoc
|
||||
* Creates or returns a new TabletProxy and returns it.
|
||||
* @function tabletInterface.getTablet
|
||||
* @param {string} name - Tablet name.
|
||||
* @returns {TabletProxy} Tablet instance.
|
||||
* @deprecated This function is deprecated and will be removed. Use {@link Tablet.getTablet} instead.
|
||||
*/
|
||||
Q_INVOKABLE TabletProxy* getTablet(const QString& tabletId);
|
||||
|
||||
void preloadSounds();
|
||||
|
@ -91,6 +106,11 @@ public:
|
|||
* @function Tablet.playSound
|
||||
* @param {Tablet.AudioEvents} sound
|
||||
*/
|
||||
/**jsdoc
|
||||
* @function tabletInterface.playSound
|
||||
* @param {Tablet.AudioEvents} sound
|
||||
* @deprecated This function is deprecated and will be removed. Use {@link Tablet.playSound} instead.
|
||||
*/
|
||||
Q_INVOKABLE void playSound(TabletAudioEvents aEvent);
|
||||
|
||||
void setToolbarMode(bool toolbarMode);
|
||||
|
@ -108,6 +128,12 @@ signals:
|
|||
* @function Tablet.tabletNotification
|
||||
* @returns {Signal}
|
||||
*/
|
||||
/**jsdoc
|
||||
* Triggered when a tablet message or dialog is created.
|
||||
* @function tabletInterface.tabletNotification
|
||||
* @returns {Signal}
|
||||
* @deprecated This function is deprecated and will be removed. Use {@link Tablet.tabletNotification} instead.
|
||||
*/
|
||||
void tabletNotification();
|
||||
|
||||
private:
|
||||
|
|
|
@ -19,14 +19,56 @@
|
|||
|
||||
class QQuickItem;
|
||||
|
||||
/**jsdoc
|
||||
* @class ToolbarButtonProxy
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*/
|
||||
class ToolbarButtonProxy : public QmlWrapper {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
ToolbarButtonProxy(QObject* qmlObject, QObject* parent = nullptr);
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarButtonProxy#editProperties
|
||||
* @param {object} properties
|
||||
*/
|
||||
Q_INVOKABLE void editProperties(const QVariantMap& properties);
|
||||
|
||||
|
||||
// QmlWrapper methods.
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarButtonProxy#writeProperty
|
||||
* @parm {string} propertyName
|
||||
* @param {object} propertyValue
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarButtonProxy#writeProperties
|
||||
* @param {object} properties
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarButtonProxy#readProperty
|
||||
* @param {string} propertyName
|
||||
* @returns {object}
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarButtonProxy#readProperties
|
||||
* @param {string[]} propertyList
|
||||
* @returns {object}
|
||||
*/
|
||||
|
||||
signals:
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarButtonProxy#clicked
|
||||
* @returns {Signal}
|
||||
*/
|
||||
void clicked();
|
||||
|
||||
protected:
|
||||
|
@ -36,19 +78,74 @@ protected:
|
|||
|
||||
Q_DECLARE_METATYPE(ToolbarButtonProxy*);
|
||||
|
||||
/**jsdoc
|
||||
* @class ToolbarProxy
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*/
|
||||
class ToolbarProxy : public QmlWrapper {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ToolbarProxy(QObject* qmlObject, QObject* parent = nullptr);
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarProxy#addButton
|
||||
* @param {object} properties
|
||||
* @returns {ToolbarButtonProxy}
|
||||
*/
|
||||
Q_INVOKABLE ToolbarButtonProxy* addButton(const QVariant& properties);
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarProxy#removeButton
|
||||
* @param {string} name
|
||||
*/
|
||||
Q_INVOKABLE void removeButton(const QVariant& name);
|
||||
|
||||
|
||||
// QmlWrapper methods.
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarProxy#writeProperty
|
||||
* @parm {string} propertyName
|
||||
* @param {object} propertyValue
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarProxy#writeProperties
|
||||
* @param {object} properties
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarProxy#readProperty
|
||||
* @param {string} propertyName
|
||||
* @returns {object}
|
||||
*/
|
||||
|
||||
/**jsdoc
|
||||
* @function ToolbarProxy#readProperties
|
||||
* @param {string[]} propertyList
|
||||
* @returns {object}
|
||||
*/
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(ToolbarProxy*);
|
||||
|
||||
/**jsdoc
|
||||
* @namespace Toolbars
|
||||
*
|
||||
* @hifi-interface
|
||||
* @hifi-client-entity
|
||||
*/
|
||||
class ToolbarScriptingInterface : public QObject, public Dependency {
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
/**jsdoc
|
||||
* @function Toolbars.getToolbar
|
||||
* @param {string} toolbarID
|
||||
* @returns {ToolbarProxy}
|
||||
*/
|
||||
Q_INVOKABLE ToolbarProxy* getToolbar(const QString& toolbarId);
|
||||
};
|
||||
|
||||
|
|
|
@ -20,6 +20,10 @@ exports.handlers = {
|
|||
|
||||
// directories to scan for jsdoc comments
|
||||
var dirList = [
|
||||
'../../assignment-client/src',
|
||||
'../../assignment-client/src/avatars',
|
||||
'../../assignment-client/src/entities',
|
||||
'../../assignment-client/src/octree',
|
||||
'../../interface/src',
|
||||
'../../interface/src/assets',
|
||||
'../../interface/src/audio',
|
||||
|
@ -28,10 +32,10 @@ exports.handlers = {
|
|||
'../../interface/src/devices',
|
||||
'../../interface/src/java',
|
||||
'../../interface/src/networking',
|
||||
'../../interface/src/ui/',
|
||||
'../../interface/src/scripting',
|
||||
'../../interface/src/ui/overlays',
|
||||
'../../interface/src/raypick',
|
||||
'../../interface/src/scripting',
|
||||
'../../interface/src/ui/',
|
||||
'../../interface/src/ui/overlays',
|
||||
'../../libraries/animation/src',
|
||||
'../../libraries/audio-client/src',
|
||||
'../../libraries/audio/src',
|
||||
|
@ -41,17 +45,22 @@ exports.handlers = {
|
|||
'../../libraries/controllers/src/controllers/impl/',
|
||||
'../../libraries/display-plugins/src/display-plugins/',
|
||||
'../../libraries/entities/src',
|
||||
'../../libraries/graphics/src/graphics/',
|
||||
'../../libraries/graphics-scripting/src/graphics-scripting/',
|
||||
'../../libraries/input-plugins/src/input-plugins',
|
||||
'../../libraries/midi/src',
|
||||
'../../libraries/model-networking/src/model-networking/',
|
||||
'../../libraries/networking/src',
|
||||
'../../libraries/octree/src',
|
||||
'../../libraries/physics/src',
|
||||
'../../libraries/plugins/src/plugins',
|
||||
'../../libraries/pointers/src',
|
||||
'../../libraries/script-engine/src',
|
||||
'../../libraries/shared/src',
|
||||
'../../libraries/shared/src/shared',
|
||||
'../../libraries/task/src/task',
|
||||
'../../libraries/trackers/src/trackers',
|
||||
'../../libraries/ui/src',
|
||||
'../../libraries/ui/src/ui',
|
||||
'../../plugins/oculus/src',
|
||||
'../../plugins/openvr/src'
|
||||
|
@ -106,8 +115,8 @@ exports.handlers = {
|
|||
|
||||
// Append an Available In: table at the end of the namespace description.
|
||||
if (rows.length > 0) {
|
||||
var table = "<br><br><table><tr><th>Available in:</th><td>" + rows.join("</td><td>") + "</td></tr></table>";
|
||||
e.doclet.description = (e.doclet.description ? e.doclet.description : "") + table;
|
||||
var table = "<table><tr><th>Available in:</th><td>" + rows.join("</td><td>") + "</td></tr></table><br>";
|
||||
e.doclet.description = table + (e.doclet.description ? e.doclet.description : "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue