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

# GameInputForceFeedbackConditionParams

> GameInputForceFeedbackConditionParams

# GameInputForceFeedbackConditionParams

定義力回饋效果的某個物理特性。

## 語法

```cpp theme={null}
struct GameInputForceFeedbackConditionParams
{
    GameInputForceFeedbackMagnitude magnitude;
    float                           positiveCoefficient;
    float                           negativeCoefficient;
    float                           maxPositiveMagnitude;
    float                           maxNegativeMagnitude;
    float                           deadZone;
    float                           bias;
};
```

### 成員

*magnitude*<br />
類型：[GameInputForceFeedbackMagnitude](/zh-TW/reference/input/gameinput/structs/gameinputforcefeedbackmagnitude)

力回饋效果的強度。

*positiveCoefficient*<br />
類型：float

力回饋效果的正向乘數。

*negativeCoefficient*<br />
類型：float

力回饋效果的負向乘數。

*maxPositiveMagnitude*<br />
類型：float

效果在正方向上可產生的最大力量。

*maxNegativeMagnitude*<br />
類型：float

效果在負方向上可產生的最大力量。

*deadZone*<br />
類型：float

力回饋效果不會回應的區域。

*bias*<br />
類型：float

套用至力回饋效果的位移。

## 備註

`GameInputForceFeedbackConditionParams` 是 [GameInputForceFeedbackParams](/zh-TW/reference/input/gameinput/structs/gameinputforcefeedbackparams) 結構的成員。

`GameInputForceFeedbackConditionParams` 結構的語意會依條件式效果的特定類型而有所不同，但思考它們如何套用至常用的彈簧效果 `GameInputForceFeedbackSpring` 會有所幫助。在一般使用案例中，當玩家將方向盤向左或向右偏移時，此效果會嘗試讓方向盤回到中心。讓我們來看看 `GameInputForceFeedbackConditionParams` 參數如何驅動此行為。

方向盤的邏輯中心位置由 `bias` 決定。值為 `0.0` 對應自然置中的位置 (與左右兩端等距)，值為 `1.0` 會將方向盤的中心完全移到右側，而值為 `-1.0` 則會將方向盤的中心完全移到左側。

`deadZone` 決定方向盤在開始套用回饋之前，可以偏離邏輯中心向左或向右移動多少。值為 `0.0` 會在方向盤離開中心位置時立即觸發回饋，值為 `0.5` 會允許方向盤移動一半距離後才啟用回饋，而值為 `1.0` 則會完全停用回饋。

`positiveCoefficient` 和 `negativeCoefficient` 會搭配方向盤與其邏輯中心的距離使用，分別決定右方向和左方向回饋的方向與力量。對於彈簧效果，我們希望方向盤抵抗玩家的轉向，因此兩者都適合使用 `-1.0` 的值。請注意，如果提供正值，方向盤實際上會朝轉向的方向加速，而不是抵抗該動作。

`maxPositiveMagnitude` 和 `maxNegativeMagnitude` 分別限制此特定效果在正方向和負方向上可套用的最大力量。

`CreateForceFeedbackEffect` 方法會在馬達中為具有指定參數集的新力回饋效果配置硬體資源。它會傳回 `IGameInputForceFeedbackEffect` 執行個體以追蹤這些資源。如果硬體資源不足以建立效果，或硬體不支援要求的效果，則會傳回 `HRESULT` 錯誤。力回饋效果由其參數定義，並儲存在 `GameInputForceFeedbackParams` 結構中。

## 需求

**標頭：** GameInput.h

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 概念文件

* [GameInput 上的力回饋](/zh-TW/build/core-features/common/input/advanced/input-forcefeedback)

## 另請參閱

[GameInput 進階主題](/zh-TW/build/core-features/common/input/advanced/input-advanced-topics)<br />
[GameInput 概觀](/zh-TW/build/core-features/common/input/overviews/input-overview)<br />
[GameInput](/zh-TW/reference/input/gameinput/gameinput_members)

## 版本歷程記錄

| 版本 | 變更 |
| - | - |
| **v0** | 推出。 |


## Related topics

- [GameInputForceFeedbackConditionParams](/reference/input/gameinput/structs/gameinputforcefeedbackconditionparams.md)
- [GameInputForceFeedbackParams](/reference/input/gameinput/structs/gameinputforcefeedbackparams.md)
- [Force feedback on GameInput](/build/core-features/common/input/advanced/input-forcefeedback.md)
- [GameInputForceFeedbackMagnitude](/reference/input/gameinput/structs/gameinputforcefeedbackmagnitude.md)
- [Force feedback en GameInput](/es/build/core-features/common/input/advanced/input-forcefeedback.md)
