History

Merge branch 'master' into M18586

# Conflicts: # interface/src/raypick/PointerScriptingInterface.cpp # interface/src/raypick/PointerScriptingInterface.h # interface/src/raypick/StylusPointer.h # libraries/pointers/src/Pointer.h # scripts/system/controllers/controllerModules/teleport.js

David Rowe committed 8 years ago

Commit e29b4032 parents c41d746 ea7bc26375 files · +10588 −5704Browse files

Showing the changes to interface/src/raypick/PointerScriptingInterface.cpp (1 of 375 files). Show all

Unified · Split

interface/src/raypick/PointerScriptingInterface.cpp+36−18
@@ -76,16 +76,19 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) · 75 unmodified lines
7676 * @property {number} distance The distance at which to render the end of this Ray Pointer, if one is defined.
7777 */
7878 /**jsdoc
79− * A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is intersecting something.
79+ * A set of properties which define the visual aspect of a Ray Pointer in the case that the Pointer is intersecting something.
8080 *
8181 * @typedef {object} Pointers.RayPointerRenderState
82− * @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState}
83− * @property {Overlays.OverlayProperties} [start] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
84− * An overlay to represent the beginning of the Ray Pointer, if desired.
85− * @property {Overlays.OverlayProperties} [path] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field), which <b>must</b> be <code>"line3d"</code>.
86− * An overlay to represent the path of the Ray Pointer, if desired.
87− * @property {Overlays.OverlayProperties} [end] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
88− * An overlay to represent the end of the Ray Pointer, if desired.
82+ * @property {string} name When using {@link Pointers.createPointer}, the name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState}
83+ * @property {Overlays.OverlayProperties|QUuid} [start] When using {@link Pointers.createPointer}, an optionally defined overlay to represent the beginning of the Ray Pointer,
84+ * using the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
85+ * When returned from {@link Pointers.getPointerProperties}, the ID of the created overlay if it exists, or a null ID otherwise.
86+ * @property {Overlays.OverlayProperties|QUuid} [path] When using {@link Pointers.createPointer}, an optionally defined overlay to represent the path of the Ray Pointer,
87+ * using the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field), which <b>must</b> be <code>"line3d"</code>.
88+ * When returned from {@link Pointers.getPointerProperties}, the ID of the created overlay if it exists, or a null ID otherwise.
89+ * @property {Overlays.OverlayProperties|QUuid} [end] When using {@link Pointers.createPointer}, an optionally defined overlay to represent the end of the Ray Pointer,
90+ * using the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
91+ * When returned from {@link Pointers.getPointerProperties}, the ID of the created overlay if it exists, or a null ID otherwise.
8992 */
9093 /**jsdoc
9194 * A set of properties that can be passed to {@link Pointers.createPointer} to create a new Pointer. Contains the relevant {@link Picks.PickProperties} to define the underlying Pick.
@@ -99,8 +102,12 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) · 7 unmodified lines
99102 * @property {number} [followNormalStrength=0.0] The strength of the interpolation between the real normal and the visual normal if followNormal is true. <code>0-1</code>. If 0 or 1,
100103 * the normal will follow exactly.
101104 * @property {boolean} [enabled=false]
102− * @property {Pointers.RayPointerRenderState[]} [renderStates] A list of different visual states to switch between.
103− * @property {Pointers.DefaultRayPointerRenderState[]} [defaultRenderStates] A list of different visual states to use if there is no intersection.
105+ * @property {Pointers.RayPointerRenderState[]|Object.<string, Pointers.RayPointerRenderState>} [renderStates] A collection of different visual states to switch between.
106+ * When using {@link Pointers.createPointer}, a list of RayPointerRenderStates.
107+ * When returned from {@link Pointers.getPointerProperties}, a map between render state names and RayPointRenderStates.
108+ * @property {Pointers.DefaultRayPointerRenderState[]|Object.<string, Pointers.DefaultRayPointerRenderState>} [defaultRenderStates] A collection of different visual states to use if there is no intersection.
109+ * When using {@link Pointers.createPointer}, a list of DefaultRayPointerRenderStates.
110+ * When returned from {@link Pointers.getPointerProperties}, a map between render state names and DefaultRayPointRenderStates.
104111 * @property {boolean} [hover=false] If this Pointer should generate hover events.
105112 * @property {Pointers.Trigger[]} [triggers] A list of different triggers mechanisms that control this Pointer's click event generation.
106113 */
@@ -224,12 +231,15 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 117 unmodified lines
224231 * A set of properties used to define the visual aspect of a Parabola Pointer in the case that the Pointer is intersecting something.
225232 *
226233 * @typedef {object} Pointers.ParabolaPointerRenderState
227−* @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState}
228−* @property {Overlays.OverlayProperties} [start] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
229−* An overlay to represent the beginning of the Parabola Pointer, if desired.
230−* @property {Pointers.ParabolaProperties} [path] The rendering properties of the parabolic path defined by the Parabola Pointer.
231−* @property {Overlays.OverlayProperties} [end] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
232−* An overlay to represent the end of the Parabola Pointer, if desired.
234+* @property {string} name When using {@link Pointers.createPointer}, the name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState}
235+* @property {Overlays.OverlayProperties|QUuid} [start] When using {@link Pointers.createPointer}, an optionally defined overlay to represent the beginning of the Parabola Pointer,
236+* using the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
237+* When returned from {@link Pointers.getPointerProperties}, the ID of the created overlay if it exists, or a null ID otherwise.
238+* @property {Pointers.ParabolaProperties} [path] When using {@link Pointers.createPointer}, the optionally defined rendering properties of the parabolic path defined by the Parabola Pointer.
239+* Not defined in {@link Pointers.getPointerProperties}.
240+* @property {Overlays.OverlayProperties|QUuid} [end] When using {@link Pointers.createPointer}, an optionally defined overlay to represent the end of the Parabola Pointer,
241+* using the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
242+* When returned from {@link Pointers.getPointerProperties}, the ID of the created overlay if it exists, or a null ID otherwise.
233243 */
234244 /**jsdoc
235245 * A set of properties that can be passed to {@link Pointers.createPointer} to create a new Pointer. Contains the relevant {@link Picks.PickProperties} to define the underlying Pick.
@@ -243,8 +253,12 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 7 unmodified lines
243253 * @property {number} [followNormalStrength=0.0] The strength of the interpolation between the real normal and the visual normal if followNormal is true. <code>0-1</code>. If 0 or 1,
244254 * the normal will follow exactly.
245255 * @property {boolean} [enabled=false]
246−* @property {Pointers.ParabolaPointerRenderState[]} [renderStates] A list of different visual states to switch between.
247−* @property {Pointers.DefaultParabolaPointerRenderState[]} [defaultRenderStates] A list of different visual states to use if there is no intersection.
256+* @property {Pointers.ParabolaPointerRenderState[]|Object.<string, Pointers.ParabolaPointerRenderState>} [renderStates] A collection of different visual states to switch between.
257+* When using {@link Pointers.createPointer}, a list of ParabolaPointerRenderStates.
258+* When returned from {@link Pointers.getPointerProperties}, a map between render state names and ParabolaPointerRenderStates.
259+* @property {Pointers.DefaultParabolaPointerRenderState[]|Object.<string, Pointers.DefaultParabolaPointerRenderState>} [defaultRenderStates] A collection of different visual states to use if there is no intersection.
260+* When using {@link Pointers.createPointer}, a list of DefaultParabolaPointerRenderStates.
261+* When returned from {@link Pointers.getPointerProperties}, a map between render state names and DefaultParabolaPointerRenderStates.
248262 * @property {boolean} [hover=false] If this Pointer should generate hover events.
249263 * @property {Pointers.Trigger[]} [triggers] A list of different triggers mechanisms that control this Pointer's click event generation.
250264 */
@@ -377,6 +391,10 @@ QVariantMap PointerScriptingInterface::getPrevPickResult(unsigned int uid) const · 126 unmodified lines
377391 return result;
378392 }
379393
394+QVariantMap PointerScriptingInterface::getPointerProperties(unsigned int uid) const {
395+ return DependencyManager::get<PointerManager>()->getPointerProperties(uid);
396+}
397+
380398 QVector<QUuid> PointerScriptingInterface::getOverlayIDs(unsigned int uid) {
381399 return DependencyManager::get<PointerManager>()->getOverlayIDs(uid);
382400 }