Tresjs / tres

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

`Event` is not triggered in `TresGroup` #728

Closed hexianWeb closed 4 months ago

hexianWeb commented 5 months ago

Describe the bug

I tried writing this code into Tresjs v 4.0.2 I think this issue and issue #727 have a common cause

    <TresGroup>
      <TresMesh
        :position="[0, 0, 0]"
        @click="onClick"
        @double-click="onDoubleClick"
        @pointer-enter="onPointerEnter"
        @pointer-leave="onPointerLeave"
        @pointer-move="onPointerMove"
        @context-menu="onContextMenu"
        @pointer-missed="onPointerMissed"
      >
        <TresBoxGeometry :args="[1, 1, 1]" />
        <TresMeshToonMaterial color="#efefef" />
      </TresMesh>
    </TresGroup>

Only @pointer-missed has been triggered during this process

https://github.com/Tresjs/tres/assets/59913119/8ca05964-6e9d-4443-a1d8-7e543aebb5fe

Reproduction

https://stackblitz.com/~/github.com/hexianWeb/starter

Steps to reproduce

switch the branch to the bug branch, or just copy this code into TheExperience.vue

    <TresGroup>
      <TresMesh
        :position="[0, 0, 0]"
        @click="onClick"
        @double-click="onDoubleClick"
        @pointer-enter="onPointerEnter"
        @pointer-leave="onPointerLeave"
        @pointer-move="onPointerMove"
        @context-menu="onContextMenu"
        @pointer-missed="onPointerMissed"
      >
        <TresBoxGeometry :args="[1, 1, 1]" />
        <TresMeshToonMaterial color="#efefef" />
      </TresMesh>
    </TresGroup>

and remove the TresGroup near camera

  <TresGroup>
    <TresPerspectiveCamera :position="[5, 5, 5]" />
  </TresGroup>

System Info

No response

Used Package Manager

pnpm

Code of Conduct

hexianWeb commented 4 months ago

Sorry I removed myself from Assignees due to a mistake.

garrlker commented 4 months ago

This issue has been resolved

Thanks for the issue and repro @hexianWeb