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

# IGameInputForceFeedbackEffect::SetGain

> IGameInputForceFeedbackEffect::SetGain

# IGameInputForceFeedbackEffect::SetGain

フォース フィードバック エフェクトのゲインを設定します。

## 構文

```cpp theme={null}
void SetGain(
    float gain
);
```

### パラメーター

*gain*   \_In\_\
型: float

フォース フィードバック エフェクトに適用する新しいゲインです。

### 戻り値

なし

## 解説

フォース フィードバック モーターのゲインは、0.0 から 1.0 の範囲の値を取ります。

フォース フィードバック エフェクトの強度に影響する 2 種類のゲインがあります。1 つは [IGameInputDevice::SetForceFeedbackMotorGain](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md) によってモーターに設定されるゲインで、もう 1 つはこの関数によってエフェクト自体に設定されるゲインです。

2 つのゲインの効果は乗算されます。エフェクトのゲインが 0.5 に設定され、モーターのマスター ゲインが 0.5 に設定されている場合、エフェクトは 0.25 の強度で再生されます。詳細については、「[GameInput の高度なトピック](https://docs.xbox.com/ja-jp/build/core-features/common/input/advanced/input-advanced-topics.md)」を参照してください。

## 要件

**ヘッダー:** GameInput.h

[GameInput の概要](https://docs.xbox.com/ja-jp/build/core-features/common/input/overviews/input-overview.md)\
[IGameInputForceFeedbackEffect::GetGain](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_getgain.md)\
[IGameInputDevice::SetForceFeedbackMotorGain](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md)\
[IGameInputForceFeedbackEffect](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/igameinputforcefeedbackeffect.md)

## バージョン履歴

| バージョン | 変更点 |
| - | - |
| **v0** | 導入。 |


## Related topics

- [IGameInputForceFeedbackEffect::GetGain](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_getgain.md)
- [GameInput のフォースフィードバック](https://docs.xbox.com/ja-jp/build/core-features/common/input/advanced/input-forcefeedback.md)
- [IGameInputForceFeedbackEffect::SetState](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_setstate.md)
- [IGameInputForceFeedbackEffect::SetParams](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_setparams.md)
- [IGameInputForceFeedbackEffect::GetDevice](https://docs.xbox.com/ja-jp/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_getdevice.md)
