diff --git a/interface/src/scripting/HMDScriptingInterface.h b/interface/src/scripting/HMDScriptingInterface.h
index 1acafab361..9b2482e73a 100644
--- a/interface/src/scripting/HMDScriptingInterface.h
+++ b/interface/src/scripting/HMDScriptingInterface.h
@@ -31,7 +31,7 @@ class QScriptEngine;
* @property {Vec3} position - The position of the HMD if currently in VR display mode, otherwise
* {@link Vec3(0)|Vec3.ZERO}. Read-only.
* @property {Quat} orientation - The orientation of the HMD if currently in VR display mode, otherwise
- * {@link Quat(0)|Quat.IDENTITY}.Read-only.
+ * {@link Quat(0)|Quat.IDENTITY}. Read-only.
* @property {boolean} active - true
if the display mode is HMD, otherwise false
. Read-only.
* @property {boolean} mounted - true
if currently in VR display mode and the HMD is being worn, otherwise
* false
. Read-only.
@@ -74,6 +74,23 @@ public:
* @param {Vec3} position - The origin of the ray.
* @param {Vec3} direction - The direction of the ray.
* @returns {Vec3} The point of intersection with the HUD overlay if it intersects, otherwise {@link Vec3(0)|Vec3.ZERO}.
+ * @example
Draw a square on the HUD overlay in the direction you're looking.
+ * var hudIntersection = HMD.calculateRayUICollisionPoint(MyAvatar.getHeadPosition(),
+ * Quat.getForward(MyAvatar.headOrientation));
+ * var hudPoint = HMD.overlayFromWorldPoint(hudIntersection);
+ *
+ * var DIMENSIONS = { x: 50, y: 50 };
+ * var square = Overlays.addOverlay("rectangle", {
+ * x: hudPoint.x - DIMENSIONS.x / 2,
+ * y: hudPoint.y - DIMENSIONS.y / 2,
+ * width: DIMENSIONS.x,
+ * height: DIMENSIONS.y,
+ * color: { red: 255, green: 0, blue: 0 }
+ * });
+ *
+ * Script.scriptEnding.connect(function () {
+ * Overlays.deleteOverlay(square);
+ * });
*/
Q_INVOKABLE glm::vec3 calculateRayUICollisionPoint(const glm::vec3& position, const glm::vec3& direction) const;
@@ -201,7 +218,7 @@ public:
/**jsdoc
* Check whether there are specific HMD controllers available.
* @function HMD.isSubdeviceContainingNameAvailable
- * @param {string} - The name of the HMD controller to check for, e.g., "OculusTouch"
.
+ * @param {string} name - The name of the HMD controller to check for, e.g., "OculusTouch"
.
* @returns {boolean} true
if an HMD controller with a name containing the specified name
is
* available, otherwise false
.
* @example Report if particular Oculus controllers are available.
@@ -240,15 +257,15 @@ public:
/**jsdoc
- * Causes the borders and decorations in HUD windows to be enlarged when the laser intersects them in HMD mode. By default,
- * borders and decorations are not enlarged.
+ * Causes the borders in HUD windows to be enlarged when the laser intersects them in HMD mode. By default, borders are not
+ * enlarged.
* @function HMD.activateHMDHandMouse
*/
Q_INVOKABLE void activateHMDHandMouse();
/**jsdoc
- * Causes the border and decorations in HUD windows to no longer be enlarged when the laser intersects them in HMD mode. By
- * default, borders and decorations are not enlarged.
+ * Causes the border in HUD windows to no longer be enlarged when the laser intersects them in HMD mode. By default,
+ * borders are not enlarged.
* @function HMD.deactivateHMDHandMouse
*/
Q_INVOKABLE void deactivateHMDHandMouse();
diff --git a/libraries/display-plugins/src/display-plugins/AbstractHMDScriptingInterface.h b/libraries/display-plugins/src/display-plugins/AbstractHMDScriptingInterface.h
index 36e1952d3c..392fa7e2a2 100644
--- a/libraries/display-plugins/src/display-plugins/AbstractHMDScriptingInterface.h
+++ b/libraries/display-plugins/src/display-plugins/AbstractHMDScriptingInterface.h
@@ -47,7 +47,7 @@ signals:
* @example Report when the display mode changes.
* HMD.displayModeChanged.connect(function (isHMDMode) {
* print("Display mode changed");
- * print("isHMD = " + isHMD);
+ * print("isHMD = " + isHMDMode);
* print("HMD.active = " + HMD.active);
* print("HMD.mounted = " + HMD.mounted);
* });