docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method ConvexHull2D

    ConvexHull2D(List<Vector3>, List<Vector3>)

    Finds the smallest convex polygon in the XZ plane that contains points.

    Declaration
    public static bool ConvexHull2D(List<Vector3> points, List<Vector3> hull)
    Parameters
    Type Name Description
    List<Vector3> points

    Points used to find the convex hull. The y coordinates of these points are ignored.

    List<Vector3> hull

    The vertices that define the smallest convex polygon are assigned to this list. The list is not cleared.

    Returns
    Type Description
    bool

    True if points has at least 3 elements, false otherwise.

    Remarks

    Based on algorithm outlined in Gift Wrapping Convex Hull Algorithm With Unity Implementation.

    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)