docs.unity3d.com
    Show / Hide Table of Contents

    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.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023