docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class UnityQuaternionExtensions

    Extensions to the Quaternion class, used in various places by Cinemachine

    Inheritance
    object
    UnityQuaternionExtensions
    Inherited Members
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Unity.Cinemachine
    Assembly: solution.dll
    Syntax
    public static class UnityQuaternionExtensions

    Methods

    Name Description
    ApplyCameraRotation(Quaternion, Vector2, Vector3)

    Apply rotations, first about world up, then about (travelling) local right. rot.y is rotation about worldUp, and rot.x is second rotation, about local right.

    GetCameraRotationToTarget(Quaternion, Vector3, Vector3)

    Get the rotations, first about world up, then about (travelling) local right, necessary to align the quaternion's forward with the target direction. This represents the tripod head movement needed to look at the target. This formulation makes it easy to interpolate without introducing spurious roll.

    SlerpWithReferenceUp(Quaternion, Quaternion, float, Vector3)

    This is a slerp that mimics a camera operator's movement in that it chooses a path that avoids the lower hemisphere, as defined by the up param

    In This Article
    Back to top
    Copyright © 2023 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)