From b886795a91015151ab571c0b5dfe18842d053ff3 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Fri, 14 Jun 2024 20:06:42 +0200 Subject: [PATCH] example of snapping to real world meshing objects --- index.html | 28 +++++++++++++++++++++++++++- jxr-core.js | 3 +++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 5913fb4..5046dea 100644 --- a/index.html +++ b/index.html @@ -5,23 +5,48 @@ + + - + diff --git a/jxr-core.js b/jxr-core.js index 87b0592..122720f 100644 --- a/jxr-core.js +++ b/jxr-core.js @@ -176,6 +176,7 @@ AFRAME.registerComponent('pinchprimary', { // currently only 1 hand, the right o } if (selectedElement){ let content = selectedElement.getAttribute("value") + console.log('emitted released event that somehow does NOT get cought anymore') // broken since 1.6, emitting works but does not seem to be caught selectedElement.emit('released', {element:selectedElement, timestamp:Date.now(), primary:true}) } // unselect current target if any @@ -249,9 +250,11 @@ AFRAME.registerComponent('pinchprimary', { // currently only 1 hand, the right o // avoiding setOnDropFromAttribute() as it is not idiosyncratic and creates timing issues AFRAME.registerComponent('onreleased', { // changed from ondrop to be coherent with event name + schema: { type: 'string' }, // rewritten due to 1.6 https://github.com/aframevr/aframe/issues/5541 // could support multi events: { released: function (e) { + console.log('received released event', e) let code = this.el.getAttribute('onreleased') // if multi, should also look for onreleased__ not just onreleased try {