diff --git a/index.html b/index.html index 1641fc4..0c978ee 100644 --- a/index.html +++ b/index.html @@ -20,6 +20,8 @@ + + @@ -2510,6 +2512,7 @@ function startMesher(){ elSecondary.addEventListener('pinchended', endedSecondary ); function endedSecondary(){ targets.push(meshEl) + meshEl.setAttribute('dynamic-body', "") //makeAnchorsVisibleOnTargets() // too large here applyToClass("meshvertex", (e, val ) => e.setAttribute("visible", val), "false") el.removeEventListener('pinchended', end) @@ -2561,6 +2564,22 @@ function startMesher(){ } } +AFRAME.registerComponent('dynamic-unless-picked', { + init: function(){ + let el = this.el + el.setAttribute('dynamic-body', "") + this.el.addEventListener('picked', function (event) { + el.removeAttribute('dynamic-body') + el.setAttribute('static-body', "") + }) + this.el.addEventListener('released', function (event) { + el.removeAttribute('static-body') + el.setAttribute('dynamic-body', "") + }) + } + // should unregister on remove +}) + // used for testing AFRAME.registerComponent('startfunctions', { init: function () { @@ -2582,6 +2601,7 @@ AFRAME.registerComponent('startfunctions', { + + + + + + + + +