# Conflicts: # interface/src/LODManager.h
Showing the changes to interface/src/scripting/ControllerScriptingInterface.h (1 of 25 files). Show all
Unified · Split
| @@ -28,7 +28,7 @@ class ScriptEngine; · 27 unmodified lines | ||
| 28 | 28 | /**jsdoc |
| 29 | 29 | * The Controller API provides facilities to interact with computer and controller hardware. |
| 30 | 30 | * |
| 31 | − * <h5>Functions:</h5> | |
| 31 | + * <h5>Functions</h5> | |
| 32 | 32 | * |
| 33 | 33 | * <p>Properties</p> |
| 34 | 34 | * <ul> |
| @@ -143,6 +143,61 @@ class ScriptEngine; · 108 unmodified lines | ||
| 143 | 143 | * <li>{@link Controller.stopInputPlayback|stopInputPlayback}</li> |
| 144 | 144 | * </ul> |
| 145 | 145 | * |
| 146 | + * <h5>Entity Methods:</h5> | |
| 147 | + * | |
| 148 | + * <p>The default scripts implement hand controller actions that use {@link Entities.callEntityMethod} to call entity script | |
| 149 | + * methods, if present in the entity being interacted with.</p> | |
| 150 | + * | |
| 151 | + * <table> | |
| 152 | + * <thead> | |
| 153 | + * <tr><th>Method Name</th><th>Description</th><th>Example</th></tr> | |
| 154 | + * </thead> | |
| 155 | + * <tbody> | |
| 156 | + * <tr> | |
| 157 | + * <td><code>startFarTrigger</code><br /><code>continueFarTrigger</code><br /><code>stopFarTrigger</code></td> | |
| 158 | + * <td>These methods are called when a user is more than 0.3m away from the entity, the entity is triggerable, and the | |
| 159 | + * user starts, continues, or stops squeezing the trigger.</td> | |
| 160 | + * </td> | |
| 161 | + * <td>A light switch that can be toggled on and off from a distance.</td> | |
| 162 | + * </tr> | |
| 163 | + * <tr> | |
| 164 | + * <td><code>startNearTrigger</code><br /><code>continueNearTrigger</code><br /><code>stopNearTrigger</code></td> | |
| 165 | + * <td>These methods are called when a user is less than 0.3m away from the entity, the entity is triggerable, and the | |
| 166 | + * user starts, continues, or stops squeezing the trigger.</td> | |
| 167 | + * <td>A doorbell that can be rung when a user is near.</td> | |
| 168 | + * </tr> | |
| 169 | + * <tr> | |
| 170 | + * <td><code>startDistanceGrab</code><br /><code>continueDistanceGrab</code><br /></td> | |
| 171 | + * <td>These methods are called when a user is more than 0.3m away from the entity, the entity is either cloneable, or | |
| 172 | + * grabbable and not locked, and the user starts or continues to squeeze the trigger.</td> | |
| 173 | + * <td>A comet that emits icy particle trails when a user is dragging it through the sky.</td> | |
| 174 | + * </tr> | |
| 175 | + * <tr> | |
| 176 | + * <td><code>startNearGrab</code><br /><code>continueNearGrab</code><br /></td> | |
| 177 | + * <td>These methods are called when a user is less than 0.3m away from the entity, the entity is either cloneable, or | |
| 178 | + * grabbable and not locked, and the user starts or continues to squeeze the trigger.</td> | |
| 179 | + * <td>A ball that glows when it's being held close.</td> | |
| 180 | + * </tr> | |
| 181 | + * <tr> | |
| 182 | + * <td><code>releaseGrab</code></td> | |
| 183 | + * <td>This method is called when a user releases the trigger when having been either distance or near grabbing an | |
| 184 | + * entity.</td> | |
| 185 | + * <td>Turn off the ball glow or comet trail with the user finishes grabbing it.</td> | |
| 186 | + * </tr> | |
| 187 | + * <tr> | |
| 188 | + * <td><code>startEquip</code><br /><code>continueEquip</code><br /><code>releaseEquip</code></td> | |
| 189 | + * <td>These methods are called when a user starts, continues, or stops equipping an entity.</td> | |
| 190 | + * <td>A glass that stays in the user's hand after the trigger is clicked.</td> | |
| 191 | + * </tr> | |
| 192 | + * </tbody> | |
| 193 | + * </table> | |
| 194 | + * <p>All the entity methods are called with the following two arguments:</p> | |
| 195 | + * <ul> | |
| 196 | + * <li>The entity ID.</li> | |
| 197 | + * <li>A string, <code>"hand,userID"</code> — where "hand" is <code>"left"</code> or <code>"right"</code>, and "userID" | |
| 198 | + * is the user's {@link MyAvatar|MyAvatar.sessionUUID}.</li> | |
| 199 | + * </ul> | |
| 200 | + * | |
| 146 | 201 | * @namespace Controller |
| 147 | 202 | * |
| 148 | 203 | * @hifi-interface |