docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method PointInPolygon3D

    PointInPolygon3D(Vector3, List<Vector3>)

    Determines if a point is inside of a convex polygon and lies on the surface.

    Declaration
    public static bool PointInPolygon3D(Vector3 testPoint, List<Vector3> vertices)
    Parameters
    Type Name Description
    Vector3 testPoint

    The point to test.

    List<Vector3> vertices

    Vertices defining the outline of the polygon. The polygon must be convex. The vertices must be coplanar, but can lie on any arbitrary plane.

    Returns
    Type Description
    bool

    True if the point is inside the polygon and coplanar, false otherwise.

    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)