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
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 |
---|---|
System.Int32 |
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 |
---|---|
System.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_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 |
---|---|
System.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 |
---|---|
System.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 |
---|---|
System.Boolean |
Methods
Cancel(Single, Boolean)
Cancel the event at the supplied time
Declaration
public void Cancel(float time, bool forceNoDecay)
Parameters
Type | Name | Description |
---|---|---|
System.Single | time | The time at which to cancel the event |
System.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 |
---|---|---|
System.Single | distance |
Returns
Type | Description |
---|---|
System.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 |
System.Boolean | use2D | True if distance calculation should ignore Z |
Vector3 | pos | The position impulse signal |
Quaternion | rot | The rotation impulse signal |
Returns
Type | Description |
---|---|
System.Boolean | true if non-trivial signal is returned |