Assets/MRTK/SDK/Features/UX/Scripts/PressableButtons/README.md
This folder contains the scripts necessary for making Interactable buttons that support Speech, Far Interaction and Near Interaction (Physical hand pressing)
PhysicalButtonMovement is similar to HandInteractionPress. It uses External Object Targeting (EOT) to move an Interactable element along a press direction vector. PhysicalButtonMovement needs a large BoxCollider on the Ignore Raycast layer (which it sets automatically) It tracks the position of both index tip fingers and uses this to move the button as needed.
It then calls into a PhysicalPressEventRouter and calls events related to Touch, Press, Unpress (Default Click), and Untouch.
The PhysicalPressEventRouter receives events and sets Interactable's InteractableState accordingly. It also calls OnPointerClicked events, allowing for the PhysicalButtonMovement script to trigger Interactable.OnClicked UnityEvents (which speech/far interaction also execute)
If PhysicalPressEventRouter does not satisfy your use case, you can write your own and utilize it instead.
Pressable buttons feature a normally invisible mesh called a 'Button Cage' or a 'Button Box' This mesh has one direction as the button face (Negative Z). This mesh has a button shader applied to it. The shader observes the position of several global positions (assigned in the GlobalShaderProximityAssigner) TouchButton triggers the glow splash when the joint positions enter into a collider or meshrenderer's bounds.
A Prefab is provide in MRTK.Examples/Demos/HandTracking/Prefabs/PressableButtons.
You can customize variables within the PressableButtons, such as the dimensions of the detection box collider.
The sizing of .032 x .032 x .016 Unity units is the default dimensions of a button. The default sizing of the EOT Collider is .032 x .032 x .128 Unity units. This gives a decent pressable depth even if a developer adjusts the maximum press depth beyond the default .05 Unity units.