Class CinemachineImpulseManager.ImpulseEvent | Cinemachine | 2.5.0
docs.unity3d.com
    Show / Hide Table of Contents

    Class CinemachineImpulseManager.ImpulseEvent

    Describes an event that generates an impulse signal on one or more channels. The event has a location in space, a start time, a duration, and a signal. The signal will dissipate as the distance from the event location increases.

    Inheritance
    Object
    CinemachineImpulseManager.ImpulseEvent
    Namespace: Cinemachine
    Syntax
    public class ImpulseEvent

    Fields

    m_Channel

    Channels on which this event will broadcast its signal.

    Declaration
    [Tooltip("Channels on which this event will broadcast its signal.")]
    public int m_Channel
    Field Value
    Type Description
    Int32

    m_DirectionMode

    How the signal direction behaves as the listener moves away from the source.

    Declaration
    [Tooltip("How the signal direction behaves as the listener moves away from the source.")]
    public CinemachineImpulseManager.ImpulseEvent.DirectionMode m_DirectionMode
    Field Value
    Type Description
    CinemachineImpulseManager.ImpulseEvent.DirectionMode

    m_DissipationDistance

    Distance over which the dissipation occurs. Must be >= 0.

    Declaration
    [Tooltip("Distance over which the dissipation occurs.  Must be >= 0.")]
    public float m_DissipationDistance
    Field Value
    Type Description
    Single

    m_DissipationMode

    How the signal dissipates with distance.

    Declaration
    [Tooltip("How the signal dissipates with distance.")]
    public CinemachineImpulseManager.ImpulseEvent.DissipationMode m_DissipationMode
    Field Value
    Type Description
    CinemachineImpulseManager.ImpulseEvent.DissipationMode

    m_Envelope

    Time-envelope of the signal.

    Declaration
    [Tooltip("Time-envelope of the signal.")]
    public CinemachineImpulseManager.EnvelopeDefinition m_Envelope
    Field Value
    Type Description
    CinemachineImpulseManager.EnvelopeDefinition

    m_Position

    Worldspace origin of the signal.

    Declaration
    [Tooltip("Worldspace origin of the signal.")]
    public Vector3 m_Position
    Field Value
    Type Description
    Vector3

    m_Radius

    Radius around the signal origin that has full signal value. Distance dissipation begins after this distance.

    Declaration
    [Tooltip("Radius around the signal origin that has full signal value.  Distance dissipation begins after this distance.")]
    public float m_Radius
    Field Value
    Type Description
    Single

    m_SignalSource

    Raw signal source. The ouput of this will be scaled to fit in the envelope.

    Declaration
    [Tooltip("Raw signal source.  The ouput of this will be scaled to fit in the envelope.")]
    public ISignalSource6D m_SignalSource
    Field Value
    Type Description
    ISignalSource6D

    m_StartTime

    Start time of the event.

    Declaration
    [Tooltip("Start time of the event.")]
    public float m_StartTime
    Field Value
    Type Description
    Single

    Properties

    Expired

    Returns true if the event is no longer generating a signal because its time has expired

    Declaration
    public bool Expired { get; }
    Property Value
    Type Description
    Boolean

    Methods

    Cancel(Single, Boolean)

    Cancel the event at the supplied time

    Declaration
    public void Cancel(float time, bool forceNoDecay)
    Parameters
    Type Name Description
    Single time

    The time at which to cancel the event

    Boolean forceNoDecay

    If true, event will be cut immediately at the time, otherwise its envelope's decay curve will begin at the cancel time

    Clear()

    Reset the event to a default state

    Declaration
    public void Clear()

    DistanceDecay(Single)

    Calculate the the decay applicable at a given distance from the impact point

    Declaration
    public float DistanceDecay(float distance)
    Parameters
    Type Name Description
    Single distance
    Returns
    Type Description
    Single

    Scale factor 0...1

    GetDecayedSignal(Vector3, Boolean, out Vector3, out Quaternion)

    Get the signal that a listener at a given position would perceive

    Declaration
    public bool GetDecayedSignal(Vector3 listenerPosition, bool use2D, out Vector3 pos, out Quaternion rot)
    Parameters
    Type Name Description
    Vector3 listenerPosition

    The listener's position in world space

    Boolean use2D

    True if distance calculation should ignore Z

    Vector3 pos

    The position impulse signal

    Quaternion rot

    The rotation impulse signal

    Returns
    Type Description
    Boolean

    true if non-trivial signal is returned

    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