docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method ClosestPointOnLineSegment

    ClosestPointOnLineSegment(Vector3, Vector3, Vector3)

    Returns the point along a line segment closest to a given point.

    Declaration
    public static Vector3 ClosestPointOnLineSegment(Vector3 point, Vector3 a, Vector3 b)
    Parameters
    Type Name Description
    Vector3 point

    The point to test against the line segment.

    Vector3 a

    The first point of the line segment.

    Vector3 b

    The second point of the line segment.

    Returns
    Type Description
    Vector3

    The point along the line segment closest to point.

    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)