support hierarchy in getClosestTargetElements() #92

Open
opened 2023-05-22 14:22:14 +00:00 by utopiah · 0 comments
Owner

Instead of the local position via el.getAttribute("position") consider the more general

let worldPosition=new THREE.Vector3();
worldPosition.copy(el.object3D.position);
el.object3D.parent.updateMatrixWorld();
el.object3D.parent.localToWorld(worldPosition)

Note though that it is more expensive to compute but allows to define the scene with parenting.

Instead of the local position via `el.getAttribute("position")` consider the more general ```javascript let worldPosition=new THREE.Vector3(); worldPosition.copy(el.object3D.position); el.object3D.parent.updateMatrixWorld(); el.object3D.parent.localToWorld(worldPosition) ``` Note though that it is more expensive to compute but allows to define the scene with parenting.
utopiah added the enhancement label 2023-05-22 14:22:28 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: utopiah/text-code-xr-engine#92