support hierarchy in getClosestTargetElements() #92

Open
opened 2 years ago 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 2 years ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: utopiah/text-code-xr-engine#92
Loading…
There is no content yet.