diff --git a/index.html b/index.html
index 30e112c..c44f676 100644
--- a/index.html
+++ b/index.html
@@ -1559,6 +1559,14 @@ function toggleVisibilityEntitiesFromClass(classname){
entities.map( e => e.setAttribute("visible", "true"))
}
+function pushLeftClass(classname, value=.1){
+ Array.from( document.querySelectorAll("."+classname) ).map( e => e.object3D.position.x -= value)
+}
+
+function pushRightClass(classname, value=.1){
+ Array.from( document.querySelectorAll("."+classname) ).map( e => e.object3D.position.x += value)
+}
+
function pushUpClass(classname, value=.1){
Array.from( document.querySelectorAll("."+classname) ).map( e => e.object3D.position.y += value)
}
@@ -1925,11 +1933,13 @@ function getClosestTilesSnappingPosition( t, threshold=0.05 ){
return point
}
+var tile_snapping_enabled = true
+
AFRAME.registerComponent('snap-on-pinchended', {
init: function(){
+ let el = this.el
this.el.addEventListener('released', function (event) {
- setFeedbackHUD("should snap to iso grid"); // TODO test
- console.log('dropped',el,'to snap')
+ if (tile_snapping_enabled) el.setAttribute("rotation", "0 0 0")
// if works, generalize and add to https://git.benetou.fr/utopiah/text-code-xr-engine/issues/66
// should come back from emit('released')
// could rely on getClosestTilesSnappingPosition()
@@ -1989,7 +1999,7 @@ function rescalePlace(scale = 10, yoffset=-1){
-
+
@@ -2000,68 +2010,31 @@ function rescalePlace(scale = 10, yoffset=-1){
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+