Hand Filtering
This feature allows the users to filter interactions on interactables objects. The XR Hand Filter
is a custom implementation of IXRSelectFilter which allows processing of additional validation checks when selecting an interactable.
Description
When selecting an interactable, XR Hand Filter
is performed on Handedness and Gesture given by the XR Hand Controller.
Developers can choose which hand and gesture will be able to interact with an object.
At runtime, any interactor will check the filters before selecting the interactable.
By default, if the XR Controller is not an XR Hand Controller, no filtering will be performed and the interactable will be selected.
Integration Step by Step
Choose which hand and gesture will be able to interact with an object by simply following the next steps :
Add an XR Hand Filter component to the object. The object must have an XR Grab Interactable component in order to be interactable.
In the Select Hand field, choose Both, Right or Left to define which hand can interact with this object.
In the Select Gesture field, choose Both, Grab or Pinch to define which gesture can interact with this object.
The Pinch gesture is defined by the triggerPressed
action mapped on SelectAction reference of the XRHandControllers.
The Grab gesture is defined by the gripPressed
action mapped on the OptionalSelectAction of XRHandControllers.
Example
The blue cube has to be selected by both hands but only with a grab gesture. The interactable should look like this :