cubing / cubing.js

🛠 A library for displaying and working with twisty puzzles. Also currently home to the code for Twizzle.
https://js.cubing.net/cubing/
GNU General Public License v3.0
232 stars 42 forks source link

[cubing.js issue] Something broke at least with PG3D visualization after 0.46.0 update #312

Closed afedotov closed 5 months ago

afedotov commented 5 months ago

Steps to reproduce the issue

This is my simple demo application which uses cubing.js library: https://github.com/afedotov/gan-cube-sample

All works fine with 0.45.1, but after 0.46.0 update looks like something broke and TwistyPlayer starts ignoring experimentalAddMove() invocations, cube faces doesn't turn on adding moves. Following error appears in the console after player instantiation (look below).

But if I change visualization mode from PG3D to 3D all works fine back.

Observed behaviour

twisty-dynamic-3d-Z7DZPPGE-RDMN5N4M.js?v=98e3aeec:1635 Uncaught (in promise) TypeError: Cannot set property updateRange of #<BufferAttribute> which has only a getter
    at _a2.onPositionChange (twisty-dynamic-3d-Z7DZPPGE-RDMN5N4M.js?v=98e3aeec:1635:57)
    at _a2.experimentalUpdateTexture (twisty-dynamic-3d-Z7DZPPGE-RDMN5N4M.js?v=98e3aeec:1778:12)
    at cubing_twisty.js?v=5c0ab3a2:963:41
onPositionChange @ twisty-dynamic-3d-Z7DZPPGE-RDMN5N4M.js?v=98e3aeec:1635
experimentalUpdateTexture @ twisty-dynamic-3d-Z7DZPPGE-RDMN5N4M.js?v=98e3aeec:1778
(anonymous) @ cubing_twisty.js?v=5c0ab3a2:963
await in (anonymous) (async)
wrappedListener @ chunk-IUVVXRP3.js?v=98e3aeec:278
await in wrappedListener (async)
callback @ chunk-IUVVXRP3.js?v=98e3aeec:118
await in callback (async)
addRawListener @ chunk-IUVVXRP3.js?v=98e3aeec:101
addFreshListener @ chunk-IUVVXRP3.js?v=98e3aeec:121
addMultiListener @ chunk-IUVVXRP3.js?v=98e3aeec:281
addMultiListener3 @ chunk-IUVVXRP3.js?v=98e3aeec:261
_a7 @ cubing_twisty.js?v=5c0ab3a2:955
onPuzzle @ cubing_twisty.js?v=5c0ab3a2:1191
wrappedListener @ chunk-IUVVXRP3.js?v=98e3aeec:278
await in wrappedListener (async)
callback @ chunk-IUVVXRP3.js?v=98e3aeec:118
await in callback (async)
addRawListener @ chunk-IUVVXRP3.js?v=98e3aeec:101
addFreshListener @ chunk-IUVVXRP3.js?v=98e3aeec:121
addMultiListener @ chunk-IUVVXRP3.js?v=98e3aeec:281
connectedCallback @ cubing_twisty.js?v=5c0ab3a2:1084
setVisualizationWrapper_fn @ cubing_twisty.js?v=5c0ab3a2:4396
callback @ chunk-IUVVXRP3.js?v=98e3aeec:118
await in callback (async)
addRawListener @ chunk-IUVVXRP3.js?v=98e3aeec:101
addFreshListener @ chunk-IUVVXRP3.js?v=98e3aeec:121
connectedCallback @ cubing_twisty.js?v=5c0ab3a2:4218
(anonymous) @ jquery.js?v=b8141010:3533
domManip @ jquery.js?v=b8141010:3421
append @ jquery.js?v=b8141010:3530
(anonymous) @ index.ts:42
Show 25 more frames
Show less

🖼 Screenshots

No response

Expected behaviour

Cube faces turns on experimentalAddMove() invocations.

Environment

System:

Additional info

No response

lgarron commented 5 months ago

Aha! I think this is what #311 was trying to report. Looks like three.js removed the updateRange setter in favor of a function.

lgarron commented 5 months ago

Thanks for the report!

btw, if you're interested in helping make the latest Gan protocols available to everyone in cubing.js, I'd be interested in help documenting specifications we can implement.

afedotov commented 5 months ago

btw, if you're interested in helping make the latest Gan protocols available to everyone in cubing.js, I'd be interested in help documenting specifications we can implement.

Yep, no problem! I tried to make code in the gan-web-bluetooth lib self-documented, so all stuff about protocol specs should be clear from there. But if you have any questions, you can reach me on Discord as 'fischie'. Not sure I can help at present to adopt to the cubing.js architecture and code style, but anyway you can take any parts of the code from my lib.