c-frame / aframe-super-hands-component

👐All-in-one natural hand controller, pointer, and gaze interaction library for A-Frame
https://c-frame.github.io/aframe-super-hands-component/examples/
MIT License
357 stars 71 forks source link

Event activation upon component loading in VueJS #222

Closed Decathlannix closed 2 years ago

Decathlannix commented 2 years ago

I'm working on a Augmented Reality project, based in Vue.js and A-Frame for HoloLens 2, and I'm using super-hands. Because most interactions are based on clicking elements, I'm taking advantage of the "hover-start" event (using the v-on directive native of Vue.js) so I can do something whenever one of the hands collide with that element, aswell as adding the "clickable" reaction component to the elements. The problem I'm having is that it seems like the event is triggering even without the hands interacting with the elements. This is the implementation for the hands:

image

and here is an example of one of the components:

image

I tried passing the $event argument inside the function so I could check the details, and indeed, many appear as soon as the component is created, even before interacting with anything:

image

Decathlannix commented 2 years ago

Figured it out. What was happening was that we have a component that serves as a list of users and it initially spawned in the scene at (0, 0, 0), the same coordinates as the super-hands entities. Because they spawned on top of each other, that seemed to be triggering the hover-start event in some parts of the list. As soon as I changed the default position of the hands to something else not on top of the hands, that seemed to solve the problem.