docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class HeadingTracker

    Tracks an object's velocity with a filter to determine a reasonably steady direction for the object's current trajectory.

    Inheritance
    object
    HeadingTracker
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Unity.Cinemachine
    Assembly: Unity.Cinemachine.dll
    Syntax
    [Obsolete]
    public class HeadingTracker

    Constructors

    HeadingTracker(int)

    Construct a heading tracker with a given filter size

    Declaration
    public HeadingTracker(int filterSize)
    Parameters
    Type Name Description
    int filterSize

    The size of the filter. The larger the filter, the more constanct (and laggy) is the heading. 30 is pretty big.

    Properties

    FilterSize

    Get the current filter size

    Declaration
    public int FilterSize { get; }
    Property Value
    Type Description
    int

    Methods

    Add(Vector3)

    Add a new velocity frame. This should be called once per frame, unless the velocity is zero

    Declaration
    public void Add(Vector3 velocity)
    Parameters
    Type Name Description
    Vector3 velocity

    The object's velocity this frame

    DecayHistory()

    Decay the history. This should be called every frame.

    Declaration
    public void DecayHistory()

    GetReliableHeading()

    Get the filtered heading.

    Declaration
    public Vector3 GetReliableHeading()
    Returns
    Type Description
    Vector3

    The filtered direction of motion

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