> ## 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.

# SetRumbleState

> SetRumbleState

# SetRumbleState

デバイス上の 4 つの振動モーターの目的の強度を設定します。

## 構文

```cpp theme={null}
void SetRumbleState(
    const GameInputRumbleParams* params
);
```

### パラメーター

*params*   \_In\_opt\_\
型: [GameInputRumbleParams\*](/reference/input/gameinput/structs/gameinputrumbleparams)

各振動モーターの目的の強度を格納する構造体です。振動モーターの強度は 0.0 から 1.0 の範囲です。

### 戻り値

型: void

## 解説

`SetRumbleState` メソッドは、デバイス上の 4 つの振動モーターの目的の強度を設定します。他の種類のフィードバックと同様に、アプリケーションはいつでもこれを呼び出せますが、アプリケーションがフォーカスされている間のみデバイスに適用されます。

できるだけシンプルに保つため、アプリケーションはデバイスがどの振動モーターをサポートしているかを確認する必要はなく、4 つすべてのモーターの強度を指定してもかまいません。デバイスに 4 つのモーターのいずれかがない場合、GameInput の実装は、ユーザーが依然として何らかのフィードバックを感じられるように、他のモーターに強度を上乗せして適応を試みます。たとえば、トリガー バイブレーション値は、高周波バイブレーション モーターに少量のバイブレーション強度を追加することで、2 モーターのゲームパッド上でエミュレートされます。

切断されたデバイス、または振動モーターのないデバイスで `SetRumbleState` メソッドを呼び出しても効果はありません。モーター強度の値は \[0.0, 1.0] の範囲です。この範囲外の値が指定された場合は、最も近い有効な値にクランプされます。

## 要件

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

[GameInput の概要](/build/core-features/common/input/overviews/input-overview)\
[GameInputRumbleParams](/reference/input/gameinput/structs/gameinputrumbleparams)\
[IGameInputDevice](/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice)

## バージョン履歴

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


## Related topics

- [IGameInput::GetCurrentTimestamp](/ja-jp/reference/input/gameinput/interfaces/igameinput/methods/igameinput_getcurrenttimestamp.md)
- [XInput から GameInput への移植](/ja-jp/build/core-features/common/input/porting/input-porting-xinput.md)
- [GameInputRumbleMotors](/ja-jp/reference/input/gameinput/enums/gameinputrumblemotors.md)
- [SetPipelineState](/ja-jp/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_setpipelinestate_public.md)
- [XInputSetState](/ja-jp/reference/input/xinputongameinput/functions/xinputsetstate.md)
