Struct RaycastHit | Unity Physics | 0.3.2-preview
docs.unity.cn
    Show / Hide Table of Contents

    Struct RaycastHit

    A struct representing the hit from a RaycastQuery.

    Namespace: Unity.Physics
    Syntax
    public struct RaycastHit : IQueryResult

    Properties

    ColliderKey

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

    Returns ColliderKey of queried leaf collider

    Implements
    IQueryResult.ColliderKey

    Entity

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

    Returns Entity of queried body

    Implements
    IQueryResult.Entity

    Fraction

    Fraction of the distance along the Ray where the hit occurred.

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

    Returns a value between 0 and 1.

    Implements
    IQueryResult.Fraction

    Position

    The point in query space where the hit occurred.

    Declaration
    public float3 Position { get; set; }
    Property Value
    Type Description
    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
    float3

    Returns the normal of the point where the hit occurred.

    Back to top Copyright © 2020 Unity Technologies
    Generated by DocFX