Skip to content

iOS: Duo back taps lying on the side, inner display rotation - #56

Open
CobreDev wants to merge 2 commits into
kanapitsas:mainfrom
CobreDev:fix/duo-per-display-axes
Open

CobreDev wants to merge 2 commits into
kanapitsas:mainfrom
CobreDev:fix/duo-per-display-axes

Conversation

@CobreDev

Copy link
Copy Markdown
Contributor

Follow-up to #54. Two fixes for the Duo's inner display.

Back taps lying on the side. The Duo still read gravity to find the screen's axes, so lying on its side every tap fired the same portal. A recording shows the outer display's sensors are laid out like any iPhone's, and the inner display's are turned a quarter turn in the screen plane. Back taps and gyro aiming now use the interface orientation, as on any iPhone, and turn the inner display's samples back into the outer display's frame (rt_backtap_set_turn, rt_gyro_params.turn). Raw recordings log display changes (w lines) and tools/backtap_replay.c replays them.

Rotation. After a launch on the outer display, the inner display could not rotate to portrait: the landscape-only request made at launch is a scene setting, so it outlived the unfold. It is now made again on each display change.

Tested: make check, UBSan, Python 3.9. On an iPhone Duo: rotation after a folded launch (twice), back taps on the expected side in every pose (both displays, upright and lying on either side, both landscapes, portrait), gyro aiming in every orientation.

Not available: upside-down portrait. iOS refuses it on this phone even when the view controller allows it. Not tested: half-open pose, other iPhones and iPads (their path is unchanged).

…ixed offsets

A recording made on a Duo (both displays, both portraits, lying on its
side) showed that the motion sensors are laid out like any iPhone's on the
outer display, and turned a quarter turn in the plane of the screen on the
inner display (held in landscape, gravity runs along y). The Duo code read
the screen's horizontal axis from gravity instead, which only worked by
accident: lying on its side, gravity points along the screen's side while
the game stays in landscape, and every back tap came out as the same portal.

Back taps and gyro aiming no longer read gravity to find the screen's
axes. The interface orientation says which device axis is horizontal, as on
any iPhone, and on the inner display (rt_ios_scene_wide_display) the samples
are first turned back into the outer display's frame (rt_backtap_set_turn,
rt_gyro_params.turn), in every orientation.

Replaying the recordings: every pose (outer display upright and lying on
either side, inner display in both landscapes and in portrait) gives
alternating groups of left and right taps.

- raw recordings log display changes (w lines); tools/backtap_replay.c
  replays them.
- tests for the turned frame, portrait and lying on a side; docs.
The landscape-only geometry request made at a launch on the outer display
is a setting of the scene, not a one-off: after unfolding, the inner
display could not rotate to portrait. Ask again for each display
(landscape, or landscape and portrait on the inner display) whenever the
display changes.

Upside-down portrait is not available: iOS refuses it on this phone even
when the view controller allows it ("None of the requested orientations
are supported by the view controller. Requested: portraitUpsideDown;
Supported: portrait, landscapeLeft, landscapeRight"). Documented.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant