Interface IXRInteractionStrengthFilter
Instances that implement this interface are called interaction strength filters. Interaction strength filters are used to adjust or set the interaction strength between an Interactor and Interactable.
Namespace: UnityEngine.XR.Interaction.Toolkit.Filtering
Syntax
public interface IXRInteractionStrengthFilter
Remarks
Add an interaction strength filter to the following objects to extend its interaction strength computation:
- XRBaseInteractable: to add an Interactable interaction strength filter used to modify interaction strength in the Interactable for a hovering or selecting Interactor.
Properties
canProcess
Whether this interaction strength filter can process. Interaction strength filters that can process receive calls to Process(IXRInteractor, IXRInteractable, Single), interaction strength filters that cannot process do not.
Declaration
bool canProcess { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
It's recommended to return isActiveAndEnabled when implementing this interface in a MonoBehaviour.
Methods
Process(IXRInteractor, IXRInteractable, Single)
Called by the host object (XRBaseInteractable) to calculate the interaction strength between the given Interactor and Interactable.
Declaration
float Process(IXRInteractor interactor, IXRInteractable interactable, float interactionStrength)
Parameters
Type | Name | Description |
---|---|---|
IXRInteractor | interactor | The Interactor interacting. |
IXRInteractable | interactable | The Interactable interacting with the interactor. |
Single | interactionStrength | The input interaction strength. |
Returns
Type | Description |
---|---|
Single | Returns the modified interaction strength that is the result of passing the interaction strength through the filter. |