Class ShakeVelocityTracker
Helper class that tracks an object's shaking velocity over a period of time This is calculated by distance traveled vs. total range of motion
Namespace: UnityEditor.Experimental.EditorVR.Helpers
Syntax
[Serializable]
public class ShakeVelocityTracker
Properties
shakeAxis
The direction this object is shaking in this frame
Declaration
public Vector3 shakeAxis { get; }
Property Value
Type | Description |
---|---|
Vector3 |
shakeStrength
How powerful of a shake an object is experiencing this frame
Declaration
public float shakeStrength { get; }
Property Value
Type | Description |
---|---|
Single |
Methods
ForceChangePosition(Vector3)
Clear the buffer and set a new position
Declaration
public void ForceChangePosition(Vector3 newPosition)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | newPosition | The new position |
Initialize(Vector3)
Initializes the shake tracker's history storage and stabilizes it at its current position
Declaration
public void Initialize(Vector3 startPoint)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | startPoint |
Update(Vector3, Single)
Based on new position data, calculates how much shake this object is currently experiencing
Declaration
public void Update(Vector3 newPosition, float timeSlice)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | newPosition | The new position of this shaken object |
Single | timeSlice | How much time has passed to get to this new position |