Skip to content

Commit da9a295

Browse files
authored
Merge pull request #118 from PButcher/master
Add remaining Oculus Touch controller buttons to schema
2 parents 18eb665 + 017a130 commit da9a295

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,8 @@ An alternative version of `grabbable` that registers that a button was pressed,
489489
move the entity. Do not use `clickable` and `grabbable` on the same entity
490490
(just use `grabbable` and watch the "grabbed" state instead of "clicked")
491491

492+
#### Component Schema
493+
492494
| Property | Description | Default Value |
493495
| -------- | ----------- | ------------- |
494496
| startButtons | Which button events to accept to start grab | `[]` |

dist/super-hands.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,22 @@ AFRAME.registerComponent('super-hands', {
3030
colliderEndEvent: { default: 'hitend' },
3131
colliderEndEventProperty: { default: 'el' },
3232
grabStartButtons: {
33-
default: ['gripdown', 'trackpaddown', 'triggerdown', 'gripclose', 'pointup', 'thumbup', 'pointingstart', 'pistolstart', 'thumbstickdown', 'mousedown', 'touchstart']
33+
default: ['gripdown', 'trackpaddown', 'triggerdown', 'gripclose', 'abuttondown', 'bbuttondown', 'xbuttondown', 'ybuttondown', 'pointup', 'thumbup', 'pointingstart', 'pistolstart', 'thumbstickdown', 'mousedown', 'touchstart']
3434
},
3535
grabEndButtons: {
36-
default: ['gripup', 'trackpadup', 'triggerup', 'gripopen', 'pointdown', 'thumbdown', 'pointingend', 'pistolend', 'thumbstickup', 'mouseup', 'touchend']
36+
default: ['gripup', 'trackpadup', 'triggerup', 'gripopen', 'abuttonup', 'bbuttonup', 'xbuttonup', 'ybuttonup', 'pointdown', 'thumbdown', 'pointingend', 'pistolend', 'thumbstickup', 'mouseup', 'touchend']
3737
},
3838
stretchStartButtons: {
39-
default: ['gripdown', 'trackpaddown', 'triggerdown', 'gripclose', 'pointup', 'thumbup', 'pointingstart', 'pistolstart', 'thumbstickdown', 'mousedown', 'touchstart']
39+
default: ['gripdown', 'trackpaddown', 'triggerdown', 'gripclose', 'abuttondown', 'bbuttondown', 'xbuttondown', 'ybuttondown', 'pointup', 'thumbup', 'pointingstart', 'pistolstart', 'thumbstickdown', 'mousedown', 'touchstart']
4040
},
4141
stretchEndButtons: {
42-
default: ['gripup', 'trackpadup', 'triggerup', 'gripopen', 'pointdown', 'thumbdown', 'pointingend', 'pistolend', 'thumbstickup', 'mouseup', 'touchend']
42+
default: ['gripup', 'trackpadup', 'triggerup', 'gripopen', 'abuttonup', 'bbuttonup', 'xbuttonup', 'ybuttonup', 'pointdown', 'thumbdown', 'pointingend', 'pistolend', 'thumbstickup', 'mouseup', 'touchend']
4343
},
4444
dragDropStartButtons: {
45-
default: ['gripdown', 'trackpaddown', 'triggerdown', 'gripclose', 'pointup', 'thumbup', 'pointingstart', 'pistolstart', 'thumbstickdown', 'mousedown', 'touchstart']
45+
default: ['gripdown', 'trackpaddown', 'triggerdown', 'gripclose', 'abuttondown', 'bbuttondown', 'xbuttondown', 'ybuttondown', 'pointup', 'thumbup', 'pointingstart', 'pistolstart', 'thumbstickdown', 'mousedown', 'touchstart']
4646
},
4747
dragDropEndButtons: {
48-
default: ['gripup', 'trackpadup', 'triggerup', 'gripopen', 'pointdown', 'thumbdown', 'pointingend', 'pistolend', 'thumbstickup', 'mouseup', 'touchend']
48+
default: ['gripup', 'trackpadup', 'triggerup', 'gripopen', 'abuttonup', 'bbuttonup', 'xbuttonup', 'ybuttonup', 'pointdown', 'thumbdown', 'pointingend', 'pistolend', 'thumbstickup', 'mouseup', 'touchend']
4949
}
5050
},
5151

@@ -185,9 +185,9 @@ AFRAME.registerComponent('super-hands', {
185185
},
186186
onStretchEndButton: function (evt) {
187187
const stretched = this.state.get(this.STRETCH_EVENT);
188-
const endEvt = { hand: this.el, buttonEvent: evt };
189-
// check if end event accepted
190-
if (stretched && !this.emitCancelable(stretched, this.UNSTRETCH_EVENT, endEvt)) {
188+
const endEvt = { hand: this.el, buttonEvent: evt
189+
// check if end event accepted
190+
};if (stretched && !this.emitCancelable(stretched, this.UNSTRETCH_EVENT, endEvt)) {
191191
this.promoteHoveredEl(stretched);
192192
this.state.delete(this.STRETCH_EVENT);
193193
this.hover();
@@ -1083,9 +1083,9 @@ AFRAME.registerComponent('grabbable', inherit({}, physicsCore, buttonsCore, {
10831083
this.deltaPositionIsValid = false;
10841084
this.grabDistance = undefined;
10851085
this.grabDirection = { x: 0, y: 0, z: -1 };
1086-
this.grabOffset = { x: 0, y: 0, z: 0 };
1087-
// persistent object speeds up repeat setAttribute calls
1088-
this.destPosition = { x: 0, y: 0, z: 0 };
1086+
this.grabOffset = { x: 0, y: 0, z: 0
1087+
// persistent object speeds up repeat setAttribute calls
1088+
};this.destPosition = { x: 0, y: 0, z: 0 };
10891089
this.deltaPosition = new THREE.Vector3();
10901090
this.targetPosition = new THREE.Vector3();
10911091
this.physicsInit();

0 commit comments

Comments
 (0)