Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (this.directionsIndex < this.directions.length) this.directionsIndex++;
},
speakingDone: function(){
// note -this needs to be updated for concurrent async speech
//this.speech = null;
},
loudnessError: function(){}
};
speaker = new Speaker(recipe);
Leap.loopController.on('gesture', function(gesture){
//if (gesture.type != 'swipe' && gesture.type != 'update') console.log('u', gesture.id);
if (gesture.type != 'swipe' || gesture.state != 'start') return;
var hand = Leap.loopController.frame().hand(gesture.handIds[0]);
if (hand.grabStrength > 0.7){
console.log('rejecting due to high grabStrength: ' + hand.grabStrength);
return
}
if (
Math.abs(gesture.direction[0]) > Math.abs(gesture.direction[1]) &&
Math.abs(gesture.direction[0]) > Math.abs(gesture.direction[2])
){
speaker.handleGesture(gesture);
}
Leap.loopController.on('gesture', function(gesture){
//if (gesture.type != 'swipe' && gesture.type != 'update') console.log('u', gesture.id);
if (gesture.type != 'swipe' || gesture.state != 'start') return;
var hand = Leap.loopController.frame().hand(gesture.handIds[0]);
if (hand.grabStrength > 0.7){
console.log('rejecting due to high grabStrength: ' + hand.grabStrength);
return
}
if (
Math.abs(gesture.direction[0]) > Math.abs(gesture.direction[1]) &&
Math.abs(gesture.direction[0]) > Math.abs(gesture.direction[2])
){
speaker.handleGesture(gesture);
}
});