cubing 0.21.2 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -8
- package/alg/package.json +1 -3
- package/bluetooth/package.json +1 -3
- package/dist/bin/order.js +16675 -0
- package/dist/bin/order.js.map +7 -0
- package/dist/bin/puzzle-geometry-bin.js +13 -9
- package/dist/bin/puzzle-geometry-bin.js.map +2 -2
- package/dist/bundle-global/cubing.bundle-global.js +3285 -291
- package/dist/esm/2x2x2.sgs.json-FRBWMMA7.js +122 -0
- package/dist/esm/2x2x2.sgs.json-FRBWMMA7.js.map +7 -0
- package/dist/esm/3d-Q4WSD4BC.js +21 -0
- package/dist/esm/3d-Q4WSD4BC.js.map +7 -0
- package/dist/esm/alg/index.js +1 -1
- package/dist/esm/bluetooth/index.d.ts +1 -1
- package/dist/esm/bluetooth/index.js +10 -8
- package/dist/esm/bluetooth/index.js.map +3 -3
- package/dist/esm/chunk-37EHU3GZ.js +66 -0
- package/dist/esm/chunk-37EHU3GZ.js.map +7 -0
- package/dist/esm/{chunk-RE7MIN5R.js → chunk-4IUYLRHT.js} +2 -2
- package/dist/esm/{chunk-RE7MIN5R.js.map → chunk-4IUYLRHT.js.map} +0 -0
- package/dist/esm/chunk-BJIOROQC.js +18 -0
- package/dist/esm/chunk-BJIOROQC.js.map +7 -0
- package/dist/esm/{chunk-MUQMBH2S.js → chunk-DK6PXBB2.js} +16 -4
- package/dist/esm/chunk-DK6PXBB2.js.map +7 -0
- package/dist/esm/chunk-DPMEZY7V.js +1552 -0
- package/dist/esm/chunk-DPMEZY7V.js.map +7 -0
- package/dist/esm/{chunk-BU5PUJK3.js → chunk-EWRBHQFX.js} +1 -1
- package/dist/esm/{chunk-BU5PUJK3.js.map → chunk-EWRBHQFX.js.map} +1 -1
- package/dist/esm/chunk-FK2SCC3Z.js +499 -0
- package/dist/esm/chunk-FK2SCC3Z.js.map +7 -0
- package/dist/esm/chunk-JZWB7AIU.js +115 -0
- package/dist/esm/chunk-JZWB7AIU.js.map +7 -0
- package/dist/esm/chunk-MLOCDLUF.js +226 -0
- package/dist/esm/chunk-MLOCDLUF.js.map +7 -0
- package/dist/esm/{chunk-APIIMJG6.js → chunk-N3RNWU5T.js} +450 -1052
- package/dist/esm/chunk-N3RNWU5T.js.map +7 -0
- package/dist/esm/chunk-PUPUQWJC.js +4065 -0
- package/dist/esm/chunk-PUPUQWJC.js.map +7 -0
- package/dist/esm/{chunk-YV3RT5PX.js → chunk-X6JHXPDX.js} +2 -2
- package/dist/esm/{chunk-YV3RT5PX.js.map → chunk-X6JHXPDX.js.map} +0 -0
- package/dist/esm/chunk-XVZOMB6J.js +89 -0
- package/dist/esm/chunk-XVZOMB6J.js.map +7 -0
- package/dist/esm/chunk-Z6X7HTPP.js +103 -0
- package/dist/esm/chunk-Z6X7HTPP.js.map +7 -0
- package/dist/esm/entry-L6CE2HLF.js +531 -0
- package/dist/esm/entry-L6CE2HLF.js.map +7 -0
- package/dist/esm/esm-test-worker.js +3 -14
- package/dist/esm/esm-test-worker.js.map +3 -3
- package/dist/esm/fto.sgs.json-62YNULOK.js +649 -0
- package/dist/esm/fto.sgs.json-62YNULOK.js.map +7 -0
- package/dist/esm/gwt-B7CBESZR.js +1669 -0
- package/dist/esm/gwt-B7CBESZR.js.map +7 -0
- package/dist/esm/kpuzzle/index.js +2 -2
- package/dist/esm/megaminx.sgs.json-PRL46G5J.js +16 -0
- package/dist/esm/megaminx.sgs.json-PRL46G5J.js.map +7 -0
- package/dist/esm/module-entry-J2N3UZP7.js +18 -0
- package/dist/esm/module-entry-J2N3UZP7.js.map +7 -0
- package/dist/esm/{node-BSAQKO3G.js → node-SP4L2AKI.js} +2 -2
- package/dist/esm/{node-BSAQKO3G.js.map → node-SP4L2AKI.js.map} +1 -1
- package/dist/esm/{node-WEHVBEKP.js → node-W3AD4HBK.js} +3 -2
- package/dist/esm/node-W3AD4HBK.js.map +7 -0
- package/dist/esm/notation/index.js +2 -2
- package/dist/esm/protocol/index.js +2 -2
- package/dist/esm/puzzle-geometry/index.js +13 -4049
- package/dist/esm/puzzle-geometry/index.js.map +3 -3
- package/dist/esm/puzzles/index.js +3 -3
- package/dist/esm/pyraminx.sgs.json-7QMPT5XP.js +14 -0
- package/dist/esm/pyraminx.sgs.json-7QMPT5XP.js.map +7 -0
- package/dist/esm/scramble/index.js +6 -4
- package/dist/esm/scramble_444-JP3CWLJM.js +2572 -0
- package/dist/esm/scramble_444-JP3CWLJM.js.map +7 -0
- package/dist/esm/scramble_sq1-PQ2AYBFW.js +706 -0
- package/dist/esm/scramble_sq1-PQ2AYBFW.js.map +7 -0
- package/dist/esm/search/index.js +8 -5
- package/dist/esm/skewb.sgs.json-FWHYACJG.js +16 -0
- package/dist/esm/skewb.sgs.json-FWHYACJG.js.map +7 -0
- package/dist/esm/stream/index.js +1 -1
- package/dist/esm/twisty/index.js +721 -2343
- package/dist/esm/twisty/index.js.map +3 -3
- package/dist/esm/worker-inside-generated-string-OWJA5IIQ.js +3450 -0
- package/dist/esm/worker-inside-generated-string-OWJA5IIQ.js.map +7 -0
- package/dist/types/alg/index.d.ts +1 -0
- package/dist/types/alg/index.d.ts.map +1 -1
- package/dist/types/alg/units/leaves/Move.d.ts +1 -1
- package/dist/types/alg/units/leaves/Move.d.ts.map +1 -1
- package/dist/types/bluetooth/smart-puzzle/gan.d.ts.map +1 -1
- package/dist/types/cubing.bundle-global.exports.d.ts +25 -0
- package/dist/types/cubing.bundle-global.exports.d.ts.map +1 -0
- package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts +3 -0
- package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts +7 -3
- package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/index.d.ts +1 -1
- package/dist/types/puzzle-geometry/index.d.ts.map +1 -1
- package/dist/types/puzzles/index.d.ts +1 -1
- package/dist/types/puzzles/index.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/cube-stickerings.d.ts.map +1 -1
- package/dist/types/search/inside/api.d.ts.map +1 -1
- package/dist/types/search/inside/module-entry-path-getter.d.ts +2 -0
- package/dist/types/search/inside/module-entry-path-getter.d.ts.map +1 -0
- package/dist/types/search/inside/module-entry.d.ts +2 -0
- package/dist/types/search/inside/module-entry.d.ts.map +1 -0
- package/dist/types/search/inside/solve/puzzles/3x3x3/index.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/4x4x4.d.ts +2 -1
- package/dist/types/search/inside/solve/puzzles/4x4x4.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/fto.d.ts +6 -0
- package/dist/types/search/inside/solve/puzzles/fto.d.ts.map +1 -0
- package/dist/types/search/inside/solve/puzzles/fto.sgs.json.d.ts +5 -0
- package/dist/types/search/inside/solve/puzzles/fto.sgs.json.d.ts.map +1 -0
- package/dist/types/search/inside/solve/puzzles/sq1.d.ts.map +1 -1
- package/dist/types/search/inside/solve/tremble.d.ts.map +1 -1
- package/dist/types/search/instantiator.d.ts +1 -2
- package/dist/types/search/instantiator.d.ts.map +1 -1
- package/dist/types/search/worker-inside-generated-string.d.ts +1 -1
- package/dist/types/search/worker-inside-generated-string.d.ts.map +1 -1
- package/dist/types/twisty/{old/animation/cursor/CursorTypes.d.ts → controllers/AnimationTypes.d.ts} +10 -3
- package/dist/types/twisty/controllers/AnimationTypes.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/RenderScheduler.d.ts +0 -0
- package/dist/types/twisty/controllers/RenderScheduler.d.ts.map +1 -0
- package/dist/types/twisty/controllers/TwistyAnimationController.d.ts +1 -1
- package/dist/types/twisty/controllers/TwistyAnimationController.d.ts.map +1 -1
- package/dist/types/twisty/{old/animation → controllers}/easing.d.ts +0 -0
- package/dist/types/twisty/controllers/easing.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/AlgDuration.d.ts +2 -2
- package/dist/types/twisty/controllers/indexer/AlgDuration.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/AlgIndexer.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/AlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/SimpleAlgIndexer.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/SimpleAlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/simultaneous-moves/simul-moves.d.ts +2 -2
- package/dist/types/twisty/controllers/indexer/simultaneous-moves/simul-moves.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/tree/AlgWalker.d.ts +2 -2
- package/dist/types/twisty/controllers/indexer/tree/AlgWalker.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/indexer/tree/TreeAlgIndexer.d.ts +3 -3
- package/dist/types/twisty/controllers/indexer/tree/TreeAlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/controllers/indexer/tree/chunkAlgs.d.ts +3 -0
- package/dist/types/twisty/controllers/indexer/tree/chunkAlgs.d.ts.map +1 -0
- package/dist/types/twisty/{old/animation → controllers}/stream/timeline-move-calculation-draft.d.ts +2 -2
- package/dist/types/twisty/controllers/stream/timeline-move-calculation-draft.d.ts.map +1 -0
- package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts +1 -2
- package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts.map +1 -1
- package/dist/types/twisty/index.d.ts +8 -11
- package/dist/types/twisty/index.d.ts.map +1 -1
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts +11 -0
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts.map +1 -1
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts +1 -1
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/display/FoundationDisplayProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/display/FoundationDisplayProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts +5 -1
- package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts +46 -1
- package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts +2 -2
- package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts +5 -2
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts +2 -2
- package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts +2 -2
- package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/state/MovePressInputProp.d.ts +11 -0
- package/dist/types/twisty/model/props/puzzle/state/MovePressInputProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/NaiveMoveCountProp.d.ts +10 -0
- package/dist/types/twisty/model/props/puzzle/state/NaiveMoveCountProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts +5 -1
- package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts +19 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts +1 -1
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts +2 -3
- package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts +1 -1
- package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts +1 -1
- package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts +6 -1
- package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts +5 -1
- package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts +5 -1
- package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts +18 -5
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts +6 -6
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts +2 -2
- package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts +5 -1
- package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts +7 -1
- package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts.map +1 -1
- package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts +1 -1
- package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts.map +1 -1
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.css.d.ts +3 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.css.d.ts.map +1 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts +4 -6
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts.map +1 -1
- package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts +1 -1
- package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts +2 -2
- package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/DragTracker.d.ts +28 -0
- package/dist/types/twisty/views/3D/DragTracker.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/RendererPool.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts +6 -1
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts +9 -4
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/Twisty3DVantage.css.d.ts +3 -0
- package/dist/types/twisty/views/3D/Twisty3DVantage.css.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts +11 -7
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/TwistyOrbitControls.d.ts +24 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControls.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControls.spec.d.ts +5 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControls.spec.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/puzzles/Cube3D.d.ts +4 -4
- package/dist/types/twisty/views/3D/puzzles/Cube3D.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts +17 -10
- package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts.map +1 -1
- package/dist/types/twisty/views/3D/puzzles/Twisty3DPuzzle.d.ts +1 -1
- package/dist/types/twisty/views/3D/puzzles/Twisty3DPuzzle.d.ts.map +1 -1
- package/dist/types/twisty/{old/dom/element → views}/ClassListManager.d.ts +0 -0
- package/dist/types/twisty/views/ClassListManager.d.ts.map +1 -0
- package/dist/types/twisty/{old/dom/element → views}/ManagedCustomElement.d.ts +0 -0
- package/dist/types/twisty/views/ManagedCustomElement.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts +2 -1
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts +1 -1
- package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyAlgViewer.d.ts +2 -2
- package/dist/types/twisty/views/TwistyAlgViewer.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyPlayer.css.d.ts +3 -0
- package/dist/types/twisty/views/TwistyPlayer.css.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyPlayer.d.ts +7 -3
- package/dist/types/twisty/views/TwistyPlayer.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts +7 -4
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts.map +1 -1
- package/dist/types/twisty/views/TwistyViewerWrapper.css.d.ts +3 -0
- package/dist/types/twisty/views/TwistyViewerWrapper.css.d.ts.map +1 -0
- package/dist/types/twisty/{old/dom/viewers → views}/canvas.d.ts +0 -0
- package/dist/types/twisty/views/canvas.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.css.d.ts +4 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.css.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts +1 -1
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts.map +1 -1
- package/dist/types/twisty/views/control-panel/TwistyScrubber.css.d.ts +3 -0
- package/dist/types/twisty/{old/dom/controls → views/control-panel}/TwistyScrubber.css.d.ts.map +1 -1
- package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts +1 -1
- package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts.map +1 -1
- package/dist/types/twisty/{old/dom/element → views}/node-custom-element-shims.d.ts +0 -0
- package/dist/types/twisty/views/node-custom-element-shims.d.ts.map +1 -0
- package/dist/types/twisty/views/stream/TwistyStreamSource.css.d.ts +3 -0
- package/dist/types/twisty/views/stream/TwistyStreamSource.css.d.ts.map +1 -0
- package/dist/types/twisty/{old/dom → views}/stream/TwistyStreamSource.d.ts +1 -1
- package/dist/types/twisty/views/stream/TwistyStreamSource.d.ts.map +1 -0
- package/dist/types/{search/vendor → vendor}/comlink-everywhere/inside/index.d.ts +0 -0
- package/dist/types/vendor/comlink-everywhere/inside/index.d.ts.map +1 -0
- package/dist/types/{search/vendor → vendor}/comlink-everywhere/inside/node.d.ts +0 -0
- package/dist/types/vendor/comlink-everywhere/inside/node.d.ts.map +1 -0
- package/dist/types/{search/vendor → vendor}/comlink-everywhere/outside/index.d.ts +0 -0
- package/dist/types/vendor/comlink-everywhere/outside/index.d.ts.map +1 -0
- package/dist/types/{search/vendor → vendor}/comlink-everywhere/outside/node.d.ts +0 -0
- package/dist/types/vendor/comlink-everywhere/outside/node.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/cstimer/src/js/lib/mathlib.d.ts +0 -0
- package/dist/types/vendor/cstimer/src/js/lib/mathlib.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/cstimer/src/js/scramble/scramble_444.d.ts +1 -1
- package/dist/types/vendor/cstimer/src/js/scramble/scramble_444.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/min2phase/gwt.d.ts +0 -0
- package/dist/types/vendor/min2phase/gwt.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/random-uint-below/get-random-values.d.ts +0 -0
- package/dist/types/vendor/random-uint-below/get-random-values.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/random-uint-below/index.d.ts +1 -1
- package/dist/types/vendor/random-uint-below/index.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/random-uint-below/random-choice.d.ts +0 -0
- package/dist/types/vendor/random-uint-below/random-choice.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor/random-uint-below/random-int.d.ts → vendor/random-uint-below/random53BitValue.d.ts} +1 -1
- package/dist/types/vendor/random-uint-below/random53BitValue.d.ts.map +1 -0
- package/dist/types/{search/inside/solve/vendor → vendor}/sq12phase/scramble_sq1.d.ts +0 -0
- package/dist/types/vendor/sq12phase/scramble_sq1.d.ts.map +1 -0
- package/dist/types/{bluetooth/smart-puzzle → vendor/unsafe-raw-aes}/unsafe-raw-aes.d.ts +0 -0
- package/dist/types/vendor/unsafe-raw-aes/unsafe-raw-aes.d.ts.map +1 -0
- package/docs/.DS_Store +0 -0
- package/docs/cubing/.DS_Store +0 -0
- package/docs/cubing/api/index.html +11 -52
- package/docs/cubing/index.html +67 -27
- package/docs/main.css +7 -6
- package/kpuzzle/package.json +1 -3
- package/notation/package.json +1 -3
- package/package.json +9 -14
- package/protocol/package.json +1 -3
- package/puzzle-geometry/package.json +1 -3
- package/puzzles/package.json +1 -3
- package/scramble/package.json +1 -3
- package/search/package.json +1 -3
- package/src/cubing/.DS_Store +0 -0
- package/src/cubing/alg/index.ts +1 -0
- package/src/cubing/alg/units/leaves/Move.ts +1 -1
- package/src/cubing/bluetooth/smart-puzzle/gan.ts +4 -1
- package/src/cubing/bluetooth/smart-timer/GanTimer.ts +1 -1
- package/src/cubing/cubing.bundle-global.exports.ts +25 -0
- package/src/cubing/cubing.bundle-global.ts +3 -31
- package/src/cubing/puzzle-geometry/PGPuzzles.spec.ts +4 -0
- package/src/cubing/puzzle-geometry/PuzzleGeometry.ts +20 -8
- package/src/cubing/puzzle-geometry/index.ts +2 -2
- package/src/cubing/puzzles/index.ts +1 -1
- package/src/cubing/puzzles/stickerings/cube-stickerings.ts +18 -0
- package/src/cubing/puzzles/stickerings/global-custom-stickering-hack.ts +1 -1
- package/src/cubing/{twisty/views/3D → search}/.DS_Store +0 -0
- package/src/cubing/search/esm-test-worker.js +1 -1
- package/src/cubing/{twisty → search/inside}/.DS_Store +0 -0
- package/src/cubing/search/inside/api.ts +3 -0
- package/src/cubing/search/inside/entry.js +1 -1
- package/src/cubing/search/inside/inside-worker.ts +1 -1
- package/src/cubing/search/inside/module-entry-path-getter.ts +5 -0
- package/src/cubing/search/inside/module-entry.ts +20 -0
- package/src/cubing/search/inside/solve/addOrientationSuffix.ts +1 -1
- package/src/cubing/search/inside/solve/puzzles/2x2x2.ts +1 -1
- package/src/cubing/search/inside/solve/puzzles/3x3x3/index.ts +14 -4
- package/src/cubing/search/inside/solve/puzzles/4x4x4.ts +19 -5
- package/src/cubing/search/inside/solve/puzzles/big-cubes.ts +1 -1
- package/src/cubing/search/inside/solve/puzzles/clock.ts +1 -1
- package/src/cubing/search/inside/solve/puzzles/fto.sgs.json.ts +643 -0
- package/src/cubing/search/inside/solve/puzzles/fto.ts +58 -0
- package/src/cubing/search/inside/solve/puzzles/sq1.ts +12 -2
- package/src/cubing/search/inside/solve/puzzles/wca-minx.ts +1 -1
- package/src/cubing/search/inside/solve/tremble.ts +2 -1
- package/src/cubing/search/instantiator.ts +76 -41
- package/src/cubing/search/worker-inside-generated-string.js +1 -1
- package/src/cubing/twisty/{old/animation/cursor/CursorTypes.ts → controllers/AnimationTypes.ts} +11 -2
- package/src/cubing/twisty/{old/animation → controllers}/RenderScheduler.ts +0 -0
- package/src/cubing/twisty/controllers/TwistyAnimationController.ts +4 -4
- package/src/cubing/twisty/{old/animation → controllers}/easing.ts +0 -0
- package/src/cubing/twisty/{old/animation → controllers}/indexer/AlgDuration.ts +2 -2
- package/src/cubing/twisty/{old/animation → controllers}/indexer/AlgIndexer.ts +4 -4
- package/src/cubing/twisty/{old/animation → controllers}/indexer/SimpleAlgIndexer.ts +4 -4
- package/src/cubing/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexer.ts +3 -3
- package/src/cubing/twisty/{old/animation → controllers}/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.ts +3 -3
- package/src/cubing/twisty/{old/animation → controllers}/indexer/simultaneous-moves/simul-moves.ts +2 -2
- package/src/cubing/twisty/{old/animation → controllers}/indexer/tree/AlgWalker.ts +4 -4
- package/src/cubing/twisty/{old/animation → controllers}/indexer/tree/TreeAlgIndexer.ts +3 -3
- package/src/cubing/twisty/{old/animation → controllers}/indexer/tree/chunkAlgs.ts +2 -2
- package/src/cubing/twisty/{old/animation → controllers}/stream/timeline-move-calculation-draft.spec.ts.TODO +0 -0
- package/src/cubing/twisty/{old/animation → controllers}/stream/timeline-move-calculation-draft.ts +2 -2
- package/src/cubing/twisty/heavy-code-imports/dynamic-entries/3d.ts +2 -12
- package/src/cubing/twisty/index.ts +11 -18
- package/src/cubing/twisty/model/TwistyPlayerModel.ts +38 -7
- package/src/cubing/twisty/model/props/TwistyPropDebugger.ts +3 -3
- package/src/cubing/twisty/model/props/puzzle/display/FoundationDisplayProp.ts +9 -0
- package/src/cubing/twisty/model/props/puzzle/display/HintFaceletProp.ts +6 -1
- package/src/cubing/twisty/model/props/puzzle/display/StickeringProp.ts +49 -1
- package/src/cubing/twisty/model/props/puzzle/state/AlgTransformationProp.ts +1 -1
- package/src/cubing/twisty/model/props/puzzle/state/AnchoredStartProp.ts +2 -2
- package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesProp.ts +2 -2
- package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesSimplified.ts +1 -1
- package/src/cubing/twisty/model/props/puzzle/state/CurrentTransformationProp.ts +1 -1
- package/src/cubing/twisty/model/props/puzzle/state/IndexerConstructorProp.ts +12 -5
- package/src/cubing/twisty/model/props/puzzle/state/IndexerProp.ts +2 -2
- package/src/cubing/twisty/model/props/puzzle/state/LegacyPositionProp.ts +2 -2
- package/src/cubing/twisty/model/props/puzzle/state/MovePressInputProp.ts +14 -0
- package/src/cubing/twisty/model/props/puzzle/state/NaiveMoveCountProp.ts +20 -0
- package/src/cubing/twisty/model/props/puzzle/state/SetupAnchorProp.ts +7 -1
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDProp.ts +1 -1
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.ts +20 -1
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleLoaderProp.ts +1 -1
- package/src/cubing/twisty/model/props/timeline/DetailedTimelineInfoProp.ts +5 -3
- package/src/cubing/twisty/model/props/timeline/PlayingInfoProp.ts +1 -4
- package/src/cubing/twisty/model/props/timeline/TimestampRequestProp.ts +1 -1
- package/src/cubing/twisty/model/props/viewer/BackViewProp.ts +7 -1
- package/src/cubing/twisty/model/props/viewer/BackgroundProp.ts +6 -1
- package/src/cubing/twisty/model/props/viewer/ControlPanelProp.ts +5 -1
- package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesProp.ts +83 -12
- package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesRequestProp.ts +8 -8
- package/src/cubing/twisty/model/props/viewer/TimeRangeProp.ts +2 -2
- package/src/cubing/twisty/model/props/viewer/ViewerLinkProp.ts +5 -1
- package/src/cubing/twisty/model/props/viewer/VisualizationProp.ts +8 -1
- package/src/cubing/twisty/model/props/viewer/VisualizationStrategyProp.ts +1 -1
- package/src/cubing/twisty/{old/dom/viewers/Twisty2DSVGView.css.ts → views/2D/Twisty2DPuzzle.css.ts} +1 -1
- package/src/cubing/twisty/views/2D/Twisty2DPuzzle.ts +8 -12
- package/src/cubing/twisty/views/2D/Twisty2DPuzzleWrapper.ts +1 -1
- package/src/cubing/twisty/views/2D/Twisty2DSceneWrapper.ts +4 -4
- package/src/cubing/twisty/views/3D/DragTracker.ts +184 -0
- package/src/cubing/twisty/views/3D/RendererPool.ts +2 -1
- package/src/cubing/twisty/views/3D/Twisty3DPuzzleWrapper.ts +51 -5
- package/src/cubing/twisty/views/3D/Twisty3DSceneWrapper.ts +51 -10
- package/src/cubing/twisty/{old/dom/viewers/Twisty3DCanvas.css.ts → views/3D/Twisty3DVantage.css.ts} +2 -2
- package/src/cubing/twisty/views/3D/Twisty3DVantage.ts +88 -30
- package/src/cubing/twisty/views/3D/TwistyOrbitControls.spec.ts +213 -0
- package/src/cubing/twisty/views/3D/TwistyOrbitControls.ts +176 -0
- package/src/cubing/twisty/views/3D/puzzles/Cube3D.ts +5 -9
- package/src/cubing/twisty/views/3D/puzzles/PG3D.ts +127 -37
- package/src/cubing/twisty/views/3D/puzzles/Twisty3DPuzzle.ts +1 -1
- package/src/cubing/twisty/{old/dom/element → views}/ClassListManager.ts +0 -0
- package/src/cubing/twisty/{old/dom/element → views}/ManagedCustomElement.ts +0 -0
- package/src/cubing/twisty/views/TwistyAlgEditor/LeafTokens.ts +1 -1
- package/src/cubing/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.ts +1 -1
- package/src/cubing/twisty/views/TwistyAlgEditor/TwistyAlgEditor.ts +11 -4
- package/src/cubing/twisty/views/TwistyAlgViewer.css.ts +1 -1
- package/src/cubing/twisty/views/TwistyAlgViewer.ts +4 -4
- package/src/cubing/twisty/{old/dom → views}/TwistyPlayer.css.ts +4 -1
- package/src/cubing/twisty/views/TwistyPlayer.ts +16 -25
- package/src/cubing/twisty/views/TwistyPlayerSettable.ts +14 -10
- package/src/cubing/twisty/{old/dom/viewers → views}/TwistyViewerWrapper.css.ts +1 -1
- package/src/cubing/twisty/{old/dom/viewers → views}/canvas.ts +0 -0
- package/src/cubing/twisty/{old/dom/controls/buttons.css.ts → views/control-panel/TwistyButtonsV2.css.ts} +1 -1
- package/src/cubing/twisty/views/control-panel/TwistyButtonsV2.ts +5 -8
- package/src/cubing/twisty/{old/dom/controls → views/control-panel}/TwistyScrubber.css.ts +1 -1
- package/src/cubing/twisty/views/control-panel/TwistyScrubberV2.ts +3 -3
- package/src/cubing/twisty/{old/dom/element → views}/node-custom-element-shims.ts +2 -2
- package/src/cubing/twisty/{old/dom → views}/stream/TwistyStreamSource.css.ts +1 -1
- package/src/cubing/twisty/{old/dom → views}/stream/TwistyStreamSource.ts +9 -9
- package/{dist/types → src/cubing/vendor}/.DS_Store +0 -0
- package/{dist → src/cubing/vendor/comlink-everywhere}/.DS_Store +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/comlink-everywhere.webloc +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/inside/index.d.ts +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/inside/index.js +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/inside/node.js +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/outside/index.d.ts +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/outside/index.js +0 -0
- package/src/cubing/{search/vendor → vendor}/comlink-everywhere/outside/node.js +1 -0
- package/src/cubing/vendor/cstimer/.DS_Store +0 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/cstimer/LICENSE +0 -0
- package/src/cubing/vendor/cstimer/src/.DS_Store +0 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/cstimer/src/js/lib/mathlib.ts +0 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/cstimer/src/js/scramble/scramble_444.ts +3 -3
- package/src/cubing/{search/inside/solve/vendor → vendor}/min2phase/gwt.d.ts +0 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/min2phase/gwt.js +0 -0
- package/src/cubing/vendor/random-uint-below/get-random-values.ts +23 -0
- package/src/cubing/{search/inside/solve/vendor → vendor}/random-uint-below/index.ts +2 -2
- package/src/cubing/{search/inside/solve/vendor → vendor}/random-uint-below/random-choice.ts +1 -1
- package/src/cubing/{search/inside/solve/vendor/random-uint-below/random-int.ts → vendor/random-uint-below/random53BitValue.ts} +1 -1
- package/src/cubing/{search/inside/solve/vendor → vendor}/sq12phase/scramble_sq1.js +2 -2
- package/src/cubing/vendor/three/.DS_Store +0 -0
- package/src/cubing/vendor/three/examples/.DS_Store +0 -0
- package/src/cubing/{bluetooth/smart-puzzle → vendor/unsafe-raw-aes}/unsafe-raw-aes.ts +18 -20
- package/stream/package.json +1 -3
- package/twisty/package.json +1 -3
- package/alg/index.d.ts +0 -1
- package/bluetooth/index.d.ts +0 -1
- package/dist/esm/3d-B25DP5PE.js +0 -39
- package/dist/esm/3d-B25DP5PE.js.map +0 -7
- package/dist/esm/chunk-APIIMJG6.js.map +0 -7
- package/dist/esm/chunk-CSVAFZSB.js +0 -1379
- package/dist/esm/chunk-CSVAFZSB.js.map +0 -7
- package/dist/esm/chunk-MUQMBH2S.js.map +0 -7
- package/dist/esm/index.d.ts +0 -1
- package/dist/esm/node-WEHVBEKP.js.map +0 -7
- package/dist/esm/worker-inside-generated-string-KDZOUGJF.js +0 -2831
- package/dist/esm/worker-inside-generated-string-KDZOUGJF.js.map +0 -7
- package/dist/types/bluetooth/smart-puzzle/unsafe-raw-aes.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lib/mathlib.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/scramble/scramble_444.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/min2phase/gwt.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/get-random-values.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/index.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/random-choice.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/random-int.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/sq12phase/scramble_sq1.d.ts.map +0 -1
- package/dist/types/search/vendor/comlink-everywhere/inside/index.d.ts.map +0 -1
- package/dist/types/search/vendor/comlink-everywhere/inside/node.d.ts.map +0 -1
- package/dist/types/search/vendor/comlink-everywhere/outside/index.d.ts.map +0 -1
- package/dist/types/search/vendor/comlink-everywhere/outside/node.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/RenderScheduler.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/Timeline.d.ts +0 -72
- package/dist/types/twisty/old/animation/Timeline.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/cursor/AlgCursor.d.ts +0 -53
- package/dist/types/twisty/old/animation/cursor/AlgCursor.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/cursor/CursorTypes.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/easing.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/AlgDuration.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/AlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/SimpleAlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/simul-moves.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/tree/AlgWalker.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/tree/TreeAlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts +0 -3
- package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts.map +0 -1
- package/dist/types/twisty/old/animation/stream/timeline-move-calculation-draft.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts +0 -52
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyPlayer.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/TwistyPlayer.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyPlayer.d.ts +0 -92
- package/dist/types/twisty/old/dom/TwistyPlayer.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts +0 -5
- package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts +0 -165
- package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts +0 -2
- package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.d.ts +0 -14
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/buttons.css.d.ts +0 -4
- package/dist/types/twisty/old/dom/controls/buttons.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/buttons.d.ts +0 -40
- package/dist/types/twisty/old/dom/controls/buttons.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts +0 -5
- package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/element/ClassListManager.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/element/ElementConfig.d.ts +0 -49
- package/dist/types/twisty/old/dom/element/ElementConfig.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/element/ManagedCustomElement.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/element/node-custom-element-shims.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVG.d.ts +0 -26
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVG.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVGView.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVGView.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts +0 -41
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/TwistyOrbitControls.d.ts +0 -59
- package/dist/types/twisty/old/dom/viewers/TwistyOrbitControls.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts +0 -4
- package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.css.d.ts +0 -3
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.css.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.d.ts +0 -18
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.d.ts.map +0 -1
- package/dist/types/twisty/old/dom/viewers/canvas.d.ts.map +0 -1
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts +0 -41
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts.map +0 -1
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts +0 -5
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts.map +0 -1
- package/kpuzzle/index.d.ts +0 -1
- package/notation/index.d.ts +0 -1
- package/protocol/index.d.ts +0 -1
- package/puzzle-geometry/index.d.ts +0 -1
- package/puzzles/index.d.ts +0 -1
- package/scramble/index.d.ts +0 -1
- package/search/index.d.ts +0 -1
- package/src/cubing/search/inside/solve/puzzles/FTO.sgs +0 -264
- package/src/cubing/search/inside/solve/vendor/random-uint-below/get-random-values.ts +0 -38
- package/src/cubing/twisty/old/animation/Timeline.ts +0 -378
- package/src/cubing/twisty/old/animation/cursor/AlgCursor.ts +0 -252
- package/src/cubing/twisty/old/dom/TwistyAlgViewerV1.css.ts +0 -25
- package/src/cubing/twisty/old/dom/TwistyAlgViewerV1.ts +0 -516
- package/src/cubing/twisty/old/dom/TwistyPlayer.spec.ts +0 -25
- package/src/cubing/twisty/old/dom/TwistyPlayer.ts +0 -927
- package/src/cubing/twisty/old/dom/TwistyPlayerConfig.ts +0 -378
- package/src/cubing/twisty/old/dom/controls/TwistyControlElement.ts +0 -1
- package/src/cubing/twisty/old/dom/controls/TwistyScrubber.ts +0 -53
- package/src/cubing/twisty/old/dom/controls/buttons.spec.ts +0 -37
- package/src/cubing/twisty/old/dom/controls/buttons.ts +0 -326
- package/src/cubing/twisty/old/dom/element/ElementConfig.ts +0 -180
- package/src/cubing/twisty/old/dom/viewers/Twisty2DSVG.ts +0 -118
- package/src/cubing/twisty/old/dom/viewers/Twisty3DCanvas.ts +0 -256
- package/src/cubing/twisty/old/dom/viewers/TwistyOrbitControls.ts +0 -420
- package/src/cubing/twisty/old/dom/viewers/TwistyViewerElement.ts +0 -5
- package/src/cubing/twisty/old/dom/viewers/TwistyViewerWrapper.ts +0 -45
- package/src/cubing/twisty/views/.DS_Store +0 -0
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.spec.ts +0 -209
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.ts +0 -270
- package/stream/index.d.ts +0 -1
- package/twisty/index.d.ts +0 -1
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { PerspectiveCamera, Vector3, WebGLRenderer } from "three";
|
|
2
|
-
import type { Twisty3DScene } from "../../../views/3D/Twisty3DScene";
|
|
3
|
-
import { RenderScheduler } from "../../animation/RenderScheduler";
|
|
4
|
-
import { ManagedCustomElement } from "../element/ManagedCustomElement";
|
|
5
|
-
import { pixelRatio } from "./canvas";
|
|
6
|
-
import { twisty3DCanvasCSS } from "./Twisty3DCanvas.css";
|
|
7
|
-
import { OrbitCoordinates, TwistyOrbitControls } from "./TwistyOrbitControls";
|
|
8
|
-
import type { TwistyViewerElement } from "./TwistyViewerElement";
|
|
9
|
-
import { customElementsShim } from "../element/node-custom-element-shims";
|
|
10
|
-
import { Stats } from "../../../../vendor/three/examples/jsm/libs/stats.modified.module";
|
|
11
|
-
import type { CameraLatitudeLimits } from "../TwistyPlayerConfig";
|
|
12
|
-
|
|
13
|
-
let SHOW_STATS = false;
|
|
14
|
-
// Show render stats for newly contructed renderers.
|
|
15
|
-
export function experimentalShowRenderStats(show: boolean): void {
|
|
16
|
-
SHOW_STATS = show;
|
|
17
|
-
}
|
|
18
|
-
const shareAllNewRenderers: boolean = false;
|
|
19
|
-
|
|
20
|
-
let sharedRenderer: WebGLRenderer | null = null;
|
|
21
|
-
|
|
22
|
-
function newRenderer(): WebGLRenderer {
|
|
23
|
-
return new WebGLRenderer({
|
|
24
|
-
antialias: true,
|
|
25
|
-
alpha: true, // TODO
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function newSharedRenderer(): WebGLRenderer {
|
|
30
|
-
return sharedRenderer ?? (sharedRenderer = newRenderer());
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// <twisty-3d-canvas>
|
|
34
|
-
export class Twisty3DCanvas
|
|
35
|
-
extends ManagedCustomElement
|
|
36
|
-
implements TwistyViewerElement
|
|
37
|
-
{
|
|
38
|
-
private scene: Twisty3DScene;
|
|
39
|
-
public canvas: HTMLCanvasElement;
|
|
40
|
-
public camera: PerspectiveCamera;
|
|
41
|
-
private legacyExperimentalShift: number = 0;
|
|
42
|
-
orbitControls: TwistyOrbitControls;
|
|
43
|
-
private scheduler = new RenderScheduler(this.render.bind(this));
|
|
44
|
-
private resizePending: boolean = false;
|
|
45
|
-
|
|
46
|
-
private renderer: WebGLRenderer; // TODO: share renderers across elements? (issue: renderers are not designed to be constantly resized?)
|
|
47
|
-
private rendererIsShared: boolean;
|
|
48
|
-
private canvas2DContext: CanvasRenderingContext2D;
|
|
49
|
-
|
|
50
|
-
private stats: Stats | null = null;
|
|
51
|
-
|
|
52
|
-
// TODO: Are there any render duration performance concerns with removing this?
|
|
53
|
-
#invisible: boolean = false;
|
|
54
|
-
#onRenderFinish: null | (() => void) = null;
|
|
55
|
-
constructor(
|
|
56
|
-
scene?: Twisty3DScene,
|
|
57
|
-
options: {
|
|
58
|
-
orbitCoordinates?: OrbitCoordinates;
|
|
59
|
-
negateCameraPosition?: boolean;
|
|
60
|
-
} = {},
|
|
61
|
-
) {
|
|
62
|
-
super();
|
|
63
|
-
this.addCSS(twisty3DCanvasCSS);
|
|
64
|
-
|
|
65
|
-
this.scene = scene!;
|
|
66
|
-
this.scene?.addRenderTarget(this); // TODO
|
|
67
|
-
if (SHOW_STATS) {
|
|
68
|
-
this.stats = new Stats();
|
|
69
|
-
this.stats.dom.style.position = "absolute";
|
|
70
|
-
this.addElement(this.stats.dom);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// We rely on the resize logic to handle renderer dimensions.
|
|
74
|
-
this.rendererIsShared = shareAllNewRenderers;
|
|
75
|
-
this.renderer = this.rendererIsShared ? newSharedRenderer() : newRenderer();
|
|
76
|
-
this.canvas = this.rendererIsShared
|
|
77
|
-
? document.createElement("canvas")
|
|
78
|
-
: this.renderer.domElement;
|
|
79
|
-
this.canvas2DContext = this.canvas.getContext("2d")!; // TODO: avoid saving unneeded?
|
|
80
|
-
this.addElement(this.canvas);
|
|
81
|
-
|
|
82
|
-
this.camera = new PerspectiveCamera(
|
|
83
|
-
20,
|
|
84
|
-
1, // We rely on the resize logic to handle this.
|
|
85
|
-
0.1,
|
|
86
|
-
20,
|
|
87
|
-
);
|
|
88
|
-
this.camera.position.copy(new Vector3(2, 4, 4));
|
|
89
|
-
this.orbitControls = new TwistyOrbitControls(
|
|
90
|
-
this.camera,
|
|
91
|
-
this.canvas,
|
|
92
|
-
this.scheduleRender.bind(this),
|
|
93
|
-
);
|
|
94
|
-
if (options.orbitCoordinates) {
|
|
95
|
-
this.orbitControls.latitude =
|
|
96
|
-
options.orbitCoordinates.latitude *
|
|
97
|
-
(options.negateCameraPosition ? -1 : 1);
|
|
98
|
-
}
|
|
99
|
-
if (options.orbitCoordinates) {
|
|
100
|
-
this.orbitControls.longitude =
|
|
101
|
-
options.orbitCoordinates.longitude +
|
|
102
|
-
(options.negateCameraPosition ? 180 : 0);
|
|
103
|
-
}
|
|
104
|
-
if (options.orbitCoordinates) {
|
|
105
|
-
this.orbitControls.distance = options.orbitCoordinates.distance;
|
|
106
|
-
}
|
|
107
|
-
this.camera.lookAt(new Vector3(0, 0, 0)); // TODO: Handle with `negateCameraPosition`
|
|
108
|
-
|
|
109
|
-
const observer = new ResizeObserver(this.onResize.bind(this));
|
|
110
|
-
observer.observe(this.contentWrapper);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
public setMirror(partner: Twisty3DCanvas): void {
|
|
114
|
-
this.orbitControls.setMirror(partner.orbitControls);
|
|
115
|
-
partner.orbitControls.setMirror(this.orbitControls);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/** @deprecated */
|
|
119
|
-
public experimentalSetLatitudeLimits(limits: CameraLatitudeLimits): void {
|
|
120
|
-
this.orbitControls.experimentalLatitudeLimits = limits;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
protected connectedCallback(): void {
|
|
124
|
-
// Resize as soon as we're in the DOM, to avoid a flash of incorrectly sized content.
|
|
125
|
-
this.#resize();
|
|
126
|
-
this.render();
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
scheduleRender(): void {
|
|
130
|
-
this.scheduler.requestAnimFrame();
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// If the current size/state is incorrect, it may be preferable to hide it
|
|
134
|
-
// briefly, rather than flashing an incorrect version for one frame.
|
|
135
|
-
makeInvisibleUntilRender(): void {
|
|
136
|
-
this.contentWrapper.classList.add("invisible");
|
|
137
|
-
this.#invisible = true;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/** @deprecated */
|
|
141
|
-
experimentalSetOnRenderFinish(f: null | (() => void)): void {
|
|
142
|
-
this.#onRenderFinish = f;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
private render(): void {
|
|
146
|
-
// Cancel any scheduled frame, since we're rendering right now.
|
|
147
|
-
// We don't need to re-render until something schedules again.
|
|
148
|
-
this.stats?.begin();
|
|
149
|
-
this.scheduler.cancelAnimFrame();
|
|
150
|
-
if (this.resizePending) {
|
|
151
|
-
this.#resize();
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
if (this.rendererIsShared) {
|
|
155
|
-
this.renderer.setSize(this.canvas.width, this.canvas.height, false);
|
|
156
|
-
this.canvas2DContext.clearRect(
|
|
157
|
-
0,
|
|
158
|
-
0,
|
|
159
|
-
this.canvas.width,
|
|
160
|
-
this.canvas.height,
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
if (this.scene) {
|
|
164
|
-
this.renderer.render(this.scene, this.camera); // TODO
|
|
165
|
-
}
|
|
166
|
-
if (this.rendererIsShared) {
|
|
167
|
-
this.canvas2DContext.drawImage(this.renderer.domElement, 0, 0);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (this.#invisible) {
|
|
171
|
-
this.contentWrapper.classList.remove("invisible");
|
|
172
|
-
}
|
|
173
|
-
this.stats?.end();
|
|
174
|
-
|
|
175
|
-
if (this.#onRenderFinish) {
|
|
176
|
-
this.#onRenderFinish();
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
private onResize(): void {
|
|
181
|
-
this.resizePending = true;
|
|
182
|
-
this.scheduleRender();
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
#resize(minWidth: number = 0, minHeight: number = 0): void {
|
|
186
|
-
this.resizePending = false;
|
|
187
|
-
|
|
188
|
-
const w = Math.max(this.contentWrapper.clientWidth, minWidth);
|
|
189
|
-
const h = Math.max(this.contentWrapper.clientHeight, minHeight);
|
|
190
|
-
let off = 0;
|
|
191
|
-
if (this.legacyExperimentalShift > 0) {
|
|
192
|
-
off = Math.max(0, Math.floor((w - h) * 0.5));
|
|
193
|
-
} else if (this.legacyExperimentalShift < 0) {
|
|
194
|
-
off = -Math.max(0, Math.floor((w - h) * 0.5));
|
|
195
|
-
}
|
|
196
|
-
let yoff = 0;
|
|
197
|
-
let excess = 0;
|
|
198
|
-
if (h > w) {
|
|
199
|
-
excess = h - w;
|
|
200
|
-
yoff = -Math.floor(0.5 * excess);
|
|
201
|
-
}
|
|
202
|
-
this.camera.aspect = w / h;
|
|
203
|
-
this.camera.setViewOffset(w, h - excess, off, yoff, w, h);
|
|
204
|
-
this.camera.updateProjectionMatrix(); // TODO
|
|
205
|
-
|
|
206
|
-
if (this.rendererIsShared) {
|
|
207
|
-
this.canvas.width = w * pixelRatio();
|
|
208
|
-
this.canvas.height = h * pixelRatio();
|
|
209
|
-
this.canvas.style.width = w.toString();
|
|
210
|
-
this.canvas.style.height = w.toString();
|
|
211
|
-
} else {
|
|
212
|
-
this.renderer.setPixelRatio(pixelRatio());
|
|
213
|
-
this.renderer.setSize(w, h, true);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
this.scheduleRender();
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
// Square crop is useful for rending icons.
|
|
220
|
-
renderToDataURL(
|
|
221
|
-
options: {
|
|
222
|
-
squareCrop?: boolean;
|
|
223
|
-
minWidth?: number;
|
|
224
|
-
minHeight?: number;
|
|
225
|
-
} = {},
|
|
226
|
-
): string {
|
|
227
|
-
this.#resize(options.minWidth, options.minHeight);
|
|
228
|
-
|
|
229
|
-
// We don't preserve the drawing buffer, so we have to render again and then immediately read the canvas data.
|
|
230
|
-
// https://stackoverflow.com/a/30647502
|
|
231
|
-
this.render();
|
|
232
|
-
|
|
233
|
-
let url: string;
|
|
234
|
-
// TODO: can we assume that a central crop is similar enough to how a square canvas render would loook?
|
|
235
|
-
if (!options.squareCrop || this.canvas.width === this.canvas.height) {
|
|
236
|
-
// TODO: is this such an uncommon path that we can skip it?
|
|
237
|
-
url = this.canvas.toDataURL();
|
|
238
|
-
} else {
|
|
239
|
-
const tempCanvas = document.createElement("canvas");
|
|
240
|
-
const squareSize = Math.min(this.canvas.width, this.canvas.height);
|
|
241
|
-
tempCanvas.width = squareSize;
|
|
242
|
-
tempCanvas.height = squareSize;
|
|
243
|
-
const tempCtx = tempCanvas.getContext("2d")!; // TODO: can we assume this is always availab?E
|
|
244
|
-
tempCtx.drawImage(
|
|
245
|
-
this.canvas,
|
|
246
|
-
-(this.canvas.width - squareSize) / 2,
|
|
247
|
-
-(this.canvas.height - squareSize) / 2,
|
|
248
|
-
);
|
|
249
|
-
url = tempCanvas.toDataURL();
|
|
250
|
-
}
|
|
251
|
-
this.#resize();
|
|
252
|
-
return url;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
customElementsShim.define("twisty-3d-canvas", Twisty3DCanvas);
|
|
@@ -1,420 +0,0 @@
|
|
|
1
|
-
import { Camera, Spherical, Vector3 } from "three";
|
|
2
|
-
import { DEGREES_PER_RADIAN } from "../../../views/3D/TAU";
|
|
3
|
-
import { RenderScheduler } from "../../animation/RenderScheduler";
|
|
4
|
-
import type { CameraLatitudeLimits } from "../TwistyPlayerConfig";
|
|
5
|
-
|
|
6
|
-
// Buffer at the end values of the latitude (phi), to prevent gymbal lock.
|
|
7
|
-
// Without this, the puzzle would flip every frame if you try to push past the
|
|
8
|
-
// end, or snap to a standard longitude (theta).
|
|
9
|
-
const EPSILON = 0.00000001;
|
|
10
|
-
|
|
11
|
-
const INERTIA_DEFAULT: boolean = true;
|
|
12
|
-
const LATITUDE_LIMITS_DEFAULT: CameraLatitudeLimits = "auto";
|
|
13
|
-
|
|
14
|
-
const INERTIA_DURATION_MS = 500;
|
|
15
|
-
// If the first inertial render is this long after the last move, we assume the
|
|
16
|
-
// user has halted the cursor and we consider inertia to have "timed out". We
|
|
17
|
-
// never begin animating the inertia.
|
|
18
|
-
const INERTIA_TIMEOUT_MS = 50;
|
|
19
|
-
|
|
20
|
-
const VERTICAL_MOVEMENT_BASE_SCALE = 0.75;
|
|
21
|
-
|
|
22
|
-
// progress is from 0 to 1.
|
|
23
|
-
function momentumScale(progress: number) {
|
|
24
|
-
// This is the exponential curve flipped so that
|
|
25
|
-
// - The slope at progress = 0 is 1 (this corresponds to "x = 1" on the normal
|
|
26
|
-
// curve).
|
|
27
|
-
// - The scale exponentially "decays" until progress = 1.
|
|
28
|
-
// This means the scale at the end will be about 0.418
|
|
29
|
-
return (Math.exp(1 - progress) - (1 - progress)) / (1 - Math.E) + 1;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
class Inertia {
|
|
33
|
-
private scheduler = new RenderScheduler(this.render.bind(this));
|
|
34
|
-
private lastTimestamp: number;
|
|
35
|
-
constructor(
|
|
36
|
-
private startTimestamp: number,
|
|
37
|
-
private momentumX: number,
|
|
38
|
-
private momentumY: number,
|
|
39
|
-
private callback: (movementX: number, movementY: number) => void,
|
|
40
|
-
) {
|
|
41
|
-
this.scheduler.requestAnimFrame();
|
|
42
|
-
this.lastTimestamp = startTimestamp;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
private render(now: DOMHighResTimeStamp) {
|
|
46
|
-
const progressBefore =
|
|
47
|
-
(this.lastTimestamp - this.startTimestamp) / INERTIA_DURATION_MS;
|
|
48
|
-
const progressAfter = Math.min(
|
|
49
|
-
1,
|
|
50
|
-
(now - this.startTimestamp) / INERTIA_DURATION_MS,
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
if (
|
|
54
|
-
progressBefore === 0 &&
|
|
55
|
-
progressAfter > INERTIA_TIMEOUT_MS / INERTIA_DURATION_MS
|
|
56
|
-
) {
|
|
57
|
-
// The user has already paused for a while. Don't start any inertia.
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const delta = momentumScale(progressAfter) - momentumScale(progressBefore);
|
|
62
|
-
|
|
63
|
-
// TODO: For now, we only carry horizontal momentum. If this should stay, we
|
|
64
|
-
// can remove the plumbing for the Y dimension.
|
|
65
|
-
this.callback(this.momentumX * delta * 1000, this.momentumY * delta * 1000);
|
|
66
|
-
|
|
67
|
-
if (progressAfter < 1) {
|
|
68
|
-
this.scheduler.requestAnimFrame();
|
|
69
|
-
}
|
|
70
|
-
this.lastTimestamp = now;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export interface OrbitCoordinates {
|
|
75
|
-
latitude: number;
|
|
76
|
-
longitude: number;
|
|
77
|
-
distance: number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export function positionToOrbitCoordinates(
|
|
81
|
-
position: Vector3,
|
|
82
|
-
): OrbitCoordinates {
|
|
83
|
-
const spherical = new Spherical();
|
|
84
|
-
spherical.setFromVector3(position);
|
|
85
|
-
return {
|
|
86
|
-
latitude: 90 - spherical.phi * DEGREES_PER_RADIAN,
|
|
87
|
-
longitude: spherical.theta * DEGREES_PER_RADIAN,
|
|
88
|
-
distance: spherical.radius,
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// TODO: change mouse cursor while moving.
|
|
93
|
-
export class TwistyOrbitControls {
|
|
94
|
-
// TODO: should we store as lat/long directly and stick to more rounded values in degrees?
|
|
95
|
-
#spherical: Spherical = new Spherical();
|
|
96
|
-
#lookAt: Vector3 = new Vector3(0, 0, 0);
|
|
97
|
-
// longitude: number;
|
|
98
|
-
// latitude: number;
|
|
99
|
-
// altitude: number;
|
|
100
|
-
|
|
101
|
-
lookAt(v: Vector3): void {
|
|
102
|
-
if (!this.#acceptPropagation) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
this.#lookAt = v;
|
|
106
|
-
|
|
107
|
-
this.#acceptPropagation = false;
|
|
108
|
-
this.#adjust();
|
|
109
|
-
this.scheduleRender();
|
|
110
|
-
try {
|
|
111
|
-
if (this.mirrorControls) {
|
|
112
|
-
// TODO: will these ever need to be separate?
|
|
113
|
-
this.mirrorControls.lookAt(v);
|
|
114
|
-
}
|
|
115
|
-
} finally {
|
|
116
|
-
this.#acceptPropagation = true;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
set latitude(newLatitude: number) {
|
|
121
|
-
// this.#pullFromCamera();
|
|
122
|
-
this.#spherical.phi = (90 - newLatitude) / DEGREES_PER_RADIAN;
|
|
123
|
-
this.#propagateSpherical();
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
get latitude(): number {
|
|
127
|
-
return 90 - this.#spherical.phi * DEGREES_PER_RADIAN;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
set longitude(newLongitude: number) {
|
|
131
|
-
// this.#pullFromCamera();
|
|
132
|
-
this.#spherical.theta = newLongitude / DEGREES_PER_RADIAN;
|
|
133
|
-
this.#propagateSpherical();
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// TODO: Wrap into [-180, 180]
|
|
137
|
-
get longitude(): number {
|
|
138
|
-
return this.#spherical.theta * DEGREES_PER_RADIAN;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
set distance(newDistance: number) {
|
|
142
|
-
// this.#pullFromCamera();
|
|
143
|
-
this.#spherical.radius = newDistance;
|
|
144
|
-
this.#propagateSpherical();
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
get distance(): number {
|
|
148
|
-
return this.#spherical.radius;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/** @deprecated */
|
|
152
|
-
get orbitCoordinates(): OrbitCoordinates {
|
|
153
|
-
return {
|
|
154
|
-
latitude: this.latitude,
|
|
155
|
-
longitude: this.longitude,
|
|
156
|
-
distance: this.distance,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
/** @deprecated */
|
|
161
|
-
set orbitCoordinates(orbitCoordinates: OrbitCoordinates) {
|
|
162
|
-
this.latitude = orbitCoordinates.latitude;
|
|
163
|
-
this.longitude = orbitCoordinates.longitude;
|
|
164
|
-
this.distance = orbitCoordinates.distance;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/** @deprecated */
|
|
168
|
-
experimentalInertia: boolean = INERTIA_DEFAULT;
|
|
169
|
-
/** @deprecated */
|
|
170
|
-
experimentalLatitudeLimits: CameraLatitudeLimits = LATITUDE_LIMITS_DEFAULT;
|
|
171
|
-
private mirrorControls?: TwistyOrbitControls;
|
|
172
|
-
private lastTouchClientX: number = 0;
|
|
173
|
-
private lastTouchClientY: number = 0;
|
|
174
|
-
private currentTouchID: number | null = null; // TODO: support multiple touches?
|
|
175
|
-
private onMoveBound = this.onMove.bind(this);
|
|
176
|
-
private onMouseMoveBound = this.onMouseMove.bind(this);
|
|
177
|
-
private onMouseEndBound = this.onMouseEnd.bind(this);
|
|
178
|
-
private onTouchMoveBound = this.onTouchMove.bind(this);
|
|
179
|
-
private onTouchEndBound = this.onTouchEnd.bind(this);
|
|
180
|
-
private lastTouchTimestamp: number = 0;
|
|
181
|
-
private lastTouchMoveMomentumX: number = 0;
|
|
182
|
-
private lastTouchMoveMomentumY: number = 0;
|
|
183
|
-
private lastMouseTimestamp: number = 0;
|
|
184
|
-
private lastMouseMoveMomentumX: number = 0;
|
|
185
|
-
private lastMouseMoveMomentumY: number = 0;
|
|
186
|
-
public experimentalHasBeenMoved: boolean = false;
|
|
187
|
-
constructor(
|
|
188
|
-
private camera: Camera,
|
|
189
|
-
private canvas: HTMLCanvasElement,
|
|
190
|
-
private scheduleRender: () => void,
|
|
191
|
-
) {
|
|
192
|
-
this.#spherical.setFromVector3(camera.position);
|
|
193
|
-
this.#propagateSpherical();
|
|
194
|
-
canvas.addEventListener("mousedown", this.onMouseStart.bind(this));
|
|
195
|
-
canvas.addEventListener("touchstart", this.onTouchStart.bind(this));
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
// f is the fraction of the canvas traversed per ms.
|
|
199
|
-
temperMovement(f: number): number {
|
|
200
|
-
// This is scaled to be linear for small values, but to reduce large values
|
|
201
|
-
// by a significant factor.
|
|
202
|
-
return (Math.sign(f) * Math.log(Math.abs(f * 10) + 1)) / 6;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
onMouseStart(e: MouseEvent): void {
|
|
206
|
-
this.experimentalHasBeenMoved = true;
|
|
207
|
-
window.addEventListener("mousemove", this.onMouseMoveBound);
|
|
208
|
-
window.addEventListener("mouseup", this.onMouseEndBound);
|
|
209
|
-
this.onStart(e);
|
|
210
|
-
|
|
211
|
-
this.lastMouseTimestamp = e.timeStamp;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
onMouseMove(e: MouseEvent): void {
|
|
215
|
-
if (e.buttons === 0) {
|
|
216
|
-
// Certain elements (e.g. disabled buttons) can capture the `mouseup`
|
|
217
|
-
// event. So if we notice that there are no mouse buttons pressed, we stop
|
|
218
|
-
// the movement.
|
|
219
|
-
this.onMouseEnd(e);
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
if (e.movementX === 0 && e.movementY === 0) {
|
|
224
|
-
// Short-circuit
|
|
225
|
-
console.log("short-circuit mouse!");
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const minDim = Math.min(this.canvas.offsetWidth, this.canvas.offsetHeight);
|
|
230
|
-
const movementX = this.temperMovement(e.movementX / minDim);
|
|
231
|
-
const movementY = this.temperMovement(
|
|
232
|
-
(e.movementY / minDim) * VERTICAL_MOVEMENT_BASE_SCALE,
|
|
233
|
-
);
|
|
234
|
-
this.onMove(movementX, movementY);
|
|
235
|
-
|
|
236
|
-
const deltaMs = e.timeStamp - this.lastMouseTimestamp;
|
|
237
|
-
if (deltaMs > 0) {
|
|
238
|
-
this.lastMouseMoveMomentumX = movementX / deltaMs;
|
|
239
|
-
this.lastMouseMoveMomentumY = movementY / deltaMs;
|
|
240
|
-
this.lastMouseTimestamp = e.timeStamp;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
onMouseEnd(e: MouseEvent): void {
|
|
245
|
-
window.removeEventListener("mousemove", this.onMouseMoveBound);
|
|
246
|
-
window.removeEventListener("mouseup", this.onMouseEndBound);
|
|
247
|
-
this.onEnd(e);
|
|
248
|
-
|
|
249
|
-
if (this.experimentalInertia) {
|
|
250
|
-
new Inertia(
|
|
251
|
-
this.lastMouseTimestamp,
|
|
252
|
-
this.lastMouseMoveMomentumX,
|
|
253
|
-
this.lastMouseMoveMomentumY,
|
|
254
|
-
this.onMoveBound,
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
onTouchStart(e: TouchEvent): void {
|
|
260
|
-
this.experimentalHasBeenMoved = true;
|
|
261
|
-
if (this.currentTouchID === null) {
|
|
262
|
-
if (e.touches[0].clientX === 0 && e.touches[0].clientY === 0) {
|
|
263
|
-
// Short-circuit
|
|
264
|
-
console.log("short-circuit touch!");
|
|
265
|
-
return;
|
|
266
|
-
}
|
|
267
|
-
this.currentTouchID = e.changedTouches[0].identifier;
|
|
268
|
-
this.lastTouchClientX = e.touches[0].clientX;
|
|
269
|
-
this.lastTouchClientY = e.touches[0].clientY;
|
|
270
|
-
window.addEventListener("touchmove", this.onTouchMoveBound);
|
|
271
|
-
window.addEventListener("touchend", this.onTouchEndBound);
|
|
272
|
-
window.addEventListener("touchcancel", this.onTouchEndBound);
|
|
273
|
-
this.onStart(e);
|
|
274
|
-
|
|
275
|
-
this.lastTouchTimestamp = e.timeStamp;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
onTouchMove(e: TouchEvent): void {
|
|
280
|
-
for (let i = 0; i < e.changedTouches.length; i++) {
|
|
281
|
-
const touch = e.changedTouches[i];
|
|
282
|
-
if (touch.identifier === this.currentTouchID) {
|
|
283
|
-
const minDim = Math.min(
|
|
284
|
-
this.canvas.offsetWidth,
|
|
285
|
-
this.canvas.offsetHeight,
|
|
286
|
-
);
|
|
287
|
-
const movementX = this.temperMovement(
|
|
288
|
-
(touch.clientX - this.lastTouchClientX) / minDim,
|
|
289
|
-
);
|
|
290
|
-
const movementY = this.temperMovement(
|
|
291
|
-
((touch.clientY - this.lastTouchClientY) / minDim) *
|
|
292
|
-
VERTICAL_MOVEMENT_BASE_SCALE,
|
|
293
|
-
);
|
|
294
|
-
this.onMove(movementX, movementY);
|
|
295
|
-
this.lastTouchClientX = touch.clientX;
|
|
296
|
-
this.lastTouchClientY = touch.clientY;
|
|
297
|
-
|
|
298
|
-
const deltaMs = e.timeStamp - this.lastTouchTimestamp;
|
|
299
|
-
if (deltaMs > 0) {
|
|
300
|
-
this.lastTouchMoveMomentumX = movementX / deltaMs;
|
|
301
|
-
this.lastTouchMoveMomentumY = movementY / deltaMs;
|
|
302
|
-
this.lastTouchTimestamp = e.timeStamp;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
onTouchEnd(e: TouchEvent): void {
|
|
309
|
-
for (let i = 0; i < e.changedTouches.length; i++) {
|
|
310
|
-
const touch = e.changedTouches[i];
|
|
311
|
-
if (touch.identifier === this.currentTouchID) {
|
|
312
|
-
this.currentTouchID = null;
|
|
313
|
-
window.removeEventListener("touchmove", this.onTouchMoveBound);
|
|
314
|
-
window.removeEventListener("touchend", this.onTouchEndBound);
|
|
315
|
-
window.removeEventListener("touchcancel", this.onTouchEndBound);
|
|
316
|
-
this.onEnd(e);
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
if (this.experimentalInertia) {
|
|
321
|
-
new Inertia(
|
|
322
|
-
this.lastTouchTimestamp,
|
|
323
|
-
this.lastTouchMoveMomentumX,
|
|
324
|
-
this.lastTouchMoveMomentumY,
|
|
325
|
-
this.onMoveBound,
|
|
326
|
-
);
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
onStart(e: MouseEvent | TouchEvent): void {
|
|
331
|
-
e.preventDefault();
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
onMove(movementX: number, movementY: number): void {
|
|
335
|
-
// TODO: optimize, e.g. by caching or using the spherical coordinates
|
|
336
|
-
// directly if they are still fresh.
|
|
337
|
-
|
|
338
|
-
// this.#pullFromCamera();
|
|
339
|
-
|
|
340
|
-
// console.log(movementX, movementY)
|
|
341
|
-
|
|
342
|
-
const newSpherical = new Spherical();
|
|
343
|
-
newSpherical.copy(this.#spherical);
|
|
344
|
-
|
|
345
|
-
newSpherical.theta += -2 * movementX;
|
|
346
|
-
newSpherical.phi += -2 * movementY;
|
|
347
|
-
if (this.experimentalLatitudeLimits !== "none") {
|
|
348
|
-
newSpherical.phi = Math.max(newSpherical.phi, Math.PI * 0.3); // TODO: Arctic circle: 1/6
|
|
349
|
-
newSpherical.phi = Math.min(newSpherical.phi, Math.PI * 0.7); // TODO: Antarctic circle: 5/6
|
|
350
|
-
} else {
|
|
351
|
-
newSpherical.phi = Math.max(newSpherical.phi, EPSILON);
|
|
352
|
-
newSpherical.phi = Math.min(newSpherical.phi, Math.PI - EPSILON);
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (
|
|
356
|
-
isNaN(newSpherical.theta) ||
|
|
357
|
-
newSpherical.theta === Infinity ||
|
|
358
|
-
newSpherical.theta === -Infinity
|
|
359
|
-
) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (
|
|
364
|
-
isNaN(newSpherical.phi) ||
|
|
365
|
-
newSpherical.phi === Infinity ||
|
|
366
|
-
newSpherical.phi === -Infinity
|
|
367
|
-
) {
|
|
368
|
-
return;
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
this.#spherical = newSpherical;
|
|
372
|
-
this.#propagateSpherical();
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
#adjust(): void {
|
|
376
|
-
this.#spherical.makeSafe(); // TODO: IS this close enouh for all purposes? Can we set exact using e.g. matrices?
|
|
377
|
-
this.camera.position.setFromSpherical(this.#spherical);
|
|
378
|
-
this.camera.lookAt(this.#lookAt);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
#acceptPropagation: boolean = true;
|
|
382
|
-
// #lastTranslation = 0;
|
|
383
|
-
#propagateSpherical(): void {
|
|
384
|
-
this.#acceptPropagation = false;
|
|
385
|
-
try {
|
|
386
|
-
this.#adjust();
|
|
387
|
-
|
|
388
|
-
this.scheduleRender();
|
|
389
|
-
this.mirrorControls?.updateMirroredCamera({
|
|
390
|
-
latitude: this.latitude,
|
|
391
|
-
longitude: this.longitude,
|
|
392
|
-
distance: this.distance,
|
|
393
|
-
});
|
|
394
|
-
// We would take the event in the arguments, and try to call
|
|
395
|
-
// `preventDefault()` on it, but Chrome logs an error event if we try to
|
|
396
|
-
// catch it, because it enforces a passive listener.
|
|
397
|
-
} finally {
|
|
398
|
-
this.#acceptPropagation = true;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
onEnd(e: MouseEvent | TouchEvent): void {
|
|
403
|
-
e.preventDefault();
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
public setMirror(m: TwistyOrbitControls): void {
|
|
407
|
-
this.mirrorControls = m;
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
updateMirroredCamera(orbitCoordinates: OrbitCoordinates): void {
|
|
411
|
-
if (this.#acceptPropagation) {
|
|
412
|
-
this.latitude = -orbitCoordinates.latitude;
|
|
413
|
-
this.longitude = orbitCoordinates.longitude + 180;
|
|
414
|
-
this.distance = orbitCoordinates.distance;
|
|
415
|
-
|
|
416
|
-
this.#adjust();
|
|
417
|
-
this.scheduleRender();
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|