docs.unity3d.com
    Show / Hide Table of Contents

    Class Damper

    Utility to perform realistic damping of float or Vector3 values. The algorithm is based on exponentially decaying the delta until only a negligible amount remains.

    Inheritance
    Object
    Damper
    Namespace: Cinemachine.Utility
    Syntax
    public static class Damper

    Fields

    kNegligibleResidual

    Standard residual

    Declaration
    public const float kNegligibleResidual = 0.01F
    Field Value
    Type Description
    Single

    Methods

    Damp(Single, Single, Single)

    Get a damped version of a quantity. This is the portion of the quantity that will take effect over the given time.

    Declaration
    public static float Damp(float initial, float dampTime, float deltaTime)
    Parameters
    Type Name Description
    Single initial

    The amount that will be damped

    Single dampTime

    The rate of damping. This is the time it would take to reduce the original amount to a negligible percentage

    Single deltaTime

    The time over which to damp

    Returns
    Type Description
    Single

    The damped amount. This will be the original amount scaled by a value between 0 and 1.

    Damp(Vector3, Single, Single)

    Get a damped version of a quantity. This is the portion of the quantity that will take effect over the given time.

    Declaration
    public static Vector3 Damp(Vector3 initial, float dampTime, float deltaTime)
    Parameters
    Type Name Description
    Vector3 initial

    The amount that will be damped

    Single dampTime

    The rate of damping. This is the time it would take to reduce the original amount to a negligible percentage

    Single deltaTime

    The time over which to damp

    Returns
    Type Description
    Vector3

    The damped amount. This will be the original amount scaled by a value between 0 and 1.

    Damp(Vector3, Vector3, Single)

    Get a damped version of a quantity. This is the portion of the quantity that will take effect over the given time.

    Declaration
    public static Vector3 Damp(Vector3 initial, Vector3 dampTime, float deltaTime)
    Parameters
    Type Name Description
    Vector3 initial

    The amount that will be damped

    Vector3 dampTime

    The rate of damping. This is the time it would take to reduce the original amount to a negligible percentage

    Single deltaTime

    The time over which to damp

    Returns
    Type Description
    Vector3

    The damped amount. This will be the original amount scaled by a value between 0 and 1.

    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