Skip to content

Commit 7b2c6a7

Browse files
committed
minor changes requested per discussion on PR
update to CDN URLs from aframevr/assets#18
1 parent c9ae9e8 commit 7b2c6a7

File tree

2 files changed

+20
-23
lines changed

2 files changed

+20
-23
lines changed

‎docs/components/hand-controls.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ handles hand animations and poses.
4646

4747
## Assets
4848

49-
- [Left hand model](https://cdn.aframe.io/controllers/oculus-hands/leftHand.json)
50-
- [Right hand model](https://cdn.aframe.io/controllers/oculus-hands/rightHand.json)
49+
- [Left hand model](https://cdn.aframe.io/controllers/oculus-hands/v2/leftHand.json)
50+
- [Right hand model](https://cdn.aframe.io/controllers/oculus-hands/v2/rightHand.json)

‎src/components/hand-controls.js‎

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
var registerComponent = require('../core/component').registerComponent;
22

3-
var OCULUS_LEFT_HAND_MODEL_URL = 'https://rawgit.com/arturitu/assets/e698020d6f335fb46a6169f8985b4e12297e157d/controllers/oculus-hands/leftHand.json'; // 'https://cdn.aframe.io/controllers/oculus-hands/leftHand.json';
4-
var OCULUS_RIGHT_HAND_MODEL_URL = 'https://rawgit.com/arturitu/assets/e698020d6f335fb46a6169f8985b4e12297e157d/controllers/oculus-hands/rightHand.json'; // 'https://cdn.aframe.io/controllers/oculus-hands/rightHand.json';
3+
var OCULUS_LEFT_HAND_MODEL_URL = 'https://cdn.aframe.io/controllers/oculus-hands/v2/leftHand.json';
4+
var OCULUS_RIGHT_HAND_MODEL_URL = 'https://cdn.aframe.io/controllers/oculus-hands/v2/rightHand.json';
55

66
/**
77
*
@@ -156,12 +156,6 @@ module.exports.Component = registerComponent('hand-controls', {
156156
return controllerId && controllerId.indexOf('Oculus Touch') === 0;
157157
},
158158

159-
isOculusTouchController: function () {
160-
var trackedControls = this.el.components['tracked-controls'];
161-
var controllerId = trackedControls && trackedControls.controller && trackedControls.controller.id;
162-
return controllerId && controllerId.indexOf('Oculus Touch') === 0;
163-
},
164-
165159
determineGesture: function () {
166160
var gesture;
167161
var isGripActive = this.pressedButtons['grip'];
@@ -189,12 +183,12 @@ module.exports.Component = registerComponent('hand-controls', {
189183
},
190184

191185
gestureAnimationMapping: {
192-
'': 'Open',
193-
'pointing': 'Point',
194-
'pistol': 'Point + Thumb',
195-
'fist': 'Fist',
196-
'touch': 'Hold',
197-
'thumb': 'Thumb Up'
186+
default: 'Open',
187+
pointing: 'Point',
188+
pistol: 'Point + Thumb',
189+
fist: 'Fist',
190+
touch: 'Hold',
191+
thumb: 'Thumb Up'
198192
},
199193

200194
animateGesture: function (gesture) {
@@ -204,17 +198,17 @@ module.exports.Component = registerComponent('hand-controls', {
204198
this.playAnimation('Open', true);
205199
return;
206200
}
207-
var animation = this.gestureAnimationMapping[gesture || ''];
201+
var animation = this.gestureAnimationMapping[gesture || 'default'];
208202
this.playAnimation(animation || 'Open', !animation && isOculusTouch);
209203
},
210204

211205
// map to old vive-specific event names for now
212206
gestureEventMapping: {
213-
'fist': 'grip', // fist: e.g. grip active, trigger active, trackpad / surface active
214-
'touch': 'point', // 'touch' e.g. trigger active, grip not active
215-
'thumb': 'thumb', // thumbs up: e.g. grip active, trigger active, trackpad / surface not active
216-
'pointing': 'pointing', // pointing: e.g. grip active, trackpad / surface active, trigger not active
217-
'pistol': 'pistol' // pistol: e.g. grip active, trigger not active, trackpad / surface not active
207+
fist: 'grip', // fist: e.g. grip active, trigger active, trackpad / surface active
208+
touch: 'point', // 'touch' e.g. trigger active, grip not active
209+
thumb: 'thumb', // thumbs up: e.g. grip active, trigger active, trackpad / surface not active
210+
pointing: 'pointing', // pointing: e.g. grip active, trackpad / surface active, trigger not active
211+
pistol: 'pistol' // pistol: e.g. grip active, trigger not active, trackpad / surface not active
218212
},
219213

220214
gestureEventName: function (gesture, active) {
@@ -258,7 +252,10 @@ module.exports.Component = registerComponent('hand-controls', {
258252

259253
// play new animation.
260254
clipAction = mesh.mixer.clipAction(animation);
261-
if (!clipAction) { return; }
255+
// returning when no clipAction will prevent further issues
256+
// (e.g. controllers no longer updating pose)
257+
// but per https://github.com/aframevr/aframe/pull/2191#discussion_r93121878
258+
// the preference is to NOT prevent the issues to catch bugs earlier in QA.
262259
clipAction.loop = 2200;
263260
clipAction.clampWhenFinished = true;
264261
clipAction.timeScale = timeScale;

0 commit comments

Comments
 (0)