Leap Motion API类库:CircleGesture

1.CircleGesture

    circlegesture类代表一个圆的手指运动,

    当一个手指的尖端在活跃区域内画出一个圆圈时,就得到了一个圆的运动。

CircleGestureImage

    圆圈的手势是连续的,circlegesture对象有三种可能的状态:

  • start – 圆圈的姿态刚刚开始

  • update – 圆圈手势继续。

  • stop – 圆手势完成。

    一个未初始化的circlegesture对象视为无效的,

    下面的例子演示了如何从一个跟踪数据帧中获取手势对象:

var controller = Leap.loop({enableGestures: true}, function(frame){
  if(frame.valid && frame.gestures.length > 0){
    frame.gestures.forEach(function(gesture){
        switch (gesture.type){
          case "circle":
              console.log("Circle Gesture");
              break;
          case "keyTap":
              console.log("Key Tap Gesture");
              break;
          case "screenTap":
              console.log("Screen Tap Gesture");
              break;
          case "swipe":
              console.log("Swipe Gesture");
              break;
        }
    });
  }});

    您还可以添加一个侦听器回调到一个控制器对象。在每个设备帧中,您的回调被调用为每个手势对象:

var controller = Leap.loop({enableGestures: true}, function(frame){
  //... handle frame data
  });
  controller.on("gesture", function(gesture){
  //... handle gesture object
  });


转载于:https://my.oschina.net/chumingcheng/blog/610853

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值