Skip to content
Zach Kinstner edited this page Nov 2, 2016 · 3 revisions

Cursors are points (in 3D space) that can interact with items.

Cursor Overview

Capabilities

A cursor uses a position and rotation in 3D space, and has a unique type (like "LeftIndex" or "RightThumb"). It also has a size and "trigger strength", which can be used for various purposes.

Each cursor can be set to one of two modes:

  • Standard mode: The "input" point is the same as the "interactive" point.
  • Raycast mode: The "input" point is the origin of a ray, which shoots in a direction based upon the point's rotation. The "interactive" point occurs where (and when) the ray hits an item.

Raycast mode offers some interesting options for interactions. When used with a cursor that is locked to the VR/AR headset, it enables items to be selected simply by looking at them. When used with a cursor attached to a fingertip, for example, it enables item to be selected with a "laser-pointer" type of interaction. In both scenarios, a Raycast cursor also provides a way to interact with distant items (without needing to move the cursor close them).

Input

The position and state of each cursor is typically controlled by a 3D input device (for example, a Leap Motion Controller, a Vive Controller, a VR/AR headset, etc.). The use of cursors makes it possible to implement Hover UI Kit support any 3D input device (via input modules).

Interaction

In Hover UI Kit, user interactions are greatly simplified by the use of single-point cursors. Regardless of the item type or input device, the user quickly learns that all items react (visually and functionally) to distance between the items and their cursors. There are no "hidden" gestures or poses to perform, no series of steps to guess or remember, and no requirements for traditional input devices (like a mouse or keyboard). Instead, a user needs only to bring a cursor near to an item, holding it there for a moment until the item selects. Visual indicators, on both the cursor and the item, teach and guide users the whole time.

Idle

Cursors support an "idle" feature for Sticky and Slider item types. A "sticky-selected" item typically requires the cursor to move away from the item to deselect it. With the idle feature, however, the item can become deselected simply by holding the cursor still. The distance threshold and duration of the idle interaction are configurable. The idle feature has its own visual indicator within a cursor renderer.

For Slider items, the idle feature makes it easier to deselect the slider handle without changing the desired slider value. With the typical pull-away interaction, it can sometimes be difficult to choose a slider value accurately.

For Sticky items, the idle feature is useful as a secondary way to deselect the item. Perhaps the item is very large, and it is difficult for the user to perform the pull-away interaction correctly.

For Sticky items that follow the cursor once selected, the idle feature might be the only possible way to deselect the item (and thus, end the cursor-following action). For example, a UI element has a Sticky item on its corner; once selected, it follows the cursor on the X/Y plane to resize the element. In another example, a 3D object has a Sticky item near it; once selected, it follows the cursor in all X/Y/Z directions to move the object. In these scenarios, it may be confusing or impossible for the user to perform the pull-away interaction correctly.

The HoverItemDataSlider and HoverItemDataSticky components both have an "Allow Idle Deselection" property. By default, this property is enabled for Slider items, but disabled for Sticky items.

Cursor Components

The following sections describe the components related to cursors.

Cursor Data Provider

The HoverCursorDataProvider component is documented with the HoverKit prefab.

Cursor Data

The HoverCursorData component is responsible for maintaining user-input and interaction information about a cursor. The HoverKit prefab includes one of these components for each CursorType. Cursor data is exposed to input modules via the ICursorDataForInput interface, and exposed to the rest of the scene via the ICursorData interface.

This component has properties that affect the cursor's functionality:

  • The "Capability" property can be set to "None" (ignored), "Transform Only" (it moves based on user input), and "Full" (it moves based on user input and can generate item interactions).
  • The "Is Raycast" property toggles the cursor into Raycast mode, which enables "laser-pointer" style interactions.
  • The "Raycast Local Direction" property specifies which direction the cursor will shoot its "laser-pointer". It is specified in local space (relative to the cursor itself), and defaults to the Vector3.forward direction.

This component has other properties that are typically controlled by an input module:

  • The "Size" property specifies how large the cursor renderer should be, and may vary based upon the input device. Interfaces and other interactions may use this value in various ways (for example, a hand-based menu could adjust its size based on the "Palm" cursor's size).
  • The "Trigger Strength" property is a numerical value (between 0 and 1). The source of this value, or the user action required to generate it, may vary based upon the input device (for example, it might be controlled by grab strength, or a controller's analog trigger button). Interfaces and other interactions may use this value in various ways (for example, a menu could perform an action when the trigger strength crosses a threshold).

Cursor Idle State

The HoverCursorIdleState component is responsible for tracking the cursor position over time, and determining how long it has remained within a particular distance threshold. This information is provided via the ICursorData.Data property. The HoverKit prefab includes one of these components for each CursorType.

This component has an "Interaction Settings" property, which provides the threshold and duration settings, and is pre-set to the settings within the HoverKit prefab. It also has a "Drift Strength" property, which determines how rapidly the cursor's average recent position converges with its current position.

Interaction Settings

The HoverInteractionSettings component is responsible for providing interaction-related settings to the rest of the scene. The HoverKit prefab includes one of these components with default values.

A scene may have multiple HoverInteractionSettings components. While it is not recommended (due to its lack of consistency), each item and cursor could potentially use a different settings component.

This component has several properties:

  • The "Highlight Distance Min" and "Highlight Distance Max" properties determine the item-to-cursor distance where the item's highlight progress begins ("Min") and ends ("Max").
  • The "Sticky Release Distance" property determines the minimum item-to-cursor distance required to end an item's sticky-selection state. This value is typically at the center of the highlight distance range.
  • The "Selection Milliseconds" property determines how long it takes (while the highlight progress is at 100%) for an item to become selected.
  • The "Idle Distance Threshold" property determines how far a cursor can move (compared to its average recent position) before it restarts the idle interaction timer. This value will vary based upon the desired input device (for example, a 3D controller that provides highly-accurate position values can have a smaller distance threshold than a 3D controller that provides jittery values).
  • The "Idle Milliseconds" property determines the amount of time that the cursor must remain relatively still before the idle action occurs (which deselects an item's sticky-selection).

Cursor Follower

The HoverCursorFollower component is responsible for updating its GameObject's transform and active states based upon the specified cursor. As the name implies, this is useful for making objects (for example, a cursor renderer or a wearable menu interface) follow the cursor as it moves and rotates.

This component has several properties:

  • The "Cursor Data Provider" property is pre-set to the provider within the HoverKit prefab.
  • The "Cursor Type" property specifies which cursor to follow.
  • The "Follow Cursor Active" property, when enabled, causes the GameObjects in the "Objects To Active" list to follow the cursor's active/inactive state. Do not add this component's own GameObject to the list; if this component gets deactivated, it will be unable to react when the cursor becomes active again.
  • The "Follow Cursor Position" and "Follow Cursor Rotation" properties, when enabled, cause the transform's world-space position and rotation (respectively) to match the cursor.
  • The "Scale Using Cursor Size" property, when enabled, causes the transform's scale to match the cursor's size, multiplied by the "Cursor Size Multiplier".
Clone this wiki locally