docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class UnityVectorExtensions

    Extensions to the Vector3 class, used by Cinemachine

    Inheritance
    object
    UnityVectorExtensions
    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 UnityVectorExtensions

    Fields

    Name Description
    Epsilon

    A useful Epsilon

    Methods

    Name Description
    Abs(Vector2)

    Component-wise absolute value

    Abs(Vector3)

    Component-wise absolute value

    AlmostZero(Vector3)

    Is the vector within Epsilon of zero length?

    Angle(Vector3, Vector3)

    Much more stable for small angles than Unity's native implementation

    ClosestPointOnSegment(Vector2, Vector2, Vector2)

    Get the closest point on a line segment.

    ClosestPointOnSegment(Vector3, Vector3, Vector3)

    Get the closest point on a line segment.

    FindIntersection(in Vector2, in Vector2, in Vector2, in Vector2, out Vector2)

    Calculates the intersection point defined by line_1 [p1, p2], and line_2 [q1, q2].

    IsNaN(Vector2)

    Checks if the Vector2 contains NaN for x or y.

    IsNaN(Vector3)

    Checks if the Vector2 contains NaN for x or y.

    IsUniform(Vector2)

    Checks whether the vector components are the same value.

    IsUniform(Vector3)

    Checks whether the vector components are the same value.

    NormalizeAngle(float)

    Put euler angle in the range of -180...180

    ProjectOntoPlane(Vector3, Vector3)

    Returns a non-normalized projection of the supplied vector onto a plane as described by its normal

    SafeFromToRotation(Vector3, Vector3, Vector3)

    Much more stable for small angles than Unity's native implementation

    SignedAngle(Vector3, Vector3, Vector3)

    Much more stable for small angles than Unity's native implementation

    SlerpWithReferenceUp(Vector3, Vector3, 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

    SquareNormalize(Vector2)

    Normalized the vector onto the unit square instead of the unit circle

    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)