Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking on back of twist gizmo should click in reverse #58

Open
HactarCE opened this issue Sep 8, 2024 · 3 comments
Open

Clicking on back of twist gizmo should click in reverse #58

HactarCE opened this issue Sep 8, 2024 · 3 comments

Comments

@HactarCE
Copy link
Owner

HactarCE commented Sep 8, 2024

Steps to reproduce

  1. Open 3x3x3 Rubik's Cube
  2. Hide internal pieces, increase facet shrink
  3. 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

  1. Fix 3D twist gizmo ignores "show frontfaces" and "show backfaces" settings #67 first, so that gizmo triangles are oriented for 3D puzzles
  2. 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.

  1. Add a preference. See hyperspeedcube/src/preferences/interaction.rs, hyperspeedcube/locales/en.kdl, and build_interaction_section() in hyperspeedcube/src/gui/components/prefs.rs. Add a default setting in default.yaml. See my comment below for what to call the setting.
@milojacquet
Copy link
Collaborator

This may make algorithms harder to execute when they include back faces.

@HactarCE
Copy link
Owner Author

HactarCE commented Sep 8, 2024

It'd be very easy to make this configurable.

@HactarCE
Copy link
Owner Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants