DeviceΒΆ

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

Inherits IEquatable< Device >.

Public Types

enum  DeviceType
 The available types of Leap Motion controllers. More...
 

Public Member Functions

 Device ()
 Constructs a default Device object. More...
 
bool Equals (Device other)
 Compare Device object equality. More...
 
override string ToString ()
 A string containing a brief, human readable description of the Device object. More...
 

Properties

float Baseline [get]
 The distance between the center points of the stereo sensors. More...
 
float HorizontalViewAngle [get]
 The angle of view along the x axis of this device. More...
 
bool IsLightingBad [get]
 The software has detected excessive IR illumination, which may interfere with tracking. More...
 
bool IsSmudged [get]
 The software has detected a possible smudge on the translucent cover over the Leap Motion cameras. More...
 
bool IsStreaming [get]
 Reports whether this device is streaming data to your application. More...
 
float Range [get]
 The maximum reliable tracking range from the center of this device. More...
 
string SerialNumber [get]
 An alphanumeric serial number unique to each device. More...
 
Device.DeviceType Type [get]
 The device type. More...
 
float VerticalViewAngle [get]
 The angle of view along the z axis of this device. More...
 

Detailed Description

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

Member Enumeration Documentation

enum DeviceType
strong

The available types of Leap Motion controllers.

Since
1.2
Enumerator
TYPE_PERIPHERAL 

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

Constructor & Destructor Documentation

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

Member Function Documentation

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.

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

Property Documentation

float Baseline
get

The distance between the center points of the stereo sensors.

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

Returns
The separation distance between the center of each sensor, in mm.
Since
2.2.5
float HorizontalViewAngle
get

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.

float angleOnLongDimension = device.HorizontalViewAngle;
Returns
The horizontal angle of view in radians.
Since
1.0
bool IsLightingBad
get

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
get

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
get

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
get

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;
Returns
The recommended maximum range of the device in mm.
Since
1.0
string SerialNumber
get

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

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.

Returns
The physical device type as a member of the DeviceType enumeration.
Since
1.2
float VerticalViewAngle
get

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.

float angleOnShortDimension = device.VerticalViewAngle;
Returns
The vertical angle of view in radians.
Since
1.0