{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Method CalculateDistance | Unity Physics | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CalculateDistance

    CalculateDistance(PointDistanceInput)

    Calculates the distance.

    Declaration
    public bool CalculateDistance(PointDistanceInput input)
    Parameters
    Type Name Description
    PointDistanceInput input

    The input.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Implements
    ICollidable.CalculateDistance(PointDistanceInput)

    CalculateDistance(PointDistanceInput, out DistanceHit)

    Calculates the distance.

    Declaration
    public bool CalculateDistance(PointDistanceInput input, out DistanceHit closestHit)
    Parameters
    Type Name Description
    PointDistanceInput input

    The input.

    DistanceHit closestHit

    [out] The closest hit.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Implements
    ICollidable.CalculateDistance(PointDistanceInput, out DistanceHit)

    CalculateDistance(PointDistanceInput, ref NativeList<DistanceHit>)

    Calculates the distance.

    Declaration
    public bool CalculateDistance(PointDistanceInput input, ref NativeList<DistanceHit> allHits)
    Parameters
    Type Name Description
    PointDistanceInput input

    The input.

    NativeList<DistanceHit> allHits

    [in,out] all hits.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Implements
    ICollidable.CalculateDistance(PointDistanceInput, ref NativeList<DistanceHit>)

    CalculateDistance<T>(PointDistanceInput, ref T)

    Calculates the distance.

    Declaration
    public bool CalculateDistance<T>(PointDistanceInput input, ref T collector) where T : struct, ICollector<DistanceHit>
    Parameters
    Type Name Description
    PointDistanceInput input

    The input.

    T collector

    [in,out] The collector.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    Implements
    ICollidable.CalculateDistance<T>(PointDistanceInput, ref T)

    CalculateDistance(ColliderDistanceInput)

    Calculates the distance.

    Declaration
    public bool CalculateDistance(ColliderDistanceInput input)
    Parameters
    Type Name Description
    ColliderDistanceInput input

    The input.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Implements
    ICollidable.CalculateDistance(ColliderDistanceInput)

    CalculateDistance(ColliderDistanceInput, out DistanceHit)

    Calculates the distance.

    Declaration
    public bool CalculateDistance(ColliderDistanceInput input, out DistanceHit closestHit)
    Parameters
    Type Name Description
    ColliderDistanceInput input

    The input.

    DistanceHit closestHit

    [out] The closest hit.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Implements
    ICollidable.CalculateDistance(ColliderDistanceInput, out DistanceHit)

    CalculateDistance(ColliderDistanceInput, ref NativeList<DistanceHit>)

    Calculates the distance.

    Declaration
    public bool CalculateDistance(ColliderDistanceInput input, ref NativeList<DistanceHit> allHits)
    Parameters
    Type Name Description
    ColliderDistanceInput input

    The input.

    NativeList<DistanceHit> allHits

    [in,out] all hits.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Implements
    ICollidable.CalculateDistance(ColliderDistanceInput, ref NativeList<DistanceHit>)

    CalculateDistance<T>(ColliderDistanceInput, ref T)

    Calculates the distance.

    Declaration
    public bool CalculateDistance<T>(ColliderDistanceInput input, ref T collector) where T : struct, ICollector<DistanceHit>
    Parameters
    Type Name Description
    ColliderDistanceInput input

    The input.

    T collector

    [in,out] The collector.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    Implements
    ICollidable.CalculateDistance<T>(ColliderDistanceInput, ref T)

    CalculateDistance(in ColliderAspect, float, QueryInteraction)

    Calculates the distance from an aspect.

    Declaration
    public bool CalculateDistance(in ColliderAspect colliderAspect, float maxDistance, QueryInteraction queryInteraction = QueryInteraction.Default)
    Parameters
    Type Name Description
    ColliderAspect colliderAspect

    The collider aspect.

    float maxDistance

    The maximum distance.

    QueryInteraction queryInteraction

    (Optional) The query interaction.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Implements
    IAspectQueryable.CalculateDistance(in ColliderAspect, float, QueryInteraction)

    CalculateDistance(in ColliderAspect, float, out DistanceHit, QueryInteraction)

    Calculates the distance from an aspect.

    Declaration
    public bool CalculateDistance(in ColliderAspect colliderAspect, float maxDistance, out DistanceHit closestHit, QueryInteraction queryInteraction = QueryInteraction.Default)
    Parameters
    Type Name Description
    ColliderAspect colliderAspect

    The collider aspect.

    float maxDistance

    The maximum distance.

    DistanceHit closestHit

    [out] The closest hit.

    QueryInteraction queryInteraction

    (Optional) The query interaction.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Implements
    IAspectQueryable.CalculateDistance(in ColliderAspect, float, out DistanceHit, QueryInteraction)

    CalculateDistance(in ColliderAspect, float, ref NativeList<DistanceHit>, QueryInteraction)

    Calculates the distance from an aspect.

    Declaration
    public bool CalculateDistance(in ColliderAspect colliderAspect, float maxDistance, ref NativeList<DistanceHit> allHits, QueryInteraction queryInteraction = QueryInteraction.Default)
    Parameters
    Type Name Description
    ColliderAspect colliderAspect

    The collider aspect.

    float maxDistance

    The maximum distance.

    NativeList<DistanceHit> allHits

    [in,out] all hits.

    QueryInteraction queryInteraction

    (Optional) The query interaction.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Implements
    IAspectQueryable.CalculateDistance(in ColliderAspect, float, ref NativeList<DistanceHit>, QueryInteraction)

    CalculateDistance<T>(in ColliderAspect, float, ref T, QueryInteraction)

    Calculates the distance from an aspect.

    Declaration
    public bool CalculateDistance<T>(in ColliderAspect colliderAspect, float maxDistance, ref T collector, QueryInteraction queryInteraction = QueryInteraction.Default) where T : struct, ICollector<DistanceHit>
    Parameters
    Type Name Description
    ColliderAspect colliderAspect

    The collider aspect.

    float maxDistance

    The maximum distance.

    T collector

    [in,out] The collector.

    QueryInteraction queryInteraction

    (Optional) The query interaction.

    Returns
    Type Description
    bool

    True if there is a hit, false otherwise.

    Type Parameters
    Name Description
    T

    Generic type parameter.

    Implements
    IAspectQueryable.CalculateDistance<T>(in ColliderAspect, float, ref T, QueryInteraction)
    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)