Interaction Mode Manager — MRTK3

Overview

An interaction mode represents a subset of interactors that should be enabled based on contextual information about what the user is doing. For example, a near interaction mode may disable all ray interactors while permitting the use of grab and poke interactors. Conversely, when the user is grabbing an object, you may want to enter a near grab interaction mode, which disables the touch interactor, preventing any accidental touch activations while grabbing the object.

Sample Near Interaction Mode

The interaction Mode Manager mediates between these interaction contexts. It relies on mode Interaction Mode Detector to determine the best mode for the current context. Mode detectors, such as ProximityModeDetector, dictate which mode should be active for a given Controller based on any arbitrary condition. Developers can create new ways to disambiguate between interaction contexts by implementing IInteractionModeDetector.

Near Interaction Mode Detector in Action

The priority of each mode is determined by their order within the Interaction Mode Manager. Modes listed later in the list have higher priority, making them the dominant mode in cases where multiple interaction contexts may be valid. The Interaction Mode Manager also allows the user to specify a default interaction mode.

Mode Manager Priority

Detectors

The MRTK contains a set IInteractionModeDetectors implementation, each specifying which InteractionMode to enable or disable.

Interaction Detector

The InteractionDetector enables or disables the specified hover and select interaction modes whenever one of the associated interactors has a valid hover or select target.

Proximity Detector

The ProximityDetector enables or disables the specified interaction mode when the detector is near an interactable's collider.

Near Interaction Mode Detector

The NearInteractionModeDetector enables or disables the specified interaction mode when the detector or one of the associated interactors is near am interactable's collider.