FHapticMix
Signal → envelope → motor mix, reusable by any gameplay feature that wants pad feel without writing its own smoothing (vehicles, weapons, impacts). The game thread sets signal values or fires one-shot kicks, calls Evaluate once a frame and hands the frame to InputManager::SetGamepadHaptics, which applies i.RumbleScale and the release watchdog. Contributions combine as 1 - prod(1 - x): several strong signals saturate towards full force instead of clipping, and one signal alone passes through unchanged.
- Module
- Input
- Header
#include "Input/GamepadHaptics.h"- Namespace
Mowo
Type aliases
| Alias | Description |
|---|---|
using FSignalHandle = int32_t |
Properties
| Type | Name | Description |
|---|---|---|
static constexpr FSignalHandle | kInvalidSignal | Default -1. |
Public functions
| Returns | Name | Description |
|---|---|---|
FSignalHandle | AddSignal | |
FSignalHandle | FindSignal | |
size_t | GetSignalCount | |
void | SetSignal | Level the signal holds until changed (0..1 after the threshold remap). |
bool | SetSignal | |
void | Kick | A one-shot kick on top of the level: the signal reads at least value for holdSeconds, then releases through its envelope (a gear shift, a landing, a hit). |
void | SetMasterGain | Overall multiplier, e.g. |
float | GetMasterGain | |
FGamepadHapticFrame | Evaluate | Advances every envelope by deltaSeconds and returns the motor frame. |
float | GetEnvelope | The envelope level of one signal after the last Evaluate (for debugging and tests). |
void | Reset | Silences every signal and envelope; the signal table stays. |
Function details
AddSignal
FSignalHandle AddSignal(const FHapticSignalDesc& desc)FindSignal
FSignalHandle FindSignal(std::string_view name) constGetSignalCount
size_t GetSignalCount() constSetSignal
void SetSignal(FSignalHandle signal, float value)Level the signal holds until changed (0..1 after the threshold remap).
SetSignal
bool SetSignal(std::string_view name, float value)Kick
void Kick(FSignalHandle signal, float value, float holdSeconds)A one-shot kick on top of the level: the signal reads at least value for holdSeconds, then releases through its envelope (a gear shift, a landing, a hit).
SetMasterGain
void SetMasterGain(float gain)Overall multiplier, e.g. a per-feature "haptics strength" option. i.RumbleScale is applied later by InputManager, on top of this.
GetMasterGain
float GetMasterGain() constEvaluate
FGamepadHapticFrame Evaluate(float deltaSeconds)Advances every envelope by deltaSeconds and returns the motor frame.
GetEnvelope
float GetEnvelope(FSignalHandle signal) constThe envelope level of one signal after the last Evaluate (for debugging and tests).
Reset
void Reset()Silences every signal and envelope; the signal table stays.