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
Assembly: Unity.XR.Interaction.Toolkit.dll
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, float), interaction strength filters that cannot process do not.
Declaration
bool canProcess { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
It's recommended to return isActiveAndEnabled when implementing this interface in a MonoBehaviour.
Methods
Process(IXRInteractor, IXRInteractable, float)
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. |
float | interactionStrength | The input interaction strength. |
Returns
Type | Description |
---|---|
float | Returns the modified interaction strength that is the result of passing the interaction strength through the filter. |