History

wiggly lasers

HifiExperiments committed 2 years ago

Commit 30646471 parent bc45c1715 files · +205 −144Browse files

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

Unified · Split

interface/src/raypick/PointerScriptingInterface.cpp+39−46
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 #include <ScriptManager.h>
2626
2727 STATIC_SCRIPT_TYPES_INITIALIZER((+[](ScriptManager* manager){
28− qDebug() << "STATIC_SCRIPT_TYPES_INITIALIZER PointerScriptingInterface";
2928 auto scriptEngine = manager->engine().get();
3029 scriptRegisterMetaType<RayPointerProperties, rayPointerPropertiesToScriptValue, rayPointerPropertiesFromScriptValue>(scriptEngine);
3130 scriptRegisterMetaType<StylusPointerProperties, stylusPointerPropertiesToScriptValue, stylusPointerPropertiesFromScriptValue>(scriptEngine);
@@ -92,7 +91,6 @@ unsigned int PointerScriptingInterface::createParabolaPointer(ParabolaPointerPro · 60 unmodified lines
9291 return createPointerInternal(PickQuery::PickType::Parabola, properties);
9392 }
9493
95−
9694 bool PointerScriptingInterface::isPointerEnabled(unsigned int uid) const {
9795 return DependencyManager::get<PointerManager>()->isPointerEnabled(uid);
9896 }
@@ -178,45 +176,45 @@ std::shared_ptr<Pointer> PointerScriptingInterface::buildStylus(const PointerPro · 79 unmodified lines
178176 * Properties that define the visual appearance of a ray pointer when the pointer is intersecting something.
179177 * @typedef {object} Pointers.RayPointerRenderState
180178 * @property {string} name - When creating using {@link Pointers.createPointer}, the name of the render state.
181− * @property {Overlays.OverlayProperties|Uuid} [start]
179+ * @property {Entities.EntityProperties|Uuid} [start]
182180 * <p>When creating or editing using {@link Pointers.createPointer} or {@link Pointers.editRenderState}, the properties of
183− * an overlay to render at the start of the ray pointer. The <code>type</code> property must be specified.</p>
184− * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the overlay rendered at the start of the ray;
185− * <code>null</code> if there is no overlay.
181+ * an entity to render at the start of the ray pointer. The <code>type</code> property must be specified.</p>
182+ * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the entity rendered at the start of the ray;
183+ * <code>null</code> if there is no entity.
186184 *
187− * @property {Overlays.OverlayProperties|Uuid} [path]
185+ * @property {Entities.EntityProperties|Uuid} [path]
188186 * <p>When creating or editing using {@link Pointers.createPointer} or {@link Pointers.editRenderState}, the properties of
189− * the overlay rendered for the path of the ray pointer. The <code>type</code> property must be specified and be
190− * <code>"line3d"</code>.</p>
191− * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the overlay rendered for the path of the ray;
192− * <code>null</code> if there is no overlay.
187+ * the entity rendered for the path of the ray pointer. The <code>type</code> property must be specified and be
188+ * <code>"PolyLine"</code>.</p> Specify <code>linePoints</code> to control how many segments make up the path.
189+ * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the entity rendered for the path of the ray;
190+ * <code>null</code> if there is no entity.
193191 *
194− * @property {Overlays.OverlayProperties|Uuid} [end]
192+ * @property {Entities.EntityProperties|Uuid} [end]
195193 * <p>When creating or editing using {@link Pointers.createPointer} or {@link Pointers.editRenderState}, the properties of
196− * an overlay to render at the end of the ray pointer. The <code>type</code> property must be specified.</p>
197− * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the overlay rendered at the end of the ray;
198− * <code>null</code> if there is no overlay.
194+ * an entity to render at the end of the ray pointer. The <code>type</code> property must be specified.</p>
195+ * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the entity rendered at the end of the ray;
196+ * <code>null</code> if there is no entity.
199197 */
200198 /*@jsdoc
201199 * The properties of a ray pointer. These include the properties from the underlying ray pick that the pointer uses.
202200 * @typedef {object} Pointers.RayPointerProperties
203− * @property {boolean} [faceAvatar=false] - <code>true</code> if the overlay rendered at the end of the ray rotates about the
201+ * @property {boolean} [faceAvatar=false] - <code>true</code> if the entity rendered at the end of the ray rotates about the
204202 * world y-axis to always face the avatar; <code>false</code> if it maintains its world orientation.
205− * @property {boolean} [centerEndY=true] - <code>true</code> if the overlay rendered at the end of the ray is centered on
206− * the ray end; <code>false</code> if the overlay is positioned against the surface if <code>followNormal</code> is
203+ * @property {boolean} [centerEndY=true] - <code>true</code> if the entity rendered at the end of the ray is centered on
204+ * the ray end; <code>false</code> if the entity is positioned against the surface if <code>followNormal</code> is
207205 * <code>true</code>, or above the ray end if <code>followNormal</code> is <code>false</code>.
208206 * @property {boolean} [lockEnd=false] - <code>true</code> if the end of the ray is locked to the center of the object at
209207 * which the ray is pointing; <code>false</code> if the end of the ray is at the intersected surface.
210− * @property {boolean} [distanceScaleEnd=false] - <code>true</code> if the dimensions of the overlay at the end of the ray
208+ * @property {boolean} [distanceScaleEnd=false] - <code>true</code> if the dimensions of the entity at the end of the ray
211209 * scale linearly with distance; <code>false</code> if they aren't.
212210 * @property {boolean} [scaleWithParent=false] - <code>true</code> if the width of the ray's path and the size of the
213− * start and end overlays scale linearly with the pointer parent's scale; <code>false</code> if they don't scale.
211+ * start and end entities scale linearly with the pointer parent's scale; <code>false</code> if they don't scale.
214212 * @property {boolean} [scaleWithAvatar=false] - A synonym for <code>scalewithParent</code>.
215213 * <p class="important">Deprecated: This property is deprecated and will be removed.</p>
216− * @property {boolean} [followNormal=false] - <code>true</code> if the overlay rendered at the end of the ray rotates to
214+ * @property {boolean} [followNormal=false] - <code>true</code> if the entity rendered at the end of the ray rotates to
217215 * follow the normal of the surface if one is intersected; <code>false</code> if it doesn't.
218− * @property {number} [followNormalStrength=0.0] - How quickly the overlay rendered at the end of the ray rotates to follow
219− * the normal of an intersected surface. If <code>0</code> or <code>1</code>, the overlay rotation follows instantaneously;
216+ * @property {number} [followNormalStrength=0.0] - How quickly the entity rendered at the end of the ray rotates to follow
217+ * the normal of an intersected surface. If <code>0</code> or <code>1</code>, the entity rotation follows instantaneously;
220218 * for other values, the larger the value the more quickly the rotation follows.
221219 * @property {Pointers.RayPointerRenderState[]|Object.<string, Pointers.RayPointerRenderState>} [renderStates]
222220 * <p>A set of visual states that can be switched among using {@link Pointers.setRenderState}. These define the visual
@@ -236,7 +234,7 @@ std::shared_ptr<Pointer> PointerScriptingInterface::buildStylus(const PointerPro · 13 unmodified lines
236234 * @property {boolean} [hover=false] - <code>true</code> if the pointer generates {@link Entities} hover events,
237235 * <code>false</code> if it doesn't.
238236 * @property {Pointers.Trigger[]} [triggers=[]] - A list of ways that a {@link Controller} action or function should trigger
239− * events on the entity or overlay currently intersected.
237+ * events on the object currently intersected.
240238 * @property {PickType} pointerType - The type of pointer returned from {@link Pointers.getPointerProperties} or
241239 * {@link Pointers.getPointerScriptParameters}. A laser pointer's type is {@link PickType(0)|PickType.Ray}.
242240 * @property {number} [pickID] - The ID of the pick created alongside this pointer, returned from
@@ -378,41 +376,41 @@ std::shared_ptr<Pointer> PointerScriptingInterface::buildLaserPointer(const Poin · 135 unmodified lines
378376 * Properties that define the visual appearance of a parabola pointer when the pointer is intersecting something.
379377 * @typedef {object} Pointers.ParabolaPointerRenderState
380378 * @property {string} name - When creating using {@link Pointers.createPointer}, the name of the render state.
381− * @property {Overlays.OverlayProperties|Uuid} [start]
379+ * @property {Entities.EntityProperties|Uuid} [start]
382380 * <p>When creating or editing using {@link Pointers.createPointer} or {@link Pointers.editRenderState}, the properties of
383− * an overlay to render at the start of the parabola pointer. The <code>type</code> property must be specified.</p>
384− * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the overlay rendered at the start of the
385− * parabola; <code>null</code> if there is no overlay.
381+ * an entity to render at the start of the parabola pointer. The <code>type</code> property must be specified.</p>
382+ * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the entity rendered at the start of the
383+ * parabola; <code>null</code> if there is no entity.
386384 * @property {Pointers.ParabolaPointerPath|Uuid} [path]
387385 * <p>When creating or editing using {@link Pointers.createPointer} or {@link Pointers.editRenderState}, the properties of
388386 * the rendered path of the parabola pointer.</p>
389387 * <p>This property is not provided when getting using {@link Pointers.getPointerProperties}.
390− * @property {Overlays.OverlayProperties|Uuid} [end]
388+ * @property {Entities.EntityProperties|Uuid} [end]
391389 * <p>When creating or editing using {@link Pointers.createPointer} or {@link Pointers.editRenderState}, the properties of
392− * an overlay to render at the end of the ray pointer. The <code>type</code> property must be specified.</p>
393− * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the overlay rendered at the end of the parabola;
394− * <code>null</code> if there is no overlay.
390+ * an entity to render at the end of the ray pointer. The <code>type</code> property must be specified.</p>
391+ * <p>When getting using {@link Pointers.getPointerProperties}, the ID of the entity rendered at the end of the parabola;
392+ * <code>null</code> if there is no entity.
395393 */
396394 /*@jsdoc
397395 * The properties of a parabola pointer. These include the properties from the underlying parabola pick that the pointer uses.
398396 * @typedef {object} Pointers.ParabolaPointerProperties
399− * @property {boolean} [faceAvatar=false] - <code>true</code> if the overlay rendered at the end of the ray rotates about the
397+ * @property {boolean} [faceAvatar=false] - <code>true</code> if the entity rendered at the end of the ray rotates about the
400398 * world y-axis to always face the avatar; <code>false</code> if it maintains its world orientation.
401− * @property {boolean} [centerEndY=true] - <code>true</code> if the overlay rendered at the end of the ray is centered on
402− * the ray end; <code>false</code> if the overlay is positioned against the surface if <code>followNormal</code> is
399+ * @property {boolean} [centerEndY=true] - <code>true</code> if the entity rendered at the end of the ray is centered on
400+ * the ray end; <code>false</code> if the entity is positioned against the surface if <code>followNormal</code> is
403401 * <code>true</code>, or above the ray end if <code>followNormal</code> is <code>false</code>.
404402 * @property {boolean} [lockEnd=false] - <code>true</code> if the end of the ray is locked to the center of the object at
405403 * which the ray is pointing; <code>false</code> if the end of the ray is at the intersected surface.
406− * @property {boolean} [distanceScaleEnd=false] - <code>true</code> if the dimensions of the overlay at the end of the ray
404+ * @property {boolean} [distanceScaleEnd=false] - <code>true</code> if the dimensions of the entity at the end of the ray
407405 * scale linearly with distance; <code>false</code> if they aren't.
408406 * @property {boolean} [scaleWithParent=false] - <code>true</code> if the width of the ray's path and the size of the
409− * start and end overlays scale linearly with the pointer parent's scale; <code>false</code> if they don't scale.
407+ * start and end entities scale linearly with the pointer parent's scale; <code>false</code> if they don't scale.
410408 * @property {boolean} [scaleWithAvatar=false] - A synonym for <code>scalewithParent</code>.
411409 * <p class="important">Deprecated: This property is deprecated and will be removed.</p>
412− * @property {boolean} [followNormal=false] - <code>true</code> if the overlay rendered at the end of the ray rotates to
410+ * @property {boolean} [followNormal=false] - <code>true</code> if the entity rendered at the end of the ray rotates to
413411 * follow the normal of the surface if one is intersected; <code>false</code> if it doesn't.
414− * @property {number} [followNormalStrength=0.0] - How quickly the overlay rendered at the end of the ray rotates to follow
415− * the normal of an intersected surface. If <code>0</code> or <code>1</code>, the overlay rotation follows instantaneously;
412+ * @property {number} [followNormalStrength=0.0] - How quickly the entity rendered at the end of the ray rotates to follow
413+ * the normal of an intersected surface. If <code>0</code> or <code>1</code>, the entity rotation follows instantaneously;
416414 * for other values, the larger the value the more quickly the rotation follows.
417415 * @property {Pointers.ParabolaPointerRenderState[]|Object.<string, Pointers.ParabolaPointerRenderState>} [renderStates]
418416 * <p>A set of visual states that can be switched among using {@link Pointers.setRenderState}. These define the visual
@@ -432,7 +430,7 @@ std::shared_ptr<Pointer> PointerScriptingInterface::buildLaserPointer(const Poin · 13 unmodified lines
432430 * @property {boolean} [hover=false] - <code>true</code> if the pointer generates {@link Entities} hover events,
433431 * <code>false</code> if it doesn't.
434432 * @property {Pointers.Trigger[]} [triggers=[]] - A list of ways that a {@link Controller} action or function should trigger
435− * events on the entity or overlay currently intersected.
433+ * events on the object currently intersected.
436434 * @property {PickType} pointerType - The type of pointer returned from {@link Pointers.getPointerProperties} or
437435 * {@link Pointers.getPointerScriptParameters}. A parabola pointer's type is {@link PickType(0)|PickType.Parabola}.
438436 * @property {number} [pickID] - The ID of the pick created alongside this pointer, returned from
@@ -622,7 +620,6 @@ bool rayPointerPropertiesFromScriptValue(const ScriptValue& value, RayPointerPro · 183 unmodified lines
622620 out.properties[*renderStatesName].setValue(renderStates);
623621 }
624622 }
625− qDebug() << "rayPointerPropertiesFromScriptValue" << out.properties;
626623 return true;
627624 }
628625
@@ -675,7 +672,6 @@ bool stylusPointerPropertiesFromScriptValue(const ScriptValue& value, StylusPoin · 46 unmodified lines
675672 out.properties[*renderStatesName].setValue(renderStates);
676673 }
677674 }
678− qDebug() << "stylusPointerPropertiesFromScriptValue" << out.properties;
679675 return true;
680676 }
681677
@@ -714,7 +710,6 @@ bool parabolaPointerPropertiesFromScriptValue(const ScriptValue& value, Parabola · 32 unmodified lines
714710 pathProperties.copyFromScriptValue(path, false);
715711 stateMap.insert("pathPropertyIndex", QVariant(out.entityProperties.length()));
716712 out.entityProperties.append(pathProperties);
717− qDebug() << "parabolaPointerPropertiesFromScriptValue : added path entity";
718713 }
719714
720715 if (stateMap["end"].isValid()) {
@@ -723,7 +718,6 @@ bool parabolaPointerPropertiesFromScriptValue(const ScriptValue& value, Parabola · 2 unmodified lines
723718 endProperties.copyFromScriptValue(end, false);
724719 stateMap.insert("endPropertyIndex", QVariant(out.entityProperties.length()));
725720 out.entityProperties.append(endProperties);
726− qDebug() << "parabolaPointerPropertiesFromScriptValue : added end entity";
727721 }
728722 renderStates[i].setValue(stateMap);
729723 }
@@ -731,6 +725,5 @@ bool parabolaPointerPropertiesFromScriptValue(const ScriptValue& value, Parabola · 1 unmodified line
731725 out.properties[*renderStatesName].setValue(renderStates);
732726 }
733727 }
734− qDebug() << "parabolaPointerPropertiesFromScriptValue" << out.properties;
735728 return true;
736729 }