diff --git a/index.html b/index.html index 41b010a..fc756f9 100644 --- a/index.html +++ b/index.html @@ -139,6 +139,8 @@ var generators = "line-link-entities link screenstack dynamic-view selectionboxo + "commands-from-external-json glossary timeline issues web-url background-via-url observableui hidableenvironmentfot fot" // could be an array proper completed on each relevant component registration var heightAdjustableClasses = ["commands-from-external-json"] +var pinches = [] // position, timestamp, primary vs secondary +var dl2p = null // from distanceLastTwoPinches // could add a dedicated MakeyMakey mode with a fixed camera, e.g bird eye view, and an action based on some physical input that others, thanks to NAF, could see or even use. // ?inputmode=makeymakey @@ -912,6 +914,11 @@ AFRAME.registerComponent('pinchprimary', { // currently only 1 hand, the right o bbox.man.copy( zeroVector3 ) */ setTimeout( _ => primaryPinchStarted = false, 200) // delay otherwise still activate on release + + var newPinchPos = new THREE.Vector3() + newPinchPos.copy(event.detail.position ) + pinches.push({position:newPinchPos, timestamp:Date.now(), primary:true}) + dl2p = distanceLastTwoPinches() }); this.el.addEventListener('pinchmoved', function (event) { // move current target if any @@ -995,6 +1002,14 @@ AFRAME.registerComponent('start-on-press', { // could become like https://twitter.com/utopiah/status/1264131327269502976 // can include a mini typing game to warm up finger placement +function distanceLastTwoPinches(){ + let dist = null + if (pinches.length>1){ + dist = pinches[pinches.length-1].position.distanceTo( pinches[pinches.length-2].position ) + } + return dist +} + function startSelectionVolume(){ selectionPinchMode = true // see setupBBox in pinchprimary and pinchsecondary @@ -1593,7 +1608,7 @@ function switchSide(){
+ toolbox disable-components-via-url enable-components-via-url NOcommands-from-external-json > @@ -1664,6 +1679,7 @@ function switchSide(){ +