libretro: add Wiimote IR passthrough - #471
Open
XenuIsWatching wants to merge 1 commit into
Open
Conversation
Adds dolphin_ir_passthrough, letting the frontend supply the Wiimote
camera's view of the sensor bar directly instead of having the core
synthesise it from a cursor position.
The cursor path cannot be made exact, and it is worth saying why. It
parks a notional remote two metres from the bar and rotates it by
Total Yaw / Total Pitch, a scale with no physical derivation, then
CameraLogic projects the LEDs through that. Where the game finally draws
its hand therefore depends on a constant fitted per game, which is what
Dolphin's own "defaults chosen to reach screen edges in most games" is
admitting. It also cannot express roll or distance at all: two angles
have nowhere to put them.
A frontend that knows the real geometry, a VR room, a tracked light gun
, can compute the two dots outright and get all of that for free, which
is what BuildDesiredWiimoteState already supports and nothing exposed.
Four pieces:
* The option itself, off by default, under Wiimote IR.
* The Pointer device now registers all four touch indices rather than
only the first. libretro's pointer is multi-touch already, so the
four IR objects ride on indices 0-3 instead of needing a new device
type. Index 0 keeps the names it had, so the existing mouse-mode IR
binding is untouched.
* IRPassthrough is bound and enabled when the option is on: object N
takes Pointer:XN+ / Pointer:YN+ across the camera's 0..1 field (so a
frontend sends the positive half of the pointer range), with
PressedN as presence and a small constant size, games read size to
reject noise, and there is no spare axis to carry it. Bindings are
CLEARED when the option is off, because AreInputsBound() is half of
what selects this path and a stale binding would keep the cursor
route switched off after it was turned back on.
* irPassthrough is raised at controller setup as well as on an option
change, so the setting applies on a cold boot. The IR offset, yaw
and pitch settings are gated on IsUpdated alone, which means their
declared defaults never reach the emulated remote until something
moves them, a trap this option should not inherit.
Author
|
essentially just allows me to then tilt/twist the pointer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds dolphin_ir_passthrough, letting the frontend supply the Wiimote camera's view of the sensor bar directly instead of having the core synthesise it from a cursor position.
The cursor path cannot be made exact, and it is worth saying why. It parks a notional remote two metres from the bar and rotates it by Total Yaw / Total Pitch, a scale with no physical derivation, then CameraLogic projects the LEDs through that. Where the game finally draws its hand therefore depends on a constant fitted per game, which is what Dolphin's own "defaults chosen to reach screen edges in most games" is admitting. It also cannot express roll or distance at all: two angles have nowhere to put them.
A frontend that knows the real geometry, a VR room, a tracked light gun , can compute the two dots outright and get all of that for free, which is what BuildDesiredWiimoteState already supports and nothing exposed.
Four pieces:
The option itself, off by default, under Wiimote IR.
The Pointer device now registers all four touch indices rather than only the first. libretro's pointer is multi-touch already, so the four IR objects ride on indices 0-3 instead of needing a new device type. Index 0 keeps the names it had, so the existing mouse-mode IR binding is untouched.
IRPassthrough is bound and enabled when the option is on: object N takes Pointer:XN+ / Pointer:YN+ across the camera's 0..1 field (so a frontend sends the positive half of the pointer range), with PressedN as presence and a small constant size, games read size to reject noise, and there is no spare axis to carry it. Bindings are CLEARED when the option is off, because AreInputsBound() is half of what selects this path and a stale binding would keep the cursor route switched off after it was turned back on.
irPassthrough is raised at controller setup as well as on an option change, so the setting applies on a cold boot. The IR offset, yaw and pitch settings are gated on IsUpdated alone, which means their declared defaults never reach the emulated remote until something moves them, a trap this option should not inherit.