|
1 | | -(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){ |
| 1 | +(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ |
2 | 2 | 'use strict'; |
3 | 3 |
|
4 | 4 | require('../index.js'); |
@@ -213,9 +213,9 @@ AFRAME.registerComponent('super-hands', { |
213 | 213 | }, |
214 | 214 | onStretchEndButton: function (evt) { |
215 | 215 | const stretched = this.state.get(this.STRETCH_EVENT); |
216 | | - const endEvt = { hand: this.el, buttonEvent: evt |
217 | | - // check if end event accepted |
218 | | - };if (stretched && !this.emitCancelable(stretched, this.UNSTRETCH_EVENT, endEvt)) { |
| 216 | + const endEvt = { hand: this.el, buttonEvent: evt }; |
| 217 | + // check if end event accepted |
| 218 | + if (stretched && !this.emitCancelable(stretched, this.UNSTRETCH_EVENT, endEvt)) { |
219 | 219 | this.promoteHoveredEl(stretched); |
220 | 220 | this.state.delete(this.STRETCH_EVENT); |
221 | 221 | this.hover(); |
@@ -429,24 +429,26 @@ AFRAME.registerComponent('super-hands', { |
429 | 429 | this.el.addEventListener(this.data.colliderEndEvent, this.unWatch); |
430 | 430 | this.el.addEventListener(this.data.colliderEndEvent, this.unHover); |
431 | 431 |
|
| 432 | + // binding order to keep grabEnd from triggering dragover |
| 433 | + // again before dragDropEnd can delete its carried state |
432 | 434 | this.data.grabStartButtons.forEach(b => { |
433 | 435 | this.el.addEventListener(b, this.onGrabStartButton); |
434 | 436 | }); |
435 | | - this.data.grabEndButtons.forEach(b => { |
436 | | - this.el.addEventListener(b, this.onGrabEndButton); |
437 | | - }); |
438 | 437 | this.data.stretchStartButtons.forEach(b => { |
439 | 438 | this.el.addEventListener(b, this.onStretchStartButton); |
440 | 439 | }); |
441 | | - this.data.stretchEndButtons.forEach(b => { |
442 | | - this.el.addEventListener(b, this.onStretchEndButton); |
443 | | - }); |
444 | 440 | this.data.dragDropStartButtons.forEach(b => { |
445 | 441 | this.el.addEventListener(b, this.onDragDropStartButton); |
446 | 442 | }); |
447 | 443 | this.data.dragDropEndButtons.forEach(b => { |
448 | 444 | this.el.addEventListener(b, this.onDragDropEndButton); |
449 | 445 | }); |
| 446 | + this.data.stretchEndButtons.forEach(b => { |
| 447 | + this.el.addEventListener(b, this.onStretchEndButton); |
| 448 | + }); |
| 449 | + this.data.grabEndButtons.forEach(b => { |
| 450 | + this.el.addEventListener(b, this.onGrabEndButton); |
| 451 | + }); |
450 | 452 | }, |
451 | 453 | unRegisterListeners: function (data) { |
452 | 454 | data = data || this.data; |
@@ -547,6 +549,7 @@ AFRAME.registerComponent('locomotor-auto-config', { |
547 | 549 | if (this.data.camera) { |
548 | 550 | if (!document.querySelector('a-camera, [camera]')) { |
549 | 551 | let cam = document.createElement('a-camera'); |
| 552 | + cam.setAttribute('position', '0 1.6 0'); |
550 | 553 | this.el.appendChild(cam); |
551 | 554 | } |
552 | 555 | } |
@@ -2570,9 +2573,9 @@ AFRAME.registerComponent('grabbable', inherit(base, { |
2570 | 2573 | this.deltaPositionIsValid = false; |
2571 | 2574 | this.grabDistance = undefined; |
2572 | 2575 | this.grabDirection = { x: 0, y: 0, z: -1 }; |
2573 | | - this.grabOffset = { x: 0, y: 0, z: 0 |
2574 | | - // persistent object speeds up repeat setAttribute calls |
2575 | | - };this.destPosition = { x: 0, y: 0, z: 0 }; |
| 2576 | + this.grabOffset = { x: 0, y: 0, z: 0 }; |
| 2577 | + // persistent object speeds up repeat setAttribute calls |
| 2578 | + this.destPosition = { x: 0, y: 0, z: 0 }; |
2576 | 2579 | this.deltaPosition = new THREE.Vector3(); |
2577 | 2580 | this.targetPosition = new THREE.Vector3(); |
2578 | 2581 | this.physicsInit(); |
|
0 commit comments