Skip to content

Latest commit

 

History

History
86 lines (48 loc) · 5.63 KB

README_Pointers.md

File metadata and controls

86 lines (48 loc) · 5.63 KB

Pointers

Pointer

A pointer is something attached to a controller that gives focus and dispatches inputs to the game object it is pointing to. Learn more about the MRTK input system here, and a scripting/engineering overview of pointers here.

For a game object to be able to receive focus it must have a collider (so it can be hit by physics raycasts) and belong to one of the layers defined in the Pointer Raycast Layer Masks in the Pointer Profile.

Pointers are instantiated automatically at runtime when a new controller is detected. The pointers that are created for each controller type are defined in the Pointer Options in the Pointer Profile. You can have more than one pointer attached to a controller; for example, with the default pointer profile, WMR controllers get both a line and a parabolic pointer for normal selection and teleportation respectively. Pointers communicate with each other to decide which one is active.

MRTK provides a set of pointer prefabs in Assets/MixedRealityToolkit.SDK/Features/UX/Prefabs/Pointers. You can use your own prefabs as long as they contain one of the pointer scripts in Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Pointers or any other script implementing IMixedRealityPointer.

Pointer Profile

MRTK Pointer Prefabs

Line Pointer

A line pointer is a ray attached to a controller. The line starts at the controller's base, and its pointing direction matches the pointing direction of the controller.

Line pointers are commonly used when you have two controllers which have a position, and a pointing direction.

For motion controllers like in Oculus, Vive, Windows Mixed Reality, the rotation will match the rotation of the controller.

For other controllers like HoloLens 2 articulated hands, the rotation matches the system-provided pointing pose of the hand.

GGV Pointer

GGV stands for "Gaze, Gesture, Voice"2. The GGV pointer's position and direction is driven by the head's position and rotation. The pointer is used to provide input that matches the HoloLens V1 input style of head gaze + airtap3.

In the pointer profile you can see that the V1 HoloLens input system is provided for you via the mapping of "GGVHand" (V1 HoloLens hand) to the GGVPointer.

You can also simulate the V1 HoloLens GGV behavior on HoloLens 2 by mapping the articulated hand to the GGVPointer.

Grab Pointer / Sphere Pointer

Grab pointer is used for near interactions, specifically for grabbing items near the hand / controller.

NOTE: Only items with Near Interaction Grabbable components will respond to the sphere pointer.

Sphere Pointer Properties

Sphere Cast Radius - The radius for the sphere used to query for grabbable objects. Debug Mode - If true, draw the sphere that is used to query for grabbable objects

Poke Pointer

Poke pointer is for near interactions, specifically for touching objects via the hand / controller.

NOTE: Only items with Near Interaction Touchable components will respond to the poke pointer.

Poke Pointer Properties

  • distBack - how far input point can go behind surface before release event occurs
  • distFront - how far input point needs to be in front of surface before press event occurs
  • debounceThreshold - once touching, the distance back hand needs to be pulled from surface before a touch release occurs.

Configuring NearInteractionTouchable

When configuring your Near Interaction Touchable, make sure to configure the localForward parameter to point out of the front of the button or other object you wish to make touchable. Also make sure that the touchable's bounds matches the bounds of your touchable object.

Other parameters:

  • eventsToReceive - if set to Touch, the object will receive OnTouchDown OnTouchUpdate and OnTouchUp events. If set to pointer, the object will receive OnPointerDown and OnPointerUp events.
  • touchableSurface - use this to help compute the bounds of the surface. Bounds will automatically adjust to the attached BoxCollider, UnityUI element, or can be set manually by adjusting bounds.
  • visuals - Game Object used to render finger tip visual (the ring on finger, by default)
  • line - optional line to draw from fingertip to the active input surface.

Mouse pointer

Mouse Pointer

Mouse pointer is used for interacting with the mouse. This pointer will only be used if the active input is a mouse. By default, the MRTK Profile does not provide a mouse as an input provider, as mouse input is instead used to simulate hand input. You may add a mouse in your MRTK profily by modifying the Registered Service Providers in your MRTK profile.

Teleport pointer

Teleport pointer is used for teleportation. This pointer will only be active when using a controller that supports teleportation (such as a motion controller like in Oculus, Vive, Windows Mixed Reality).