Skip to content

Commit a656891

Browse files
committed
Merge remote-tracking branch 'upstream/master' into contributor-master
2 parents 988133b + 868e809 commit a656891

File tree

11 files changed

+52558
-137291
lines changed

11 files changed

+52558
-137291
lines changed

.babelrc

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
11
{
2-
"presets": [["env", {
3-
"targets": {
4-
"browsers": [
5-
"last 1 Samsung versions", "last 2 Firefox versions",
6-
"last 2 Chrome versions", "last 2 FirefoxAndroid versions",
7-
"last 2 iOS versions"
8-
]
9-
}
10-
}]],
112
"env": {
123
"production": {
134
"presets": ["minify"]

.travis.yml

Lines changed: 0 additions & 24 deletions
This file was deleted.

README.md

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Super Hands
22

3-
[![Build Status](https://travis-ci.com/c-frame/aframe-super-hands-component.svg?branch=master)](https://travis-ci.com/c-frame/aframe-super-hands-component)
43
[![npm Dowloads](https://img.shields.io/npm/dt/super-hands.svg?style=flat-square)](https://www.npmjs.com/package/super-hands)
54
[![npm Version](http://img.shields.io/npm/v/super-hands.svg?style=flat-square)](https://www.npmjs.com/package/super-hands)
65
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
@@ -56,9 +55,9 @@ Install and use by directly by including the [browser files](dist):
5655
```html
5756
<head>
5857
<title>Most Basic Super-Hands Example</title>
59-
<script src="https://aframe.io/releases/1.4.0/aframe.min.js"></script>
58+
<script src="https://aframe.io/releases/1.4.2/aframe.min.js"></script>
6059
<script src="https://cdn.jsdelivr.net/gh/donmccurdy/[email protected]/dist/aframe-extras.misc.min.js"></script>
61-
<script src="https://unpkg.com/super-hands@^3.0.3/dist/super-hands.min.js"></script>
60+
<script src="https://unpkg.com/super-hands@^3.0.5/dist/super-hands.min.js"></script>
6261
</head>
6362

6463
<body>
@@ -75,6 +74,35 @@ Install and use by directly by including the [browser files](dist):
7574
</body>
7675
```
7776

77+
To use with A-Frame 1.5.0 and onward:
78+
79+
```html
80+
<head>
81+
<title>Most Basic Super-Hands Example</title>
82+
<script src="https://aframe.io/releases/1.6.0/aframe.min.js"></script>
83+
<script>
84+
delete AFRAME.components["grabbable"];
85+
</script>
86+
<script src="https://cdn.jsdelivr.net/gh/c-frame/[email protected]/dist/aframe-extras.min.js"></script></script>
87+
<script src="https://unpkg.com/super-hands@^3.0.5/dist/super-hands.min.js"></script>
88+
</head>
89+
90+
<body>
91+
<a-scene>
92+
<a-assets></a-assets>
93+
<a-entity>
94+
<a-camera></a-camera>
95+
<a-entity sphere-collider="objects: a-box" super-hands hand-controls="hand: left"></a-entity>
96+
<a-entity sphere-collider="objects: a-box" super-hands hand-controls="hand: right"></a-entity>
97+
</a-entity>
98+
<!-- hover & drag-drop won't have any obvious effect without some additional event handlers or components. See the examples page for more -->
99+
<a-box hoverable grabbable stretchable draggable droppable color="blue" position="0 0 -1"></a-box>
100+
</a-scene>
101+
</body>
102+
```
103+
104+
Note: This is a workaround solution to resolve the conflict between A-Frame grabbable component (introduced in A-Frame 1.5.0) and Superhands grabbable component.
105+
78106
#### npm
79107

80108
Install via npm:
@@ -116,10 +144,9 @@ The [examples page](https://c-frame.github.io/aframe-super-hands-component/examp
116144

117145
## News
118146

119-
v3.0.4
120-
* A-Frame 1.4.0 support confirmation
121-
* Updated dependencies and fixed tests and examples
122-
* No API changes
147+
v3.0.5
148+
* Add instanceId to Object3D.userData if available
149+
* Add instruction to use superhands with aframe 1.5.0 and onward
123150

124151
[Previous news](news.md)
125152

dist/super-hands.js

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
2-
"use strict";
3-
42
/* global AFRAME */
53

64
if (typeof AFRAME === 'undefined') {
@@ -287,6 +285,9 @@ AFRAME.registerComponent('super-hands', {
287285
const hoverEls = this.hoverEls;
288286
const hitElIndex = this.hoverEls.indexOf(hitEl);
289287
let hoverNeedsUpdate = false;
288+
if (dist && intersection.instanceId !== undefined) hitEl.object3D.userData = {
289+
instanceId: intersection.instanceId
290+
};
290291
if (hitElIndex === -1) {
291292
hoverNeedsUpdate = true;
292293
// insert in order of distance when available
@@ -542,8 +543,6 @@ AFRAME.registerComponent('super-hands', {
542543
});
543544

544545
},{"./reaction_components/clickable.js":2,"./reaction_components/drag-droppable.js":3,"./reaction_components/draggable.js":4,"./reaction_components/droppable.js":5,"./reaction_components/grabbable.js":6,"./reaction_components/hoverable.js":7,"./reaction_components/stretchable.js":10,"./systems/super-hands-system.js":11}],2:[function(require,module,exports){
545-
"use strict";
546-
547546
/* global AFRAME */
548547
const buttonCore = require('./prototypes/buttons-proto.js');
549548
AFRAME.registerComponent('clickable', AFRAME.utils.extendDeep({}, buttonCore, {
@@ -596,8 +595,6 @@ AFRAME.registerComponent('clickable', AFRAME.utils.extendDeep({}, buttonCore, {
596595
}));
597596

598597
},{"./prototypes/buttons-proto.js":8}],3:[function(require,module,exports){
599-
"use strict";
600-
601598
/* global AFRAME */
602599
const inherit = AFRAME.utils.extendDeep;
603600
const buttonCore = require('./prototypes/buttons-proto.js');
@@ -667,8 +664,6 @@ AFRAME.registerComponent('drag-droppable', inherit({}, buttonCore, {
667664
}));
668665

669666
},{"./prototypes/buttons-proto.js":8}],4:[function(require,module,exports){
670-
"use strict";
671-
672667
/* global AFRAME */
673668
const inherit = AFRAME.utils.extendDeep;
674669
const buttonCore = require('./prototypes/buttons-proto.js');
@@ -707,8 +702,6 @@ AFRAME.registerComponent('draggable', inherit({}, buttonCore, {
707702
}));
708703

709704
},{"./prototypes/buttons-proto.js":8}],5:[function(require,module,exports){
710-
"use strict";
711-
712705
/* global AFRAME */
713706
function elementMatches(el, selector) {
714707
if (el.matches) {
@@ -838,8 +831,6 @@ AFRAME.registerComponent('droppable', {
838831
});
839832

840833
},{}],6:[function(require,module,exports){
841-
"use strict";
842-
843834
/* global AFRAME, THREE */
844835
const inherit = AFRAME.utils.extendDeep;
845836
const physicsCore = require('./prototypes/physics-grab-proto.js');
@@ -996,8 +987,6 @@ AFRAME.registerComponent('grabbable', inherit(base, {
996987
}));
997988

998989
},{"./prototypes/buttons-proto.js":8,"./prototypes/physics-grab-proto.js":9}],7:[function(require,module,exports){
999-
"use strict";
1000-
1001990
/* global AFRAME */
1002991
AFRAME.registerComponent('hoverable', {
1003992
init: function () {
@@ -1041,8 +1030,6 @@ AFRAME.registerComponent('hoverable', {
10411030
});
10421031

10431032
},{}],8:[function(require,module,exports){
1044-
"use strict";
1045-
10461033
// common code used in customizing reaction components by button
10471034
module.exports = function () {
10481035
function buttonIsValid(evt, buttonList) {
@@ -1067,8 +1054,6 @@ module.exports = function () {
10671054
}();
10681055

10691056
},{}],9:[function(require,module,exports){
1070-
"use strict";
1071-
10721057
// base code used by grabbable for physics interactions
10731058
module.exports = {
10741059
schema: {
@@ -1130,8 +1115,6 @@ module.exports = {
11301115
};
11311116

11321117
},{}],10:[function(require,module,exports){
1133-
"use strict";
1134-
11351118
/* global AFRAME, THREE */
11361119
const inherit = AFRAME.utils.extendDeep;
11371120
const buttonsCore = require('./prototypes/buttons-proto.js');
@@ -1207,7 +1190,6 @@ AFRAME.registerComponent('stretchable', inherit(base, {
12071190
evt.preventDefault();
12081191
} // gesture accepted
12091192
},
1210-
12111193
end: function (evt) {
12121194
const stretcherIndex = this.stretchers.indexOf(evt.detail.hand);
12131195
if (evt.defaultPrevented || !this.endButtonOk(evt)) {
@@ -1277,8 +1259,6 @@ AFRAME.registerComponent('stretchable', inherit(base, {
12771259
}));
12781260

12791261
},{"./prototypes/buttons-proto.js":8}],11:[function(require,module,exports){
1280-
"use strict";
1281-
12821262
/* global AFRAME */
12831263
AFRAME.registerSystem('super-hands', {
12841264
init: function () {

0 commit comments

Comments
 (0)