From 5caf9d166020e52707fa3bba15db67f5d1830c78 Mon Sep 17 00:00:00 2001 From: Fabien Benetou Date: Fri, 25 Nov 2022 16:03:39 +0100 Subject: [PATCH] selected elements history --- index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.html b/index.html index fc756f9..ee2d4ee 100644 --- a/index.html +++ b/index.html @@ -141,6 +141,7 @@ var generators = "line-link-entities link screenstack dynamic-view selectionboxo var heightAdjustableClasses = ["commands-from-external-json"] var pinches = [] // position, timestamp, primary vs secondary var dl2p = null // from distanceLastTwoPinches +var selectedElements = []; // 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 @@ -840,6 +841,7 @@ AFRAME.registerComponent('pinchsecondary', { init: function () { this.el.addEventListener('pinchended', function (event) { selectedElement = getClosestTargetElement( event.detail.position ) + selectedElements.push({element:selectedElement, timestamp:Date.now(), primary:false}) // if close enough to a target among a list of potential targets, unselect previous target then select new if (selectedElement) interpretJXR( selectedElement.getAttribute("value") ) selectedElement = null @@ -947,6 +949,7 @@ AFRAME.registerComponent('pinchprimary', { // currently only 1 hand, the right o //selectedElement = clone selectedElement = getClosestTargetElement( event.detail.position ) + selectedElements.push({element:selectedElement, timestamp:Date.now(), primary:true}) // if close enough to a target among a list of potential targets, unselect previous target then select new }); }, @@ -1680,6 +1683,8 @@ function switchSide(){ +