diff --git a/interface/src/scripting/ControllerScriptingInterface.h b/interface/src/scripting/ControllerScriptingInterface.h index f19caa8478..4fceda3b04 100644 --- a/interface/src/scripting/ControllerScriptingInterface.h +++ b/interface/src/scripting/ControllerScriptingInterface.h @@ -28,7 +28,7 @@ class ScriptEngine; /**jsdoc * The Controller API provides facilities to interact with computer and controller hardware. * - *
Properties
*The default scripts implement hand controller actions that use {@link Entities.callEntityMethod} to call entity script + * methods, if present in the entity being interacted with.
+ * + *Method Name | Description | Example |
---|---|---|
startFarTrigger continueFarTrigger stopFarTrigger |
+ * These methods are called when a user is more than 0.3m away from the entity, the entity is triggerable, and the + * user starts, continues, or stops squeezing the trigger. | + * + *A light switch that can be toggled on and off from a distance. | + *
startNearTrigger continueNearTrigger stopNearTrigger |
+ * These methods are called when a user is less than 0.3m away from the entity, the entity is triggerable, and the + * user starts, continues, or stops squeezing the trigger. | + *A doorbell that can be rung when a user is near. | + *
startDistanceGrab continueDistanceGrab |
+ * These methods are called when a user is more than 0.3m away from the entity, the entity is either cloneable, or + * grabbable and not locked, and the user starts or continues to squeeze the trigger. | + *A comet that emits icy particle trails when a user is dragging it through the sky. | + *
startNearGrab continueNearGrab |
+ * These methods are called when a user is less than 0.3m away from the entity, the entity is either cloneable, or + * grabbable and not locked, and the user starts or continues to squeeze the trigger. | + *A ball that glows when it's being held close. | + *
releaseGrab |
+ * This method is called when a user releases the trigger when having been either distance or near grabbing an + * entity. | + *Turn off the ball glow or comet trail with the user finishes grabbing it. | + *
startEquip continueEquip releaseEquip |
+ * These methods are called when a user starts, continues, or stops equipping an entity. | + *A glass that stays in the user's hand after the trigger is clicked. | + *
All the entity methods are called with the following two arguments:
+ *"hand,userID"
— where "hand" is "left"
or "right"
, and "userID"
+ * is the user's {@link MyAvatar|MyAvatar.sessionUUID}.Enable the mapping using {@link MappingObject#enable|enable} or {@link Controller.enableMapping} for it to take effect. + * + *
Enable the mapping using {@link MappingObject#enable|enable} or {@link Controller.enableMapping} for it to take + * effect.
* *Mappings and their routes are applied according to the following rules:
*A route in a {@link MappingObject} used by the {@link Controller} API.
* *Create a route using {@link MappingObject} methods and apply this object's methods to process it, terminating with
- * {@link RouteObject#to} to apply it to a Standard
control, action, or script function.
Standard
control, action, or script function. Note: Loops are not
+ * permitted.
*
* Some methods apply to routes with number data, some apply routes with {@link Pose} data, and some apply to both route * types.
diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index c79ffffec7..f0a13cc62b 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -2161,6 +2161,32 @@ void ScriptEngine::loadEntityScript(const EntityItemID& entityID, const QString& }, forceRedownload); } +/**jsdoc + * Triggered when the script starts for a user. + *
Note: Can only be connected to via this.preload = function (...) { ... }
in the entity script.
Available in: | Client Entity Scripts | Server Entity Scripts |
---|
Note: Can only be connected to via this.unoad = function () { ... }
in the entity script.
Available in: | Client Entity Scripts | Server Entity Scripts |
---|