docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method RayLineDistance

    RayLineDistance(float3, float3, float3, float3)

    Returns the shortest distance between a ray and line segment as a direction and magnitude.

    Declaration
    public static float3 RayLineDistance(float3 ro, float3 rd, float3 a, float3 b)
    Parameters
    Type Name Description
    float3 ro

    The ray origin point.

    float3 rd

    The ray direction (normalized vector).

    float3 a

    The line start point.

    float3 b

    The line end point.

    Returns
    Type Description
    float3

    Returns the shortest distance between a ray and line segment as a direction and magnitude.

    In This Article
    Back to top
    Copyright © 2024 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)