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.
Namespace: Cinemachine
Syntax
public class ImpulseEvent
Fields
m_Channel
Channels on which this event will broadcast its signal.
Declaration
public int m_Channel
Field Value
Type | Description |
---|---|
Int32 |
m_CustomDissipation
How the effect fades with distance. 0 = no dissipation, 1 = rapid dissipation, -1 = off (legacy mode)
Declaration
public float m_CustomDissipation
Field Value
Type | Description |
---|---|
Single |
m_DirectionMode
How the signal direction behaves as the listener moves away from the source.
Declaration
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
public float m_DissipationDistance
Field Value
Type | Description |
---|---|
Single |
m_DissipationMode
How the signal dissipates with distance.
Declaration
public CinemachineImpulseManager.ImpulseEvent.DissipationMode m_DissipationMode
Field Value
Type | Description |
---|---|
CinemachineImpulseManager.ImpulseEvent.DissipationMode |
m_Envelope
Time-envelope of the signal.
Declaration
public CinemachineImpulseManager.EnvelopeDefinition m_Envelope
Field Value
Type | Description |
---|---|
CinemachineImpulseManager.EnvelopeDefinition |
m_Position
Worldspace origin of the signal.
Declaration
public Vector3 m_Position
Field Value
Type | Description |
---|---|
Vector3 |
m_PropagationSpeed
The speed (m/s) at which the impulse propagates through space. High speeds allow listeners to react instantaneously, while slower speeds allow listeres in the scene to react as if to a wave spreading from the source.
Declaration
public float m_PropagationSpeed
Field Value
Type | Description |
---|---|
Single |
m_Radius
Radius around the signal origin that has full signal value. Distance dissipation begins after this distance.
Declaration
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
public ISignalSource6D m_SignalSource
Field Value
Type | Description |
---|---|
ISignalSource6D |
m_StartTime
Start time of the event.
Declaration
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 | The distance over which to perform the decay |
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 |