docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method FindClosestEdge

    FindClosestEdge(List<Vector3>, Vector3, out Vector3, out Vector3)

    Finds the side of a polygon closest to a specified world space position.

    Declaration
    public static bool FindClosestEdge(List<Vector3> vertices, Vector3 point, out Vector3 vertexA, out Vector3 vertexB)
    Parameters
    Type Name Description
    List<Vector3> vertices

    Vertices defining the outline of a polygon.

    Vector3 point

    The position in space to find the two closest outline vertices to.

    Vector3 vertexA

    The coordinates of the first vertex of the nearest side is assigned to this out parameter.

    Vector3 vertexB

    The coordinates of the second vertex of the nearest side is assigned to this out parameter.

    Returns
    Type Description
    bool

    True if a nearest edge could be found.

    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)