Class SmoothFloat
Calculates a 'smooth' values of a float based on history. 1d-version of the PhysicsTracker
Namespace: UnityEditor.Experimental.EditorVR.Helpers
Syntax
public class SmoothFloat
Properties
predictedValue
Declaration
public float predictedValue { get; }
Property Value
Type | Description |
---|---|
Single |
speed
Declaration
public float speed { get; }
Property Value
Type | Description |
---|---|
Single |
Methods
Reset(Single)
Sets the Smoothed Float value to a 'known' linear state
Declaration
public void Reset(float currentValue)
Parameters
Type | Name | Description |
---|---|---|
Single | currentValue | The expected value that the Smoothed Float should have and predict to have until new updates |
Update(Single, Single)
Takes in a new raw value to determine the smoothed value
Declaration
public void Update(float newValue, float timeSlice)
Parameters
Type | Name | Description |
---|---|---|
Single | newValue | The 'raw' up to date value we are tracking |
Single | timeSlice | How much time has passed since the last update |