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

Grabbable not working properly if parent is rotated #218

Open jdjuli opened 2 years ago

jdjuli commented 2 years ago

Hi!

While using the grabbable component without physics I found out that if the grabbed entity is a child of another entity which has an arbitrary orientation (throught rotation component), the grabbed entity doesn't follow the hands nor the cursor.

I've made a basic example to illustrate the problem (glitch scene & code). On it, you can't move the green box to the left side of the screen without moving arround.

By testing different rotations, I discovered that the displacement of the hands (or cursor) is applied locally to the grabbed entity without considering the transformations performed to it's parents.

I'm using the following versions:

wmurphyrd commented 2 years ago

I'm working on a new version of grabbable that acts more like reparenting using matrix multiplication

jdjuli commented 2 years ago

Thank you so much :)

Sorry for the late response. I've been searching through my notes and I found out this page that might be helpful: https://tipsfordev.com/using-superhands-component-in-a-frame-is-it-possible-to-rotate-grabbed-objects-without-using-physics