1.Leap Motion全部类
javascript
Bone | InteractionBox |
CircleGesture | KeyTapGesture |
Controller | Pointable |
Finger | ScreenTapGesture |
Frame | SwipeGesture |
Gesture | Matrix math |
Hand | Vector math |
2.Leap 命名空间html
Leap是Leap API的全局命名空间,除此以外,Leap命名空间还包含下面functions:java
1)Leap.loop(options, callback)api
创建Leap controller和WebSocket connection,同时按期调用指定的回调函数,使用这个无需建立本身的controller。浏览器
做为替代,你能够建立你本身的controller()对象和轮询帧控制器当你准备循环调用本身时。函数
① options (Object) –一个包含option值并处于这个Controller里面的对象oop
host:127.0.0.1
动画
port:6437
spa
enableGestures
:启用手势识别,true或falsecode
background
:接受帧,true或false
optimizeHMD
:链接头戴显示器,true或false
frameEventName
:用于处理帧数据的更新循环的类型
animationFrame
:用浏览器的动画循环(通常60fps),Leap默认使用此类
deviceFrame
:运行在leap motion controller的帧速率(依靠用户设置和计算能力)
useAllPlugins
:默认false,告诉controller使用在此页面的全部plugins
loopWhileDisconnected
:默认true,链接时和不链接时是否循环动画
② callback (function) –浏览器准备绘制图像到屏幕,全部当前的帧对象已经经过函数调用
var controller = Leap.loop({enableGestures:true}, function(frame){ var currentFrame = frame; var previousFrame = controller.frame(1); var tenFramesBack = controller.frame(10);});
③ Returns: Controller--在这个循环函数中controller不断提供跟踪数据。