Showing the changes to interface/src/raypick/PointerScriptingInterface.cpp (1 of 6 files). Show all
Unified · Split
| @@ -42,6 +42,12 @@ unsigned int PointerScriptingInterface::createPointer(const PickQuery::PickType& · 41 unmodified lines | |||
| 42 | } | 42 | } |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | /**jsdoc | ||
| 46 | * 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. | ||
| 47 | * @typedef {object} Pointers.StylusPointerProperties | ||
| 48 | * @property {boolean} [hover=false] If this pointer should generate hover events. | ||
| 49 | * @property {boolean} [enabled=false] | ||
| 50 | */ | ||
| 45 | unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) const { | 51 | unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) const { |
| 46 | QVariantMap propertyMap = properties.toMap(); | 52 | QVariantMap propertyMap = properties.toMap(); |
| 47 | 53 | ||
| @@ -58,6 +64,48 @@ unsigned int PointerScriptingInterface::createStylus(const QVariant& properties) · 10 unmodified lines | |||
| 58 | return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<StylusPointer>(properties, StylusPointer::buildStylusOverlay(propertyMap), hover, enabled)); | 64 | return DependencyManager::get<PointerManager>()->addPointer(std::make_shared<StylusPointer>(properties, StylusPointer::buildStylusOverlay(propertyMap), hover, enabled)); |
| 59 | } | 65 | } |
| 60 | 66 | ||
| 67 | /**jsdoc | ||
| 68 | * A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is not intersecting something. Same as a {@link Pointers.RayPointerRenderState}, | ||
| 69 | * but with an additional distance field. | ||
| 70 | * | ||
| 71 | * @typedef {Object} Pointers.DefaultRayPointerRenderState | ||
| 72 | * @augments Pointers.RayPointerRenderState | ||
| 73 | * @property {number} distance The distance at which to render the end of this Ray Pointer, if one is defined. | ||
| 74 | */ | ||
| 75 | /**jsdoc | ||
| 76 | * A set of properties used to define the visual aspect of a Ray Pointer in the case that the Pointer is intersecting something. | ||
| 77 | * | ||
| 78 | * @typedef {Object} Pointers.RayPointerRenderState | ||
| 79 | * @property {string} name The name of this render state, used by {@link Pointers.setRenderState} and {@link Pointers.editRenderState} | ||
| 80 | * @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). | ||
| 81 | * An overlay to represent the beginning of the Ray Pointer, if desired. | ||
| 82 | * @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>. | ||
| 83 | * An overlay to represent the path of the Ray Pointer, if desired. | ||
| 84 | * @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). | ||
| 85 | * An overlay to represent the end of the Ray Pointer, if desired. | ||
| 86 | */ | ||
| 87 | /**jsdoc | ||
| 88 | * A trigger mechanism for Ray Pointers. | ||
| 89 | * | ||
| 90 | * @typedef {Object} Pointers.Trigger | ||
| 91 | * @property {Controller.Standard|Controller.Actions|function} action This can be a built-in Controller action, like Controller.Standard.LTClick, or a function that evaluates to >= 1.0 when you want to trigger <code>button</code>. | ||
| 92 | * @property {string} button Which button to trigger. "Primary", "Secondary", "Tertiary", and "Focus" are currently supported. Only "Primary" will trigger clicks on web surfaces. If "Focus" is triggered, | ||
| 93 | * it will try to set the entity or overlay focus to the object at which the Pointer is aimed. Buttons besides the first three will still trigger events, but event.button will be "None". | ||
| 94 | */ | ||
| 95 | /**jsdoc | ||
| 96 | * 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. | ||
| 97 | * @typedef {object} Pointers.LaserPointerProperties | ||
| 98 | * @property {boolean} [faceAvatar=false] Ray Pointers only. If true, the end of the Pointer will always rotate to face the avatar. | ||
| 99 | * @property {boolean} [centerEndY=true] Ray Pointers only. If false, the end of the Pointer will be moved up by half of its height. | ||
| 100 | * @property {boolean} [lockEnd=false] Ray Pointers only. If true, the end of the Pointer will lock on to the center of the object at which the laser is pointing. | ||
| 101 | * @property {boolean} [distanceScaleEnd=false] Ray Pointers only. If true, the dimensions of the end of the Pointer will scale linearly with distance. | ||
| 102 | * @property {boolean} [scaleWithAvatar=false] Ray Pointers only. If true, the width of the Pointer's path will scale linearly with your avatar's scale. | ||
| 103 | * @property {boolean} [enabled=false] | ||
| 104 | * @property {Pointers.RayPointerRenderState[]} [renderStates] Ray Pointers only. A list of different visual states to switch between. | ||
| 105 | * @property {Pointers.DefaultRayPointerRenderState[]} [defaultRenderStates] Ray Pointers only. A list of different visual states to use if there is no intersection. | ||
| 106 | * @property {boolean} [hover=false] If this Pointer should generate hover events. | ||
| 107 | * @property {Pointers.Trigger[]} [triggers] Ray Pointers only. A list of different triggers mechanisms that control this Pointer's click event generation. | ||
| 108 | */ | ||
| 61 | unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& properties) const { | 109 | unsigned int PointerScriptingInterface::createLaserPointer(const QVariant& properties) const { |
| 62 | QVariantMap propertyMap = properties.toMap(); | 110 | QVariantMap propertyMap = properties.toMap(); |
| 63 | 111 | ||