Hyperspeedcube icon indicating copy to clipboard operation
Hyperspeedcube copied to clipboard

Clicking on back of twist gizmo should click in reverse

Open HactarCE opened this issue 1 year ago • 3 comments

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 #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.

HactarCE avatar Sep 08 '24 22:09 HactarCE

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

milojacquet avatar Sep 08 '24 22:09 milojacquet

It'd be very easy to make this configurable.

HactarCE avatar Sep 08 '24 22:09 HactarCE

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)

HactarCE avatar Nov 25 '24 06:11 HactarCE