Class VibrationEffect
Dual-motor gamepad vibration. Wraps a FeedbackIntensity and reuses the existing FeedbackScaler so its behavior (and tests) are unchanged.
Implements
Inherited Members
Namespace: Serenity.Feedback.Application.Effects
Assembly: Serenity.Feedback.Application.dll
Syntax
public sealed class VibrationEffect : IFeedbackEffect
Constructors
VibrationEffect(FeedbackIntensity, bool)
Initializes a new instance from a FeedbackIntensity.
Declaration
public VibrationEffect(FeedbackIntensity intensity, bool haveExitTime = true)
Parameters
| Type | Name | Description |
|---|---|---|
| FeedbackIntensity | intensity | |
| bool | haveExitTime |
VibrationEffect(float, float, float, bool)
Initializes a new instance from raw amplitudes and duration.
Declaration
public VibrationEffect(float low, float high, float durationSeconds, bool haveExitTime = true)
Parameters
| Type | Name | Description |
|---|---|---|
| float | low | |
| float | high | |
| float | durationSeconds | |
| bool | haveExitTime |
Fields
HaveExitTime
Declaration
public readonly bool HaveExitTime
Field Value
| Type | Description |
|---|---|
| bool | When true the channel auto-stops the vibration after its duration; when false it persists until another effect overwrites it (e.g. a zero-intensity vibration). |
Intensity
Declaration
public readonly FeedbackIntensity Intensity
Field Value
| Type | Description |
|---|---|
| FeedbackIntensity | The motor impulse (low/high amplitudes + duration). |
Kind
Declaration
public const string Kind = "vibration"
Field Value
| Type | Description |
|---|---|
| string | Stable kind id for this effect. |
Properties
BypassesGlobalGate
Declaration
public bool BypassesGlobalGate { get; }
Property Value
| Type | Description |
|---|---|
| bool | When true, this effect ignores the global vibration enable/intensity settings — it is dispatched even when feedback is disabled and is never passed through Scaled(float). Reserved for non-haptic effects (e.g. audio) that must not be silenced or attenuated by the controller-vibration toggle. Haptic effects return false. |
EffectKind
Declaration
public string EffectKind { get; }
Property Value
| Type | Description |
|---|---|
| string | Stable identifier of the effect type (e.g. "vibration"). Used for logging/diagnostics. |
Methods
Scaled(float)
Returns a copy of this effect scaled by the global intensity multiplier (0..1).
Declaration
public IFeedbackEffect Scaled(float globalIntensity)
Parameters
| Type | Name | Description |
|---|---|---|
| float | globalIntensity | Global multiplier; values outside 0..1 are clamped by the effect. |
Returns
| Type | Description |
|---|---|
| IFeedbackEffect | A new, scaled effect of the same type. |