From 7108e0a61c611e0e687d7446e46a3e3c7f67543e Mon Sep 17 00:00:00 2001 From: Lucas Garron Date: Thu, 1 Jul 2021 03:16:02 -0700 Subject: [PATCH] [cubing/twisty] Set corner cam for Skewb. --- src/cubing/twisty/dom/TwistyPlayer.ts | 9 ++++++++- src/cubing/twisty/dom/TwistyPlayerConfig.ts | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/cubing/twisty/dom/TwistyPlayer.ts b/src/cubing/twisty/dom/TwistyPlayer.ts index 70348e7ac..078e9cb83 100644 --- a/src/cubing/twisty/dom/TwistyPlayer.ts +++ b/src/cubing/twisty/dom/TwistyPlayer.ts @@ -31,6 +31,7 @@ import { BackgroundTheme, centeredCameraPosition, ControlsLocation, + cornerCameraPosition, cubeCameraPosition, ExperimentalStickering, HintFaceletStyle, @@ -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[] { diff --git a/src/cubing/twisty/dom/TwistyPlayerConfig.ts b/src/cubing/twisty/dom/TwistyPlayerConfig.ts index 638b205f7..f757fc877 100644 --- a/src/cubing/twisty/dom/TwistyPlayerConfig.ts +++ b/src/cubing/twisty/dom/TwistyPlayerConfig.ts @@ -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 = {