Clicking on back of twist gizmo should click in reverse
Steps to reproduce
- Open 3x3x3 Rubik's Cube
- Hide internal pieces, increase facet shrink
- Left-click on the back of a face
Expected behavior: the pieces twist counterclockwise from the user's current perspective
Actual behavior: the pieces twist counterclockwise from the holding-the-face-in-front perspective
Guide
- Fix #67 first, so that gizmo triangles are oriented for 3D puzzles
- In
hyperspeedcube/src/gui/tabs/puzzle_view.rs, compute triangle orientation (clockwise vs. counterclockwise) and reverse the twist depending on it
You might try first changing the fill color of the triangle depending on its orientation, to make sure you're detecting orientations correctly.
Test with various 3D puzzles of different shapes, as long as they have twist gizmos at all. "Show frontfaces", "show backfaces", and "gizmo scale" may be useful for testing.
- Add a preference. See
hyperspeedcube/src/preferences/interaction.rs,hyperspeedcube/locales/en.kdl, andbuild_interaction_section()inhyperspeedcube/src/gui/components/prefs.rs. Add a default setting indefault.yaml. See my comment below for what to call the setting.
This may make algorithms harder to execute when they include back faces.
It'd be very easy to make this configurable.
I'd add a "Twists" section in interaction settings, with a checkbox "Back of 3D gizmo does reverse twist" (or similar phrasing, ideally as concise as possible)