Fix jsDoc references to Vircadia platform/CDN

This commit is contained in:
Zetaphor 2023-08-25 13:58:45 -03:00
parent ef0fb6ce94
commit 13242611ea
7 changed files with 98 additions and 98 deletions

View file

@ -71,10 +71,10 @@ public:
}; };
/*@jsdoc /*@jsdoc
* The <code>Overlays</code> API provides facilities to create and interact with overlays. These are 2D and 3D objects visible * The <code>Overlays</code> API provides facilities to create and interact with overlays. These are 2D and 3D objects visible
* only to yourself and that aren't persisted to the domain. They are used for UI. * only to yourself and that aren't persisted to the domain. They are used for UI.
* *
* <p><strong>Note:</strong> 3D overlays are local {@link Entities}, internally, so many of the methods also work with * <p><strong>Note:</strong> 3D overlays are local {@link Entities}, internally, so many of the methods also work with
* entities.</p> * entities.</p>
* *
* @namespace Overlays * @namespace Overlays
@ -83,8 +83,8 @@ public:
* @hifi-client-entity * @hifi-client-entity
* @hifi-avatar * @hifi-avatar
* *
* @property {Uuid} keyboardFocusOverlay - The <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay * @property {Uuid} keyboardFocusOverlay - The <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay
* ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus. If no overlay (entity) has keyboard focus, * ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus. If no overlay (entity) has keyboard focus,
* returns <code>null</code>; set to <code>null</code> or {@link Uuid(0)|Uuid.NULL} to clear keyboard focus. * returns <code>null</code>; set to <code>null</code> or {@link Uuid(0)|Uuid.NULL} to clear keyboard focus.
*/ */
@ -152,7 +152,7 @@ public slots:
* @function Overlays.editOverlay * @function Overlays.editOverlay
* @param {Uuid} id - The ID of the overlay (or entity) to edit. * @param {Uuid} id - The ID of the overlay (or entity) to edit.
* @param {Overlays.OverlayProperties} properties - The properties changes to make. * @param {Overlays.OverlayProperties} properties - The properties changes to make.
* @returns {boolean} <code>false</code> if Interface is exiting. Otherwise, if a 2D overlay then <code>true</code> always, * @returns {boolean} <code>false</code> if Interface is exiting. Otherwise, if a 2D overlay then <code>true</code> always,
* and if a 3D overlay then <code>true</code> if the overlay was found and edited, otherwise <code>false</code>. * and if a 3D overlay then <code>true</code> if the overlay was found and edited, otherwise <code>false</code>.
* @example <caption>Add an overlay in front of your avatar then change its color.</caption> * @example <caption>Add an overlay in front of your avatar then change its color.</caption>
* var overlay = Overlays.addOverlay("cube", { * var overlay = Overlays.addOverlay("cube", {
@ -222,8 +222,8 @@ public slots:
QString getOverlayType(const QUuid& id); QString getOverlayType(const QUuid& id);
/*@jsdoc /*@jsdoc
* Gets an overlay's (or entity's) script object. In particular, this is useful for accessing a * Gets an overlay's (or entity's) script object. In particular, this is useful for accessing a
* <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay's <code>EventBridge</code> script object to * <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay's <code>EventBridge</code> script object to
* exchange messages with the web page script. * exchange messages with the web page script.
* <p>To send a message from an Interface script to a <code>"web3d"</code> overlay over its event bridge:</p> * <p>To send a message from an Interface script to a <code>"web3d"</code> overlay over its event bridge:</p>
* <pre class="prettyprint"><code>var overlayObject = Overlays.getOverlayObject(overlayID); * <pre class="prettyprint"><code>var overlayObject = Overlays.getOverlayObject(overlayID);
@ -250,9 +250,9 @@ public slots:
* // Message received from the script. * // Message received from the script.
* console.log("Message received: " + message); * console.log("Message received: " + message);
* } * }
* *
* EventBridge.scriptEventReceived.connect(onScriptEventReceived); * EventBridge.scriptEventReceived.connect(onScriptEventReceived);
* *
* setInterval(function () { * setInterval(function () {
* // Send a message to the script. * // Send a message to the script.
* EventBridge.emitWebEvent("hello"); * EventBridge.emitWebEvent("hello");
@ -260,7 +260,7 @@ public slots:
* </script> * </script>
* </body> * </body>
* </html> * </html>
* *
* // Interface script file. * // Interface script file.
* var web3DOverlay = Overlays.addOverlay("web3d", { * var web3DOverlay = Overlays.addOverlay("web3d", {
* type: "Web", * type: "Web",
@ -269,22 +269,22 @@ public slots:
* sourceUrl : Script.resolvePath("web3d.html"), * sourceUrl : Script.resolvePath("web3d.html"),
* alpha : 1.0 * alpha : 1.0
* }); * });
* *
* var overlayObject; * var overlayObject;
* *
* function onWebEventReceived(message) { * function onWebEventReceived(message) {
* // Message received. * // Message received.
* print("Message received: " + message); * print("Message received: " + message);
* *
* // Send a message back. * // Send a message back.
* overlayObject.emitScriptEvent(message + " back"); * overlayObject.emitScriptEvent(message + " back");
* } * }
* *
* Script.setTimeout(function() { * Script.setTimeout(function() {
* overlayObject = Overlays.getOverlayObject(web3DOverlay); * overlayObject = Overlays.getOverlayObject(web3DOverlay);
* overlayObject.webEventReceived.connect(onWebEventReceived); * overlayObject.webEventReceived.connect(onWebEventReceived);
* }, 500); * }, 500);
* *
* Script.scriptEnding.connect(function() { * Script.scriptEnding.connect(function() {
* Overlays.deleteOverlay(web3DOverlay); * Overlays.deleteOverlay(web3DOverlay);
* }); * });
@ -314,18 +314,18 @@ public slots:
* Finds the closest 3D overlay (or local entity) intersected by a {@link PickRay}. * Finds the closest 3D overlay (or local entity) intersected by a {@link PickRay}.
* @function Overlays.findRayIntersection * @function Overlays.findRayIntersection
* @param {PickRay} pickRay - The PickRay to use for finding overlays. * @param {PickRay} pickRay - The PickRay to use for finding overlays.
* @param {boolean} [precisionPicking=false] - <code>true</code> to pick against precise meshes, <code>false</code> to pick * @param {boolean} [precisionPicking=false] - <code>true</code> to pick against precise meshes, <code>false</code> to pick
* against coarse meshes. If <code>true</code> and the intersected entity is a model, the result's * against coarse meshes. If <code>true</code> and the intersected entity is a model, the result's
* <code>extraInfo</code> property includes more information than it otherwise would. * <code>extraInfo</code> property includes more information than it otherwise would.
* @param {Array.<Uuid>} [include=[]] - If not empty, then the search is restricted to these overlays (and local entities). * @param {Array.<Uuid>} [include=[]] - If not empty, then the search is restricted to these overlays (and local entities).
* @param {Array.<Uuid>} [discard=[]] - Overlays (and local entities) to ignore during the search. * @param {Array.<Uuid>} [discard=[]] - Overlays (and local entities) to ignore during the search.
* @param {boolean} [visibleOnly=false] - <code>true</code> if only overlays (and local entities) that are * @param {boolean} [visibleOnly=false] - <code>true</code> if only overlays (and local entities) that are
* <code>{@link Overlays.OverlayProperties|visible}</code> should be searched. * <code>{@link Overlays.OverlayProperties|visible}</code> should be searched.
* @param {boolean} [collideableOnly=false] - <code>true</code> if only local entities that are not * @param {boolean} [collideableOnly=false] - <code>true</code> if only local entities that are not
* <code>{@link Entities.EntityProperties|collisionless}</code> should be searched. * <code>{@link Entities.EntityProperties|collisionless}</code> should be searched.
* @returns {Overlays.RayToOverlayIntersectionResult} The result of the search for the first intersected overlay (or local * @returns {Overlays.RayToOverlayIntersectionResult} The result of the search for the first intersected overlay (or local
* entity. * entity.
* @example <caption>Create a cube overlay in front of your avatar. Report 3D overlay intersection details for mouse * @example <caption>Create a cube overlay in front of your avatar. Report 3D overlay intersection details for mouse
* clicks.</caption> * clicks.</caption>
* var overlay = Overlays.addOverlay("cube", { * var overlay = Overlays.addOverlay("cube", {
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })), * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })),
@ -352,7 +352,7 @@ public slots:
* @function Overlays.findOverlays * @function Overlays.findOverlays
* @param {Vec3} center - The center of the search sphere. * @param {Vec3} center - The center of the search sphere.
* @param {number} radius - The radius of the search sphere. * @param {number} radius - The radius of the search sphere.
* @returns {Uuid[]} The IDs of the overlays (local entities) that are visible and have bounding boxes that touch a search * @returns {Uuid[]} The IDs of the overlays (local entities) that are visible and have bounding boxes that touch a search
* sphere. * sphere.
* @example <caption>Create two overlays in front of your avatar then search for overlays near your avatar.</caption> * @example <caption>Create two overlays in front of your avatar then search for overlays near your avatar.</caption>
* var overlayA = Overlays.addOverlay("cube", { * var overlayA = Overlays.addOverlay("cube", {
@ -376,17 +376,17 @@ public slots:
QVector<QUuid> findOverlays(const glm::vec3& center, float radius); QVector<QUuid> findOverlays(const glm::vec3& center, float radius);
/*@jsdoc /*@jsdoc
* Checks whether an overlay's (or entity's) assets have been loaded. For example, for an * Checks whether an overlay's (or entity's) assets have been loaded. For example, for an
* <code>{@link Overlays.OverlayProperties-Image|"image"}</code> overlay, the result indicates whether its image has been * <code>{@link Overlays.OverlayProperties-Image|"image"}</code> overlay, the result indicates whether its image has been
* loaded. * loaded.
* @function Overlays.isLoaded * @function Overlays.isLoaded
* @param {Uuid} id - The ID of the overlay (or entity) to check. * @param {Uuid} id - The ID of the overlay (or entity) to check.
* @returns {boolean} <code>true</code> if the overlay's (or entity's) assets have been loaded, otherwise * @returns {boolean} <code>true</code> if the overlay's (or entity's) assets have been loaded, otherwise
* <code>false</code>. * <code>false</code>.
* @example <caption>Create an image overlay and report whether its image is loaded after 1s.</caption> * @example <caption>Create an image overlay and report whether its image is loaded after 1s.</caption>
* var overlay = Overlays.addOverlay("image", { * var overlay = Overlays.addOverlay("image", {
* bounds: { x: 100, y: 100, width: 200, height: 200 }, * bounds: { x: 100, y: 100, width: 200, height: 200 },
* imageURL: "https://content.vircadia.com/eu-c-1/vircadia-assets/interface/default/default_particle.png" * imageURL: "https://content.overte.org/Bazaar/Assets/Textures/Defaults/Interface/default_particle.png"
* }); * });
* Script.setTimeout(function () { * Script.setTimeout(function () {
* var isLoaded = Overlays.isLoaded(overlay); * var isLoaded = Overlays.isLoaded(overlay);
@ -397,13 +397,13 @@ public slots:
/*@jsdoc /*@jsdoc
* Calculates the size of some text in a text overlay (or entity). The overlay (or entity) need not be set visible. * Calculates the size of some text in a text overlay (or entity). The overlay (or entity) need not be set visible.
* <p><strong>Note:</strong> The size of text in a 3D overlay (or entity) cannot be calculated immediately after the * <p><strong>Note:</strong> The size of text in a 3D overlay (or entity) cannot be calculated immediately after the
* overlay (or entity) is created; a short delay is required while the overlay (or entity) finishes being created.</p> * overlay (or entity) is created; a short delay is required while the overlay (or entity) finishes being created.</p>
* @function Overlays.textSize * @function Overlays.textSize
* @param {Uuid} id - The ID of the overlay (or entity) to use for calculation. * @param {Uuid} id - The ID of the overlay (or entity) to use for calculation.
* @param {string} text - The string to calculate the size of. * @param {string} text - The string to calculate the size of.
* @returns {Size} The size of the <code>text</code> if the object is a text overlay (or entity), otherwise * @returns {Size} The size of the <code>text</code> if the object is a text overlay (or entity), otherwise
* <code>{ height: 0, width : 0 }</code>. If the object is a 2D overlay, the size is in pixels; if the object is a 3D * <code>{ height: 0, width : 0 }</code>. If the object is a 2D overlay, the size is in pixels; if the object is a 3D
* overlay (or entity), the size is in meters. * overlay (or entity), the size is in meters.
* @example <caption>Calculate the size of "hello" in a 3D text entity.</caption> * @example <caption>Calculate the size of "hello" in a 3D text entity.</caption>
* var overlay = Overlays.addOverlay("text3d", { * var overlay = Overlays.addOverlay("text3d", {
@ -447,7 +447,7 @@ public slots:
* @function Overlays.sendMousePressOnOverlay * @function Overlays.sendMousePressOnOverlay
* @param {Uuid} id - The ID of the overlay (or local entity) to generate a mouse press event on. * @param {Uuid} id - The ID of the overlay (or local entity) to generate a mouse press event on.
* @param {PointerEvent} event - The mouse press event details. * @param {PointerEvent} event - The mouse press event details.
* @example <caption>Create a 2D rectangle overlay plus a 3D cube overlay and generate mousePressOnOverlay events for the * @example <caption>Create a 2D rectangle overlay plus a 3D cube overlay and generate mousePressOnOverlay events for the
* 2D overlay.</caption> * 2D overlay.</caption>
* var overlay3D = Overlays.addOverlay("cube", { * var overlay3D = Overlays.addOverlay("cube", {
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })), * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })),
@ -523,20 +523,20 @@ public slots:
void sendHoverLeaveOverlay(const QUuid& id, const PointerEvent& event); void sendHoverLeaveOverlay(const QUuid& id, const PointerEvent& event);
/*@jsdoc /*@jsdoc
* Gets the ID of the <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay * Gets the ID of the <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay
* ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus. * ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus.
* @function Overlays.getKeyboardFocusOverlay * @function Overlays.getKeyboardFocusOverlay
* @returns {Uuid} The ID of the <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay * @returns {Uuid} The ID of the <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay
* ({@link Entities.EntityProperties-Web|Web} entity) that has focus, if any, otherwise <code>null</code>. * ({@link Entities.EntityProperties-Web|Web} entity) that has focus, if any, otherwise <code>null</code>.
*/ */
QUuid getKeyboardFocusOverlay() { return DependencyManager::get<EntityScriptingInterface>()->getKeyboardFocusEntity(); } QUuid getKeyboardFocusOverlay() { return DependencyManager::get<EntityScriptingInterface>()->getKeyboardFocusEntity(); }
/*@jsdoc /*@jsdoc
* Sets the <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay * Sets the <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay
* ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus. * ({@link Entities.EntityProperties-Web|Web} entity) that has keyboard focus.
* @function Overlays.setKeyboardFocusOverlay * @function Overlays.setKeyboardFocusOverlay
* @param {Uuid} id - The ID of the <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay * @param {Uuid} id - The ID of the <code>{@link Overlays.OverlayProperties-Web3D|"web3d"}</code> overlay
* ({@link Entities.EntityProperties-Web|Web} entity) to set keyboard focus to. Use <code>null</code> or * ({@link Entities.EntityProperties-Web|Web} entity) to set keyboard focus to. Use <code>null</code> or
* {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an overlay (entity). * {@link Uuid(0)|Uuid.NULL} to unset keyboard focus from an overlay (entity).
*/ */
void setKeyboardFocusOverlay(const QUuid& id) { DependencyManager::get<EntityScriptingInterface>()->setKeyboardFocusEntity(id); } void setKeyboardFocusOverlay(const QUuid& id) { DependencyManager::get<EntityScriptingInterface>()->setKeyboardFocusEntity(id); }
@ -566,7 +566,7 @@ signals:
void overlayDeleted(const QUuid& id); void overlayDeleted(const QUuid& id);
/*@jsdoc /*@jsdoc
* Triggered when a mouse press event occurs on an overlay. Only occurs for 3D overlays (unless you use * Triggered when a mouse press event occurs on an overlay. Only occurs for 3D overlays (unless you use
* {@link Overlays.sendMousePressOnOverlay|sendMousePressOnOverlay} for a 2D overlay). * {@link Overlays.sendMousePressOnOverlay|sendMousePressOnOverlay} for a 2D overlay).
* @function Overlays.mousePressOnOverlay * @function Overlays.mousePressOnOverlay
* @param {Uuid} id - The ID of the overlay the mouse press event occurred on. * @param {Uuid} id - The ID of the overlay the mouse press event occurred on.
@ -599,7 +599,7 @@ signals:
void mouseDoublePressOnOverlay(const QUuid& id, const PointerEvent& event); void mouseDoublePressOnOverlay(const QUuid& id, const PointerEvent& event);
/*@jsdoc /*@jsdoc
* Triggered when a mouse release event occurs on an overlay. Only occurs for 3D overlays (unless you use * Triggered when a mouse release event occurs on an overlay. Only occurs for 3D overlays (unless you use
* {@link Overlays.sendMouseReleaseOnOverlay|sendMouseReleaseOnOverlay} for a 2D overlay). * {@link Overlays.sendMouseReleaseOnOverlay|sendMouseReleaseOnOverlay} for a 2D overlay).
* @function Overlays.mouseReleaseOnOverlay * @function Overlays.mouseReleaseOnOverlay
* @param {Uuid} id - The ID of the overlay the mouse release event occurred on. * @param {Uuid} id - The ID of the overlay the mouse release event occurred on.
@ -609,7 +609,7 @@ signals:
void mouseReleaseOnOverlay(const QUuid& id, const PointerEvent& event); void mouseReleaseOnOverlay(const QUuid& id, const PointerEvent& event);
/*@jsdoc /*@jsdoc
* Triggered when a mouse move event occurs on an overlay. Only occurs for 3D overlays (unless you use * Triggered when a mouse move event occurs on an overlay. Only occurs for 3D overlays (unless you use
* {@link Overlays.sendMouseMoveOnOverlay|sendMouseMoveOnOverlay} for a 2D overlay). * {@link Overlays.sendMouseMoveOnOverlay|sendMouseMoveOnOverlay} for a 2D overlay).
* @function Overlays.mouseMoveOnOverlay * @function Overlays.mouseMoveOnOverlay
* @param {Uuid} id - The ID of the overlay the mouse moved event occurred on. * @param {Uuid} id - The ID of the overlay the mouse moved event occurred on.
@ -633,7 +633,7 @@ signals:
void mouseDoublePressOffOverlay(); void mouseDoublePressOffOverlay();
/*@jsdoc /*@jsdoc
* Triggered when a mouse cursor starts hovering over an overlay. Only occurs for 3D overlays (unless you use * Triggered when a mouse cursor starts hovering over an overlay. Only occurs for 3D overlays (unless you use
* {@link Overlays.sendHoverEnterOverlay|sendHoverEnterOverlay} for a 2D overlay). * {@link Overlays.sendHoverEnterOverlay|sendHoverEnterOverlay} for a 2D overlay).
* @function Overlays.hoverEnterOverlay * @function Overlays.hoverEnterOverlay
* @param {Uuid} id - The ID of the overlay the mouse moved event occurred on. * @param {Uuid} id - The ID of the overlay the mouse moved event occurred on.
@ -655,7 +655,7 @@ signals:
void hoverEnterOverlay(const QUuid& id, const PointerEvent& event); void hoverEnterOverlay(const QUuid& id, const PointerEvent& event);
/*@jsdoc /*@jsdoc
* Triggered when a mouse cursor continues hovering over an overlay. Only occurs for 3D overlays (unless you use * Triggered when a mouse cursor continues hovering over an overlay. Only occurs for 3D overlays (unless you use
* {@link Overlays.sendHoverOverOverlay|sendHoverOverOverlay} for a 2D overlay). * {@link Overlays.sendHoverOverOverlay|sendHoverOverOverlay} for a 2D overlay).
* @function Overlays.hoverOverOverlay * @function Overlays.hoverOverOverlay
* @param {Uuid} id - The ID of the overlay the hover over event occurred on. * @param {Uuid} id - The ID of the overlay the hover over event occurred on.
@ -665,7 +665,7 @@ signals:
void hoverOverOverlay(const QUuid& id, const PointerEvent& event); void hoverOverOverlay(const QUuid& id, const PointerEvent& event);
/*@jsdoc /*@jsdoc
* Triggered when a mouse cursor finishes hovering over an overlay. Only occurs for 3D overlays (unless you use * Triggered when a mouse cursor finishes hovering over an overlay. Only occurs for 3D overlays (unless you use
* {@link Overlays.sendHoverLeaveOverlay|sendHoverLeaveOverlay} for a 2D overlay). * {@link Overlays.sendHoverLeaveOverlay|sendHoverLeaveOverlay} for a 2D overlay).
* @function Overlays.hoverLeaveOverlay * @function Overlays.hoverLeaveOverlay
* @param {Uuid} id - The ID of the overlay the hover leave event occurred on. * @param {Uuid} id - The ID of the overlay the hover leave event occurred on.

View file

@ -48,7 +48,7 @@ public:
} }
/*@jsdoc /*@jsdoc
* Adds avatars to the audio solo list. If the audio solo list is not empty, only audio from the avatars in the list is * Adds avatars to the audio solo list. If the audio solo list is not empty, only audio from the avatars in the list is
* played. * played.
* @function Audio.addToSoloList * @function Audio.addToSoloList
* @param {Uuid[]} ids - Avatar IDs to add to the solo list. * @param {Uuid[]} ids - Avatar IDs to add to the solo list.
@ -57,25 +57,25 @@ public:
* // Find nearby avatars. * // Find nearby avatars.
* var RANGE = 100; // m * var RANGE = 100; // m
* var nearbyAvatars = AvatarList.getAvatarsInRange(MyAvatar.position, RANGE); * var nearbyAvatars = AvatarList.getAvatarsInRange(MyAvatar.position, RANGE);
* *
* // Remove own avatar from list. * // Remove own avatar from list.
* var myAvatarIndex = nearbyAvatars.indexOf(MyAvatar.sessionUUID); * var myAvatarIndex = nearbyAvatars.indexOf(MyAvatar.sessionUUID);
* if (myAvatarIndex !== -1) { * if (myAvatarIndex !== -1) {
* nearbyAvatars.splice(myAvatarIndex, 1); * nearbyAvatars.splice(myAvatarIndex, 1);
* } * }
* *
* if (nearbyAvatars.length > 0) { * if (nearbyAvatars.length > 0) {
* // Listen to only one of the nearby avatars. * // Listen to only one of the nearby avatars.
* var avatarName = AvatarList.getAvatar(nearbyAvatars[0]).displayName; * var avatarName = AvatarList.getAvatar(nearbyAvatars[0]).displayName;
* print("Listening only to " + avatarName); * print("Listening only to " + avatarName);
* Audio.addToSoloList([nearbyAvatars[0]]); * Audio.addToSoloList([nearbyAvatars[0]]);
* *
* // Stop listening to only the one avatar after a short while. * // Stop listening to only the one avatar after a short while.
* Script.setTimeout(function () { * Script.setTimeout(function () {
* print("Finished listening only to " + avatarName); * print("Finished listening only to " + avatarName);
* Audio.resetSoloList(); * Audio.resetSoloList();
* }, 10000); // 10s * }, 10000); // 10s
* *
* } else { * } else {
* print("No nearby avatars"); * print("No nearby avatars");
* } * }
@ -85,7 +85,7 @@ public:
} }
/*@jsdoc /*@jsdoc
* Removes avatars from the audio solo list. If the audio solo list is not empty, only audio from the avatars in the list * Removes avatars from the audio solo list. If the audio solo list is not empty, only audio from the avatars in the list
* is played. * is played.
* @function Audio.removeFromSoloList * @function Audio.removeFromSoloList
* @param {Uuid[]} ids - Avatar IDs to remove from the solo list. * @param {Uuid[]} ids - Avatar IDs to remove from the solo list.
@ -103,44 +103,44 @@ public:
} }
/*@jsdoc /*@jsdoc
* Gets whether your microphone audio is echoed back to you from the server. When enabled, microphone audio is echoed only * Gets whether your microphone audio is echoed back to you from the server. When enabled, microphone audio is echoed only
* if you're unmuted or are using push-to-talk. * if you're unmuted or are using push-to-talk.
* @function Audio.getServerEcho * @function Audio.getServerEcho
* @returns {boolean} <code>true</code> if echoing microphone audio back to you from the server is enabled, * @returns {boolean} <code>true</code> if echoing microphone audio back to you from the server is enabled,
* <code>false</code> if it isn't. * <code>false</code> if it isn't.
*/ */
Q_INVOKABLE bool getServerEcho(); Q_INVOKABLE bool getServerEcho();
/*@jsdoc /*@jsdoc
* Sets whether your microphone audio is echoed back to you from the server. When enabled, microphone audio is echoed * Sets whether your microphone audio is echoed back to you from the server. When enabled, microphone audio is echoed
* only if you're unmuted or are using push-to-talk. * only if you're unmuted or are using push-to-talk.
* @function Audio.setServerEcho * @function Audio.setServerEcho
* @param {boolean} serverEcho - <code>true</code> to enable echoing microphone back to you from the server, * @param {boolean} serverEcho - <code>true</code> to enable echoing microphone back to you from the server,
* <code>false</code> to disable. * <code>false</code> to disable.
*/ */
Q_INVOKABLE void setServerEcho(bool serverEcho); Q_INVOKABLE void setServerEcho(bool serverEcho);
/*@jsdoc /*@jsdoc
* Toggles the echoing of microphone audio back to you from the server. When enabled, microphone audio is echoed only if * Toggles the echoing of microphone audio back to you from the server. When enabled, microphone audio is echoed only if
* you're unmuted or are using push-to-talk. * you're unmuted or are using push-to-talk.
* @function Audio.toggleServerEcho * @function Audio.toggleServerEcho
*/ */
Q_INVOKABLE void toggleServerEcho(); Q_INVOKABLE void toggleServerEcho();
/*@jsdoc /*@jsdoc
* Gets whether your microphone audio is echoed back to you by the client. When enabled, microphone audio is echoed * Gets whether your microphone audio is echoed back to you by the client. When enabled, microphone audio is echoed
* even if you're muted or not using push-to-talk. * even if you're muted or not using push-to-talk.
* @function Audio.getLocalEcho * @function Audio.getLocalEcho
* @returns {boolean} <code>true</code> if echoing microphone audio back to you from the client is enabled, * @returns {boolean} <code>true</code> if echoing microphone audio back to you from the client is enabled,
* <code>false</code> if it isn't. * <code>false</code> if it isn't.
*/ */
Q_INVOKABLE bool getLocalEcho(); Q_INVOKABLE bool getLocalEcho();
/*@jsdoc /*@jsdoc
* Sets whether your microphone audio is echoed back to you by the client. When enabled, microphone audio is echoed * Sets whether your microphone audio is echoed back to you by the client. When enabled, microphone audio is echoed
* even if you're muted or not using push-to-talk. * even if you're muted or not using push-to-talk.
* @function Audio.setLocalEcho * @function Audio.setLocalEcho
* @parm {boolean} localEcho - <code>true</code> to enable echoing microphone audio back to you from the client, * @parm {boolean} localEcho - <code>true</code> to enable echoing microphone audio back to you from the client,
* <code>false</code> to disable. * <code>false</code> to disable.
* @example <caption>Echo local audio for a few seconds.</caption> * @example <caption>Echo local audio for a few seconds.</caption>
* Audio.setLocalEcho(true); * Audio.setLocalEcho(true);
@ -151,7 +151,7 @@ public:
Q_INVOKABLE void setLocalEcho(bool localEcho); Q_INVOKABLE void setLocalEcho(bool localEcho);
/*@jsdoc /*@jsdoc
* Toggles the echoing of microphone audio back to you by the client. When enabled, microphone audio is echoed even if * Toggles the echoing of microphone audio back to you by the client. When enabled, microphone audio is echoed even if
* you're muted or not using push-to-talk. * you're muted or not using push-to-talk.
* @function Audio.toggleLocalEcho * @function Audio.toggleLocalEcho
*/ */
@ -164,32 +164,32 @@ protected:
// these methods are protected to stop C++ callers from calling, but invokable from script // these methods are protected to stop C++ callers from calling, but invokable from script
/*@jsdoc /*@jsdoc
* Starts playing or "injecting" the content of an audio file. The sound is played globally (sent to the audio * Starts playing or "injecting" the content of an audio file. The sound is played globally (sent to the audio
* mixer) so that everyone hears it, unless the <code>injectorOptions</code> has <code>localOnly</code> set to * mixer) so that everyone hears it, unless the <code>injectorOptions</code> has <code>localOnly</code> set to
* <code>true</code> in which case only the client hears the sound played. No sound is played if sent to the audio mixer * <code>true</code> in which case only the client hears the sound played. No sound is played if sent to the audio mixer
* but the client is not connected to an audio mixer. The {@link AudioInjector} object returned by the function can be used * but the client is not connected to an audio mixer. The {@link AudioInjector} object returned by the function can be used
* to control the playback and get information about its current state. * to control the playback and get information about its current state.
* @function Audio.playSound * @function Audio.playSound
* @param {SoundObject} sound - The content of an audio file, loaded using {@link SoundCache.getSound}. See * @param {SoundObject} sound - The content of an audio file, loaded using {@link SoundCache.getSound}. See
* {@link SoundObject} for supported formats. * {@link SoundObject} for supported formats.
* @param {AudioInjector.AudioInjectorOptions} [injectorOptions={}] - Configures where and how the audio injector plays the * @param {AudioInjector.AudioInjectorOptions} [injectorOptions={}] - Configures where and how the audio injector plays the
* audio file. * audio file.
* @returns {AudioInjector} The audio injector that plays the audio file. * @returns {AudioInjector} The audio injector that plays the audio file.
* @example <caption>Play a sound.</caption> * @example <caption>Play a sound.</caption>
* var sound = SoundCache.getSound("https://cdn-1.vircadia.com/us-c-1/ken/samples/forest_ambiX.wav"); * var sound = SoundCache.getSound("https://apidocs.overte.org/examples/beach-tide-amplified.wav");
* *
* function playSound() { * function playSound() {
* var injectorOptions = { * var injectorOptions = {
* position: MyAvatar.position * position: MyAvatar.position
* }; * };
* var injector = Audio.playSound(sound, injectorOptions); * var injector = Audio.playSound(sound, injectorOptions);
* } * }
* *
* function onSoundReady() { * function onSoundReady() {
* sound.ready.disconnect(onSoundReady); * sound.ready.disconnect(onSoundReady);
* playSound(); * playSound();
* } * }
* *
* if (sound.downloaded) { * if (sound.downloaded) {
* playSound(); * playSound();
* } else { * } else {
@ -199,18 +199,18 @@ protected:
Q_INVOKABLE ScriptAudioInjector* playSound(SharedSoundPointer sound, const AudioInjectorOptions& injectorOptions = AudioInjectorOptions()); Q_INVOKABLE ScriptAudioInjector* playSound(SharedSoundPointer sound, const AudioInjectorOptions& injectorOptions = AudioInjectorOptions());
/*@jsdoc /*@jsdoc
* Starts playing the content of an audio file locally (isn't sent to the audio mixer). This is the same as calling * Starts playing the content of an audio file locally (isn't sent to the audio mixer). This is the same as calling
* {@link Audio.playSound} with {@link AudioInjector.AudioInjectorOptions} <code>localOnly</code> set <code>true</code> and * {@link Audio.playSound} with {@link AudioInjector.AudioInjectorOptions} <code>localOnly</code> set <code>true</code> and
* the specified <code>position</code>. * the specified <code>position</code>.
* @function Audio.playSystemSound * @function Audio.playSystemSound
* @param {SoundObject} sound - The content of an audio file, which is loaded using {@link SoundCache.getSound}. See * @param {SoundObject} sound - The content of an audio file, which is loaded using {@link SoundCache.getSound}. See
* {@link SoundObject} for supported formats. * {@link SoundObject} for supported formats.
* @returns {AudioInjector} The audio injector that plays the audio file. * @returns {AudioInjector} The audio injector that plays the audio file.
*/ */
Q_INVOKABLE ScriptAudioInjector* playSystemSound(SharedSoundPointer sound); Q_INVOKABLE ScriptAudioInjector* playSystemSound(SharedSoundPointer sound);
/*@jsdoc /*@jsdoc
* Sets whether the audio input should be used in stereo. If the audio input doesn't support stereo then setting a value * Sets whether the audio input should be used in stereo. If the audio input doesn't support stereo then setting a value
* of <code>true</code> has no effect. * of <code>true</code> has no effect.
* @function Audio.setStereoInput * @function Audio.setStereoInput
* @param {boolean} stereo - <code>true</code> if the audio input should be used in stereo, otherwise <code>false</code>. * @param {boolean} stereo - <code>true</code> if the audio input should be used in stereo, otherwise <code>false</code>.
@ -220,57 +220,57 @@ protected:
/*@jsdoc /*@jsdoc
* Gets whether the audio input is used in stereo. * Gets whether the audio input is used in stereo.
* @function Audio.isStereoInput * @function Audio.isStereoInput
* @returns {boolean} <code>true</code> if the audio input is used in stereo, otherwise <code>false</code>. * @returns {boolean} <code>true</code> if the audio input is used in stereo, otherwise <code>false</code>.
*/ */
Q_INVOKABLE bool isStereoInput(); Q_INVOKABLE bool isStereoInput();
signals: signals:
/*@jsdoc /*@jsdoc
* Triggered when the client is muted by the mixer because their loudness value for the noise background has reached the * Triggered when the client is muted by the mixer because their loudness value for the noise background has reached the
* threshold set for the domain (in the server settings). * threshold set for the domain (in the server settings).
* @function Audio.mutedByMixer * @function Audio.mutedByMixer
* @returns {Signal} * @returns {Signal}
*/ */
void mutedByMixer(); void mutedByMixer();
/*@jsdoc /*@jsdoc
* Triggered when the client is muted by the mixer because they're within a certain radius (50m) of someone who requested * Triggered when the client is muted by the mixer because they're within a certain radius (50m) of someone who requested
* the mute through Developer &gt; Audio &gt; Mute Environment. * the mute through Developer &gt; Audio &gt; Mute Environment.
* @function Audio.environmentMuted * @function Audio.environmentMuted
* @returns {Signal} * @returns {Signal}
*/ */
void environmentMuted(); void environmentMuted();
/*@jsdoc /*@jsdoc
* Triggered when the client receives its first packet from the audio mixer. * Triggered when the client receives its first packet from the audio mixer.
* @function Audio.receivedFirstPacket * @function Audio.receivedFirstPacket
* @returns {Signal} * @returns {Signal}
*/ */
void receivedFirstPacket(); void receivedFirstPacket();
/*@jsdoc /*@jsdoc
* Triggered when the client is disconnected from the audio mixer. * Triggered when the client is disconnected from the audio mixer.
* @function Audio.disconnected * @function Audio.disconnected
* @returns {Signal} * @returns {Signal}
*/ */
void disconnected(); void disconnected();
/*@jsdoc /*@jsdoc
* Triggered when the noise gate is opened. The input audio signal is no longer blocked (fully attenuated) because it has * Triggered when the noise gate is opened. The input audio signal is no longer blocked (fully attenuated) because it has
* risen above an adaptive threshold set just above the noise floor. Only occurs if <code>Audio.noiseReduction</code> is * risen above an adaptive threshold set just above the noise floor. Only occurs if <code>Audio.noiseReduction</code> is
* <code>true</code>. * <code>true</code>.
* @function Audio.noiseGateOpened * @function Audio.noiseGateOpened
* @returns {Signal} * @returns {Signal}
*/ */
void noiseGateOpened(); void noiseGateOpened();
/*@jsdoc /*@jsdoc
* Triggered when the noise gate is closed. The input audio signal is blocked (fully attenuated) because it has fallen * Triggered when the noise gate is closed. The input audio signal is blocked (fully attenuated) because it has fallen
* below an adaptive threshold set just above the noise floor. Only occurs if <code>Audio.noiseReduction</code> is * below an adaptive threshold set just above the noise floor. Only occurs if <code>Audio.noiseReduction</code> is
* <code>true</code>. * <code>true</code>.
* @function Audio.noiseGateClosed * @function Audio.noiseGateClosed
* @returns {Signal} * @returns {Signal}
*/ */
void noiseGateClosed(); void noiseGateClosed();
@ -278,7 +278,7 @@ signals:
* Triggered when a frame of audio input is processed. * Triggered when a frame of audio input is processed.
* @function Audio.inputReceived * @function Audio.inputReceived
* @param {Int16Array} inputSamples - The audio input processed. * @param {Int16Array} inputSamples - The audio input processed.
* @returns {Signal} * @returns {Signal}
*/ */
void inputReceived(const QByteArray& inputSamples); void inputReceived(const QByteArray& inputSamples);

View file

@ -1045,7 +1045,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* type: "Model", * type: "Model",
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -2 })), * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.75, z: -2 })),
* rotation: MyAvatar.orientation, * rotation: MyAvatar.orientation,
* modelURL: "https://apidocs.vircadia.dev/models/cowboy-hat.fbx", * modelURL: "https://apidocs.overte.org/examples/cowboy-hat.fbx",
* dimensions: { x: 0.8569, y: 0.3960, z: 1.0744 }, * dimensions: { x: 0.8569, y: 0.3960, z: 1.0744 },
* lifetime: 300 // Delete after 5 minutes. * lifetime: 300 // Delete after 5 minutes.
* }); * });
@ -1160,7 +1160,7 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const {
* speedSpread: 0.01, * speedSpread: 0.01,
* emitAcceleration: { x: 0, y: 0.02, z: 0 }, * emitAcceleration: { x: 0, y: 0.02, z: 0 },
* polarFinish: Math.PI, * polarFinish: Math.PI,
* textures: "https://content.vircadia.com/eu-c-1/vircadia-assets/interface/default/default_particle.png", * textures: "https://content.overte.org/Bazaar/Assets/Textures/Defaults/Interface/default_particle.png",
* particleRadius: 0.1, * particleRadius: 0.1,
* color: { red: 0, green: 255, blue: 0 }, * color: { red: 0, green: 255, blue: 0 },
* alphaFinish: 0, * alphaFinish: 0,

View file

@ -25,8 +25,8 @@
class ScriptEngine; class ScriptEngine;
/*@jsdoc /*@jsdoc
* The <code>Graphics</code> API enables you to access and manipulate avatar, entity, and overlay models in the rendered scene. * The <code>Graphics</code> API enables you to access and manipulate avatar, entity, and overlay models in the rendered scene.
* This includes getting mesh and material information for applying {@link Entities.EntityProperties-Material|Material} * This includes getting mesh and material information for applying {@link Entities.EntityProperties-Material|Material}
* entities. * entities.
* *
* @namespace Graphics * @namespace Graphics
@ -49,7 +49,7 @@ public slots:
* <p>Note: The model data may be used for more than one instance of the item displayed in the scene.</p> * <p>Note: The model data may be used for more than one instance of the item displayed in the scene.</p>
* @function Graphics.getModel * @function Graphics.getModel
* @param {UUID} id - The ID of the avatar, 3D entity, or 3D overlay. * @param {UUID} id - The ID of the avatar, 3D entity, or 3D overlay.
* @returns {GraphicsModel} The model data for the avatar, entity, or overlay, as displayed. This includes the results of * @returns {GraphicsModel} The model data for the avatar, entity, or overlay, as displayed. This includes the results of
* applying any {@link Entities.EntityProperties-Material|Material} entities to the item. * applying any {@link Entities.EntityProperties-Material|Material} entities to the item.
* @example <caption>Report some details of your avatar's model.</caption> * @example <caption>Report some details of your avatar's model.</caption>
* var model = Graphics.getModel(MyAvatar.sessionUUID); * var model = Graphics.getModel(MyAvatar.sessionUUID);
@ -58,7 +58,7 @@ public slots:
* for (var i = 0; i < meshes.length; i++) { * for (var i = 0; i < meshes.length; i++) {
* numMeshparts += meshes[i].numParts; * numMeshparts += meshes[i].numParts;
* } * }
* *
* print("Avatar:", MyAvatar.skeletonModelURL); * print("Avatar:", MyAvatar.skeletonModelURL);
* print("Number of meshes:", model.numMeshes); * print("Number of meshes:", model.numMeshes);
* print("Number of mesh parts:", numMeshparts); * print("Number of mesh parts:", numMeshparts);
@ -77,7 +77,7 @@ public slots:
bool updateModel(const QUuid& uuid, const scriptable::ScriptableModelPointer& model); bool updateModel(const QUuid& uuid, const scriptable::ScriptableModelPointer& model);
/*@jsdoc /*@jsdoc
* Checks whether the model for an avatar, entity, or overlay can be updated in the rendered scene. Only avatars, * Checks whether the model for an avatar, entity, or overlay can be updated in the rendered scene. Only avatars,
* <code>"Model"</code> entities and <code>"model"</code> overlays can have their meshes updated. * <code>"Model"</code> entities and <code>"model"</code> overlays can have their meshes updated.
* @function Graphics.canUpdateModel * @function Graphics.canUpdateModel
* @param {Uuid} id - The ID of the avatar, entity, or overlay. * @param {Uuid} id - The ID of the avatar, entity, or overlay.
@ -89,7 +89,7 @@ public slots:
* type: "Model", * type: "Model",
* position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(Camera.orientation, { x: -0.5, y: 0, z: -3 })), * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(Camera.orientation, { x: -0.5, y: 0, z: -3 })),
* rotation: MyAvatar.orientation, * rotation: MyAvatar.orientation,
* modelURL: "https://apidocs.vircadia.dev/models/cowboy-hat.fbx", * modelURL: "https://apidocs.overte.org/examples/cowboy-hat.fbx",
* dimensions: { x: 0.8569, y: 0.3960, z: 1.0744 }, * dimensions: { x: 0.8569, y: 0.3960, z: 1.0744 },
* lifetime: 300 // Delete after 5 minutes. * lifetime: 300 // Delete after 5 minutes.
* }); * });
@ -100,7 +100,7 @@ public slots:
* dimensions: { x: 0.4, y: 0.6, z: 0.4 }, * dimensions: { x: 0.4, y: 0.6, z: 0.4 },
* lifetime: 300 // Delete after 5 minutes. * lifetime: 300 // Delete after 5 minutes.
* }); * });
* *
* Script.setTimeout(function () { * Script.setTimeout(function () {
* print("Can update avatar:", Graphics.canUpdateModel(MyAvatar.sessionUUID)); // true * print("Can update avatar:", Graphics.canUpdateModel(MyAvatar.sessionUUID)); // true
* print("Can update model entity:", Graphics.canUpdateModel(modelEntityID)); // true * print("Can update model entity:", Graphics.canUpdateModel(modelEntityID)); // true

View file

@ -358,7 +358,7 @@ public:
* // Replace AnimationCache with MaterialCache, ModelCache, SoundCache, or TextureCache as appropriate. * // Replace AnimationCache with MaterialCache, ModelCache, SoundCache, or TextureCache as appropriate.
* // TextureCache has its own version of this function. * // TextureCache has its own version of this function.
* *
* var resourceURL = "https://cdn-1.vircadia.com/eu-c-1/vircadia-public/clement/production/animations/sitting_idle.fbx"; * var resourceURL = "https://apidocs.overte.org/examples/Silly%20Dancing.fbx";
* var resourceObject = AnimationCache.prefetch(resourceURL); * var resourceObject = AnimationCache.prefetch(resourceURL);
* *
* function checkIfResourceLoaded(state) { * function checkIfResourceLoaded(state) {

View file

@ -26,7 +26,7 @@
class ScriptEngine; class ScriptEngine;
/// Represents a 2D or 3D pointer to the scripting engine. Exposed as <code><a href="https://apidocs.vircadia.dev/global.html#PointerEvent">PointerEvent</a></code> /// Represents a 2D or 3D pointer to the scripting engine. Exposed as <code><a href="https://apidocs.overte.org/global.html#PointerEvent">PointerEvent</a></code>
class PointerEvent { class PointerEvent {
public: public:
enum Button { enum Button {

View file

@ -365,7 +365,7 @@ public:
Q_INVOKABLE QUrl resourcesPath() const { return _manager->resourcesPath(); } Q_INVOKABLE QUrl resourcesPath() const { return _manager->resourcesPath(); }
/*@jsdoc /*@jsdoc
* Starts timing a section of code in order to send usage data about it to Vircadia. Shouldn't be used outside of the * Starts timing a section of code in order to send usage data about it to Overte. Shouldn't be used outside of the
* standard scripts. * standard scripts.
* @function Script.beginProfileRange * @function Script.beginProfileRange
* @param {string} label - A name that identifies the section of code. * @param {string} label - A name that identifies the section of code.
@ -373,7 +373,7 @@ public:
Q_INVOKABLE void beginProfileRange(const QString& label) const { _manager->beginProfileRange(label); } Q_INVOKABLE void beginProfileRange(const QString& label) const { _manager->beginProfileRange(label); }
/*@jsdoc /*@jsdoc
* Finishes timing a section of code in order to send usage data about it to Vircadia. Shouldn't be used outside of * Finishes timing a section of code in order to send usage data about it to Overte. Shouldn't be used outside of
* the standard scripts. * the standard scripts.
* @function Script.endProfileRange * @function Script.endProfileRange
* @param {string} label - A name that identifies the section of code. * @param {string} label - A name that identifies the section of code.
@ -481,7 +481,7 @@ public:
* @Returns {string} The URL of an external asset. * @Returns {string} The URL of an external asset.
* @example <caption>Report the URL of a default particle.</caption> * @example <caption>Report the URL of a default particle.</caption>
* print(Script.getExternalPath(Script.ExternalPaths.Assets, "Bazaar/Assets/Textures/Defaults/Interface/default_particle.png")); * print(Script.getExternalPath(Script.ExternalPaths.Assets, "Bazaar/Assets/Textures/Defaults/Interface/default_particle.png"));
* @example <caption>Report the root directory where the Vircadia assets are located.</caption> * @example <caption>Report the root directory where the Overte assets are located.</caption>
* print(Script.getExternalPath(Script.ExternalPaths.Assets, ".")); * print(Script.getExternalPath(Script.ExternalPaths.Assets, "."));
*/ */
Q_INVOKABLE QString getExternalPath(ExternalResource::Bucket bucket, const QString& path) { return _manager->getExternalPath(bucket, path); } Q_INVOKABLE QString getExternalPath(ExternalResource::Bucket bucket, const QString& path) { return _manager->getExternalPath(bucket, path); }