Leap Motion C# API Reference  0.8.0
Leap.Device Class Reference

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

Inherits 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.
 
bool Equals (Device arg0)
 Compare Device object equality.
 
override string ToString ()
 A string containing a brief, human readable description of the Device object.
 

Properties

float HorizontalViewAngle [get]
 The angle of view along the x axis of this device.
 
static Device Invalid [get]
 Returns an invalid Device object.
 
bool IsValid [get]
 Reports whether this is a valid Device object.
 
float Range [get]
 The maximum reliable tracking range.
 
float VerticalViewAngle [get]
 The angle of view along the z axis of this device.
 

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

Leap.Device.Device ( )
inline

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 Leap.Device.DistanceToBoundary ( Vector  position)
inline

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.
bool Leap.Device.Equals ( Device  arg0)
inline

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.

override string Leap.Device.ToString ( )
inline

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

Returns
A description of the Device as a string.

Property Documentation

float Leap.Device.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.

Returns
The horizontal angle of view in radians.
Device Leap.Device.Invalid
staticget

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.
bool Leap.Device.IsValid
get

Reports whether this is a valid Device object.

Returns
True, if this Device object contains valid data.
float Leap.Device.Range
get

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.
float Leap.Device.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.

Returns
The vertical angle of view in radians.