History

Merge remote-tracking branch 'upstream/master' into 21856-d

# Conflicts: # interface/src/LODManager.h

David Rowe committed 8 years ago

Commit 1aa28b72 parents 2cc3ed6 3bb090225 files · +405 −77Browse files

Showing the changes to interface/src/scripting/ControllerScriptingInterface.h (1 of 25 files). Show all

Unified · Split

interface/src/scripting/ControllerScriptingInterface.h+56−1
@@ -28,7 +28,7 @@ class ScriptEngine; · 27 unmodified lines
2828 /**jsdoc
2929 * The Controller API provides facilities to interact with computer and controller hardware.
3030 *
31− * <h5>Functions:</h5>
31+ * <h5>Functions</h5>
3232 *
3333 * <p>Properties</p>
3434 * <ul>
@@ -143,6 +143,61 @@ class ScriptEngine; · 108 unmodified lines
143143 * <li>{@link Controller.stopInputPlayback|stopInputPlayback}</li>
144144 * </ul>
145145 *
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> &mdash; 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+ *
146201 * @namespace Controller
147202 *
148203 * @hifi-interface