pmndrs / xr

🤳 VR/AR for react-three-fiber
https://pmndrs.github.io/xr/docs/
Other
2.17k stars 155 forks source link

Update XRInputSourceStateMap types #339

Closed Ledzz closed 2 months ago

Ledzz commented 2 months ago

The types are not including gamepad (however it shows up in console).

bbohlender commented 2 months ago

gamepad is part of the XRControllerState and not its own XRInputSource

Ledzz commented 2 months ago

so you mean it should be like this?

export type XRInputSourceState = XRInputSourceStateMap[keyof XRInputSourceStateMap] & { gamepad: XRControllerGamepadState};
bbohlender commented 2 months ago

gamepad is only loaded on the XRController and its already on the XRControllerState see here: https://github.com/pmndrs/xr/blob/0b5d334e5b726368b5cf79d5f22cd8bd963425e3/packages/xr/src/input.ts#L35

Ledzz commented 2 months ago

Aw, I get it, I confused types.Thank you!