diff --git a/libraries/entities/src/EntityScriptingInterface.h b/libraries/entities/src/EntityScriptingInterface.h
index 1a34fd2139..d38f2917a7 100644
--- a/libraries/entities/src/EntityScriptingInterface.h
+++ b/libraries/entities/src/EntityScriptingInterface.h
@@ -177,13 +177,12 @@ public:
public slots:
/**jsdoc
- * Check whether or not you can change the locked
property of entities. Locked entities have their
- * locked
property set to true
and cannot be edited or deleted. Whether or not you can change
- * entities' locked
properties is configured in the domain server's permissions.
+ * Checks whether or not the script can change the locked
property of entities. Locked entities have their
+ * locked
property set to true
and cannot be edited or deleted.
* @function Entities.canAdjustLocks
- * @returns {boolean} true
if the client can change the locked
property of entities,
- * otherwise false
.
- * @example
locked
property to true if you can.true
if the domain server will allow the script to change the locked
+ * property of entities, otherwise false
.
+ * @example true
if the domain server will allow the script to rez (create) new entities,
- * otherwise false
.
+ * @returns {boolean} true
if the domain server will allow the script to rez (create) new entities, otherwise
+ * false
.
*/
Q_INVOKABLE bool canRez();
/**jsdoc
- * Check whether or not you can rez (create) new temporary entities in the domain. Temporary entities are entities with a
- * finite lifetime
property value set.
+ * Checks whether or not the script can rez (create) new temporary entities in the domain. Temporary entities are entities
+ * with a finite lifetime
property value set.
* @function Entities.canRezTmp
- * @returns {boolean} true
if the domain server will allow the script to rez (create) new temporary
- * entities, otherwise false
.
+ * @returns {boolean} true
if the domain server will allow the script to rez (create) new temporary entities,
+ * otherwise false
.
*/
Q_INVOKABLE bool canRezTmp();
/**jsdoc
- * Check whether or not you can rez (create) new certified entities in the domain. Certified entities are entities that have
- * PoP certificates.
+ * Checks whether or not the script can rez (create) new certified entities in the domain. Certified entities are entities
+ * that have PoP certificates.
* @function Entities.canRezCertified
- * @returns {boolean} true
if the domain server will allow the script to rez (create) new certified
- * entities, otherwise false
.
+ * @returns {boolean} true
if the domain server will allow the script to rez (create) new certified entities,
+ * otherwise false
.
*/
Q_INVOKABLE bool canRezCertified();
/**jsdoc
- * Check whether or not you can rez (create) new temporary certified entities in the domain. Temporary entities are entities
- * with a finite lifetime
property value set. Certified entities are entities that have PoP certificates.
+ * Checks whether or not the script can rez (create) new temporary certified entities in the domain. Temporary entities are
+ * entities with a finite lifetime
property value set. Certified entities are entities that have PoP
+ * certificates.
* @function Entities.canRezTmpCertified
- * @returns {boolean} true
if the domain server will allow the script to rez (create) new temporary
- * certified entities, otherwise false
.
+ * @returns {boolean} true
if the domain server will allow the script to rez (create) new temporary certified
+ * entities, otherwise false
.
*/
Q_INVOKABLE bool canRezTmpCertified();
/**jsdoc
- * Check whether or not you can make changes to the asset server's assets.
+ * Checks whether or not the script can make changes to the asset server's assets.
* @function Entities.canWriteAssets
* @returns {boolean} true
if the domain server will allow the script to make changes to the asset server's
* assets, otherwise false
.
@@ -236,7 +236,7 @@ public slots:
Q_INVOKABLE bool canWriteAssets();
/**jsdoc
- * Check whether or not you can replace the domain's content set.
+ * Checks whether or not the script can replace the domain's content set.
* @function Entities.canReplaceContent
* @returns {boolean} true
if the domain server will allow the script to replace the domain's content set,
* otherwise false
.
@@ -244,10 +244,10 @@ public slots:
Q_INVOKABLE bool canReplaceContent();
/**jsdoc
- * Check whether or not you can get and set private user data.
+ * Checks whether or not the script can get and set the privateUserData
property of entities.
* @function Entities.canGetAndSetPrivateUserData
- * @returns {boolean} true
if the domain server will allow the user to get and set private user data,
- * otherwise false
.
+ * @returns {boolean} true
if the domain server will allow the script to get and set the
+ * privateUserData
property of entities, otherwise false
.
*/
Q_INVOKABLE bool canGetAndSetPrivateUserData();
@@ -411,11 +411,13 @@ public slots:
/**jsdoc
* Gets an entity's script object. In particular, this is useful for accessing a {@link Entities.EntityProperties-Web|Web}
- * entity's event bridge.
+ * entity's HTML EventBridge
script object to exchange messages with the web page script.
+ * Alternatively, you can use {@link Entities.emitScriptEvent} and {@link Entities.webEventReceived} to exchange + * messages with a Web entity over its event bridge.
* @function Entities.getEntityObject * @param {Uuid} id - The ID of the entity to get the script object for. * @returns {object} The script object for the entity if found. - * @exampletrue
if an object with the given ID exists, false
otherwise.
+ * @returns {boolean} true
if an entity with the specified ID exists, false
if it doesn't.
*/
Q_INVOKABLE bool isAddedEntity(const QUuid& id);
@@ -486,7 +501,7 @@ public slots:
Q_INVOKABLE QSizeF textSize(const QUuid& id, const QString& text);
/**jsdoc
- * Call a method in a client entity script from a client script or client entity script, or call a method in a server
+ * Calls a method in a client entity script from a client script or client entity script, or calls a method in a server
* entity script from a server entity script. The entity script method must be exposed as a property in the target client
* entity script. Additionally, if calling a server entity script, the server entity script must include the method's name
* in an exposed property called remotelyCallable
that is an array of method names that can be called.
@@ -498,7 +513,7 @@ public slots:
Q_INVOKABLE void callEntityMethod(const QUuid& entityID, const QString& method, const QStringList& params = QStringList());
/**jsdoc
- * Call a method in a server entity script from a client script or client entity script. The entity script method must be
+ * Calls a method in a server entity script from a client script or client entity script. The entity script method must be
* exposed as a property in the target server entity script. Additionally, the target server entity script must include the
* method's name in an exposed property called remotelyCallable
that is an array of method names that can be
* called.
@@ -510,7 +525,7 @@ public slots:
Q_INVOKABLE void callEntityServerMethod(const QUuid& entityID, const QString& method, const QStringList& params = QStringList());
/**jsdoc
- * Call a method in a specific user's client entity script from a server entity script. The entity script method must be
+ * Calls a method in a specific user's client entity script from a server entity script. The entity script method must be
* exposed as a property in the target client entity script.
* @function Entities.callEntityClientMethod
* @param {Uuid} clientSessionID - The session ID of the user to call the method in.
@@ -652,14 +667,14 @@ public slots:
Q_INVOKABLE bool reloadServerScripts(const QUuid& entityID);
/**jsdoc
- * Gets the status of server entity script attached to an entity
+ * Gets the status of a server entity script attached to an entity.
* @function Entities.getServerScriptStatus
- * @param {Uuid} entityID - The ID of the entity to get the server entity script status for.
+ * @param {Uuid} entityID - The ID of the entity to get the server entity script status of.
* @param {Entities~getServerScriptStatusCallback} callback - The function to call upon completion.
* @returns {boolean} true
always.
*/
/**jsdoc
- * Called when {@link Entities.getServerScriptStatus} is complete.
+ * Called when a {@link Entities.getServerScriptStatus} call is complete.
* @callback Entities~getServerScriptStatusCallback
* @param {boolean} success - true
if the server entity script status could be obtained, otherwise
* false
.
@@ -703,18 +718,18 @@ public slots:
/**jsdoc
- * Set whether or not ray picks intersect the bounding box of {@link Entities.EntityProperties-Light|Light} entities. By
+ * Sets whether or not ray picks intersect the bounding box of {@link Entities.EntityProperties-Light|Light} entities. By
* default, Light entities are not intersected. The setting lasts for the Interface session. Ray picks are done using
- * {@link Entities.findRayIntersection|findRayIntersection}, or the {@link Picks} API.
+ * {@link Entities.findRayIntersection|findRayIntersection}, or the {@link Picks} API.
* @function Entities.setLightsArePickable
- * @param {boolean} value - Set true
to make ray picks intersect the bounding box of
+ * @param {boolean} value - true
to make ray picks intersect the bounding box of
* {@link Entities.EntityProperties-Light|Light} entities, otherwise false
.
*/
// FIXME move to a renderable entity interface
Q_INVOKABLE void setLightsArePickable(bool value);
/**jsdoc
- * Get whether or not ray picks intersect the bounding box of {@link Entities.EntityProperties-Light|Light} entities. Ray
+ * Gets whether or not ray picks intersect the bounding box of {@link Entities.EntityProperties-Light|Light} entities. Ray
* picks are done using {@link Entities.findRayIntersection|findRayIntersection}, or the {@link Picks} API.
* @function Entities.getLightsArePickable
* @returns {boolean} true
if ray picks intersect the bounding box of
@@ -724,18 +739,18 @@ public slots:
Q_INVOKABLE bool getLightsArePickable() const;
/**jsdoc
- * Set whether or not ray picks intersect the bounding box of {@link Entities.EntityProperties-Zone|Zone} entities. By
- * default, Light entities are not intersected. The setting lasts for the Interface session. Ray picks are done using
+ * Sets whether or not ray picks intersect the bounding box of {@link Entities.EntityProperties-Zone|Zone} entities. By
+ * default, Zone entities are not intersected. The setting lasts for the Interface session. Ray picks are done using
* {@link Entities.findRayIntersection|findRayIntersection}, or the {@link Picks} API.
* @function Entities.setZonesArePickable
- * @param {boolean} value - Set true
to make ray picks intersect the bounding box of
+ * @param {boolean} value - true
to make ray picks intersect the bounding box of
* {@link Entities.EntityProperties-Zone|Zone} entities, otherwise false
.
*/
// FIXME move to a renderable entity interface
Q_INVOKABLE void setZonesArePickable(bool value);
/**jsdoc
- * Get whether or not ray picks intersect the bounding box of {@link Entities.EntityProperties-Zone|Zone} entities. Ray
+ * Gets whether or not ray picks intersect the bounding box of {@link Entities.EntityProperties-Zone|Zone} entities. Ray
* picks are done using {@link Entities.findRayIntersection|findRayIntersection}, or the {@link Picks} API.
* @function Entities.getZonesArePickable
* @returns {boolean} true
if ray picks intersect the bounding box of
@@ -745,17 +760,17 @@ public slots:
Q_INVOKABLE bool getZonesArePickable() const;
/**jsdoc
- * Set whether or not {@link Entities.EntityProperties-Zone|Zone} entities' boundaries should be drawn. Currently not
+ * Sets whether or not {@link Entities.EntityProperties-Zone|Zone} entities' boundaries should be drawn. Currently not
* used.
* @function Entities.setDrawZoneBoundaries
- * @param {boolean} value - Set to true
if {@link Entities.EntityProperties-Zone|Zone} entities' boundaries
- * should be drawn, otherwise false
.
+ * @param {boolean} value - true
if {@link Entities.EntityProperties-Zone|Zone} entities' boundaries should be
+ * drawn, otherwise false
.
*/
// FIXME move to a renderable entity interface
Q_INVOKABLE void setDrawZoneBoundaries(bool value);
/**jsdoc
- * Get whether or not {@link Entities.EntityProperties-Zone|Zone} entities' boundaries should be drawn. Currently
+ * Gets whether or not {@link Entities.EntityProperties-Zone|Zone} entities' boundaries should be drawn. Currently
* not used.
* @function Entities.getDrawZoneBoundaries
* @returns {boolean} true
if {@link Entities.EntityProperties-Zone|Zone} entities' boundaries should be
@@ -876,9 +891,9 @@ public slots:
Q_INVOKABLE bool setVoxelsInCuboid(const QUuid& entityID, const glm::vec3& lowPosition, const glm::vec3& cuboidSize, int value);
/**jsdoc
- * Convert voxel coordinates in a {@link Entities.EntityProperties-PolyVox|PolyVox} entity to world coordinates. Voxel coordinates are
- * relative to the minimum axes values corner of the entity with a scale of Vec3.ONE
being the dimensions of
- * each voxel.
+ * Converts voxel coordinates in a {@link Entities.EntityProperties-PolyVox|PolyVox} entity to world coordinates. Voxel
+ * coordinates are relative to the minimum axes values corner of the entity with a scale of Vec3.ONE
being the
+ * dimensions of each voxel.
* @function Entities.voxelCoordsToWorldCoords
* @param {Uuid} entityID - The ID of the {@link Entities.EntityProperties-PolyVox|PolyVox} entity.
* @param {Vec3} voxelCoords - The voxel coordinates. May be fractional and outside the entity's bounding box.
@@ -911,21 +926,24 @@ public slots:
Q_INVOKABLE glm::vec3 voxelCoordsToWorldCoords(const QUuid& entityID, glm::vec3 voxelCoords);
/**jsdoc
- * Convert world coordinates to voxel coordinates in a {@link Entities.EntityProperties-PolyVox|PolyVox} entity. Voxel coordinates are
- * relative to the minimum axes values corner of the entity, with a scale of Vec3.ONE
being the dimensions of
- * each voxel.
+ * Converts world coordinates to voxel coordinates in a {@link Entities.EntityProperties-PolyVox|PolyVox} entity. Voxel
+ * coordinates are relative to the minimum axes values corner of the entity, with a scale of Vec3.ONE
being
+ * the dimensions of each voxel.
* @function Entities.worldCoordsToVoxelCoords
* @param {Uuid} entityID - The ID of the {@link Entities.EntityProperties-PolyVox|PolyVox} entity.
* @param {Vec3} worldCoords - The world coordinates. May be outside the entity's bounding box.
* @returns {Vec3} The voxel coordinates of the worldCoords
if the entityID
is a
- * {@link Entities.EntityProperties-PolyVox|PolyVox} entity, otherwise {@link Vec3(0)|Vec3.ZERO}. The value may be fractional.
+ * {@link Entities.EntityProperties-PolyVox|PolyVox} entity, otherwise {@link Vec3(0)|Vec3.ZERO}. The value may be
+ * fractional and outside the entity's bounding box.
*/
// FIXME move to a renderable entity interface
Q_INVOKABLE glm::vec3 worldCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 worldCoords);
/**jsdoc
- * Convert voxel coordinates in a {@link Entities.EntityProperties-PolyVox|PolyVox} entity to local coordinates relative to the minimum
- * axes value corner of the entity, with the scale being the same as world coordinates.
+ * Converts voxel coordinates in a {@link Entities.EntityProperties-PolyVox|PolyVox} entity to local coordinates. Local
+ * coordinates are relative to the minimum axes value corner of the entity, with the scale being the same as world
+ * coordinates. Voxel coordinates are relative to the minimum axes values corner of the entity, with a scale of
+ * Vec3.ONE
being the dimensions of each voxel.
* @function Entities.voxelCoordsToLocalCoords
* @param {Uuid} entityID - The ID of the {@link Entities.EntityProperties-PolyVox|PolyVox} entity.
* @param {Vec3} voxelCoords - The voxel coordinates. May be fractional and outside the entity's bounding box.
@@ -946,13 +964,16 @@ public slots:
Q_INVOKABLE glm::vec3 voxelCoordsToLocalCoords(const QUuid& entityID, glm::vec3 voxelCoords);
/**jsdoc
- * Convert local coordinates to voxel coordinates in a {@link Entities.EntityProperties-PolyVox|PolyVox} entity. Local coordinates are
- * relative to the minimum axes value corner of the entity, with the scale being the same as world coordinates.
+ * Converts local coordinates to voxel coordinates in a {@link Entities.EntityProperties-PolyVox|PolyVox} entity. Local
+ * coordinates are relative to the minimum axes value corner of the entity, with the scale being the same as world
+ * coordinates. Voxel coordinates are relative to the minimum axes values corner of the entity, with a scale of
+ * Vec3.ONE
being the dimensions of each voxel.
* @function Entities.localCoordsToVoxelCoords
* @param {Uuid} entityID - The ID of the {@link Entities.EntityProperties-PolyVox|PolyVox} entity.
* @param {Vec3} localCoords - The local coordinates. May be outside the entity's bounding box.
* @returns {Vec3} The voxel coordinates of the worldCoords
if the entityID
is a
- * {@link Entities.EntityProperties-PolyVox|PolyVox} entity, otherwise {@link Vec3(0)|Vec3.ZERO}. The value may be fractional.
+ * {@link Entities.EntityProperties-PolyVox|PolyVox} entity, otherwise {@link Vec3(0)|Vec3.ZERO}. The value may be
+ * fractional and outside the entity's bounding box.
*/
// FIXME move to a renderable entity interface
Q_INVOKABLE glm::vec3 localCoordsToVoxelCoords(const QUuid& entityID, glm::vec3 localCoords);
@@ -1020,7 +1041,8 @@ public slots:
Q_INVOKABLE bool appendPoint(const QUuid& entityID, const glm::vec3& point);
/**jsdoc
- * Dumps debug information about all entities in Interface's local in-memory tree of entities it knows about to the program log.
+ * Dumps debug information about all entities in Interface's local in-memory tree of entities it knows about to the program
+ * log.
* @function Entities.dumpTree
*/
Q_INVOKABLE void dumpTree() const;
@@ -1125,7 +1147,7 @@ public slots:
* @example EventBridge
to the Web page's scripts.
+ * Sends a message to a {@link Entities.EntityProperties-Web|Web} entity's HTML page. To receive the message, the web
+ * page's script must connect to the EventBridge
that is automatically provided to the script:
+ * EventBridge.scriptEventReceived.connect(function(message) {
+ * ...
+ * });
+ * Use {@link Entities.webEventReceived} to receive messages from the Web entity's HTML page.
+ *Alternatively, you can use {@link Entities.getEntityObject} to exchange messages over a Web entity's HTML event + * bridge.
* @function Entities.emitScriptEvent - * @param {Uuid} entityID - The ID of the {@link Entities.EntityProperties-Web|Web} entity. + * @param {Uuid} entityID - The ID of the Web entity to send the message to. * @param {string} message - The message to send. + * @exampletrue
if the AA box and capsule intersect, otherwise false
.
*/
Q_INVOKABLE bool AABoxIntersectsCapsule(const glm::vec3& low, const glm::vec3& dimensions,
@@ -1709,123 +1784,174 @@ public slots:
/**jsdoc
+ * Converts a position in world coordinates to a position in an avatar, entity, or joint's local coordinates.
* @function Entities.worldToLocalPosition
- * @param {Vec3} worldPosition
- * @param {Uuid} parentID
- * @param {number} parentJointIndex
- * @param {boolean} scalesWithparent
- * @returns {Vec3}
+ * @param {Vec3} worldPosition - The world position to convert.
+ * @param {Uuid} parentID - The avatar or entity that the local coordinates are based on.
+ * @param {number} [parentJointIndex=-1] - The joint in the avatar or entity that the local coordinates are based on. If
+ * -1
then no joint is used and the local coordinates are based solely on the avatar or entity.
+ * @param {boolean} [scalesWithParent= false] - true
to scale the local position per the parent's scale,
+ * false
for the local position to be at world scale.
+ * @returns {Vec3} The position converted to local coordinates if successful, otherwise {@link Vec3(0)|Vec3.ZERO}.
+ * @example -1
then no joint is used and the local coordinates are based solely on the avatar or entity.
+ * @param {boolean} [scalesWithParent=false] - Not used in the calculation.
+ * @returns {Quat} The rotation converted to local coordinates if successful, otherwise {@link Quat(0)|Quat.IDENTITY}.
*/
Q_INVOKABLE glm::quat worldToLocalRotation(glm::quat worldRotation, const QUuid& parentID,
int parentJointIndex = -1, bool scalesWithParent = false);
/**jsdoc
+ * Converts a velocity in world coordinates to a velocity in an avatar, entity, or joint's local coordinates.
* @function Entities.worldToLocalVelocity
- * @param {Vec3} worldVelocity
- * @param {Uuid} parentID
- * @param {number} parentJointIndex
- * @param {boolean} scalesWithparent
- * @returns {Vec3}
+ * @param {Vec3} worldVelocity - The world velocity to convert.
+ * @param {Uuid} parentID - The avatar or entity that the local coordinates are based on.
+ * @param {number} [parentJointIndex=-1] - The joint in the avatar or entity that the local coordinates are based on. If
+ * -1
then no joint is used and the local coordinates are based solely on the avatar or entity.
+ * @param {boolean} [scalesWithParent=false] - true
to scale the local velocity per the parent's scale,
+ * false
for the local velocity to be at world scale.
+ * @returns {Vec3} The velocity converted to local coordinates if successful, otherwise {@link Vec3(0)|Vec3.ZERO}.
*/
Q_INVOKABLE glm::vec3 worldToLocalVelocity(glm::vec3 worldVelocity, const QUuid& parentID,
int parentJointIndex = -1, bool scalesWithParent = false);
/**jsdoc
+ * Converts a Euler angular velocity in world coordinates to an angular velocity in an avatar, entity, or joint's local
+ * coordinates.
* @function Entities.worldToLocalAngularVelocity
- * @param {Vec3} worldAngularVelocity
- * @param {Uuid} parentID
- * @param {number} parentJointIndex
- * @param {boolean} scalesWithparent
- * @returns {Vec3}
+ * @param {Vec3} worldAngularVelocity - The world Euler angular velocity to convert. (Can be in any unit, e.g., deg/s or
+ * rad/s.)
+ * @param {Uuid} parentID - The avatar or entity that the local coordinates are based on.
+ * @param {number} [parentJointIndex=-1] - The joint in the avatar or entity that the local coordinates are based on. If
+ * -1
then no joint is used and the local coordinates are based solely on the avatar or entity.
+ * @param {boolean} [scalesWithParent=false] - Not used in the calculation.
+ * @returns {Vec3} The angular velocity converted to local coordinates if successful, otherwise {@link Vec3(0)|Vec3.ZERO}.
*/
Q_INVOKABLE glm::vec3 worldToLocalAngularVelocity(glm::vec3 worldAngularVelocity, const QUuid& parentID,
int parentJointIndex = -1, bool scalesWithParent = false);
/**jsdoc
+ * Converts dimensions in world coordinates to dimensions in an avatar or entity's local coordinates.
* @function Entities.worldToLocalDimensions
- * @param {Vec3} worldDimensions
- * @param {Uuid} parentID
- * @param {number} parentJointIndex
- * @param {boolean} scalesWithparent
- * @returns {Vec3}
+ * @param {Vec3} worldDimensions - The world dimensions to convert.
+ * @param {Uuid} parentID - The avatar or entity that the local coordinates are based on.
+ * @param {number} [parentJointIndex=-1] - Not used in the calculation.
+ * @param {boolean} [scalesWithParent=false] - true
to scale the local dimensions per the parent's scale,
+ * false
for the local dimensions to be at world scale.
+ * @returns {Vec3} The dimensions converted to local coordinates if successful, otherwise {@link Vec3(0)|Vec3.ZERO}.
*/
Q_INVOKABLE glm::vec3 worldToLocalDimensions(glm::vec3 worldDimensions, const QUuid& parentID,
int parentJointIndex = -1, bool scalesWithParent = false);
/**jsdoc
+ * Converts a position in an avatar, entity, or joint's local coordinate to a position in world coordinates.
* @function Entities.localToWorldPosition
- * @param {Vec3} localPosition
- * @param {Uuid} parentID
- * @param {number} parentJointIndex
- * @param {boolean} scalesWithparent
- * @returns {Vec3}
+ * @param {Vec3} localPosition - The local position to convert.
+ * @param {Uuid} parentID - The avatar or entity that the local coordinates are based on.
+ * @param {number} [parentJointIndex=-1] - The joint in the avatar or entity that the local coordinates are based on. If
+ * -1
then no joint is used and the local coordinates are based solely on the avatar or entity.
+ * @param {boolean} [scalesWithparent=false] - true
if the local dimensions are scaled per the parent's scale,
+ * false
if the local dimensions are at world scale.
+ * @returns {Vec3} The position converted to world coordinates if successful, otherwise {@link Vec3(0)|Vec3.ZERO}.
*/
Q_INVOKABLE glm::vec3 localToWorldPosition(glm::vec3 localPosition, const QUuid& parentID,
int parentJointIndex = -1, bool scalesWithParent = false);
/**jsdoc
+ * Converts a rotation or orientation in an avatar, entity, or joint's local coordinate to a rotation in world coordinates.
* @function Entities.localToWorldRotation
- * @param {Quat} localRotation
- * @param {Uuid} parentID
- * @param {number} parentJointIndex
- * @param {boolean} scalesWithparent
- * @returns {Quat}
+ * @param {Quat} localRotation - The local rotation to convert.
+ * @param {Uuid} parentID - The avatar or entity that the local coordinates are based on.
+ * @param {number} [parentJointIndex=-1] - The joint in the avatar or entity that the local coordinates are based on. If
+ * -1
then no joint is used and the local coordinates are based solely on the avatar or entity.
+ * @param {boolean} [scalesWithParent= false] - Not used in the calculation.
+ * @returns {Quat} The rotation converted to local coordinates if successful, otherwise {@link Quat(0)|Quat.IDENTITY}.
*/
Q_INVOKABLE glm::quat localToWorldRotation(glm::quat localRotation, const QUuid& parentID,
int parentJointIndex = -1, bool scalesWithParent = false);
/**jsdoc
+ * Converts a velocity in an avatar, entity, or joint's local coordinate to a velocity in world coordinates.
* @function Entities.localToWorldVelocity
- * @param {Vec3} localVelocity
- * @param {Uuid} parentID
- * @param {number} parentJointIndex
- * @param {boolean} scalesWithparent
- * @returns {Vec3}
+ * @param {Vec3} localVelocity - The local velocity to convert.
+ * @param {Uuid} parentID - The avatar or entity that the local coordinates are based on.
+ * @param {number} [parentJointIndex=-1] - The joint in the avatar or entity that the local coordinates are based on. If
+ * -1
then no joint is used and the local coordinates are based solely on the avatar or entity.
+ * @param {boolean} [scalesWithParent= false] - true
if the local velocity is scaled per the parent's scale,
+ * false
if the local velocity is at world scale.
+ * @returns {Vec3} The velocity converted to world coordinates it successful, otherwise {@link Vec3(0)|Vec3.ZERO}.
*/
Q_INVOKABLE glm::vec3 localToWorldVelocity(glm::vec3 localVelocity, const QUuid& parentID,
int parentJointIndex = -1, bool scalesWithParent = false);
/**jsdoc
+ * Converts a Euler angular velocity in an avatar, entity, or joint's local coordinate to an angular velocity in world
+ * coordinates.
* @function Entities.localToWorldAngularVelocity
- * @param {Vec3} localAngularVelocity
- * @param {Uuid} parentID
- * @param {number} parentJointIndex
- * @param {boolean} scalesWithparent
- * @returns {Vec3}
+ * @param {Vec3} localAngularVelocity - The local Euler angular velocity to convert. (Can be in any unit, e.g., deg/s or
+ * rad/s.)
+ * @param {Uuid} parentID - The avatar or entity that the local coordinates are based on.
+ * @param {number} [parentJointIndex=-1] - The joint in the avatar or entity that the local coordinates are based on. If
+ * -1
then no joint is used and the local coordinates are based solely on the avatar or entity.
+ * @param {boolean} [scalesWithParent= false] - Not used in the calculation.
+ * @returns {Vec3} The angular velocity converted to world coordinates if successful, otherwise {@link Vec3(0)|Vec3.ZERO}.
*/
Q_INVOKABLE glm::vec3 localToWorldAngularVelocity(glm::vec3 localAngularVelocity, const QUuid& parentID,
int parentJointIndex = -1, bool scalesWithParent = false);
/**jsdoc
+ * Converts dimensions in an avatar or entity's local coordinates to dimensions in world coordinates.
* @function Entities.localToWorldDimensions
- * @param {Vec3} localDimensions
- * @param {Uuid} parentID
- * @param {number} parentJointIndex
- * @param {boolean} scalesWithparent
- * @returns {Vec3}
+ * @param {Vec3} localDimensions - The local dimensions to convert.
+ * @param {Uuid} parentID - The avatar or entity that the local coordinates are based on.
+ * @param {number} [parentJointIndex=-1] - Not used in the calculation.
+ * @param {boolean} [scalesWithParent= false] - true
if the local dimensions are scaled per the parent's
+ * scale, false
if the local dimensions are at world scale.
+ * @returns {Vec3} The dimensions converted to world coordinates if successful, otherwise {@link Vec3(0)|Vec3.ZERO}.
*/
Q_INVOKABLE glm::vec3 localToWorldDimensions(glm::vec3 localDimensions, const QUuid& parentID,
int parentJointIndex = -1, bool scalesWithParent = false);
/**jsdoc
- * Get the static certificate for an entity. The static certificate contains static properties of the item which cannot
- * be altered.
- * @function Entities.getStaticCertificateJSON
- * @param {Uuid} entityID - The ID of the entity to get the static certificate for.
- * @returns {string} The entity's static certificate as a JSON string if the entity can be found, otherwise an empty string.
- */
+ * Gets the static certificate for an entity. The static certificate contains static properties of the item which cannot
+ * be altered.
+ * @function Entities.getStaticCertificateJSON
+ * @param {Uuid} entityID - The ID of the entity to get the static certificate for.
+ * @returns {string} The entity's static certificate as a JSON string if the entity can be found, otherwise ""
.
+ */
Q_INVOKABLE QString getStaticCertificateJSON(const QUuid& entityID);
/**jsdoc
- * Verify the entity's proof of provenance, i.e., that the entity's certificateID
property was produced by
+ * Verifies the entity's proof of provenance, i.e., that the entity's certificateID
property was produced by
* High Fidelity signing the entity's static certificate JSON.
* @function Entities.verifyStaticCertificateProperties
* @param {Uuid} entityID - The ID of the entity to verify.
- * @returns {boolean} true
if the entity can be found an its certificateID
property is present
- * and its value matches the entity's static certificate JSON; otherwise false
.
+ * @returns {boolean} true
if the entity can be found, its certificateID
property is present, and
+ * its value matches the entity's static certificate JSON; otherwise false
.
*/
Q_INVOKABLE bool verifyStaticCertificateProperties(const QUuid& entityID);
@@ -1960,7 +2086,7 @@ signals:
* pressed while its laser is on an entity.
* See also, {@link Script.addEventHandler}.
* @function Entities.mousePressOnEntity - * @param {Uuid} entityID - The ID of the entity that was pressed. + * @param {Uuid} entityID - The ID of the entity that was pressed on. * @param {PointerEvent} event - Details of the event. * @returns {Signal} * @exampleSee also, {@link Script.addEventHandler}.
* @function Entities.clickDownOnEntity - * @param {Uuid} entityID - The ID of the entity that was clicked. + * @param {Uuid} entityID - The ID of the entity that was clicked on. * @param {PointerEvent} event - Details of the event. * @returns {Signal} */ diff --git a/libraries/octree/src/OctreeScriptingInterface.h b/libraries/octree/src/OctreeScriptingInterface.h index e501dd166a..c7b0552511 100644 --- a/libraries/octree/src/OctreeScriptingInterface.h +++ b/libraries/octree/src/OctreeScriptingInterface.h @@ -37,7 +37,7 @@ private slots: public slots: /**jsdoc - * Set the maximum number of entity packets that the client can send per second. + * Sets the maximum number of entity packets that the client can send per second. * @function Entities.setPacketsPerSecond * @param {number} packetsPerSecond - Integer maximum number of entity packets that the client can send per second. */ @@ -45,7 +45,7 @@ public slots: void setPacketsPerSecond(int packetsPerSecond) { return _packetSender->setPacketsPerSecond(packetsPerSecond); } /**jsdoc - * Get the maximum number of entity packets that the client can send per second. + * Gets the maximum number of entity packets that the client can send per second. * @function Entities.getPacketsPerSecond * @returns {number} Integer maximum number of entity packets that the client can send per second. */ @@ -53,7 +53,7 @@ public slots: int getPacketsPerSecond() const { return _packetSender->getPacketsPerSecond(); } /**jsdoc - * Check whether servers exist for the client to send entity packets to, i.e., whether you are connected to a domain and + * Checks whether servers exist for the client to send entity packets to, i.e., whether you are connected to a domain and * its entity server is working. * @function Entities.serversExist * @returns {boolean}true
if servers exist for the client to send entity packets to, otherwise
@@ -63,7 +63,7 @@ public slots:
bool serversExist() const { return _packetSender->serversExist(); }
/**jsdoc
- * Check whether the client has entity packets waiting to be sent.
+ * Checks whether the client has entity packets waiting to be sent.
* @function Entities.hasPacketsToSend
* @returns {boolean} true
if the client has entity packets waiting to be sent, otherwise false
.
*/
@@ -71,7 +71,7 @@ public slots:
bool hasPacketsToSend() const { return _packetSender->hasPacketsToSend(); }
/**jsdoc
- * Get the number of entity packets the client has waiting to be sent.
+ * Gets the number of entity packets the client has waiting to be sent.
* @function Entities.packetsToSendCount
* @returns {number} Integer number of entity packets the client has waiting to be sent.
*/
@@ -79,7 +79,7 @@ public slots:
int packetsToSendCount() const { return (int)_packetSender->packetsToSendCount(); }
/**jsdoc
- * Get the entity packets per second send rate of the client over its lifetime.
+ * Gets the entity packets per second send rate of the client over its lifetime.
* @function Entities.getLifetimePPS
* @returns {number} Entity packets per second send rate of the client over its lifetime.
*/
@@ -87,7 +87,7 @@ public slots:
float getLifetimePPS() const { return _packetSender->getLifetimePPS(); }
/**jsdoc
- * Get the entity bytes per second send rate of the client over its lifetime.
+ * Gets the entity bytes per second send rate of the client over its lifetime.
* @function Entities.getLifetimeBPS
* @returns {number} Entity bytes per second send rate of the client over its lifetime.
*/
@@ -95,7 +95,7 @@ public slots:
float getLifetimeBPS() const { return _packetSender->getLifetimeBPS(); }
/**jsdoc
- * Get the entity packets per second queued rate of the client over its lifetime.
+ * Gets the entity packets per second queued rate of the client over its lifetime.
* @function Entities.getLifetimePPSQueued
* @returns {number} Entity packets per second queued rate of the client over its lifetime.
*/
@@ -103,7 +103,7 @@ public slots:
float getLifetimePPSQueued() const { return _packetSender->getLifetimePPSQueued(); }
/**jsdoc
- * Get the entity bytes per second queued rate of the client over its lifetime.
+ * Gets the entity bytes per second queued rate of the client over its lifetime.
* @function Entities.getLifetimeBPSQueued
* @returns {number} Entity bytes per second queued rate of the client over its lifetime.
*/
@@ -111,7 +111,7 @@ public slots:
float getLifetimeBPSQueued() const { return _packetSender->getLifetimeBPSQueued(); }
/**jsdoc
- * Get the lifetime of the client from the first entity packet sent until now, in microseconds.
+ * Gets the lifetime of the client from the first entity packet sent until now, in microseconds.
* @function Entities.getLifetimeInUsecs
* @returns {number} Lifetime of the client from the first entity packet sent until now, in microseconds.
*/
@@ -119,7 +119,7 @@ public slots:
long long unsigned int getLifetimeInUsecs() const { return _packetSender->getLifetimeInUsecs(); }
/**jsdoc
- * Get the lifetime of the client from the first entity packet sent until now, in seconds.
+ * Gets the lifetime of the client from the first entity packet sent until now, in seconds.
* @function Entities.getLifetimeInSeconds
* @returns {number} Lifetime of the client from the first entity packet sent until now, in seconds.
*/
@@ -127,7 +127,7 @@ public slots:
float getLifetimeInSeconds() const { return _packetSender->getLifetimeInSeconds(); }
/**jsdoc
- * Get the total number of entity packets sent by the client over its lifetime.
+ * Gets the total number of entity packets sent by the client over its lifetime.
* @function Entities.getLifetimePacketsSent
* @returns {number} The total number of entity packets sent by the client over its lifetime.
*/
@@ -135,7 +135,7 @@ public slots:
long long unsigned int getLifetimePacketsSent() const { return _packetSender->getLifetimePacketsSent(); }
/**jsdoc
- * Get the total bytes of entity packets sent by the client over its lifetime.
+ * Gets the total bytes of entity packets sent by the client over its lifetime.
* @function Entities.getLifetimeBytesSent
* @returns {number} The total bytes of entity packets sent by the client over its lifetime.
*/
@@ -143,7 +143,7 @@ public slots:
long long unsigned int getLifetimeBytesSent() const { return _packetSender->getLifetimeBytesSent(); }
/**jsdoc
- * Get the total number of entity packets queued by the client over its lifetime.
+ * Gets the total number of entity packets queued by the client over its lifetime.
* @function Entities.getLifetimePacketsQueued
* @returns {number} The total number of entity packets queued by the client over its lifetime.
*/
@@ -151,7 +151,7 @@ public slots:
long long unsigned int getLifetimePacketsQueued() const { return _packetSender->getLifetimePacketsQueued(); }
/**jsdoc
- * Get the total bytes of entity packets queued by the client over its lifetime.
+ * Gets the total bytes of entity packets queued by the client over its lifetime.
* @function Entities.getLifetimeBytesQueued
* @returns {number} The total bytes of entity packets queued by the client over its lifetime.
*/
diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp
index 9d29f32931..d820f0cb0f 100644
--- a/libraries/script-engine/src/ScriptEngine.cpp
+++ b/libraries/script-engine/src/ScriptEngine.cpp
@@ -2200,6 +2200,7 @@ void ScriptEngine::loadEntityScript(const EntityItemID& entityID, const QString&
* lifetime: 300 // Delete after 5 minutes.
* });
*/
+// The JSDoc is for the callEntityScriptMethod() call in this method.
// since all of these operations can be asynch we will always do the actual work in the response handler
// for the download
void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, const QString& scriptOrURL, const QString& contents, bool isURL, bool success , const QString& status) {
@@ -2384,8 +2385,10 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co
* Note: Can only be connected to via this.unoad = function () { ... }
in the entity script.
Available in: | Client Entity Scripts | Server Entity Scripts |
---|
"Press"
, "DoublePress"
, "Release"
, or
* "Move"
.