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

Refact and move selection in Edit Mode #3

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Igorxp5
Copy link

@Igorxp5 Igorxp5 commented May 22, 2024

Hi I was looking for the move selection feature in the project, and saw it wasn't present. To make that possible and easy to build, I've refactored the brick positioning and other stuff. See the list of changes below:

  • Build bricks from axis origin instead of the center. This change removes the necessity of adding offset based on the parity of the brick dimensions. The logic has been moved to createGeometry;
  • Move positioning, translation and rotation to the Scene. Now Brick must receive the exactly position where it should be. This change is also applicable for BrickCursor;
  • BREAKING CHANGE: During the refactoring, the brick scheme synced with Liveblocks has been changed for simplification. Hence this change makes impossible to access old rooms (any room created before this update);
  • Add move selection feature in Edit Mode. Now when a brick is selected the brick cursor shows up allowing to move it. Moving multiple blocks is also allowed;
  • Add rotate selected blocks;
  • Add Escape shortcut to unselect bricks;
  • Disable rotate checkbox in Edit Mode;
  • Reflect translation (Anchor X, and Anchor Z) values on UI when it changed by keyboard shortcuts (A,W,S,D)
  • Fix ChangeColor:
    • The application wasn't propagating the changing of the color to other users;
    • The application was changing the color of the first selected brick in Edit Mode whenever the changing color feature was used in Create Mode previously;
  • Remove dead code from constants.js;
  • Uppercase all the constants in constants.js;

To be able to migrate current Room storage scheme to the new one, I build this script to update every room in the Liveblocks project: liveblocks-migration.js. Before running it, set Liveblocks SECRECT KEY in the script file (API_KEY constant). Note, the API SECRECT KEY is different from API PUBLIC KEY.

Copy link

vercel bot commented May 22, 2024

@Igorxp5 is attempting to deploy a commit to the Bhushan Nana Wagh's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Igorxp5 Igorxp5 marked this pull request as draft May 24, 2024 14:52
@Igorxp5 Igorxp5 marked this pull request as ready for review May 25, 2024 05:08
Scene and its children were being rendered every mouse move, causing render lag in some slower hardwares
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