docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method PolygonCentroid2D

    PolygonCentroid2D(List<Vector3>)

    Given a list of vertices of a 2d convex polygon, find the centroid of the polygon. This implementation operates only on the X and Z axes.

    Declaration
    public static Vector3 PolygonCentroid2D(List<Vector3> vertices)
    Parameters
    Type Name Description
    List<Vector3> vertices

    Vertices defining the outline of a 2D polygon.

    Returns
    Type Description
    Vector3

    The centroid point for the polygon.

    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)