docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method MatchOriginUpCameraForward

    MatchOriginUpCameraForward(Vector3, Vector3)

    This function will rotate the XR Origin object around the camera object using the destinationUp vector such that:

    • The camera will look at the area in the direction of the destinationForward
    • The projection of camera's forward vector on the plane with the normal destinationUp will be in the direction of destinationForward
    • The up vector of the XR Origin object will match the provided destinationUp vector (note that the camera's Up vector can not be manipulated)
    Declaration
    public bool MatchOriginUpCameraForward(Vector3 destinationUp, Vector3 destinationForward)
    Parameters
    Type Name Description
    Vector3 destinationUp

    The up vector that the origin's up vector will be matched to.

    Vector3 destinationForward

    The forward vector that will be matched to the projection of the camera's forward vector on the plane with the normal destinationUp.

    Returns
    Type Description
    bool

    Returns true if the rotation is performed. Otherwise, returns false.

    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)