docs.unity3d.com
    Show / Hide Table of Contents

    Enum XRBaseInteractable.DistanceCalculationMode

    Options for how to calculate an Interactable distance to a location in world space.

    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public enum DistanceCalculationMode

    Fields

    Name Description Value
    TransformPosition

    Calculates the distance using the Interactable's transform position. This option has low performance cost, but it may have low distance calculation accuracy for some objects.


    0
    ColliderPosition

    Calculates the distance using the Interactable's colliders list using the shortest distance to each. This option has moderate performance cost and should have moderate distance calculation accuracy for most objects.


    1
    ColliderVolume

    Calculates the distance using the Interactable's colliders list using the shortest distance to the closest point of each (either on the surface or inside the Collider). This option has high performance cost but high distance calculation accuracy.


    The Interactable's colliders can only be of type BoxCollider, SphereCollider, CapsuleCollider, or convex MeshCollider.

    2
    See Also
    distanceCalculationMode
    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