DeviceΒΆ

Properties:

Methods:

class Leap::Device

The Device class represents a physically connected device.

The Device class contains information related to a particular connected device such as device id, field of view relative to the device, and the position and orientation of the device in relative coordinates.

The position and orientation describe the alignment of the device relative to the user. The alignment relative to the user is only descriptive. Aligning devices to users provides consistency in the parameters that describe user interactions.

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.

Since
1.0

Public Type

DeviceType enum

The available types of Leap Motion controllers.

Since
1.2

Values:

  • TYPE_INVALID = = -1 -
  • TYPE_PERIPHERAL = = 1 -

    A standalone USB peripheral.

    The original Leap Motion controller device.

    Since

    1.2

  • TYPE_LAPTOP -

    A controller embedded in a keyboard.

    Since

    1.2

  • TYPE_KEYBOARD -

    A controller embedded in a laptop computer.

    Since

    1.2

Public Functions

Device()

Constructs a default Device object.

Get valid Device objects from a DeviceList object obtained using the Controller::devices() method.

Device device = controller.Devices [0];

Since
1.0

bool Equals(Device other)

Compare Device object equality.

Boolean isEqual = thisDevice == thatDevice;

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

Since
1.0

override string ToString()

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

Return
A description of the Device as a string.
Since
1.0

Property

float Baseline

The distance between the center points of the stereo sensors.

The baseline value, together with the maximum resolution, influence the maximum range.

Return
The separation distance between the center of each sensor, in mm.
Since
2.2.5

float HorizontalViewAngle

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

https://di4564baj7skl.cloudfront.net/documentation/images/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.

float angleOnLongDimension = device.HorizontalViewAngle;

Return
The horizontal angle of view in radians.
Since
1.0

bool IsLightingBad

The software has detected excessive IR illumination, which may interfere with tracking.

If robust mode is enabled, the system will enter robust mode when isLightingBad() is true.

Not implemented yet.

if(device.IsLightingBad){
    //Display message to user
}

Since
3.0

bool IsSmudged

The software has detected a possible smudge on the translucent cover over the Leap Motion cameras.

Not implemented yet.

if(device.IsSmudged){
    //Display message to user
}

Since
3.0

bool IsStreaming

Reports whether this device is streaming data to your application.

Currently only one controller can provide data at a time.

Since
1.2

float Range

The maximum reliable tracking range from the center of this device.

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.

float range = device.Range;

Return
The recommended maximum range of the device in mm.
Since
1.0

string SerialNumber

An alphanumeric serial number unique to each device.

Consumer device serial numbers consist of 2 letters followed by 11 digits.

When using multiple devices, the serial number provides an unambiguous identifier for each device.

Since
2.2.2

Device.DeviceType Type

The device type.

Use the device type value in the (rare) circumstances that you have an application feature which relies on a particular type of device. Current types of device include the original Leap Motion peripheral, keyboard-embedded controllers, and laptop-embedded controllers.

Return
The physical device type as a member of the DeviceType enumeration.
Since
1.2

float VerticalViewAngle

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

https://di4564baj7skl.cloudfront.net/documentation/images/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.

float angleOnShortDimension = device.VerticalViewAngle;

Return
The vertical angle of view in radians.
Since
1.0