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

# IGameInputDevice::GetForceFeedbackMotorInfo

> 지원되는 축 및 효과 유형과 같은 장치의 포스 피드백 모터에 대한 정보를 검색합니다.

지원되는 축 및 효과 유형과 같은 장치의 포스 피드백 모터에 대한 정보를 검색합니다.

## 구문

```cpp theme={null}
uint32_t GetForceFeedbackMotorInfo(
    uint32_t infoArrayCount,
    GameInputForceFeedbackMotorInfo* infoArray
);
```

### 매개변수

*infoArrayCount*   \_In\_\
형식: uint32\_t

*infoArray*의 요소 수입니다. 모든 포스 피드백 모터를 검색하려면 [GetForceFeedbackMotorCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorcount.md)가 반환하는 값을 전달하세요.

*infoArray*   \_Out\_writes\_to\_opt\_(infoArrayCount, return)\
형식: [GameInputForceFeedbackMotorInfo](https://docs.xbox.com/ko/reference/input/gameinput/structs/gameinputforcefeedbackmotorinfo.md)\*

포스 피드백 모터당 하나의 구조체를 받는 배열에 대한 포인터입니다. `nullptr`일 수 있으며, 이 경우 아무것도 기록되지 않고 메서드는 0을 반환합니다.

### 반환값

형식: uint32\_t

*infoArray*에 기록된 요소 수입니다. *infoArrayCount*와 장치의 포스 피드백 모터 수 중 작은 값이며, *infoArray*가 `nullptr`이거나 장치에 포스 피드백 모터가 없으면 0입니다.

## 설명

각 요소는 해당 모터가 구동하는 축과 모터가 지원하는 포스 피드백 효과 유형을 설명하는 [GameInputForceFeedbackMotorInfo](https://docs.xbox.com/ko/reference/input/gameinput/structs/gameinputforcefeedbackmotorinfo.md) 구조체입니다.

[GetForceFeedbackMotorCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorcount.md)를 호출하여 포스 피드백 모터 수를 가져오고, 해당 크기의 배열을 할당한 다음, `GetForceFeedbackMotorInfo`를 호출하여 배열을 채우세요. *infoArrayCount*가 포스 피드백 모터 수보다 작으면 처음 *infoArrayCount*개의 요소만 기록됩니다. 장치의 포스 피드백 모터는 장치가 연결되어 있는 동안 변경되지 않으므로 한 번 쿼리하고 결과를 캐시할 수 있습니다.

정보 배열의 요소 *i*는 모터 인덱스가 *i*인 모터를 설명합니다. 이 인덱스를 [CreateForceFeedbackEffect](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createforcefeedbackeffect.md), [IsForceFeedbackMotorPoweredOn](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_isforcefeedbackmotorpoweredon.md) 및 [SetForceFeedbackMotorGain](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md)의 *motorIndex* 매개변수로 사용하세요.

다음 예제는 장치의 포스 피드백 모터를 검색하는 방법을 보여줍니다.

```cpp theme={null}
uint32_t motorCount = device->GetForceFeedbackMotorCount();
std::vector<GameInputForceFeedbackMotorInfo> motorInfo(motorCount);
motorInfo.resize(device->GetForceFeedbackMotorInfo(motorCount, motorInfo.data()));

for (uint32_t motorIndex = 0; motorIndex < motorInfo.size(); ++motorIndex)
{
    if (motorInfo[motorIndex].isConstantEffectSupported)
    {
        GameInputForceFeedbackParams params = {};
        params.kind = GameInputForceFeedbackConstant;
        // Fill in the remaining effect parameters...

        Microsoft::WRL::ComPtr<IGameInputForceFeedbackEffect> effect;
        device->CreateForceFeedbackEffect(motorIndex, &params, &effect);
    }
}
```

GameInput v3 이하에서는 [IGameInputDevice::GetDeviceInfo](https://docs.xbox.com/ko/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getdeviceinfo.md)가 반환하는 [GameInputDeviceInfo](https://docs.xbox.com/ko/reference/input/gameinput/deprecated/structs/gameinputdeviceinfo.md) 구조체의 `forceFeedbackMotorInfo` 멤버에서 이 정보를 얻을 수 있었습니다.

## 요구 사항

**헤더:** GameInput.h

**라이브러리:** gameinput.lib

**지원되는 플랫폼:** Windows, XBOX One 제품군 콘솔 및 XBOX Series 콘솔

## 함께 보기

[GameInput 개요](https://docs.xbox.com/ko/build/core-features/common/input/overviews/input-overview.md)\
[GetForceFeedbackMotorCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorcount.md)\
[GameInputForceFeedbackMotorInfo](https://docs.xbox.com/ko/reference/input/gameinput/structs/gameinputforcefeedbackmotorinfo.md)\
[CreateForceFeedbackEffect](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_createforcefeedbackeffect.md)\
[IsForceFeedbackMotorPoweredOn](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_isforcefeedbackmotorpoweredon.md)\
[SetForceFeedbackMotorGain](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_setforcefeedbackmotorgain.md)\
[GameInput의 포스 피드백](https://docs.xbox.com/ko/build/core-features/common/input/advanced/input-forcefeedback.md)\
[IGameInputDevice](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/igameinputdevice.md)

## 버전 기록

| 버전 | 변경 사항 |
| - | - |
| **v4** | 도입됨. |


## Related topics

- [GameInputForceFeedbackMotorInfo](https://docs.xbox.com/ko/reference/input/gameinput/structs/gameinputforcefeedbackmotorinfo.md)
- [GameInputFeedbackAxes](https://docs.xbox.com/ko/reference/input/gameinput/enums/gameinputfeedbackaxes.md)
- [GameInput의 포스 피드백](https://docs.xbox.com/ko/build/core-features/common/input/advanced/input-forcefeedback.md)
- [IGameInputDevice::GetForceFeedbackMotorCount](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputdevice/methods/igameinputdevice_getforcefeedbackmotorcount.md)
- [IGameInputForceFeedbackEffect::GetDevice](https://docs.xbox.com/ko/reference/input/gameinput/interfaces/igameinputforcefeedbackeffect/methods/igameinputforcefeedbackeffect_getdevice.md)
