Tresjs / tres

Declarative ThreeJS using Vue Components
https://tresjs.org
MIT License
2.17k stars 102 forks source link

`<TresSprite @click="() => console.log('')" />` throws error on pointer interaction #527

Closed andretchen0 closed 1 month ago

andretchen0 commented 8 months ago

Describe the bug

When ...

<TresSprite @click="(e) => { console.log('ok', e); }" />

... is moused over, it throws this error:

Uncaught TypeError: proxy must report the same value for the non-writable, non-configurable property '"modelViewMatrix"'

Expected

@click should work normally and not throw an error.

Reproduction

StackBlitz

Additional context

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.14.0 - /usr/local/bin/pnpm
  npmPackages:
    @tresjs/cientos: ^3.5.1 => 3.5.1 
    @tresjs/core: ^3.4.1 => 3.4.1 
    @tresjs/eslint-config-vue: ^0.2.1 => 0.2.1 
    vite: ^4.5.0 => 4.5.0

Used Package Manager

npm

Code of Conduct

garrlker commented 8 months ago

Replying here to keep the main thread clean as well

1st, thank you for making this issue and reproduction! Your questions and repros are helping me a ton!

2nd, The solution I've been working on for #515 for abstracts the parts of the event system so we support events for everything in the scene, not just Object3Ds. Originally I had made that change to support event's on primitives, BUT, It looks like those changes allow for TresSprite events to work as well

image

Copied your reproduction into my local and it worked first try

andretchen0 commented 8 months ago

@garrlker Sure thing! Let me know if there's anything I can help with on #515.

garrlker commented 8 months ago

@andretchen0 I've got my draft PR up, #529, I would love if you could give it a thorough look over when you get a chance?

alvarosabu commented 4 months ago

Hi @andretchen0 can you please check if this still the case in v4 after @garrlker changes? If not please close it

alvarosabu commented 1 month ago

Close due inactivity. Feel free to re-open if needed.