diff --git a/index.html b/index.html index a8936d5..1aad49f 100644 --- a/index.html +++ b/index.html @@ -7,7 +7,7 @@ - + @@ -246,13 +246,42 @@ AFRAME.registerComponent('teleporter', { events: { mouseenter: function (e) { this.el.setAttribute("opacity", .8) }, mouseleave: function (e) { this.el.setAttribute("opacity", .5) }, - click: function (e) { document.getElementById('rig').setAttribute('position', this.el.getAttribute("position") ) } + click: function (e) { + let posTarget = new THREE.Vector3() + this.el.object3D.getWorldPosition( posTarget ) + console.log( posTarget) + document.getElementById('rig').setAttribute('position', posTarget) + // seems to work, maybe inteference with others teleporters activated unknowingly, e.g in succession + } + // this.el.getAttribute("position") ) } + // does not get proper world position // makes it compatible with mouse on desktop ... but also somehow enable the wrist shortcut?! } }); +AFRAME.registerComponent('scaffolding', { + init: function(){ + console.log(this.el.innerHTML) + // should become editable then saved back/replaced (or cloned) + // could do a test with switching to wireframe or grey color + // BT keyboard does get focus on Vision Pro too + // enter key does not seem to work though + // it does work on desktop tso should console.log() what keypresses are actually received + // Meta+Enter does work though! (on Corne-ish Zen it's Linux key with Enter) + // still prepare jxr regexes + // e.g el = document.querySelector("[scaffolding]")l el.innerHTML = el.innerHTML.replaceAll(" { @@ -353,6 +382,97 @@ setTimeout( _ => { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +