Struct CinemachineImpulseListener.ImpulseReaction
This controls the secondary reaction of the listener to the incoming impulse.
The impulse might be for example a sharp shock, and the secondary reaction could
be a vibration whose amplitude and duration is controlled by the size of the
original impulse. This allows different listeners to respond in different ways
to the same impulse signal.
Inherited Members
Namespace: Unity.Cinemachine
Assembly: Unity.Cinemachine.dll
Syntax
[Serializable]
public struct CinemachineImpulseListener.ImpulseReaction
Fields
AmplitudeGain
Gain to apply to the amplitudes defined in the signal source asset.
Declaration
[Tooltip("Gain to apply to the amplitudes defined in the signal source. 1 is normal. Setting this to 0 completely mutes the signal.")]
[FormerlySerializedAs("m_AmplitudeGain")]
public float AmplitudeGain
Field Value
Type | Description |
---|---|
float |
Duration
How long the secondary reaction lasts.
Declaration
[Tooltip("How long the secondary reaction lasts.")]
[FormerlySerializedAs("m_Duration")]
public float Duration
Field Value
Type | Description |
---|---|
float |
FrequencyGain
Scale factor to apply to the time axis.
Declaration
[Tooltip("Scale factor to apply to the time axis. 1 is normal. Larger magnitudes will make the signal progress more rapidly.")]
[FormerlySerializedAs("m_FrequencyGain")]
public float FrequencyGain
Field Value
Type | Description |
---|---|
float |
m_SecondaryNoise
Secondary shake that will be triggered by the primary impulse
Declaration
[Tooltip("Secondary shake that will be triggered by the primary impulse.")]
public NoiseSettings m_SecondaryNoise
Field Value
Type | Description |
---|---|
NoiseSettings |
Methods
GetReaction(float, Vector3, out Vector3, out Quaternion)
Get the rection effect for a given impulse at a given time.
Declaration
public bool GetReaction(float deltaTime, Vector3 impulsePos, out Vector3 pos, out Quaternion rot)
Parameters
Type | Name | Description |
---|---|---|
float | deltaTime | Current time interval |
Vector3 | impulsePos | The input impulse signal at this time |
Vector3 | pos | output reaction position delta |
Quaternion | rot | output reaction rotation delta |
Returns
Type | Description |
---|---|
bool | True if there is a reaction effect, false otherwise |
ReSeed()
Generate a new random seed
Declaration
public void ReSeed()