jesstelford / aframe-click-drag-component

Aframe Click & Drag Component
https://jesstelford.github.io/aframe-click-drag-component/
MIT License
103 stars 49 forks source link

Store position #21

Closed bknill closed 6 years ago

bknill commented 6 years ago

Hi,

Great component.

I'm trying to store the new position, for some reason whenever I reapply the data the entity is always in a slightly different position, usually a bit closer or further away.

I've tried

hotspot.config.position = el.getAttribute('position') hotspot.config.position = el.object3D.localToWorld(new three.Vector3(newPos.x,newPos.y,newPos.z)) hotspot.config.position = el.object3D.localToWorld(new three.Vector3(e.detail.offset.x,e.detail.offset.y,e.detail.offset.z))

All in the on dragend event.

When the entity get's re added to the scene it's slightly moved.

Is there anything in the component that means it's position when ending the drag isn't it's real position!?

bknill commented 6 years ago

Was setting the position on the child not the parent