cubing 0.20.2 → 0.21.0-pre12
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 +6 -9
- package/dist/.DS_Store +0 -0
- package/dist/bin/puzzle-geometry-bin.js +1124 -1128
- package/dist/bin/puzzle-geometry-bin.js.map +3 -3
- package/dist/bundle-global/cubing.bundle-global.js +3978 -3587
- package/dist/esm/.DS_Store +0 -0
- package/dist/esm/{2x2x2.kpuzzle.json_-ZLJSYD5K.js → 2x2x2.kpuzzle.json-JOGUSQ4N.js} +3 -3
- package/dist/esm/{2x2x2.kpuzzle.json_-ZLJSYD5K.js.map → 2x2x2.kpuzzle.json-JOGUSQ4N.js.map} +1 -1
- package/dist/esm/{2x2x2.kpuzzle.svg-BNXPAM3A.js → 2x2x2.kpuzzle.svg-CQF2FTV7.js} +2 -2
- package/dist/esm/{2x2x2.kpuzzle.svg-BNXPAM3A.js.map → 2x2x2.kpuzzle.svg-CQF2FTV7.js.map} +0 -0
- package/dist/esm/3d-JZD3V366.js +39 -0
- package/dist/esm/3d-JZD3V366.js.map +7 -0
- package/dist/esm/{3x3x3-ll.kpuzzle.svg-EC42JHOH.js → 3x3x3-ll.kpuzzle.svg-53CBPG5O.js} +2 -2
- package/dist/esm/{3x3x3-ll.kpuzzle.svg-EC42JHOH.js.map → 3x3x3-ll.kpuzzle.svg-53CBPG5O.js.map} +0 -0
- package/dist/esm/{3x3x3.kpuzzle.svg-DUKG2WHC.js → 3x3x3.kpuzzle.svg-ERSSH66P.js} +2 -2
- package/dist/esm/{3x3x3.kpuzzle.svg-DUKG2WHC.js.map → 3x3x3.kpuzzle.svg-ERSSH66P.js.map} +0 -0
- package/dist/esm/alg/index.js +2 -2
- package/dist/esm/bluetooth/index.js +13 -11
- package/dist/esm/bluetooth/index.js.map +2 -2
- package/dist/esm/chunk-5DN4DAAX.js +2512 -0
- package/dist/esm/chunk-5DN4DAAX.js.map +7 -0
- package/dist/esm/{chunk-KKSDHNLH.js → chunk-7GADUDIG.js} +49 -71
- package/dist/esm/chunk-7GADUDIG.js.map +7 -0
- package/dist/esm/{chunk-YNB7QLBF.js → chunk-BU5PUJK3.js} +9 -10
- package/dist/esm/chunk-BU5PUJK3.js.map +7 -0
- package/dist/esm/chunk-CQS6JZ7G.js +762 -0
- package/dist/esm/chunk-CQS6JZ7G.js.map +7 -0
- package/dist/esm/{chunk-2GRKPQQL.js → chunk-RE7MIN5R.js} +2 -2
- package/dist/esm/{chunk-2GRKPQQL.js.map → chunk-RE7MIN5R.js.map} +0 -0
- package/dist/esm/{chunk-WJ7AVUI7.js → chunk-WO2AXYFE.js} +12 -1
- package/dist/esm/{chunk-WJ7AVUI7.js.map → chunk-WO2AXYFE.js.map} +0 -0
- package/dist/esm/{chunk-CWVB5RRW.js → chunk-YV3RT5PX.js} +625 -1282
- package/dist/esm/chunk-YV3RT5PX.js.map +7 -0
- package/dist/esm/{clock.kpuzzle.json_-PXORG6YF.js → clock.kpuzzle.json-EKWRMHJM.js} +3 -3
- package/dist/esm/{clock.kpuzzle.json_-PXORG6YF.js.map → clock.kpuzzle.json-EKWRMHJM.js.map} +1 -1
- package/dist/esm/{clock.kpuzzle.svg-E52B5OQV.js → clock.kpuzzle.svg-B7TMN3SY.js} +2 -2
- package/dist/esm/{clock.kpuzzle.svg-E52B5OQV.js.map → clock.kpuzzle.svg-B7TMN3SY.js.map} +0 -0
- package/dist/esm/esm-test-worker.js +2 -2
- package/dist/esm/esm-test-worker.js.map +1 -1
- package/dist/esm/kpuzzle/index.js +5 -3
- package/dist/esm/{node-SIGYKAZG.js → node-BSAQKO3G.js} +2 -2
- package/dist/esm/{node-SIGYKAZG.js.map → node-BSAQKO3G.js.map} +0 -0
- package/dist/esm/{node-BHGOVUN3.js → node-WEHVBEKP.js} +2 -2
- package/dist/esm/{node-BHGOVUN3.js.map → node-WEHVBEKP.js.map} +0 -0
- package/dist/esm/notation/index.js +3 -3
- package/dist/esm/protocol/index.js +3 -3
- package/dist/esm/puzzle-geometry/index.js +1085 -1179
- package/dist/esm/puzzle-geometry/index.js.map +3 -3
- package/dist/esm/puzzles/index.js +10 -4
- package/dist/esm/{pyraminx.kpuzzle.svg-QKUJX37T.js → pyraminx.kpuzzle.svg-QBBMZVDY.js} +2 -2
- package/dist/esm/{pyraminx.kpuzzle.svg-QKUJX37T.js.map → pyraminx.kpuzzle.svg-QBBMZVDY.js.map} +0 -0
- package/dist/esm/scramble/index.js +5 -4
- package/dist/esm/search/index.js +7 -4
- package/dist/esm/{sq1-hyperorbit.kpuzzle.json_-7KW5LSXC.js → sq1-hyperorbit.kpuzzle.json-N3FGCPML.js} +3 -3
- package/dist/esm/{sq1-hyperorbit.kpuzzle.json_-7KW5LSXC.js.map → sq1-hyperorbit.kpuzzle.json-N3FGCPML.js.map} +1 -1
- package/dist/esm/{sq1-hyperorbit.kpuzzle.svg-7Y7N37NN.js → sq1-hyperorbit.kpuzzle.svg-ID57EER7.js} +2 -2
- package/dist/esm/{sq1-hyperorbit.kpuzzle.svg-7Y7N37NN.js.map → sq1-hyperorbit.kpuzzle.svg-ID57EER7.js.map} +0 -0
- package/dist/esm/stream/index.js +3 -3
- package/dist/esm/stream/index.js.map +2 -2
- package/dist/esm/twisty/index.js +4442 -3214
- package/dist/esm/twisty/index.js.map +3 -3
- package/dist/esm/worker-inside-generated-string-KDZOUGJF.js +2831 -0
- package/dist/esm/worker-inside-generated-string-KDZOUGJF.js.map +7 -0
- package/dist/types/alg/Alg.d.ts +88 -0
- package/dist/types/alg/Alg.d.ts.map +1 -1
- package/dist/types/alg/Alg.spec.d.ts +2 -0
- package/dist/types/alg/Alg.spec.d.ts.map +1 -0
- package/dist/types/alg/common.d.ts.map +1 -1
- package/dist/types/alg/operation.spec.d.ts +2 -0
- package/dist/types/alg/operation.spec.d.ts.map +1 -0
- package/dist/types/alg/parse.spec.d.ts +2 -0
- package/dist/types/alg/parse.spec.d.ts.map +1 -0
- package/dist/types/alg/test/alg-comparison.d.ts.map +1 -1
- package/dist/types/alg/test/alg.spec.d.ts +2 -0
- package/dist/types/alg/test/alg.spec.d.ts.map +1 -0
- package/dist/types/alg/units/leaves/LineComment.spec.d.ts +2 -0
- package/dist/types/alg/units/leaves/LineComment.spec.d.ts.map +1 -0
- package/dist/types/alg/units/leaves/Move.spec.d.ts +2 -0
- package/dist/types/alg/units/leaves/Move.spec.d.ts.map +1 -0
- package/dist/types/alg/url.spec.d.ts +2 -0
- package/dist/types/alg/url.spec.d.ts.map +1 -0
- package/dist/types/bluetooth/smart-puzzle/bluetooth-puzzle.d.ts +1 -1
- package/dist/types/bluetooth/smart-puzzle/bluetooth-puzzle.d.ts.map +1 -1
- package/dist/types/bluetooth/smart-puzzle/giiker.spec.d.ts +5 -0
- package/dist/types/bluetooth/smart-puzzle/giiker.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/3x3x3/3x3x3.kpuzzle.json.d.ts +3 -0
- package/dist/types/kpuzzle/3x3x3/3x3x3.kpuzzle.json.d.ts.map +1 -0
- package/dist/types/kpuzzle/3x3x3/3x3x3.kpuzzle.json.spec.d.ts +2 -0
- package/dist/types/kpuzzle/3x3x3/3x3x3.kpuzzle.json.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/canon.spec.d.ts +2 -0
- package/dist/types/kpuzzle/canon.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/index.d.ts +1 -0
- package/dist/types/kpuzzle/index.d.ts.map +1 -1
- package/dist/types/kpuzzle/kpuzzle.spec.d.ts +2 -0
- package/dist/types/kpuzzle/kpuzzle.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/prunetable.spec.d.ts +2 -0
- package/dist/types/kpuzzle/prunetable.spec.d.ts.map +1 -0
- package/dist/types/kpuzzle/svg.d.ts.map +1 -1
- package/dist/types/kpuzzle/transformations.spec.d.ts +2 -0
- package/dist/types/kpuzzle/transformations.spec.d.ts.map +1 -0
- package/dist/types/protocol/binary/binary3x3x3.spec.d.ts +2 -0
- package/dist/types/protocol/binary/binary3x3x3.spec.d.ts.map +1 -0
- package/dist/types/protocol/binary/hex.spec.d.ts +2 -0
- package/dist/types/protocol/binary/hex.spec.d.ts.map +1 -0
- package/dist/types/protocol/binary/orbit-indexing.spec.d.ts +2 -0
- package/dist/types/protocol/binary/orbit-indexing.spec.d.ts.map +1 -0
- package/dist/types/puzzle-geometry/Options.d.ts +45 -1
- package/dist/types/puzzle-geometry/Options.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts +2 -0
- package/dist/types/puzzle-geometry/PGPuzzles.spec.d.ts.map +1 -0
- package/dist/types/puzzle-geometry/PermOriSet.d.ts +39 -39
- package/dist/types/puzzle-geometry/PermOriSet.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts +118 -110
- package/dist/types/puzzle-geometry/PuzzleGeometry.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/Quat.d.ts +0 -11
- package/dist/types/puzzle-geometry/Quat.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/Quat.spec.d.ts +2 -0
- package/dist/types/puzzle-geometry/Quat.spec.d.ts.map +1 -0
- package/dist/types/puzzle-geometry/SchreierSims.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/index.d.ts +2 -4
- package/dist/types/puzzle-geometry/index.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/interfaces.d.ts +1 -21
- package/dist/types/puzzle-geometry/interfaces.d.ts.map +1 -1
- package/dist/types/puzzle-geometry/orientcenters.spec.d.ts +2 -0
- package/dist/types/puzzle-geometry/orientcenters.spec.d.ts.map +1 -0
- package/dist/types/puzzles/async/async-pg3d.d.ts.map +1 -1
- package/dist/types/puzzles/customPGPuzzleLoader.d.ts +12 -0
- package/dist/types/puzzles/customPGPuzzleLoader.d.ts.map +1 -0
- package/dist/types/puzzles/implementations/2x2x2/{2x2x2.kpuzzle.json_.d.ts → 2x2x2.kpuzzle.json.d.ts} +1 -1
- package/dist/types/puzzles/implementations/2x2x2/2x2x2.kpuzzle.json.d.ts.map +1 -0
- package/dist/types/puzzles/implementations/3x3x3/index.d.ts.map +1 -1
- package/dist/types/puzzles/implementations/clock/{clock.kpuzzle.json_.d.ts → clock.kpuzzle.json.d.ts} +1 -1
- package/dist/types/puzzles/implementations/clock/clock.kpuzzle.json.d.ts.map +1 -0
- package/dist/types/puzzles/implementations/fto/index.d.ts +2 -2
- package/dist/types/puzzles/implementations/fto/index.d.ts.map +1 -1
- package/dist/types/puzzles/implementations/pyraminx/{pyraminx.kpuzzle.json_.d.ts → pyraminx.kpuzzle.json.d.ts} +1 -1
- package/dist/types/puzzles/implementations/pyraminx/pyraminx.kpuzzle.json.d.ts.map +1 -0
- package/dist/types/puzzles/implementations/square1/index.d.ts.map +1 -1
- package/dist/types/puzzles/implementations/square1/{sq1-hyperorbit.kpuzzle.json_.d.ts → sq1-hyperorbit.kpuzzle.json.d.ts} +1 -1
- package/dist/types/puzzles/implementations/square1/sq1-hyperorbit.kpuzzle.json.d.ts.map +1 -0
- package/dist/types/puzzles/index.d.ts +4 -2
- package/dist/types/puzzles/index.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/appearance.d.ts +9 -9
- package/dist/types/puzzles/stickerings/appearance.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/cube-stickerings.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/fto-stickerings.d.ts.map +1 -1
- package/dist/types/puzzles/stickerings/global-custom-stickering-hack.d.ts +3 -0
- package/dist/types/puzzles/stickerings/global-custom-stickering-hack.d.ts.map +1 -0
- package/dist/types/search/index.d.ts +1 -1
- package/dist/types/search/index.d.ts.map +1 -1
- package/dist/types/search/inside/api.d.ts +2 -1
- package/dist/types/search/inside/api.d.ts.map +1 -1
- package/dist/types/search/inside/api.spec.d.ts +2 -0
- package/dist/types/search/inside/api.spec.d.ts.map +1 -0
- package/dist/types/search/inside/solve/parseSGS.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/3x3x3/filter.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/3x3x3/index.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/megaminx.sgs.json.d.ts.map +1 -1
- package/dist/types/search/inside/solve/puzzles/sgs-defs.spec.d.ts +2 -0
- package/dist/types/search/inside/solve/puzzles/sgs-defs.spec.d.ts.map +1 -0
- package/dist/types/search/inside/solve/puzzles/skewb.sgs.json.d.ts.map +1 -1
- package/dist/types/search/inside/solve/tremble.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lib/mathlib.d.ts +4 -31
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lib/mathlib.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/scramble/scramble_444.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/min2phase/gwt.d.ts +3 -0
- package/dist/types/search/inside/solve/vendor/min2phase/gwt.d.ts.map +1 -0
- package/dist/types/search/inside/solve/vendor/random-uint-below/get-random-values.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/random-uint-below/random-int.d.ts.map +1 -1
- package/dist/types/search/inside/solve/vendor/sq12phase/scramble_sq1.d.ts.map +1 -1
- package/dist/types/search/instantiator.d.ts.map +1 -1
- package/dist/types/search/outside.d.ts +4 -2
- package/dist/types/search/outside.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/stream/twizzle/TwizzleStream.d.ts +9 -8
- package/dist/types/stream/twizzle/TwizzleStream.d.ts.map +1 -1
- package/dist/types/stream/websocket-proxy.d.ts +1 -1
- package/dist/types/stream/websocket-proxy.d.ts.map +1 -1
- package/dist/types/twisty/controllers/TwistyAnimationController.d.ts +34 -0
- package/dist/types/twisty/controllers/TwistyAnimationController.d.ts.map +1 -0
- package/dist/types/twisty/controllers/TwistyPlayerController.d.ts +16 -0
- package/dist/types/twisty/controllers/TwistyPlayerController.d.ts.map +1 -0
- package/dist/types/twisty/heavy-code-imports/3d.d.ts +3 -0
- package/dist/types/twisty/heavy-code-imports/3d.d.ts.map +1 -0
- package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts +12 -0
- package/dist/types/twisty/heavy-code-imports/dynamic-entries/3d.d.ts.map +1 -0
- package/dist/types/twisty/index.d.ts +20 -15
- package/dist/types/twisty/index.d.ts.map +1 -1
- package/dist/types/twisty/model/PromiseFreshener.d.ts +14 -0
- package/dist/types/twisty/model/PromiseFreshener.d.ts.map +1 -0
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts +84 -0
- package/dist/types/twisty/model/TwistyPlayerModel.d.ts.map +1 -0
- package/dist/types/twisty/model/UserVisibleErrorTracker.d.ts +11 -0
- package/dist/types/twisty/model/UserVisibleErrorTracker.d.ts.map +1 -0
- package/dist/types/twisty/model/helpers.d.ts +5 -0
- package/dist/types/twisty/model/helpers.d.ts.map +1 -0
- package/dist/types/twisty/model/props/TwistyProp.d.ts +60 -0
- package/dist/types/twisty/model/props/TwistyProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/TwistyProp.spec.d.ts +5 -0
- package/dist/types/twisty/model/props/TwistyProp.spec.d.ts.map +1 -0
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts +28 -0
- package/dist/types/twisty/model/props/TwistyPropDebugger.d.ts.map +1 -0
- package/dist/types/twisty/model/props/general/URLProp.d.ts +6 -0
- package/dist/types/twisty/model/props/general/URLProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts +7 -0
- package/dist/types/twisty/model/props/puzzle/display/HintFaceletProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/display/SpriteProp.d.ts +10 -0
- package/dist/types/twisty/model/props/puzzle/display/SpriteProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/display/StickeringProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/AlgProp.d.ts +27 -0
- package/dist/types/twisty/model/props/puzzle/state/AlgProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/AlgTransformationProp.d.ts +14 -0
- package/dist/types/twisty/model/props/puzzle/state/AlgTransformationProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts +15 -0
- package/dist/types/twisty/model/props/puzzle/state/AnchoredStartProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts +12 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts +17 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentLeavesSimplified.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts +15 -0
- package/dist/types/twisty/model/props/puzzle/state/CurrentTransformationProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts +17 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorRequestProp.d.ts +12 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerConstructorRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts +15 -0
- package/dist/types/twisty/model/props/puzzle/state/IndexerProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts +12 -0
- package/dist/types/twisty/model/props/puzzle/state/LegacyPositionProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/PuzzleAlgProp.d.ts +13 -0
- package/dist/types/twisty/model/props/puzzle/state/PuzzleAlgProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/state/SetupAnchorProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleDefProp.d.ts +11 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleDefProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleDescriptionProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleDescriptionProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts +11 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts +6 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts +13 -0
- package/dist/types/twisty/model/props/puzzle/structure/PuzzleLoaderProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/timeline/CoarseTimelineInfoProp.d.ts +25 -0
- package/dist/types/twisty/model/props/timeline/CoarseTimelineInfoProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts +23 -0
- package/dist/types/twisty/model/props/timeline/DetailedTimelineInfoProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts +15 -0
- package/dist/types/twisty/model/props/timeline/PlayingInfoProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/timeline/TempoScaleProp.d.ts +6 -0
- package/dist/types/twisty/model/props/timeline/TempoScaleProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts +16 -0
- package/dist/types/twisty/model/props/timeline/TimestampRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/BackViewProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/BackgroundProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/ButtonAppearanceProp.d.ts +22 -0
- package/dist/types/twisty/model/props/viewer/ButtonAppearanceProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/ControlPanelProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/LatitudeLimit.d.ts +6 -0
- package/dist/types/twisty/model/props/viewer/LatitudeLimit.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts +16 -0
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts +15 -0
- package/dist/types/twisty/model/props/viewer/OrbitCoordinatesRequestProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts +11 -0
- package/dist/types/twisty/model/props/viewer/TimeRangeProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/ViewerLinkProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts +7 -0
- package/dist/types/twisty/model/props/viewer/VisualizationProp.d.ts.map +1 -0
- package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts +13 -0
- package/dist/types/twisty/model/props/viewer/VisualizationStrategyProp.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/RenderScheduler.d.ts +3 -0
- package/dist/types/twisty/old/animation/RenderScheduler.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/Timeline.d.ts +0 -0
- package/dist/types/twisty/old/animation/Timeline.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/cursor/AlgCursor.d.ts +4 -4
- package/dist/types/twisty/old/animation/cursor/AlgCursor.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/cursor/CursorTypes.d.ts +4 -4
- package/dist/types/twisty/old/animation/cursor/CursorTypes.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/easing.d.ts +0 -0
- package/dist/types/twisty/old/animation/easing.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/AlgDuration.d.ts +1 -1
- package/dist/types/twisty/old/animation/indexer/AlgDuration.d.ts.map +1 -0
- package/dist/types/twisty/old/animation/indexer/AlgIndexer.d.ts +36 -0
- package/dist/types/twisty/old/animation/indexer/AlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/SimpleAlgIndexer.d.ts +3 -3
- package/dist/types/twisty/old/animation/indexer/SimpleAlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts +6 -5
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +1 -0
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts +22 -0
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.d.ts.map +1 -0
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/simul-moves.d.ts +26 -0
- package/dist/types/twisty/old/animation/indexer/simultaneous-moves/simul-moves.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/tree/AlgWalker.d.ts +2 -2
- package/dist/types/twisty/old/animation/indexer/tree/AlgWalker.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/indexer/tree/TreeAlgIndexer.d.ts +3 -3
- package/dist/types/twisty/old/animation/indexer/tree/TreeAlgIndexer.d.ts.map +1 -0
- package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts +3 -0
- package/dist/types/twisty/old/animation/indexer/tree/chunkAlgs.d.ts.map +1 -0
- package/dist/types/twisty/{animation → old/animation}/stream/timeline-move-calculation-draft.d.ts +1 -1
- package/dist/types/twisty/old/animation/stream/timeline-move-calculation-draft.d.ts.map +1 -0
- package/dist/types/twisty/{dom/TwistyAlgViewer.css_.d.ts → old/dom/TwistyAlgViewerV1.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.css.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts +52 -0
- package/dist/types/twisty/old/dom/TwistyAlgViewerV1.d.ts.map +1 -0
- package/dist/types/twisty/{dom/TwistyPlayer.css_.d.ts → old/dom/TwistyPlayer.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/TwistyPlayer.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/TwistyPlayer.d.ts +8 -8
- package/dist/types/twisty/old/dom/TwistyPlayer.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts +5 -0
- package/dist/types/twisty/old/dom/TwistyPlayer.spec.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/TwistyPlayerConfig.d.ts +10 -5
- package/dist/types/twisty/old/dom/TwistyPlayerConfig.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts +2 -0
- package/dist/types/twisty/old/dom/controls/TwistyControlElement.d.ts.map +1 -0
- package/dist/types/twisty/{dom/controls/TwistyScrubber.css_.d.ts → old/dom/controls/TwistyScrubber.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/controls/TwistyScrubber.d.ts +1 -1
- package/dist/types/twisty/old/dom/controls/TwistyScrubber.d.ts.map +1 -0
- package/dist/types/twisty/{dom/controls/buttons.css_.d.ts → old/dom/controls/buttons.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/controls/buttons.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/controls/buttons.d.ts +1 -1
- package/dist/types/twisty/old/dom/controls/buttons.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts +5 -0
- package/dist/types/twisty/old/dom/controls/buttons.spec.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/element/ClassListManager.d.ts +0 -0
- package/dist/types/twisty/old/dom/element/ClassListManager.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/element/ElementConfig.d.ts +1 -1
- package/dist/types/twisty/old/dom/element/ElementConfig.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/element/ManagedCustomElement.d.ts +0 -0
- package/dist/types/twisty/old/dom/element/ManagedCustomElement.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/element/node-custom-element-shims.d.ts +0 -0
- package/dist/types/twisty/old/dom/element/node-custom-element-shims.d.ts.map +1 -0
- package/dist/types/twisty/{dom/stream/TwistyStreamSource.css_.d.ts → old/dom/stream/TwistyStreamSource.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/stream/TwistyStreamSource.d.ts +0 -0
- package/dist/types/twisty/old/dom/stream/TwistyStreamSource.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/viewers/Twisty2DSVG.d.ts +2 -2
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVG.d.ts.map +1 -0
- package/dist/types/twisty/{dom/viewers/Twisty2DSVGView.css_.d.ts → old/dom/viewers/Twisty2DSVGView.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/viewers/Twisty2DSVGView.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom/viewers/Twisty3DCanvas.css_.d.ts → old/dom/viewers/Twisty3DCanvas.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/viewers/Twisty3DCanvas.d.ts +1 -2
- package/dist/types/twisty/old/dom/viewers/Twisty3DCanvas.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/viewers/TwistyOrbitControls.d.ts +0 -0
- package/dist/types/twisty/old/dom/viewers/TwistyOrbitControls.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts +4 -0
- package/dist/types/twisty/old/dom/viewers/TwistyViewerElement.d.ts.map +1 -0
- package/dist/types/twisty/{dom/viewers/TwistyViewerWrapper.css_.d.ts → old/dom/viewers/TwistyViewerWrapper.css.d.ts} +1 -1
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → old/dom}/viewers/TwistyViewerWrapper.d.ts +0 -0
- package/dist/types/twisty/old/dom/viewers/TwistyViewerWrapper.d.ts.map +1 -0
- package/dist/types/twisty/old/dom/viewers/canvas.d.ts +3 -0
- package/dist/types/twisty/old/dom/viewers/canvas.d.ts.map +1 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts +29 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzle.d.ts.map +1 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts +16 -0
- package/dist/types/twisty/views/2D/Twisty2DPuzzleWrapper.d.ts.map +1 -0
- package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts +20 -0
- package/dist/types/twisty/views/2D/Twisty2DSceneWrapper.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/RendererPool.d.ts +4 -0
- package/dist/types/twisty/views/3D/RendererPool.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/TAU.d.ts +0 -0
- package/dist/types/twisty/views/3D/TAU.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts +17 -0
- package/dist/types/twisty/views/3D/Twisty3DPuzzleWrapper.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/Twisty3DRenderTarget.d.ts +0 -0
- package/dist/types/twisty/views/3D/Twisty3DRenderTarget.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/Twisty3DScene.d.ts +0 -0
- package/dist/types/twisty/views/3D/Twisty3DScene.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts +28 -0
- package/dist/types/twisty/views/3D/Twisty3DSceneWrapper.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts +32 -0
- package/dist/types/twisty/views/3D/Twisty3DVantage.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts +41 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts +5 -0
- package/dist/types/twisty/views/3D/TwistyOrbitControlsV2.spec.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/puzzles/Cube3D.d.ts +11 -7
- package/dist/types/twisty/views/3D/puzzles/Cube3D.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/puzzles/KPuzzleWrapper.d.ts +2 -2
- package/dist/types/twisty/views/3D/puzzles/KPuzzleWrapper.d.ts.map +1 -0
- package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts +57 -0
- package/dist/types/twisty/views/3D/puzzles/PG3D.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/puzzles/Twisty3DPuzzle.d.ts +1 -1
- package/dist/types/twisty/views/3D/puzzles/Twisty3DPuzzle.d.ts.map +1 -0
- package/dist/types/twisty/{3D → views/3D}/puzzles/TwistyTestBox.d.ts +2 -2
- package/dist/types/twisty/views/3D/puzzles/TwistyTestBox.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts +18 -0
- package/dist/types/twisty/views/TwistyAlgEditor/LeafTokens.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts +3 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.css.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts +40 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.spec.d.ts +5 -0
- package/dist/types/twisty/views/TwistyAlgEditor/TwistyAlgEditor.spec.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgEditor/model.d.ts +61 -0
- package/dist/types/twisty/views/TwistyAlgEditor/model.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts +3 -0
- package/dist/types/twisty/views/TwistyAlgViewer.css.d.ts.map +1 -0
- package/dist/types/twisty/{dom → views}/TwistyAlgViewer.d.ts +6 -6
- package/dist/types/twisty/views/TwistyAlgViewer.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyPlayer.d.ts +97 -0
- package/dist/types/twisty/views/TwistyPlayer.d.ts.map +1 -0
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts +71 -0
- package/dist/types/twisty/views/TwistyPlayerSettable.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts +33 -0
- package/dist/types/twisty/views/control-panel/TwistyButtonsV2.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts +14 -0
- package/dist/types/twisty/views/control-panel/TwistyScrubberV2.d.ts.map +1 -0
- package/dist/types/twisty/views/control-panel/webkit-fullscreen.d.ts +15 -0
- package/dist/types/twisty/views/control-panel/webkit-fullscreen.d.ts.map +1 -0
- package/dist/types/twisty/views/document.d.ts +2 -0
- package/dist/types/twisty/views/document.d.ts.map +1 -0
- package/dist/types/twisty/views/screenshot.d.ts +12 -0
- package/dist/types/twisty/views/screenshot.d.ts.map +1 -0
- package/dist/types/vendor/p-lazy/p-lazy.d.ts +10 -0
- package/dist/types/vendor/p-lazy/p-lazy.d.ts.map +1 -0
- package/dist/types/vendor/three/examples/jsm/libs/stats.modified.module.d.ts +33 -0
- package/dist/types/vendor/three/examples/jsm/libs/stats.modified.module.d.ts.map +1 -0
- package/docs/.DS_Store +0 -0
- package/docs/cubing/.DS_Store +0 -0
- package/docs/cubing/alg/index.html +37 -23
- package/docs/cubing/index.html +56 -252
- package/docs/cubing/scramble/index.html +122 -0
- package/docs/cubing/twisty/index.html +329 -0
- package/docs/main.css +15 -3
- package/package.json +83 -57
- package/src/cubing/.DS_Store +0 -0
- package/src/cubing/alg/.DS_Store +0 -0
- package/src/cubing/alg/Alg.ts +89 -0
- package/src/cubing/alg/common.ts +4 -2
- package/src/cubing/alg/iteration.ts +1 -1
- package/src/cubing/alg/parse.ts +2 -0
- package/src/cubing/alg/test/alg-comparison.ts +1 -0
- package/src/cubing/alg/units/.DS_Store +0 -0
- package/src/cubing/alg/units/Unit.ts +0 -3
- package/src/cubing/alg/units/containers/Commutator.ts +1 -1
- package/src/cubing/alg/units/leaves/Move.ts +4 -4
- package/src/cubing/bluetooth/.DS_Store +0 -0
- package/src/cubing/bluetooth/connect/index.ts +1 -1
- package/src/cubing/bluetooth/smart-puzzle/Heykube.ts +1 -1
- package/src/cubing/bluetooth/smart-puzzle/bluetooth-puzzle.ts +1 -1
- package/src/cubing/bluetooth/smart-puzzle/gan.ts +5 -5
- package/src/cubing/bluetooth/smart-puzzle/giiker.ts +2 -2
- package/src/cubing/bluetooth/smart-puzzle/gocube.ts +5 -5
- package/src/cubing/bluetooth/smart-robot/GanRobot.ts +5 -5
- package/src/cubing/bluetooth/smart-timer/GanTimer.ts +2 -2
- package/src/cubing/kpuzzle/.DS_Store +0 -0
- package/src/cubing/kpuzzle/3x3x3/3x3x3.kpuzzle.json.spec.ts +40 -0
- package/src/cubing/{puzzles/implementations/3x3x3/3x3x3.kpuzzle.json_.ts → kpuzzle/3x3x3/3x3x3.kpuzzle.json.ts} +11 -6
- package/src/cubing/kpuzzle/canon.spec.ts +6 -11
- package/src/cubing/kpuzzle/canonicalize.ts +1 -1
- package/src/cubing/kpuzzle/definition_types.ts +0 -3
- package/src/cubing/kpuzzle/index.ts +1 -0
- package/src/cubing/kpuzzle/prunetable.spec.ts +2 -4
- package/src/cubing/kpuzzle/puzzle-orientation.ts +1 -1
- package/src/cubing/kpuzzle/svg.ts +4 -9
- package/src/cubing/kpuzzle/transformations.ts +1 -1
- package/src/cubing/protocol/binary/binary3x3x3.spec.ts +5 -2
- package/src/cubing/protocol/binary/hex.ts +4 -4
- package/src/cubing/protocol/binary/orbit-indexing.ts +2 -2
- package/src/cubing/protocol/binary/puzzle-orientation.ts +2 -2
- package/src/cubing/puzzle-geometry/Options.ts +151 -22
- package/src/cubing/puzzle-geometry/PGPuzzles.spec.ts +24 -28
- package/src/cubing/puzzle-geometry/PermOriSet.ts +99 -98
- package/src/cubing/puzzle-geometry/PlatonicGenerator.ts +1 -1
- package/src/cubing/puzzle-geometry/PuzzleGeometry.ts +836 -867
- package/src/cubing/puzzle-geometry/Quat.ts +1 -68
- package/src/cubing/puzzle-geometry/SchreierSims.ts +2 -13
- package/src/cubing/puzzle-geometry/index.ts +2 -11
- package/src/cubing/puzzle-geometry/interfaces.ts +1 -27
- package/src/cubing/puzzle-geometry/orientcenters.spec.ts +24 -30
- package/src/cubing/puzzles/.DS_Store +0 -0
- package/src/cubing/puzzles/PuzzleLoader.ts +1 -1
- package/src/cubing/puzzles/async/async-pg3d.ts +5 -8
- package/src/cubing/puzzles/customPGPuzzleLoader.ts +60 -0
- package/src/cubing/puzzles/implementations/.DS_Store +0 -0
- package/src/cubing/puzzles/implementations/2x2x2/{2x2x2.kpuzzle.json_.ts → 2x2x2.kpuzzle.json.ts} +0 -0
- package/src/cubing/puzzles/implementations/2x2x2/index.ts +1 -1
- package/src/cubing/puzzles/implementations/3x3x3/index.ts +2 -3
- package/src/cubing/puzzles/implementations/clock/{clock.kpuzzle.json_.ts → clock.kpuzzle.json.ts} +0 -0
- package/src/cubing/puzzles/implementations/clock/index.ts +1 -1
- package/src/cubing/puzzles/implementations/fto/index.ts +19 -11
- package/src/cubing/puzzles/implementations/pyraminx/{pyraminx.kpuzzle.json_.ts → pyraminx.kpuzzle.json.ts} +0 -0
- package/src/cubing/puzzles/implementations/square1/index.ts +1 -2
- package/src/cubing/puzzles/implementations/square1/{sq1-hyperorbit.kpuzzle.json_.ts → sq1-hyperorbit.kpuzzle.json.ts} +0 -0
- package/src/cubing/puzzles/index.ts +30 -20
- package/src/cubing/puzzles/stickerings/appearance.ts +10 -9
- package/src/cubing/puzzles/stickerings/cube-stickerings.ts +8 -0
- package/src/cubing/puzzles/stickerings/fto-stickerings.ts +9 -0
- package/src/cubing/puzzles/stickerings/global-custom-stickering-hack.ts +61 -0
- package/src/cubing/search/.DS_Store +0 -0
- package/src/cubing/search/.gitignore +1 -2
- package/src/cubing/search/esm-test-worker.js +1 -1
- package/src/cubing/search/index.ts +1 -0
- package/src/cubing/search/inside/api.spec.ts +1 -0
- package/src/cubing/search/inside/api.ts +6 -1
- package/src/cubing/search/inside/solve/parseSGS.ts +7 -11
- package/src/cubing/search/inside/solve/puzzles/2x2x2.ts +3 -3
- package/src/cubing/search/inside/solve/puzzles/3x3x3/filter.ts +0 -6
- package/src/cubing/search/inside/solve/puzzles/3x3x3/index.ts +0 -2
- package/src/cubing/search/inside/solve/puzzles/FTO.sgs +264 -0
- package/src/cubing/search/inside/solve/puzzles/megaminx.sgs.json.ts +4 -6
- package/src/cubing/search/inside/solve/puzzles/skewb.sgs.json.ts +4 -6
- package/src/cubing/search/inside/solve/tremble.ts +6 -9
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/lib/mathlib.ts +20 -822
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/scramble/scramble_444.ts +177 -252
- package/src/cubing/search/inside/solve/vendor/min2phase/gwt.js +62 -222
- package/src/cubing/search/inside/solve/vendor/random-uint-below/get-random-values.ts +4 -5
- package/src/cubing/search/inside/solve/vendor/random-uint-below/random-int.ts +9 -11
- package/src/cubing/search/inside/solve/vendor/sq12phase/scramble_sq1.js +13 -582
- package/src/cubing/search/instantiator.ts +11 -7
- package/src/cubing/search/outside.ts +8 -2
- package/src/cubing/search/worker-inside-generated-string.js +1 -1
- package/src/cubing/stream/.DS_Store +0 -0
- package/src/cubing/stream/process/ReorientedStream.ts +1 -1
- package/src/cubing/stream/twizzle/TwizzleStream.ts +11 -8
- package/src/cubing/stream/websocket-proxy.ts +1 -3
- package/src/cubing/twisty/.DS_Store +0 -0
- package/src/cubing/twisty/controllers/TwistyAnimationController.ts +248 -0
- package/src/cubing/twisty/controllers/TwistyPlayerController.ts +38 -0
- package/src/cubing/twisty/heavy-code-imports/3d.ts +18 -0
- package/src/cubing/twisty/heavy-code-imports/dynamic-entries/3d.ts +41 -0
- package/src/cubing/twisty/index.ts +24 -17
- package/src/cubing/twisty/model/.DS_Store +0 -0
- package/src/cubing/twisty/model/PromiseFreshener.ts +49 -0
- package/src/cubing/twisty/model/TwistyPlayerModel.ts +222 -0
- package/src/cubing/twisty/model/UserVisibleErrorTracker.ts +22 -0
- package/src/cubing/twisty/model/helpers.ts +47 -0
- package/src/cubing/{search/vendor → twisty/model/props}/.DS_Store +0 -0
- package/src/cubing/twisty/model/props/TwistyProp.spec.ts +38 -0
- package/src/cubing/twisty/model/props/TwistyProp.ts +366 -0
- package/src/cubing/twisty/model/props/TwistyPropDebugger.ts +370 -0
- package/src/cubing/twisty/model/props/general/URLProp.ts +14 -0
- package/src/cubing/{solve → twisty/model/props/puzzle}/.DS_Store +0 -0
- package/src/cubing/twisty/model/props/puzzle/display/HintFaceletProp.ts +10 -0
- package/src/cubing/twisty/model/props/puzzle/display/SpriteProp.ts +43 -0
- package/src/cubing/twisty/model/props/puzzle/display/StickeringProp.ts +8 -0
- package/src/cubing/twisty/model/props/puzzle/state/AlgProp.ts +91 -0
- package/src/cubing/twisty/model/props/puzzle/state/AlgTransformationProp.ts +28 -0
- package/src/cubing/twisty/model/props/puzzle/state/AnchoredStartProp.ts +44 -0
- package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesProp.ts +91 -0
- package/src/cubing/twisty/model/props/puzzle/state/CurrentLeavesSimplified.ts +48 -0
- package/src/cubing/twisty/model/props/puzzle/state/CurrentTransformationProp.ts +46 -0
- package/src/cubing/twisty/model/props/puzzle/state/IndexerConstructorProp.ts +46 -0
- package/src/cubing/twisty/model/props/puzzle/state/IndexerConstructorRequestProp.ts +15 -0
- package/src/cubing/twisty/model/props/puzzle/state/IndexerProp.ts +24 -0
- package/src/cubing/twisty/model/props/puzzle/state/LegacyPositionProp.ts +22 -0
- package/src/cubing/twisty/model/props/puzzle/state/PuzzleAlgProp.ts +28 -0
- package/src/cubing/twisty/model/props/puzzle/state/SetupAnchorProp.ts +8 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleDefProp.ts +14 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleDescriptionProp.ts +14 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDProp.ts +12 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleIDRequestProp.ts +17 -0
- package/src/cubing/twisty/model/props/puzzle/structure/PuzzleLoaderProp.ts +38 -0
- package/src/cubing/twisty/model/props/timeline/CoarseTimelineInfoProp.ts +45 -0
- package/src/cubing/twisty/model/props/timeline/DetailedTimelineInfoProp.ts +76 -0
- package/src/cubing/twisty/model/props/timeline/PlayingInfoProp.ts +51 -0
- package/src/cubing/twisty/model/props/timeline/TempoScaleProp.ts +13 -0
- package/src/cubing/twisty/model/props/timeline/TimestampRequestProp.ts +38 -0
- package/src/cubing/twisty/model/props/viewer/BackViewProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/BackgroundProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/ButtonAppearanceProp.ts +86 -0
- package/src/cubing/twisty/model/props/viewer/ControlPanelProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/LatitudeLimit.ts +11 -0
- package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesProp.ts +56 -0
- package/src/cubing/twisty/model/props/viewer/OrbitCoordinatesRequestProp.ts +69 -0
- package/src/cubing/twisty/model/props/viewer/TimeRangeProp.ts +15 -0
- package/src/cubing/twisty/model/props/viewer/ViewerLinkProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/VisualizationProp.ts +10 -0
- package/src/cubing/twisty/model/props/viewer/VisualizationStrategyProp.ts +45 -0
- package/src/cubing/twisty/old/.DS_Store +0 -0
- package/src/cubing/twisty/old/animation/.DS_Store +0 -0
- package/src/cubing/twisty/{animation → old/animation}/RenderScheduler.ts +5 -0
- package/src/cubing/twisty/{animation → old/animation}/Timeline.ts +0 -0
- package/src/cubing/twisty/{animation → old/animation}/cursor/AlgCursor.ts +15 -8
- package/src/cubing/twisty/{animation → old/animation}/cursor/CursorTypes.ts +4 -4
- package/src/cubing/twisty/{animation → old/animation}/easing.ts +0 -0
- package/src/cubing/{search/inside → twisty/old/animation/indexer}/.DS_Store +0 -0
- package/src/cubing/twisty/{animation → old/animation}/indexer/AlgDuration.ts +1 -1
- package/src/cubing/twisty/old/animation/indexer/AlgIndexer.ts +86 -0
- package/src/cubing/twisty/{animation → old/animation}/indexer/SimpleAlgIndexer.ts +9 -6
- package/src/cubing/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.ts +181 -0
- package/src/cubing/twisty/old/animation/indexer/simultaneous-moves/SimultaneousMoveIndexerV2.ts +243 -0
- package/src/cubing/twisty/{animation → old/animation}/indexer/simultaneous-moves/simul-moves.ts +46 -34
- package/src/cubing/twisty/{animation → old/animation}/indexer/tree/AlgWalker.ts +6 -3
- package/src/cubing/twisty/{animation → old/animation}/indexer/tree/TreeAlgIndexer.ts +8 -5
- package/src/cubing/twisty/{animation → old/animation}/indexer/tree/chunkAlgs.ts +2 -2
- package/src/cubing/twisty/{animation → old/animation}/stream/timeline-move-calculation-draft.spec.ts.TODO +0 -0
- package/src/cubing/twisty/{animation → old/animation}/stream/timeline-move-calculation-draft.ts +2 -2
- package/src/cubing/twisty/old/dom/.DS_Store +0 -0
- package/src/cubing/twisty/{dom/TwistyAlgViewer.css_.ts → old/dom/TwistyAlgViewerV1.css.ts} +0 -0
- package/src/cubing/twisty/{dom/TwistyAlgViewer.ts → old/dom/TwistyAlgViewerV1.ts} +43 -36
- package/src/cubing/twisty/{dom/TwistyPlayer.css_.ts → old/dom/TwistyPlayer.css.ts} +28 -1
- package/src/cubing/twisty/{dom → old/dom}/TwistyPlayer.spec.ts +5 -6
- package/src/cubing/twisty/{dom → old/dom}/TwistyPlayer.ts +36 -43
- package/src/cubing/twisty/{dom → old/dom}/TwistyPlayerConfig.ts +27 -10
- package/src/cubing/twisty/{dom/controls/TwistyControlElement.ts.ts → old/dom/controls/TwistyControlElement.ts} +0 -0
- package/src/cubing/twisty/{dom/controls/TwistyScrubber.css_.ts → old/dom/controls/TwistyScrubber.css.ts} +0 -0
- package/src/cubing/twisty/{dom → old/dom}/controls/TwistyScrubber.ts +3 -3
- package/src/cubing/twisty/{dom/controls/buttons.css_.ts → old/dom/controls/buttons.css.ts} +14 -1
- package/src/cubing/twisty/{dom → old/dom}/controls/buttons.spec.ts +1 -1
- package/src/cubing/twisty/{dom → old/dom}/controls/buttons.ts +15 -15
- package/src/cubing/twisty/{dom → old/dom}/element/ClassListManager.ts +0 -0
- package/src/cubing/twisty/{dom → old/dom}/element/ElementConfig.ts +1 -1
- package/src/cubing/twisty/{dom → old/dom}/element/ManagedCustomElement.ts +0 -0
- package/src/cubing/twisty/{dom → old/dom}/element/node-custom-element-shims.ts +0 -0
- package/src/cubing/twisty/{dom/stream/TwistyStreamSource.css_.ts → old/dom/stream/TwistyStreamSource.css.ts} +0 -0
- package/src/cubing/twisty/{dom → old/dom}/stream/TwistyStreamSource.ts +8 -8
- package/src/cubing/twisty/{dom → old/dom}/viewers/Twisty2DSVG.ts +7 -9
- package/src/cubing/twisty/{dom/viewers/Twisty2DSVGView.css_.ts → old/dom/viewers/Twisty2DSVGView.css.ts} +0 -0
- package/src/cubing/twisty/{dom/viewers/Twisty3DCanvas.css_.ts → old/dom/viewers/Twisty3DCanvas.css.ts} +0 -0
- package/src/cubing/twisty/{dom → old/dom}/viewers/Twisty3DCanvas.ts +5 -12
- package/src/cubing/twisty/{dom → old/dom}/viewers/TwistyOrbitControls.ts +53 -20
- package/src/cubing/twisty/{dom → old/dom}/viewers/TwistyViewerElement.ts +1 -1
- package/src/cubing/twisty/{dom/viewers/TwistyViewerWrapper.css_.ts → old/dom/viewers/TwistyViewerWrapper.css.ts} +0 -0
- package/src/cubing/twisty/{dom → old/dom}/viewers/TwistyViewerWrapper.ts +1 -1
- package/src/cubing/twisty/old/dom/viewers/canvas.ts +9 -0
- package/src/cubing/twisty/views/.DS_Store +0 -0
- package/src/cubing/twisty/views/2D/Twisty2DPuzzle.ts +150 -0
- package/src/cubing/twisty/views/2D/Twisty2DPuzzleWrapper.ts +52 -0
- package/src/cubing/twisty/views/2D/Twisty2DSceneWrapper.ts +77 -0
- package/src/cubing/twisty/views/3D/RendererPool.ts +53 -0
- package/src/cubing/twisty/{3D → views/3D}/TAU.ts +0 -0
- package/src/cubing/twisty/views/3D/Twisty3DPuzzleWrapper.ts +168 -0
- package/src/cubing/twisty/{3D → views/3D}/Twisty3DRenderTarget.ts +0 -0
- package/src/cubing/twisty/{3D → views/3D}/Twisty3DScene.ts +0 -0
- package/src/cubing/twisty/views/3D/Twisty3DSceneWrapper.ts +144 -0
- package/src/cubing/twisty/views/3D/Twisty3DVantage.ts +244 -0
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.spec.ts +209 -0
- package/src/cubing/twisty/views/3D/TwistyOrbitControlsV2.ts +270 -0
- package/src/cubing/twisty/{3D → views/3D}/puzzles/Cube3D.ts +36 -15
- package/src/cubing/twisty/{3D → views/3D}/puzzles/KPuzzleWrapper.ts +4 -5
- package/src/cubing/twisty/views/3D/puzzles/PG3D.ts +988 -0
- package/src/cubing/twisty/views/3D/puzzles/Twisty3DPuzzle.ts +6 -0
- package/src/cubing/twisty/{3D → views/3D}/puzzles/TwistyTestBox.ts +2 -2
- package/src/cubing/twisty/views/TwistyAlgEditor/LeafTokens.ts +116 -0
- package/src/cubing/twisty/{dom/TwistyAlgEditor.css_.ts → views/TwistyAlgEditor/TwistyAlgEditor.css.ts} +3 -1
- package/src/cubing/twisty/{dom → views/TwistyAlgEditor}/TwistyAlgEditor.spec.ts +7 -6
- package/src/cubing/twisty/views/TwistyAlgEditor/TwistyAlgEditor.ts +360 -0
- package/src/cubing/twisty/views/TwistyAlgEditor/model.ts +179 -0
- package/src/cubing/twisty/views/TwistyAlgViewer.css.ts +25 -0
- package/src/cubing/twisty/views/TwistyAlgViewer.ts +502 -0
- package/src/cubing/twisty/views/TwistyPlayer.ts +327 -0
- package/src/cubing/twisty/views/TwistyPlayerSettable.ts +111 -0
- package/src/cubing/twisty/views/control-panel/TwistyButtonsV2.ts +159 -0
- package/src/cubing/twisty/views/control-panel/TwistyScrubberV2.ts +145 -0
- package/src/cubing/twisty/views/control-panel/webkit-fullscreen.ts +44 -0
- package/src/cubing/twisty/views/document.ts +4 -0
- package/src/cubing/twisty/views/screenshot.ts +90 -0
- package/src/cubing/vendor/.DS_Store +0 -0
- package/src/cubing/vendor/p-lazy/license +9 -0
- package/src/cubing/vendor/p-lazy/p-lazy.ts +52 -0
- package/src/cubing/vendor/p-lazy/readme.md +54 -0
- package/src/cubing/vendor/three/examples/jsm/libs/stats.modified.module.ts +179 -0
- package/dist/esm/chunk-CWVB5RRW.js.map +0 -7
- package/dist/esm/chunk-KKSDHNLH.js.map +0 -7
- package/dist/esm/chunk-YNB7QLBF.js.map +0 -7
- package/dist/esm/worker-inside-generated-string-LT4NV55Q.js +0 -2826
- package/dist/esm/worker-inside-generated-string-LT4NV55Q.js.map +0 -7
- package/dist/types/puzzles/implementations/2x2x2/2x2x2.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/puzzles/implementations/3x3x3/3x3x3.kpuzzle.json_.d.ts +0 -3
- package/dist/types/puzzles/implementations/3x3x3/3x3x3.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/puzzles/implementations/clock/clock.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/puzzles/implementations/pyraminx/pyraminx.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/puzzles/implementations/square1/sq1-hyperorbit.kpuzzle.json_.d.ts.map +0 -1
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lgarron-additions-for-typescript/shim-lib.d.ts +0 -3
- package/dist/types/search/inside/solve/vendor/cstimer/src/js/lgarron-additions-for-typescript/shim-lib.d.ts.map +0 -1
- package/dist/types/twisty/3D/TAU.d.ts.map +0 -1
- package/dist/types/twisty/3D/Twisty3DRenderTarget.d.ts.map +0 -1
- package/dist/types/twisty/3D/Twisty3DScene.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/Cube3D.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/KPuzzleWrapper.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/PG3D.d.ts +0 -51
- package/dist/types/twisty/3D/puzzles/PG3D.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/Twisty3DPuzzle.d.ts.map +0 -1
- package/dist/types/twisty/3D/puzzles/TwistyTestBox.d.ts.map +0 -1
- package/dist/types/twisty/animation/RenderScheduler.d.ts.map +0 -1
- package/dist/types/twisty/animation/Timeline.d.ts.map +0 -1
- package/dist/types/twisty/animation/cursor/AlgCursor.d.ts.map +0 -1
- package/dist/types/twisty/animation/cursor/CursorTypes.d.ts.map +0 -1
- package/dist/types/twisty/animation/easing.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/AlgDuration.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/AlgIndexer.d.ts +0 -15
- package/dist/types/twisty/animation/indexer/AlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/SimpleAlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/simultaneous-moves/simul-moves.d.ts +0 -25
- package/dist/types/twisty/animation/indexer/simultaneous-moves/simul-moves.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/tree/AlgWalker.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/tree/TreeAlgIndexer.d.ts.map +0 -1
- package/dist/types/twisty/animation/indexer/tree/chunkAlgs.d.ts +0 -3
- package/dist/types/twisty/animation/indexer/tree/chunkAlgs.d.ts.map +0 -1
- package/dist/types/twisty/animation/stream/timeline-move-calculation-draft.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgEditor.css_.d.ts +0 -3
- package/dist/types/twisty/dom/TwistyAlgEditor.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgEditor.d.ts +0 -27
- package/dist/types/twisty/dom/TwistyAlgEditor.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgEditorStartCharSearch.d.ts +0 -26
- package/dist/types/twisty/dom/TwistyAlgEditorStartCharSearch.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgViewer.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyAlgViewer.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyPlayer.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyPlayer.d.ts.map +0 -1
- package/dist/types/twisty/dom/TwistyPlayerConfig.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/TwistyControlElement.ts.d.ts +0 -2
- package/dist/types/twisty/dom/controls/TwistyControlElement.ts.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/TwistyScrubber.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/TwistyScrubber.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/buttons.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/controls/buttons.d.ts.map +0 -1
- package/dist/types/twisty/dom/element/ClassListManager.d.ts.map +0 -1
- package/dist/types/twisty/dom/element/ElementConfig.d.ts.map +0 -1
- package/dist/types/twisty/dom/element/ManagedCustomElement.d.ts.map +0 -1
- package/dist/types/twisty/dom/element/node-custom-element-shims.d.ts.map +0 -1
- package/dist/types/twisty/dom/stream/TwistyStreamSource.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/stream/TwistyStreamSource.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/Twisty2DSVG.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/Twisty2DSVGView.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/Twisty3DCanvas.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/Twisty3DCanvas.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/TwistyOrbitControls.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/TwistyViewerElement.d.ts +0 -4
- package/dist/types/twisty/dom/viewers/TwistyViewerElement.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/TwistyViewerWrapper.css_.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/TwistyViewerWrapper.d.ts.map +0 -1
- package/dist/types/twisty/dom/viewers/canvas.d.ts +0 -2
- package/dist/types/twisty/dom/viewers/canvas.d.ts.map +0 -1
- package/dist/types/vendor/three/examples/jsm/libs/stats.module.d.ts +0 -2
- package/dist/types/vendor/three/examples/jsm/libs/stats.module.d.ts.map +0 -1
- package/dist/types/vendor/three/examples/jsm/libs/stats.module.wrapped.d.ts +0 -21
- package/dist/types/vendor/three/examples/jsm/libs/stats.module.wrapped.d.ts.map +0 -1
- package/src/cubing/protocol/.DS_Store +0 -0
- package/src/cubing/puzzle-geometry/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/puzzles/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/puzzles/3x3x3/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/src/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/lgarron-additions-for-typescript/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/lgarron-additions-for-typescript/shim-lib.ts +0 -13
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/lib/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/cstimer/src/js/scramble/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/sgs/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/sgs/src/.DS_Store +0 -0
- package/src/cubing/search/inside/solve/vendor/sgs/src/test/.DS_Store +0 -0
- package/src/cubing/search/vendor/comlink-everywhere/.DS_Store +0 -0
- package/src/cubing/twisty/3D/puzzles/PG3D.ts +0 -600
- package/src/cubing/twisty/3D/puzzles/Twisty3DPuzzle.ts +0 -9
- package/src/cubing/twisty/3D/puzzles/mkbhd.svg +0 -5
- package/src/cubing/twisty/animation/indexer/AlgIndexer.ts +0 -25
- package/src/cubing/twisty/animation/indexer/simultaneous-moves/SimultaneousMoveIndexer.ts +0 -168
- package/src/cubing/twisty/dom/TwistyAlgEditor.ts +0 -373
- package/src/cubing/twisty/dom/TwistyAlgEditorStartCharSearch.ts +0 -138
- package/src/cubing/twisty/dom/viewers/canvas.ts +0 -4
- package/src/cubing/twisty/views/3D/.DS_Store +0 -0
- package/src/cubing/vendor/three/.DS_Store +0 -0
- package/src/cubing/vendor/three/examples/jsm/libs/stats.module.ts +0 -2
- package/src/cubing/vendor/three/examples/jsm/libs/stats.module.wrapped.d.ts +0 -24
- package/src/cubing/vendor/three/examples/jsm/libs/stats.module.wrapped.js +0 -178
|
@@ -0,0 +1,988 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BufferAttribute,
|
|
3
|
+
BufferGeometry,
|
|
4
|
+
Color,
|
|
5
|
+
DoubleSide,
|
|
6
|
+
Euler,
|
|
7
|
+
FrontSide,
|
|
8
|
+
Group,
|
|
9
|
+
Material,
|
|
10
|
+
Mesh,
|
|
11
|
+
MeshBasicMaterial,
|
|
12
|
+
Object3D,
|
|
13
|
+
Texture,
|
|
14
|
+
Vector3,
|
|
15
|
+
} from "three";
|
|
16
|
+
import {
|
|
17
|
+
areTransformationsEquivalent,
|
|
18
|
+
KPuzzleDefinition,
|
|
19
|
+
Transformation,
|
|
20
|
+
} from "../../../../kpuzzle";
|
|
21
|
+
import { experimentalTransformationForQuantumMove } from "../../../../kpuzzle";
|
|
22
|
+
import type {
|
|
23
|
+
StickerDat,
|
|
24
|
+
StickerDatSticker,
|
|
25
|
+
} from "../../../../puzzle-geometry";
|
|
26
|
+
import type { TextureMapper } from "../../../../puzzle-geometry/PuzzleGeometry";
|
|
27
|
+
import {
|
|
28
|
+
ExperimentalFaceletMeshAppearance,
|
|
29
|
+
experimentalGetFaceletAppearance,
|
|
30
|
+
ExperimentalPuzzleAppearance,
|
|
31
|
+
} from "../../../../puzzles";
|
|
32
|
+
import type { AlgCursor } from "../../../old/animation/cursor/AlgCursor";
|
|
33
|
+
import type { PuzzlePosition } from "../../../old/animation/cursor/CursorTypes";
|
|
34
|
+
import { smootherStep } from "../../../old/animation/easing";
|
|
35
|
+
import type { HintFaceletStyle } from "../../../old/dom/TwistyPlayerConfig";
|
|
36
|
+
import { TAU } from "../TAU";
|
|
37
|
+
|
|
38
|
+
import type { Twisty3DPuzzle } from "./Twisty3DPuzzle";
|
|
39
|
+
|
|
40
|
+
const foundationMaterial = new MeshBasicMaterial({
|
|
41
|
+
side: DoubleSide,
|
|
42
|
+
color: 0x000000,
|
|
43
|
+
});
|
|
44
|
+
const invisMaterial = new MeshBasicMaterial({
|
|
45
|
+
visible: false,
|
|
46
|
+
});
|
|
47
|
+
const basicStickerMaterial = new MeshBasicMaterial({
|
|
48
|
+
vertexColors: true,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
function dist(coords: number[], a: number, b: number): number {
|
|
52
|
+
return Math.hypot(
|
|
53
|
+
coords[3 * a] - coords[3 * b],
|
|
54
|
+
coords[3 * a + 1] - coords[3 * b + 1],
|
|
55
|
+
coords[3 * a + 2] - coords[3 * b + 2],
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function triarea(coords: number[], a: number, b: number, c: number): number {
|
|
60
|
+
const ab = dist(coords, a, b);
|
|
61
|
+
const bc = dist(coords, b, c);
|
|
62
|
+
const ac = dist(coords, a, c);
|
|
63
|
+
const p = (ab + bc + ac) / 2;
|
|
64
|
+
return Math.sqrt(p * (p - ab) * (p - bc) * (p - ac));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function polyarea(coords: number[]): number {
|
|
68
|
+
let sum = 0;
|
|
69
|
+
for (let i = 2; 3 * i < coords.length; i++) {
|
|
70
|
+
sum += triarea(coords, 0, 1, i);
|
|
71
|
+
}
|
|
72
|
+
return sum;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function normalize(r: number[]): number[] {
|
|
76
|
+
const m = Math.hypot(r[0], r[1], r[2]);
|
|
77
|
+
r[0] /= m;
|
|
78
|
+
r[1] /= m;
|
|
79
|
+
r[2] /= m;
|
|
80
|
+
return r;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function cross(a: number[], b: number[]): number[] {
|
|
84
|
+
const r = new Array<number>(3);
|
|
85
|
+
r[0] = a[1] * b[2] - a[2] * b[1];
|
|
86
|
+
r[1] = a[2] * b[0] - a[0] * b[2];
|
|
87
|
+
r[2] = a[0] * b[1] - a[1] * b[0];
|
|
88
|
+
return r;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function normal(c: number[]): number[] {
|
|
92
|
+
const a: number[] = [c[3] - c[0], c[4] - c[1], c[5] - c[2]];
|
|
93
|
+
const b: number[] = [c[6] - c[3], c[7] - c[4], c[8] - c[5]];
|
|
94
|
+
const r = cross(a, b);
|
|
95
|
+
return normalize(r);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function trimEdges(face: number[], tr: number): number[] {
|
|
99
|
+
const r: number[] = [];
|
|
100
|
+
const A: number[] = new Array(3);
|
|
101
|
+
const B: number[] = new Array(3);
|
|
102
|
+
for (let iter = 1; iter < 10; iter++) {
|
|
103
|
+
for (let i = 0; i < face.length; i += 3) {
|
|
104
|
+
const pi = (i + face.length - 3) % face.length;
|
|
105
|
+
const ni = (i + 3) % face.length;
|
|
106
|
+
for (let k = 0; k < 3; k++) {
|
|
107
|
+
A[k] = face[pi + k] - face[i + k];
|
|
108
|
+
B[k] = face[ni + k] - face[i + k];
|
|
109
|
+
}
|
|
110
|
+
const alen = Math.hypot(A[0], A[1], A[2]);
|
|
111
|
+
const blen = Math.hypot(B[0], B[1], B[2]);
|
|
112
|
+
for (let k = 0; k < 3; k++) {
|
|
113
|
+
A[k] /= alen;
|
|
114
|
+
B[k] /= blen;
|
|
115
|
+
}
|
|
116
|
+
const d = A[0] * B[0] + A[1] * B[1] + A[2] * B[2];
|
|
117
|
+
const m = tr / Math.sqrt(1 - d * d);
|
|
118
|
+
for (let k = 0; k < 3; k++) {
|
|
119
|
+
r[i + k] = face[i + k] + (A[k] + B[k]) * m;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
let good = true;
|
|
123
|
+
for (let i = 0; good && i < r.length; i += 3) {
|
|
124
|
+
const ni = (i + 3) % face.length;
|
|
125
|
+
let t = 0;
|
|
126
|
+
for (let k = 0; k < 3; k++) {
|
|
127
|
+
const a = face[ni + k] - face[i + k];
|
|
128
|
+
const b = r[ni + k] - r[i + k];
|
|
129
|
+
t += a * b;
|
|
130
|
+
}
|
|
131
|
+
if (t <= 0) {
|
|
132
|
+
good = false;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (good) {
|
|
136
|
+
return r;
|
|
137
|
+
}
|
|
138
|
+
tr /= 2;
|
|
139
|
+
}
|
|
140
|
+
return face;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
class Filler {
|
|
144
|
+
pos: number;
|
|
145
|
+
ipos: number;
|
|
146
|
+
vertices: Float32Array;
|
|
147
|
+
colors: Uint8Array;
|
|
148
|
+
uvs?: Float32Array;
|
|
149
|
+
ind: Uint8Array;
|
|
150
|
+
constructor(public sz: number, public tm: TextureMapper) {
|
|
151
|
+
this.vertices = new Float32Array(9 * sz);
|
|
152
|
+
this.uvs = undefined;
|
|
153
|
+
this.colors = new Uint8Array(18 * sz);
|
|
154
|
+
this.ind = new Uint8Array(sz);
|
|
155
|
+
this.pos = 0;
|
|
156
|
+
this.ipos = 0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
add(pt: number[], i: number, c: number) {
|
|
160
|
+
this.vertices[this.pos] = pt[3 * i + 0];
|
|
161
|
+
this.vertices[this.pos + 1] = pt[3 * i + 1];
|
|
162
|
+
this.vertices[this.pos + 2] = pt[3 * i + 2];
|
|
163
|
+
this.colors[this.pos] = c >> 16;
|
|
164
|
+
this.colors[this.pos + 1] = (c >> 8) & 255;
|
|
165
|
+
this.colors[this.pos + 2] = c & 255;
|
|
166
|
+
this.pos += 3;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
addUncolored(pt: number[], i: number) {
|
|
170
|
+
this.vertices[this.pos] = pt[3 * i + 0];
|
|
171
|
+
this.vertices[this.pos + 1] = pt[3 * i + 1];
|
|
172
|
+
this.vertices[this.pos + 2] = pt[3 * i + 2];
|
|
173
|
+
this.pos += 3;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
setind(i: number) {
|
|
177
|
+
this.ind[this.ipos++] = i;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
makePoly(coords: number[], color: number, ind: number): void {
|
|
181
|
+
const ncoords: number[] = coords;
|
|
182
|
+
for (let g = 1; 3 * (g + 1) < ncoords.length; g++) {
|
|
183
|
+
this.add(ncoords, 0, color);
|
|
184
|
+
this.add(ncoords, g, color);
|
|
185
|
+
this.add(ncoords, g + 1, color);
|
|
186
|
+
this.setind(ind);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
setAttributes(geo: BufferGeometry) {
|
|
191
|
+
geo.setAttribute("position", new BufferAttribute(this.vertices, 3));
|
|
192
|
+
// the geometry only needs the first half of the array
|
|
193
|
+
const sa2 = this.colors.subarray(0, 9 * this.sz);
|
|
194
|
+
geo.setAttribute("color", new BufferAttribute(sa2, 3, true));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
makeGroups(geo: BufferGeometry) {
|
|
198
|
+
geo.clearGroups();
|
|
199
|
+
for (let i = 0; i < this.ipos; ) {
|
|
200
|
+
const si = i++;
|
|
201
|
+
const iv = this.ind[si];
|
|
202
|
+
while (this.ind[i] === iv) {
|
|
203
|
+
i++;
|
|
204
|
+
}
|
|
205
|
+
geo.addGroup(3 * si, 3 * (i - si), iv);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
saveOriginalColors() {
|
|
210
|
+
this.colors.copyWithin(this.pos, 0, this.pos);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
class StickerDef {
|
|
215
|
+
private origColor: number;
|
|
216
|
+
private origColorAppearance: number;
|
|
217
|
+
private faceColor: number;
|
|
218
|
+
private texturePtr?: StickerDef = undefined;
|
|
219
|
+
public twistVal: number = -1;
|
|
220
|
+
public stickerStart: number;
|
|
221
|
+
public stickerEnd: number;
|
|
222
|
+
public hintStart: number;
|
|
223
|
+
public hintEnd: number;
|
|
224
|
+
public foundationStart: number;
|
|
225
|
+
public foundationEnd: number;
|
|
226
|
+
private isDup: boolean;
|
|
227
|
+
private faceNum: number;
|
|
228
|
+
constructor(
|
|
229
|
+
filler: Filler,
|
|
230
|
+
stickerDat: StickerDatSticker,
|
|
231
|
+
trim: number,
|
|
232
|
+
options?: {
|
|
233
|
+
appearance?: ExperimentalFaceletMeshAppearance;
|
|
234
|
+
},
|
|
235
|
+
) {
|
|
236
|
+
this.isDup = !!stickerDat.isDup;
|
|
237
|
+
this.faceNum = stickerDat.face;
|
|
238
|
+
this.stickerStart = filler.ipos;
|
|
239
|
+
const sdColor = new Color(stickerDat.color).getHex();
|
|
240
|
+
this.origColor = sdColor;
|
|
241
|
+
this.origColorAppearance = sdColor;
|
|
242
|
+
if (options?.appearance) {
|
|
243
|
+
this.setAppearance(filler, options.appearance);
|
|
244
|
+
}
|
|
245
|
+
this.faceColor = sdColor;
|
|
246
|
+
const coords = this.stickerCoords(stickerDat.coords, trim);
|
|
247
|
+
filler.makePoly(coords, this.faceColor, this.isDup ? 4 : 0);
|
|
248
|
+
this.stickerEnd = filler.ipos;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
private stickerCoords(coords: number[], trim: number): number[] {
|
|
252
|
+
return trimEdges(coords.slice(), trim);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
private hintCoords(
|
|
256
|
+
coords: number[],
|
|
257
|
+
hintStickerHeightScale: number,
|
|
258
|
+
trim: number,
|
|
259
|
+
normal: number[],
|
|
260
|
+
): number[] {
|
|
261
|
+
coords = this.stickerCoords(coords, trim); // pick up trim from stickers
|
|
262
|
+
normal = normal.slice();
|
|
263
|
+
for (let i = 0; i < 3; i++) {
|
|
264
|
+
normal[i] *= 0.5 * hintStickerHeightScale;
|
|
265
|
+
}
|
|
266
|
+
const hCoords = new Array<number>(coords.length);
|
|
267
|
+
for (let i = 0; 3 * i < coords.length; i++) {
|
|
268
|
+
const j = coords.length / 3 - 1 - i;
|
|
269
|
+
hCoords[3 * i] = coords[3 * j] + normal[0];
|
|
270
|
+
hCoords[3 * i + 1] = coords[3 * j + 1] + normal[1];
|
|
271
|
+
hCoords[3 * i + 2] = coords[3 * j + 2] + normal[2];
|
|
272
|
+
}
|
|
273
|
+
return hCoords;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
private foundationCoords(coords: number[]): number[] {
|
|
277
|
+
const ncoords = coords.slice();
|
|
278
|
+
for (let i = 0; i < coords.length; i++) {
|
|
279
|
+
ncoords[i] = coords[i] * 0.999;
|
|
280
|
+
}
|
|
281
|
+
return ncoords;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
addHint(
|
|
285
|
+
filler: Filler,
|
|
286
|
+
stickerDat: StickerDatSticker,
|
|
287
|
+
hintStickers: boolean,
|
|
288
|
+
hintStickerHeightScale: number,
|
|
289
|
+
trim: number,
|
|
290
|
+
normal: number[],
|
|
291
|
+
): void {
|
|
292
|
+
this.hintStart = filler.ipos;
|
|
293
|
+
const coords = this.hintCoords(
|
|
294
|
+
stickerDat.coords,
|
|
295
|
+
hintStickerHeightScale,
|
|
296
|
+
trim,
|
|
297
|
+
normal,
|
|
298
|
+
);
|
|
299
|
+
filler.makePoly(
|
|
300
|
+
coords,
|
|
301
|
+
this.faceColor,
|
|
302
|
+
hintStickers && !this.isDup ? 2 : 4,
|
|
303
|
+
);
|
|
304
|
+
this.hintEnd = filler.ipos;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
public addFoundation(
|
|
308
|
+
filler: Filler,
|
|
309
|
+
stickerDat: StickerDatSticker,
|
|
310
|
+
black: number,
|
|
311
|
+
) {
|
|
312
|
+
this.foundationStart = filler.ipos;
|
|
313
|
+
const coords = this.foundationCoords(stickerDat.coords);
|
|
314
|
+
filler.makePoly(coords, black, this.isDup ? 4 : 6);
|
|
315
|
+
this.foundationEnd = filler.ipos;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
private setHintStickers(filler: Filler, hintStickers: boolean): void {
|
|
319
|
+
const indv = this.isDup || !hintStickers ? 4 : 2;
|
|
320
|
+
for (let i = this.hintStart; i < this.hintEnd; i++) {
|
|
321
|
+
filler.ind[i] = indv | (filler.ind[i] & 1);
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
public setAppearance(
|
|
326
|
+
filler: Filler,
|
|
327
|
+
faceletMeshAppearance: ExperimentalFaceletMeshAppearance,
|
|
328
|
+
): void {
|
|
329
|
+
let c = 0;
|
|
330
|
+
switch (faceletMeshAppearance) {
|
|
331
|
+
case "regular":
|
|
332
|
+
c = this.origColor;
|
|
333
|
+
break;
|
|
334
|
+
case "dim":
|
|
335
|
+
if (this.origColor === 0xffffff) {
|
|
336
|
+
c = 0xdddddd;
|
|
337
|
+
} else {
|
|
338
|
+
c = new Color(this.origColor).multiplyScalar(0.5).getHex();
|
|
339
|
+
}
|
|
340
|
+
break;
|
|
341
|
+
case "oriented":
|
|
342
|
+
c = 0xff88ff;
|
|
343
|
+
break;
|
|
344
|
+
case "ignored":
|
|
345
|
+
c = 0x444444;
|
|
346
|
+
break;
|
|
347
|
+
case "invisible":
|
|
348
|
+
c = this.origColor;
|
|
349
|
+
}
|
|
350
|
+
this.origColorAppearance = c;
|
|
351
|
+
for (let i = 9 * this.stickerStart; i < 9 * this.stickerEnd; i += 3) {
|
|
352
|
+
filler.colors[filler.pos + i] = c >> 16;
|
|
353
|
+
filler.colors[filler.pos + i + 1] = (c >> 8) & 255;
|
|
354
|
+
filler.colors[filler.pos + i + 2] = c & 255;
|
|
355
|
+
}
|
|
356
|
+
for (let i = 9 * this.hintStart; i < 9 * this.hintEnd; i += 3) {
|
|
357
|
+
filler.colors[filler.pos + i] = c >> 16;
|
|
358
|
+
filler.colors[filler.pos + i + 1] = (c >> 8) & 255;
|
|
359
|
+
filler.colors[filler.pos + i + 2] = c & 255;
|
|
360
|
+
}
|
|
361
|
+
this.setHintStickers(
|
|
362
|
+
filler,
|
|
363
|
+
faceletMeshAppearance !== "invisible" && !this.isDup,
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
public addUVs(filler: Filler): void {
|
|
368
|
+
const uvs = filler.uvs!;
|
|
369
|
+
const vert = filler.vertices;
|
|
370
|
+
const coords = new Array(3);
|
|
371
|
+
for (let i = 3 * this.stickerStart; i < 3 * this.stickerEnd; i++) {
|
|
372
|
+
coords[0] = vert[3 * i];
|
|
373
|
+
coords[1] = vert[3 * i + 1];
|
|
374
|
+
coords[2] = vert[3 * i + 2];
|
|
375
|
+
const uv = filler.tm.getuv(this.faceNum, coords);
|
|
376
|
+
uvs[2 * i] = uv[0];
|
|
377
|
+
uvs[2 * i + 1] = uv[1];
|
|
378
|
+
}
|
|
379
|
+
for (let i = 3 * this.hintStart; i < 3 * this.hintEnd; i++) {
|
|
380
|
+
coords[0] = vert[3 * i];
|
|
381
|
+
coords[1] = vert[3 * i + 1];
|
|
382
|
+
coords[2] = vert[3 * i + 2];
|
|
383
|
+
const uv = filler.tm.getuv(this.faceNum, coords);
|
|
384
|
+
uvs[2 * i] = uv[0];
|
|
385
|
+
uvs[2 * i + 1] = uv[1];
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
public setTexture(filler: Filler, sd: StickerDef): number {
|
|
390
|
+
if (this.texturePtr === sd) {
|
|
391
|
+
return 0;
|
|
392
|
+
}
|
|
393
|
+
this.texturePtr = sd;
|
|
394
|
+
const sz = 6 * filler.sz;
|
|
395
|
+
filler.uvs!.copyWithin(
|
|
396
|
+
6 * this.stickerStart,
|
|
397
|
+
6 * sd.stickerStart + sz,
|
|
398
|
+
6 * sd.stickerEnd + sz,
|
|
399
|
+
);
|
|
400
|
+
filler.uvs!.copyWithin(
|
|
401
|
+
6 * this.hintStart,
|
|
402
|
+
6 * sd.hintStart + sz,
|
|
403
|
+
6 * sd.hintEnd + sz,
|
|
404
|
+
);
|
|
405
|
+
return 1;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
public setColor(filler: Filler, sd: StickerDef): number {
|
|
409
|
+
const c = sd.origColorAppearance;
|
|
410
|
+
if (this.faceColor !== c) {
|
|
411
|
+
this.faceColor = c;
|
|
412
|
+
const sz = filler.pos;
|
|
413
|
+
filler.colors.copyWithin(
|
|
414
|
+
9 * this.stickerStart,
|
|
415
|
+
9 * sd.stickerStart + sz,
|
|
416
|
+
9 * sd.stickerEnd + sz,
|
|
417
|
+
);
|
|
418
|
+
filler.colors.copyWithin(
|
|
419
|
+
9 * this.hintStart,
|
|
420
|
+
9 * sd.hintStart + sz,
|
|
421
|
+
9 * sd.hintEnd + sz,
|
|
422
|
+
);
|
|
423
|
+
return 1;
|
|
424
|
+
} else {
|
|
425
|
+
return 0;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
class HitPlaneDef {
|
|
431
|
+
public cubie: Group;
|
|
432
|
+
private geo: BufferGeometry;
|
|
433
|
+
constructor(hitface: any, tm: TextureMapper) {
|
|
434
|
+
this.cubie = new Group();
|
|
435
|
+
const coords = hitface.coords as number[];
|
|
436
|
+
const filler = new Filler(coords.length / 3 - 2, tm);
|
|
437
|
+
for (let g = 1; 3 * g + 3 < coords.length; g++) {
|
|
438
|
+
filler.addUncolored(coords, 0);
|
|
439
|
+
filler.addUncolored(coords, g);
|
|
440
|
+
filler.addUncolored(coords, g + 1);
|
|
441
|
+
}
|
|
442
|
+
this.geo = new BufferGeometry();
|
|
443
|
+
filler.setAttributes(this.geo);
|
|
444
|
+
const obj = new Mesh(this.geo, invisMaterial);
|
|
445
|
+
obj.userData.name = hitface.name;
|
|
446
|
+
this.cubie.scale.setScalar(0.99);
|
|
447
|
+
this.cubie.add(obj);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
class AxisInfo {
|
|
452
|
+
public axis: Vector3;
|
|
453
|
+
public order: number;
|
|
454
|
+
constructor(axisDat: any) {
|
|
455
|
+
const vec = axisDat[0] as number[];
|
|
456
|
+
this.axis = new Vector3(vec[0], vec[1], vec[2]);
|
|
457
|
+
this.order = axisDat[2];
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
export interface PG3DOptions {
|
|
462
|
+
appearance?: ExperimentalPuzzleAppearance;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
const DEFAULT_COLOR_FRACTION = 0.71;
|
|
466
|
+
const PG_SCALE = 0.5;
|
|
467
|
+
|
|
468
|
+
// TODO: Split into "scene model" and "view".
|
|
469
|
+
/*
|
|
470
|
+
* PG3D uses a single geometry for the puzzle, with all the faces for
|
|
471
|
+
* each sticker (including the foundation stickers) in a single
|
|
472
|
+
* geometry. We use the materialIndex in the face to point to a
|
|
473
|
+
* specific entry, which is either a colored sticker, invisible, or
|
|
474
|
+
* black (foundation).
|
|
475
|
+
*
|
|
476
|
+
* To support general twisting of a subset of the puzzle, we then
|
|
477
|
+
* instantiate this same geometry in two different meshes with two
|
|
478
|
+
* distinct material arrays. One, the fixed mesh, has the material
|
|
479
|
+
* array set up like: [colored, invisible, black, invisible].
|
|
480
|
+
* The twisting mesh has the material array set up as
|
|
481
|
+
* [invisible, colored, invislble, black]. When not twisted, the
|
|
482
|
+
* two meshes are directly coincident, and the (shared) materialIndex
|
|
483
|
+
* in each face points to a non-invisible material in exactly one of
|
|
484
|
+
* the two meshes. When we decide to twist some cubies, we make
|
|
485
|
+
* the cubies that move point to visible materials in the moving
|
|
486
|
+
* mesh (which makes them point to invisible materials in the static
|
|
487
|
+
* mesh). This way, we only need to rotate the moving mesh as a
|
|
488
|
+
* single object---this should be very fast, and occur entirely in
|
|
489
|
+
* the GPU. Unfortunately this doesn't quite work as fast as we'd
|
|
490
|
+
* like because three.js makes a draw call every time we have a change
|
|
491
|
+
* in the material index. By moving the foundation triangles separate
|
|
492
|
+
* from the sticker triangles, we enhance the probability that many
|
|
493
|
+
* triangles can be rendered in one call speeding up the render.
|
|
494
|
+
* We also get some assistance from puzzleGeometry to try to keep
|
|
495
|
+
* nearby stickers close to each other.
|
|
496
|
+
*/
|
|
497
|
+
export class PG3D extends Object3D implements Twisty3DPuzzle {
|
|
498
|
+
private stickers: { [key: string]: StickerDef[][] };
|
|
499
|
+
private axesInfo: { [key: string]: AxisInfo };
|
|
500
|
+
|
|
501
|
+
private stickerTargets: Object3D[] = [];
|
|
502
|
+
private controlTargets: Object3D[] = [];
|
|
503
|
+
|
|
504
|
+
private movingObj: Object3D;
|
|
505
|
+
private filler: Filler;
|
|
506
|
+
private foundationBound: number; // before this: colored; after: black
|
|
507
|
+
private fixedGeo: BufferGeometry;
|
|
508
|
+
private lastPos: PuzzlePosition;
|
|
509
|
+
private lastMove: Transformation;
|
|
510
|
+
private hintMaterial: Material;
|
|
511
|
+
private stickerMaterial: Material;
|
|
512
|
+
private materialArray1: Material[];
|
|
513
|
+
private materialArray2: Material[];
|
|
514
|
+
private textured: boolean = false;
|
|
515
|
+
private hintMaterialDisposable: boolean;
|
|
516
|
+
private stickerMaterialDisposable: boolean;
|
|
517
|
+
|
|
518
|
+
#pendingStickeringUpdate: boolean = false;
|
|
519
|
+
|
|
520
|
+
constructor(
|
|
521
|
+
cursor: AlgCursor,
|
|
522
|
+
private scheduleRenderCallback: () => void,
|
|
523
|
+
private definition: KPuzzleDefinition,
|
|
524
|
+
private pgdat: StickerDat,
|
|
525
|
+
private showFoundation: boolean = false,
|
|
526
|
+
private showHintStickers: boolean = false,
|
|
527
|
+
hintStickerHeightScale: number = 1,
|
|
528
|
+
private params: PG3DOptions = {},
|
|
529
|
+
) {
|
|
530
|
+
super();
|
|
531
|
+
if (pgdat.stickers.length === 0) {
|
|
532
|
+
throw Error("Reuse of stickerdat from pg; please don't do that.");
|
|
533
|
+
}
|
|
534
|
+
this.hintMaterial = new MeshBasicMaterial({
|
|
535
|
+
vertexColors: true,
|
|
536
|
+
transparent: true,
|
|
537
|
+
opacity: 0.5,
|
|
538
|
+
});
|
|
539
|
+
this.hintMaterialDisposable = true;
|
|
540
|
+
this.stickerMaterial = basicStickerMaterial;
|
|
541
|
+
this.stickerMaterialDisposable = false;
|
|
542
|
+
this.axesInfo = {};
|
|
543
|
+
const axesDef = this.pgdat.axis as any[];
|
|
544
|
+
for (const axis of axesDef) {
|
|
545
|
+
this.axesInfo[axis[1]] = new AxisInfo(axis);
|
|
546
|
+
}
|
|
547
|
+
const stickers = this.pgdat.stickers as any[];
|
|
548
|
+
this.stickers = {};
|
|
549
|
+
this.materialArray1 = new Array(8);
|
|
550
|
+
this.materialArray2 = new Array(8);
|
|
551
|
+
this.enableFoundation(showFoundation);
|
|
552
|
+
this.updateMaterialArrays();
|
|
553
|
+
let triangleCount = 0;
|
|
554
|
+
const multiplier = 3;
|
|
555
|
+
for (const sticker of stickers) {
|
|
556
|
+
const sides = sticker.coords.length / 3;
|
|
557
|
+
triangleCount += multiplier * (sides - 2);
|
|
558
|
+
}
|
|
559
|
+
const filler = new Filler(triangleCount, pgdat.textureMapper);
|
|
560
|
+
const black = 0;
|
|
561
|
+
const normals: number[][] = [];
|
|
562
|
+
let totArea = 0;
|
|
563
|
+
for (const f of pgdat.faces) {
|
|
564
|
+
normals.push(normal(f.coords));
|
|
565
|
+
totArea += polyarea(f.coords);
|
|
566
|
+
}
|
|
567
|
+
const colorfrac = DEFAULT_COLOR_FRACTION;
|
|
568
|
+
let nonDupStickers = 0;
|
|
569
|
+
for (const sticker of stickers) {
|
|
570
|
+
if (!sticker.isDup) {
|
|
571
|
+
nonDupStickers++;
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
const trim =
|
|
575
|
+
(Math.sqrt(totArea / nonDupStickers) * (1 - Math.sqrt(colorfrac))) / 2;
|
|
576
|
+
for (const sticker of stickers) {
|
|
577
|
+
const orbit = sticker.orbit;
|
|
578
|
+
const ord = sticker.ord;
|
|
579
|
+
const ori = sticker.ori;
|
|
580
|
+
if (!this.stickers[orbit]) {
|
|
581
|
+
this.stickers[orbit] = [];
|
|
582
|
+
}
|
|
583
|
+
if (!this.stickers[orbit][ori]) {
|
|
584
|
+
this.stickers[orbit][ori] = [];
|
|
585
|
+
}
|
|
586
|
+
const options: { appearance?: ExperimentalFaceletMeshAppearance } = {};
|
|
587
|
+
if (params.appearance) {
|
|
588
|
+
options.appearance = experimentalGetFaceletAppearance(
|
|
589
|
+
params.appearance,
|
|
590
|
+
orbit,
|
|
591
|
+
ord,
|
|
592
|
+
ori,
|
|
593
|
+
false,
|
|
594
|
+
);
|
|
595
|
+
}
|
|
596
|
+
const stickerdef = new StickerDef(filler, sticker, trim, options);
|
|
597
|
+
this.stickers[orbit][ori][ord] = stickerdef;
|
|
598
|
+
}
|
|
599
|
+
for (const sticker of stickers) {
|
|
600
|
+
const orbit = sticker.orbit;
|
|
601
|
+
const ord = sticker.ord;
|
|
602
|
+
const ori = sticker.ori;
|
|
603
|
+
this.stickers[orbit][ori][ord].addHint(
|
|
604
|
+
filler,
|
|
605
|
+
sticker,
|
|
606
|
+
showHintStickers,
|
|
607
|
+
hintStickerHeightScale,
|
|
608
|
+
trim,
|
|
609
|
+
normals[sticker.face],
|
|
610
|
+
);
|
|
611
|
+
}
|
|
612
|
+
this.foundationBound = filler.ipos;
|
|
613
|
+
for (const sticker of stickers) {
|
|
614
|
+
const orbit = sticker.orbit;
|
|
615
|
+
const ord = sticker.ord;
|
|
616
|
+
const ori = sticker.ori;
|
|
617
|
+
this.stickers[orbit][ori][ord].addFoundation(filler, sticker, black);
|
|
618
|
+
}
|
|
619
|
+
const fixedGeo = new BufferGeometry();
|
|
620
|
+
filler.setAttributes(fixedGeo);
|
|
621
|
+
filler.makeGroups(fixedGeo);
|
|
622
|
+
const obj = new Mesh(fixedGeo, this.materialArray1);
|
|
623
|
+
obj.scale.set(PG_SCALE, PG_SCALE, PG_SCALE);
|
|
624
|
+
this.add(obj);
|
|
625
|
+
const obj2 = new Mesh(fixedGeo, this.materialArray2);
|
|
626
|
+
obj2.scale.set(PG_SCALE, PG_SCALE, PG_SCALE);
|
|
627
|
+
this.add(obj2);
|
|
628
|
+
const hitfaces = this.pgdat.faces as any[];
|
|
629
|
+
this.movingObj = obj2;
|
|
630
|
+
this.fixedGeo = fixedGeo;
|
|
631
|
+
this.filler = filler;
|
|
632
|
+
for (const hitface of hitfaces) {
|
|
633
|
+
const facedef = new HitPlaneDef(hitface, pgdat.textureMapper);
|
|
634
|
+
facedef.cubie.scale.set(PG_SCALE, PG_SCALE, PG_SCALE);
|
|
635
|
+
this.add(facedef.cubie);
|
|
636
|
+
this.controlTargets.push(facedef.cubie.children[0]);
|
|
637
|
+
}
|
|
638
|
+
filler.saveOriginalColors();
|
|
639
|
+
cursor.addPositionListener(this);
|
|
640
|
+
pgdat.stickers = []; // don't need these anymore
|
|
641
|
+
/*
|
|
642
|
+
this.experimentalUpdateTexture(
|
|
643
|
+
true,
|
|
644
|
+
new TextureLoader().load(
|
|
645
|
+
"/experiments.cubing.net/cubing.js/twisty/mkbhd-sprite-red.png",
|
|
646
|
+
),
|
|
647
|
+
new TextureLoader().load(
|
|
648
|
+
"/experiments.cubing.net/cubing.js/twisty/mkbhd-sprite-red-hint.png",
|
|
649
|
+
),
|
|
650
|
+
);
|
|
651
|
+
*/
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
public dispose(): void {
|
|
655
|
+
if (this.fixedGeo) {
|
|
656
|
+
this.fixedGeo.dispose();
|
|
657
|
+
}
|
|
658
|
+
if (this.stickerMaterialDisposable) {
|
|
659
|
+
this.stickerMaterial.dispose();
|
|
660
|
+
this.stickerMaterial = basicStickerMaterial;
|
|
661
|
+
this.stickerMaterialDisposable = false;
|
|
662
|
+
}
|
|
663
|
+
if (this.hintMaterialDisposable) {
|
|
664
|
+
this.hintMaterial.dispose();
|
|
665
|
+
this.hintMaterial = basicStickerMaterial;
|
|
666
|
+
this.hintMaterialDisposable = false;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
public experimentalGetStickerTargets(): Object3D[] {
|
|
671
|
+
return this.stickerTargets;
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
public experimentalGetControlTargets(): Object3D[] {
|
|
675
|
+
return this.controlTargets;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
experimentalSetAppearance(appearance: ExperimentalPuzzleAppearance): void {
|
|
679
|
+
this.params.appearance = appearance;
|
|
680
|
+
for (const orbitName in this.definition.orbits) {
|
|
681
|
+
const { numPieces, orientations } = this.definition.orbits[orbitName];
|
|
682
|
+
for (let pieceIdx = 0; pieceIdx < numPieces; pieceIdx++) {
|
|
683
|
+
for (let faceletIdx = 0; faceletIdx < orientations; faceletIdx++) {
|
|
684
|
+
const faceletAppearance = experimentalGetFaceletAppearance(
|
|
685
|
+
appearance,
|
|
686
|
+
orbitName,
|
|
687
|
+
pieceIdx,
|
|
688
|
+
faceletIdx,
|
|
689
|
+
false,
|
|
690
|
+
);
|
|
691
|
+
const stickerDef = this.stickers[orbitName][faceletIdx][pieceIdx];
|
|
692
|
+
stickerDef.setAppearance(this.filler, faceletAppearance);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
if (this.scheduleRenderCallback) {
|
|
697
|
+
this.#pendingStickeringUpdate = true;
|
|
698
|
+
if (this.lastPos) {
|
|
699
|
+
this.onPositionChange(this.lastPos);
|
|
700
|
+
}
|
|
701
|
+
this.scheduleRenderCallback();
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
public onPositionChange(p: PuzzlePosition): void {
|
|
706
|
+
const state = p.state;
|
|
707
|
+
const noRotation = new Euler();
|
|
708
|
+
this.movingObj.rotation.copy(noRotation);
|
|
709
|
+
let colormods = 0;
|
|
710
|
+
const filler = this.filler;
|
|
711
|
+
const ind = filler.ind;
|
|
712
|
+
if (
|
|
713
|
+
!this.lastPos ||
|
|
714
|
+
this.#pendingStickeringUpdate ||
|
|
715
|
+
!areTransformationsEquivalent(this.definition, this.lastPos.state, state)
|
|
716
|
+
) {
|
|
717
|
+
for (const orbit in this.stickers) {
|
|
718
|
+
const pieces = this.stickers[orbit];
|
|
719
|
+
const pos2 = state[orbit];
|
|
720
|
+
const orin = pieces.length;
|
|
721
|
+
if (orin === 1) {
|
|
722
|
+
const pieces2 = pieces[0];
|
|
723
|
+
for (let i = 0; i < pieces2.length; i++) {
|
|
724
|
+
const ni = pos2.permutation[i];
|
|
725
|
+
if (this.textured) {
|
|
726
|
+
colormods += pieces2[i].setTexture(filler, pieces2[ni]);
|
|
727
|
+
} else {
|
|
728
|
+
colormods += pieces2[i].setColor(filler, pieces2[ni]);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
} else {
|
|
732
|
+
for (let ori = 0; ori < orin; ori++) {
|
|
733
|
+
const pieces2 = pieces[ori];
|
|
734
|
+
for (let i = 0; i < pieces2.length; i++) {
|
|
735
|
+
const nori = (ori + orin - pos2.orientation[i]) % orin;
|
|
736
|
+
const ni = pos2.permutation[i];
|
|
737
|
+
if (this.textured) {
|
|
738
|
+
colormods += pieces2[i].setTexture(filler, pieces[nori][ni]);
|
|
739
|
+
} else {
|
|
740
|
+
colormods += pieces2[i].setColor(filler, pieces[nori][ni]);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
this.lastPos = p;
|
|
747
|
+
this.#pendingStickeringUpdate = false;
|
|
748
|
+
}
|
|
749
|
+
let vismods = 0;
|
|
750
|
+
for (const moveProgress of p.movesInProgress) {
|
|
751
|
+
const externalMove = moveProgress.move;
|
|
752
|
+
// TODO: unswizzle goes external to internal, and so does the call after that
|
|
753
|
+
// and so does the stateForBlockMove call
|
|
754
|
+
const unswizzled = this.pgdat.unswizzle(externalMove);
|
|
755
|
+
const move = this.pgdat.notationMapper.notationToInternal(externalMove);
|
|
756
|
+
if (move === null) {
|
|
757
|
+
throw Error("Bad blockmove " + externalMove.family);
|
|
758
|
+
}
|
|
759
|
+
const quantumTransformation = experimentalTransformationForQuantumMove(
|
|
760
|
+
this.definition,
|
|
761
|
+
externalMove.quantum,
|
|
762
|
+
);
|
|
763
|
+
const ax = this.axesInfo[unswizzled];
|
|
764
|
+
const turnNormal = ax.axis;
|
|
765
|
+
const angle =
|
|
766
|
+
(-this.ease(moveProgress.fraction) *
|
|
767
|
+
moveProgress.direction *
|
|
768
|
+
move.amount *
|
|
769
|
+
TAU) /
|
|
770
|
+
ax.order;
|
|
771
|
+
this.movingObj.rotateOnAxis(turnNormal, angle);
|
|
772
|
+
if (this.lastMove !== quantumTransformation) {
|
|
773
|
+
for (const orbit in this.stickers) {
|
|
774
|
+
const pieces = this.stickers[orbit];
|
|
775
|
+
const orin = pieces.length;
|
|
776
|
+
const bmv = quantumTransformation[orbit];
|
|
777
|
+
for (let ori = 0; ori < orin; ori++) {
|
|
778
|
+
const pieces2 = pieces[ori];
|
|
779
|
+
for (let i = 0; i < pieces2.length; i++) {
|
|
780
|
+
const p2 = pieces2[i];
|
|
781
|
+
const ni = bmv.permutation[i];
|
|
782
|
+
let tv = 0;
|
|
783
|
+
if (ni !== i || bmv.orientation[i] !== 0) {
|
|
784
|
+
tv = 1;
|
|
785
|
+
}
|
|
786
|
+
if (tv !== p2.twistVal) {
|
|
787
|
+
if (tv) {
|
|
788
|
+
for (let j = p2.stickerStart; j < p2.stickerEnd; j++) {
|
|
789
|
+
ind[j] |= 1;
|
|
790
|
+
}
|
|
791
|
+
for (let j = p2.hintStart; j < p2.hintEnd; j++) {
|
|
792
|
+
ind[j] |= 1;
|
|
793
|
+
}
|
|
794
|
+
for (let j = p2.foundationStart; j < p2.foundationEnd; j++) {
|
|
795
|
+
ind[j] |= 1;
|
|
796
|
+
}
|
|
797
|
+
} else {
|
|
798
|
+
for (let j = p2.stickerStart; j < p2.stickerEnd; j++) {
|
|
799
|
+
ind[j] &= ~1;
|
|
800
|
+
}
|
|
801
|
+
for (let j = p2.hintStart; j < p2.hintEnd; j++) {
|
|
802
|
+
ind[j] &= ~1;
|
|
803
|
+
}
|
|
804
|
+
for (let j = p2.foundationStart; j < p2.foundationEnd; j++) {
|
|
805
|
+
ind[j] &= ~1;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
p2.twistVal = tv;
|
|
809
|
+
vismods++;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
this.lastMove = quantumTransformation;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
if (vismods) {
|
|
818
|
+
this.filler.makeGroups(this.fixedGeo);
|
|
819
|
+
}
|
|
820
|
+
if (colormods) {
|
|
821
|
+
if (this.textured) {
|
|
822
|
+
(this.fixedGeo.getAttribute("uv") as BufferAttribute).updateRange = {
|
|
823
|
+
offset: 0,
|
|
824
|
+
count: 6 * this.foundationBound,
|
|
825
|
+
};
|
|
826
|
+
(this.fixedGeo.getAttribute("uv") as BufferAttribute).needsUpdate =
|
|
827
|
+
true;
|
|
828
|
+
} else {
|
|
829
|
+
(this.fixedGeo.getAttribute("color") as BufferAttribute).updateRange = {
|
|
830
|
+
offset: 0,
|
|
831
|
+
count: 9 * this.foundationBound,
|
|
832
|
+
};
|
|
833
|
+
(this.fixedGeo.getAttribute("color") as BufferAttribute).needsUpdate =
|
|
834
|
+
true;
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
this.scheduleRenderCallback();
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
private ease(fraction: number): number {
|
|
841
|
+
return smootherStep(fraction);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
private enableHintFacelets(v: boolean) {
|
|
845
|
+
this.showHintStickers = v;
|
|
846
|
+
this.updateMaterialArrays();
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
private updateMaterialArrays() {
|
|
850
|
+
for (let i = 0; i < 8; i++) {
|
|
851
|
+
this.materialArray1[i] = invisMaterial;
|
|
852
|
+
this.materialArray2[i] = invisMaterial;
|
|
853
|
+
}
|
|
854
|
+
this.materialArray1[0] = this.stickerMaterial;
|
|
855
|
+
this.materialArray2[1] = this.stickerMaterial;
|
|
856
|
+
if (this.showHintStickers) {
|
|
857
|
+
this.materialArray1[2] = this.hintMaterial;
|
|
858
|
+
this.materialArray2[3] = this.hintMaterial;
|
|
859
|
+
} else {
|
|
860
|
+
this.materialArray1[2] = invisMaterial;
|
|
861
|
+
this.materialArray2[3] = invisMaterial;
|
|
862
|
+
}
|
|
863
|
+
if (this.showFoundation) {
|
|
864
|
+
this.materialArray1[6] = foundationMaterial;
|
|
865
|
+
this.materialArray2[7] = foundationMaterial;
|
|
866
|
+
} else {
|
|
867
|
+
this.materialArray1[6] = invisMaterial;
|
|
868
|
+
this.materialArray2[7] = invisMaterial;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
private enableFoundation(v: boolean) {
|
|
873
|
+
this.showFoundation = v;
|
|
874
|
+
this.updateMaterialArrays();
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
private setHintStickerOpacity(v: number): void {
|
|
878
|
+
if (this.hintMaterialDisposable) {
|
|
879
|
+
this.hintMaterial.dispose();
|
|
880
|
+
this.hintMaterialDisposable = false;
|
|
881
|
+
}
|
|
882
|
+
if (v === 0) {
|
|
883
|
+
this.hintMaterial = invisMaterial;
|
|
884
|
+
} else if (v === 1) {
|
|
885
|
+
this.hintMaterial = this.stickerMaterial;
|
|
886
|
+
} else {
|
|
887
|
+
this.hintMaterial = new MeshBasicMaterial({
|
|
888
|
+
vertexColors: true,
|
|
889
|
+
transparent: true,
|
|
890
|
+
opacity: 0.5,
|
|
891
|
+
});
|
|
892
|
+
this.hintMaterialDisposable = true;
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
public experimentalUpdateOptions(options: {
|
|
897
|
+
showMainStickers?: boolean;
|
|
898
|
+
hintFacelets?: HintFaceletStyle;
|
|
899
|
+
showFoundation?: boolean; // TODO: better name
|
|
900
|
+
hintStickerOpacity?: number;
|
|
901
|
+
}): void {
|
|
902
|
+
if (options.hintFacelets !== undefined) {
|
|
903
|
+
this.enableHintFacelets(options.hintFacelets !== "none");
|
|
904
|
+
}
|
|
905
|
+
if (options.showFoundation !== undefined) {
|
|
906
|
+
this.enableFoundation(options.showFoundation);
|
|
907
|
+
}
|
|
908
|
+
if (options.hintStickerOpacity !== undefined) {
|
|
909
|
+
this.setHintStickerOpacity(options.hintStickerOpacity);
|
|
910
|
+
}
|
|
911
|
+
this.#pendingStickeringUpdate = true;
|
|
912
|
+
if (this.lastPos) {
|
|
913
|
+
this.onPositionChange(this.lastPos);
|
|
914
|
+
}
|
|
915
|
+
this.scheduleRenderCallback();
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
private adduvs() {
|
|
919
|
+
const filler = this.filler;
|
|
920
|
+
if (filler.uvs) {
|
|
921
|
+
return;
|
|
922
|
+
}
|
|
923
|
+
this.filler.uvs = new Float32Array(12 * filler.sz);
|
|
924
|
+
for (const orbit in this.stickers) {
|
|
925
|
+
const pieces = this.stickers[orbit];
|
|
926
|
+
const orin = pieces.length;
|
|
927
|
+
for (let ori = 0; ori < orin; ori++) {
|
|
928
|
+
const pieces2 = pieces[ori];
|
|
929
|
+
for (const piece2 of pieces2) {
|
|
930
|
+
piece2.addUVs(this.filler);
|
|
931
|
+
}
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
filler.uvs!.copyWithin(6 * filler.sz, 0, 6 * filler.sz);
|
|
935
|
+
const sa1 = filler.uvs!.subarray(0, 6 * filler.sz);
|
|
936
|
+
this.fixedGeo.setAttribute("uv", new BufferAttribute(sa1, 2, true));
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
public experimentalUpdateTexture(
|
|
940
|
+
enabled: boolean,
|
|
941
|
+
stickerTexture?: Texture | null,
|
|
942
|
+
hintTexture?: Texture | null,
|
|
943
|
+
) {
|
|
944
|
+
if (!stickerTexture) {
|
|
945
|
+
enabled = false;
|
|
946
|
+
} else if (!hintTexture) {
|
|
947
|
+
hintTexture = stickerTexture;
|
|
948
|
+
}
|
|
949
|
+
if (enabled && !this.filler.uvs) {
|
|
950
|
+
this.adduvs();
|
|
951
|
+
}
|
|
952
|
+
this.textured = enabled;
|
|
953
|
+
if (this.stickerMaterialDisposable) {
|
|
954
|
+
this.stickerMaterial.dispose();
|
|
955
|
+
this.stickerMaterialDisposable = false;
|
|
956
|
+
}
|
|
957
|
+
if (enabled) {
|
|
958
|
+
this.stickerMaterial = new MeshBasicMaterial({
|
|
959
|
+
map: stickerTexture,
|
|
960
|
+
side: FrontSide,
|
|
961
|
+
transparent: false,
|
|
962
|
+
});
|
|
963
|
+
this.stickerMaterialDisposable = true;
|
|
964
|
+
} else {
|
|
965
|
+
this.stickerMaterial = basicStickerMaterial;
|
|
966
|
+
}
|
|
967
|
+
if (this.hintMaterialDisposable) {
|
|
968
|
+
this.hintMaterial.dispose();
|
|
969
|
+
this.hintMaterialDisposable = false;
|
|
970
|
+
}
|
|
971
|
+
if (enabled) {
|
|
972
|
+
this.hintMaterial = new MeshBasicMaterial({
|
|
973
|
+
map: hintTexture,
|
|
974
|
+
side: FrontSide,
|
|
975
|
+
transparent: false,
|
|
976
|
+
});
|
|
977
|
+
this.hintMaterialDisposable = true;
|
|
978
|
+
} else {
|
|
979
|
+
this.hintMaterial = basicStickerMaterial;
|
|
980
|
+
}
|
|
981
|
+
this.updateMaterialArrays();
|
|
982
|
+
this.#pendingStickeringUpdate = true;
|
|
983
|
+
if (this.lastPos) {
|
|
984
|
+
this.onPositionChange(this.lastPos);
|
|
985
|
+
}
|
|
986
|
+
this.scheduleRenderCallback();
|
|
987
|
+
}
|
|
988
|
+
}
|