docs.unity.cn
    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
    Namespace: Unity.Cinemachine
    Syntax
    [Obsolete]
    public class HeadingTracker

    Constructors

    HeadingTracker(Int32)

    Construct a heading tracker with a given filter size

    Declaration
    public HeadingTracker(int filterSize)
    Parameters
    Type Name Description
    Int32 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
    Int32

    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

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Saturday, May 6, 2023