new Controller()
Constructs a Controller object.
When creating a Controller object, you may optionally pass in options to set the host , set the port, enable gestures, or select the frame event type.
var controller = new Leap.Controller({
host: '127.0.0.1',
port: 6437,
enableGestures: true,
frameEventName: 'animationFrame'
});
- Source:
- controller.js, line 9
Methods
-
frame(history) → {Leap.Frame}
-
Returns a frame of tracking data from the Leap.
Use the optional history parameter to specify which frame to retrieve. Call frame() or frame(0) to access the most recent frame; call frame(1) to access the previous frame, and so on. If you use a history value greater than the number of stored frames, then the controller returns an invalid frame.
Parameters:
Name Type Description history
Number The age of the frame to return, counting backwards from the most recent frame (0) into the past and up to the maximum age (59).
- Source:
- controller.js, line 93
Returns:
The specified frame; or, if no history parameter is specified, the newest frame. If a frame is not available at the specified history position, an invalid Frame is returned.
- Type
- Leap.Frame