UNPKG

leapjs

Version:

JavaScript client for the Leap Motion Controller

10 lines (9 loc) 272 B
var Cursor = module.exports = function() { return function(frame) { var pointable = frame.pointables.sort(function(a, b) { return a.z - b.z })[0] if (pointable && pointable.valid) { frame.cursorPosition = pointable.tipPosition } return frame } }