Class HeadingTracker
Tracks an object's velocity with a filter to determine a reasonably steady direction for the object's current trajectory.
Inherited Members
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 |