Leap 類與命名空間

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:6437spa

    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不斷提供跟蹤數據。

相關文章
相關標籤/搜索