docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method OrientedMinimumBoundingBox2D

    OrientedMinimumBoundingBox2D(List<Vector3>, Vector3[])

    Find the oriented minimum bounding box for a 2D convex hull.

    Declaration
    public static Vector2 OrientedMinimumBoundingBox2D(List<Vector3> convexHull, Vector3[] boundingBox)
    Parameters
    Type Name Description
    List<Vector3> convexHull

    The list of all points in a 2D convex hull on the X and Z axes, in a clockwise winding order.

    Vector3[] boundingBox

    An array of length 4 to fill with the vertex positions of the bounding box, in the order { top left, bottom left, bottom right, top right }.

    Returns
    Type Description
    Vector2

    The size of the bounding box on each axis. Y here maps to the Z axis.

    Remarks

    This implements the 'rotating calipers' algorithm and operates in linear time. Operates only on the X and Z axes of the input.

    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)