docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method RotationForBox

    RotationForBox(Vector3[])

    Given a 2D bounding box's vertices, find the rotation of the box.

    Declaration
    public static Quaternion RotationForBox(Vector3[] vertices)
    Parameters
    Type Name Description
    Vector3[] vertices

    The 4 vertices of the bounding box, in the order { top left, bottom left, bottom right, top right }.

    Returns
    Type Description
    Quaternion

    The rotation of the box, with the horizontal side aligned to the x axis and the vertical side aligned to the z axis

    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)