docs.unity3d.com
    Show / Hide Table of Contents

    Struct ClosestHitCollector<T>

    A collector which stores only the closest hit.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    ValueType.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.Physics
    Syntax
    public struct ClosestHitCollector<T> : ICollector<T> where T : struct, IQueryResult
    Type Parameters
    Name Description
    T

    Generic type parameter.

    Constructors

    ClosestHitCollector(Single)

    Constructor.

    Declaration
    public ClosestHitCollector(float maxFraction)
    Parameters
    Type Name Description
    Single maxFraction

    The maximum fraction.

    Properties

    ClosestHit

    Gets the closest hit.

    Declaration
    public readonly T ClosestHit { get; }
    Property Value
    Type Description
    T

    The closest hit.

    EarlyOutOnFirstHit

    Gets a value indicating whether the early out on first hit.

    Declaration
    public readonly bool EarlyOutOnFirstHit { get; }
    Property Value
    Type Description
    Boolean

    False.

    Implements
    ICollector<T>.EarlyOutOnFirstHit

    MaxFraction

    Gets or sets the maximum fraction.

    Declaration
    public float MaxFraction { get; }
    Property Value
    Type Description
    Single

    The maximum fraction.

    Implements
    ICollector<T>.MaxFraction

    NumHits

    Gets the number of hits.

    Declaration
    public int NumHits { get; }
    Property Value
    Type Description
    Int32

    The total number of hits (0 or 1).

    Implements
    ICollector<T>.NumHits

    Methods

    AddHit(T)

    Adds a hit.

    Declaration
    public bool AddHit(T hit)
    Parameters
    Type Name Description
    T hit

    The hit.

    Returns
    Type Description
    Boolean

    True.

    Implements
    ICollector<T>.AddHit(T)
    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