Struct DistanceHit | Unity Physics | 0.5.1-preview.2
docs.unity3d.com
    Show / Hide Table of Contents

    Struct DistanceHit

    Namespace: Unity.Physics
    Syntax
    public struct DistanceHit : IQueryResult

    Properties

    ColliderKey

    Declaration
    public ColliderKey ColliderKey { get; set; }
    Property Value
    Type Description
    ColliderKey

    Returns ColliderKey of queried leaf collider

    Implements
    IQueryResult.ColliderKey

    Distance

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

    Distance at which the hit occurred.

    Entity

    Declaration
    public Entity Entity { get; set; }
    Property Value
    Type Description
    Entity

    Returns Entity of queried body

    Implements
    IQueryResult.Entity

    Fraction

    Fraction in distance queries represents the actual distance where the hit occurred, NOT the percentage of max distance

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

    Distance at which the hit occurred.

    Implements
    IQueryResult.Fraction

    Position

    The point in query space where the hit occurred.

    Declaration
    public float3 Position { get; set; }
    Property Value
    Type Description
    Unity.Mathematics.float3

    Returns the position of the point where the hit occurred.

    RigidBodyIndex

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

    Returns RigidBodyIndex of queried body.

    Implements
    IQueryResult.RigidBodyIndex

    SurfaceNormal

    Declaration
    public float3 SurfaceNormal { get; set; }
    Property Value
    Type Description
    Unity.Mathematics.float3

    Returns the normal of the point where the hit occurred.

    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