Skip to content

Commit

Permalink
[cubing/twisty] Set corner cam for Skewb.
Browse files Browse the repository at this point in the history
  • Loading branch information
lgarron committed Jul 1, 2021
1 parent 45628dd commit 7108e0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cubing/twisty/dom/TwistyPlayer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
BackgroundTheme,
centeredCameraPosition,
ControlsLocation,
cornerCameraPosition,
cubeCameraPosition,
ExperimentalStickering,
HintFaceletStyle,
Expand Down Expand Up @@ -366,7 +367,13 @@ export class TwistyPlayer extends ManagedCustomElement {

// TODO
get defaultCameraPosition(): Vector3 {
return this.puzzle[1] === "x" ? cubeCameraPosition : centeredCameraPosition;
if (this.puzzle[1] === "x") {
return cubeCameraPosition;
}
if (this.puzzle === "skewb") {
return cornerCameraPosition;
}
return centeredCameraPosition;
}

static get observedAttributes(): string[] {
Expand Down
1 change: 1 addition & 0 deletions src/cubing/twisty/dom/TwistyPlayerConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const centeredCameraPosition = new Vector3(

// TODO
export const cubeCameraPosition = new Vector3(3, 4, 5);
export const cornerCameraPosition = new Vector3(4, 4, 4);

// TODO: turn these maps into lists?
export const setupToLocations = {
Expand Down

0 comments on commit 7108e0a

Please sign in to comment.