Leap Motion Java API Reference  0.8.0
com.leapmotion.leap.Device Class Reference

The Device class represents a physically connected device. More...

Inherits com.leapmotion.leap.Interface.

Public Member Functions

 Device ()
 Constructs a Device object.
 
float distanceToBoundary (Vector position)
 The distance to the nearest edge of the Leap Motion controller's view volume.
 
boolean equals (Device arg0)
 Compare Device object equality.
 
float horizontalViewAngle ()
 The angle of view along the x axis of this device.
 
boolean isValid ()
 Reports whether this is a valid Device object.
 
float range ()
 The maximum reliable tracking range.
 
String toString ()
 A string containing a brief, human readable description of the Device object.
 
float verticalViewAngle ()
 The angle of view along the z axis of this device.
 

Static Public Member Functions

static Device invalid ()
 Returns an invalid Device object.
 

Detailed Description

The Device class represents a physically connected device.

The Device class contains information related to a particular connected device such as field of view, device id, and calibrated positions.

Note that Device objects can be invalid, which means that they do not contain valid device information and do not correspond to a physical device. Test for validity with the Device::isValid() function.

Constructor & Destructor Documentation

com.leapmotion.leap.Device.Device ( )

Constructs a Device object.

An uninitialized device is considered invalid. Get valid Device objects from a DeviceList object obtained using the Controller::devices() method.

Member Function Documentation

float com.leapmotion.leap.Device.distanceToBoundary ( Vector  position)

The distance to the nearest edge of the Leap Motion controller's view volume.

The view volume is an axis-aligned, inverted pyramid centered on the device origin and extending upward to the range limit. The walls of the pyramid are described by the horizontalViewAngle and verticalViewAngle and the roof by the range. This function estimates the distance between the specified input position and the nearest wall or roof of the view volume.

Parameters
positionThe point to use for the distance calculation.
Returns
The distance in millimeters from the input position to the nearest boundary.
boolean com.leapmotion.leap.Device.equals ( Device  arg0)

Compare Device object equality.

Two Device objects are equal if and only if both Device objects represent the exact same Device and both Devices are valid.

float com.leapmotion.leap.Device.horizontalViewAngle ( )

The angle of view along the x axis of this device.

Leap_horizontalViewAngle.png

The Leap Motion controller scans a region in the shape of an inverted pyramid centered at the device's center and extending upwards. The horizontalViewAngle reports the view angle along the long dimension of the device.

Returns
The horizontal angle of view in radians.
static Device com.leapmotion.leap.Device.invalid ( )
static

Returns an invalid Device object.

You can use the instance returned by this function in comparisons testing whether a given Device instance is valid or invalid. (You can also use the Device::isValid() function.)

Returns
The invalid Device instance.
boolean com.leapmotion.leap.Device.isValid ( )

Reports whether this is a valid Device object.

Returns
True, if this Device object contains valid data.
float com.leapmotion.leap.Device.range ( )

The maximum reliable tracking range.

The range reports the maximum recommended distance from the device center for which tracking is expected to be reliable. This distance is not a hard limit. Tracking may be still be functional above this distance or begin to degrade slightly before this distance depending on calibration and extreme environmental conditions.

Returns
The recommended maximum range of the device in mm.
String com.leapmotion.leap.Device.toString ( )

A string containing a brief, human readable description of the Device object.

Returns
A description of the Device as a string.
float com.leapmotion.leap.Device.verticalViewAngle ( )

The angle of view along the z axis of this device.

Leap_verticalViewAngle.png

The Leap Motion controller scans a region in the shape of an inverted pyramid centered at the device's center and extending upwards. The verticalViewAngle reports the view angle along the short dimension of the device.

Returns
The vertical angle of view in radians.