Class ShakeVelocityTracker | Unity Reflect | 1.1.0-preview.6
docs.unity3d.com
    Show / Hide Table of Contents

    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

    Inheritance
    Object
    ShakeVelocityTracker
    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

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023