> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInputDevice::SetForceFeedbackMotorGain

> IGameInputDevice::SetForceFeedbackMotorGain

# IGameInputDevice::SetForceFeedbackMotorGain

对电机上所有已加载的效果应用一个全局衰减因子。

## 语法

```cpp theme={null}
void SetForceFeedbackMotorGain(
    uint32_t motorIndex,
    float masterGain
);
```

### 参数

\u0001\u0001\u0001*motorIndex*   \_In\_\
类型:uint32\_t

要变更的电机索引。

*masterGain*   \_In\_\
类型:float

对电机上所有已加载效果的全局衰减因子，取值范围为 0.0 到 1.0。

### 返回值

无。

## 注解

此方法对电机上所有已加载的效果应用一个全局衰减因子。`masterGain` 指针接受 0.0 到 1.0 之间的值。此值用于应用程序的力反馈强度设置。有关更多信息，请参见 [GameInput 概述](/build/core-features/common/input/overviews/input-overview)。

## 要求

**头文件:** GameInput.h

[GameInput](/reference/input/gameinput/gameinput_members)\
[IGameInputDevice](/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice)

## 版本历史

| 版本     | 变更  |
| ------ | --- |
| **v0** | 引入。 |


## Related topics

- [IGameInputDevice::SetHapticMotorState](/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_sethapticmotorstate.md)
- [IGameInputForceFeedbackEffect::SetGain](/zh-CN/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_setgain.md)
- [IGameInputForceFeedbackEffect::GetGain](/zh-CN/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_getgain.md)
- [IsForceFeedbackMotorPoweredOn](/zh-CN/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_isforcefeedbackmotorpoweredon.md)
- [GameInputHapticFeedbackParams](/zh-CN/reference/input/gameinput/deprecated/structs/gameinputhapticfeedbackparams.md)
