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
76 * @property {number} distance The distance at which to render the end of this Ray Pointer, if one is defined.76 * @property {number} distance The distance at which to render the end of this Ray Pointer, if one is defined.
77 */77 */
78/**jsdoc78/**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.
80 *80 *
81 * @typedef {object} Pointers.RayPointerRenderState81 * @typedef {object} Pointers.RayPointerRenderState
82 * @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState}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} [start] All of the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).83 * @property {Overlays.OverlayProperties|QUuid} [start] When using {@link Pointers.createPointer}, an optionally defined overlay to represent the beginning of the Ray Pointer,
84 * An overlay to represent the beginning of the Ray Pointer, if desired.84 * using the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
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>.85 * When returned from {@link Pointers.getPointerProperties}, the ID of the created overlay if it exists, or a null ID otherwise.
86 * An overlay to represent the path of the Ray Pointer, if desired.86 * @property {Overlays.OverlayProperties|QUuid} [path] When using {@link Pointers.createPointer}, an optionally defined overlay to represent the path of the Ray Pointer,
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).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 * An overlay to represent the end of the Ray Pointer, if desired.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.
89 */92 */
90/**jsdoc93/**jsdoc
91 * 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.94 * 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
99 * @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,102 * @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,
100 * the normal will follow exactly.103 * the normal will follow exactly.
101 * @property {boolean} [enabled=false]104 * @property {boolean} [enabled=false]
102 * @property {Pointers.RayPointerRenderState[]} [renderStates] A list of different visual states to switch between.105 * @property {Pointers.RayPointerRenderState[]|Object.<string, Pointers.RayPointerRenderState>} [renderStates] A collection 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.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.
104 * @property {boolean} [hover=false] If this Pointer should generate hover events.111 * @property {boolean} [hover=false] If this Pointer should generate hover events.
105 * @property {Pointers.Trigger[]} [triggers] A list of different triggers mechanisms that control this Pointer's click event generation.112 * @property {Pointers.Trigger[]} [triggers] A list of different triggers mechanisms that control this Pointer's click event generation.
106 */113 */
@@ -224,12 +231,15 @@ unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& prope · 117 unmodified lines
224* A set of properties used to define the visual aspect of a Parabola Pointer in the case that the Pointer is intersecting something.231* A set of properties used to define the visual aspect of a Parabola Pointer in the case that the Pointer is intersecting something.
225*232*
226* @typedef {object} Pointers.ParabolaPointerRenderState233* @typedef {object} Pointers.ParabolaPointerRenderState
227* @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState}234* @property {string} name When using {@link Pointers.createPointer}, 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).235* @property {Overlays.OverlayProperties|QUuid} [start] When using {@link Pointers.createPointer}, an optionally defined overlay to represent the beginning of the Parabola Pointer,
229* An overlay to represent the beginning of the Parabola Pointer, if desired.236* using the properties you would normally pass to {@link Overlays.addOverlay}, plus the type (as a <code>type</code> field).
230* @property {Pointers.ParabolaProperties} [path] The rendering properties of the parabolic path defined by the Parabola Pointer.237* When returned from {@link Pointers.getPointerProperties}, the ID of the created overlay if it exists, or a null ID otherwise.
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).238* @property {Pointers.ParabolaProperties} [path] When using {@link Pointers.createPointer}, the optionally defined rendering properties of the parabolic path defined by the Parabola Pointer.
232* An overlay to represent the end of the Parabola Pointer, if desired.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.
233*/243*/
234/**jsdoc244/**jsdoc
235* 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.245* 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
243* @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,253* @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,
244* the normal will follow exactly.254* the normal will follow exactly.
245* @property {boolean} [enabled=false]255* @property {boolean} [enabled=false]
246* @property {Pointers.ParabolaPointerRenderState[]} [renderStates] A list of different visual states to switch between.256* @property {Pointers.ParabolaPointerRenderState[]|Object.<string, Pointers.ParabolaPointerRenderState>} [renderStates] A collection 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.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.
248* @property {boolean} [hover=false] If this Pointer should generate hover events.262* @property {boolean} [hover=false] If this Pointer should generate hover events.
249* @property {Pointers.Trigger[]} [triggers] A list of different triggers mechanisms that control this Pointer's click event generation.263* @property {Pointers.Trigger[]} [triggers] A list of different triggers mechanisms that control this Pointer's click event generation.
250*/264*/
@@ -377,6 +391,10 @@ QVariantMap PointerScriptingInterface::getPrevPickResult(unsigned int uid) const · 126 unmodified lines
377 return result;391 return result;
378}392}
379 393
394QVariantMap PointerScriptingInterface::getPointerProperties(unsigned int uid) const {
395 return DependencyManager::get<PointerManager>()->getPointerProperties(uid);
396}
397
380QVector<QUuid> PointerScriptingInterface::getOverlayIDs(unsigned int uid) {398QVector<QUuid> PointerScriptingInterface::getOverlayIDs(unsigned int uid) {
381 return DependencyManager::get<PointerManager>()->getOverlayIDs(uid);399 return DependencyManager::get<PointerManager>()->getOverlayIDs(uid);
382}400}