Unigine::LeapMotion::LeapMotionInterface Class
Header: | #include <LeapMotionInterface.h> |
This set of functions is available when the LeapMotion plugin is loaded.
If the plugin is loaded together with the engine, the HAS_LEAP_MOTION definition is set. This definition can be used, for example, to avoid errors if the plugin is not loaded: the code in which the plugin functions are executed can be wrapped around as follows:
#ifdef HAS_LEAP_MOTION
// engine.leap_motion functions
#endif
LeapMotionInterface Class
Members
void clearPolicy(int policy)
Requests clearing the specified policy. A request to change a policy is subject to user approval and a policy can be changed by the user at any time (using the Leap Motion settings dialog).The desired policy flags must be set every time an application runs.
Arguments
- int policy - Policy. One of the POLICY_*values.
float getHorizontalViewAngle()
Returns the angle of view along the X axis (long dimension) of the Leap Motion device. The Leap Motion controller scans a region in the shape of an inverted pyramid centered at the device’s center and extending upwards.Return value
Angle of view along the X axis of the Leap Motion device, in degrees.float getRange()
Returns 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.
Return value
Maximum reliable tracking range from the center of this device, in meters.void setPaused(int pause)
Pauses or resumes the Leap Motion service.Arguments
- int pause - 1 - to pause the Leap Motion service; 0 - to resume it.
int isPaused()
Returns a value indicating if the Leap Motion service is currently paused.Return value
1 if the Leap Motion service is currently paused; otherwise, 0.int hasFocus()
Returns a value indicating if the application is the focused (foreground) application.By default, your application only receives tracking information from the Leap Motion controller when it has the operating system input focus. To receive tracking data when your application is in the background, the background frames policy flag must be set.
Return value
1 if the application is the focused (foreground) application; otherwise, 0.float getDistanceToBoundary(const vec3 & position)
Returns the distance from the specified point 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.Arguments
- const vec3 & position - Point to measure the distance from.
Return value
Distance from the specified point to the nearest edge of the Leap Motion controller’s view volume, in meters.int isServiceConnected()
Returns a value indicating if your application has a connection to the Leap Motion daemon/service.Can return 1 even if the Leap Motion hardware is not available. To check if the hardware is connected, use the isConnected() method.
Return value
1 if your application has a connection to the Leap Motion daemon/service; otherwise, 0.float getBaseline()
Returns the distance between the center points of the stereo cameras of the Leap Motion device.Return value
Distance between the center points of the stereo cameras of the Leap Motion device, in meters.int isConnected()
Returns a value indicating if the Leap Motion device is connected.Return value
1 if the Leap Motion device is connected; otherwise, 0.float getFPS()
Returns the current framerate.Return value
Current framerate.float getVerticalViewAngle()
Returns the angle of view along the Z axis (short dimension) of the Leap Motion device. The Leap Motion controller scans a region in the shape of an inverted pyramid centered at the device’s center and extending upwards.Return value
Angle of view along the Z axis of the Leap Motion device, in degrees.int isPolicySet(int policy)
Returns a value indicating if the specified policy is set. To set a policy use the setPolicy() method.Arguments
- int policy - Policy type. One of the POLICY_*values.
Return value
1 if the specified policy is set; otherwise, 0.int isLightingBad()
Returns a value indicating if the excessive IR illumination was detected.Return value
1 if the excessive IR illumination was detected; otherwise, 0.int isSmudged()
Returns a value indicating if a possible smudge on the translucent cover over the Leap Motion cameras was detected.Return value
1 if a possible smudge on the translucent cover over the Leap Motion cameras was detected; otherwise, 0.void setPolicy(int policy)
Requests setting the specified policy. A request to change a policy is subject to user approval and a policy can be changed by the user at any time (using the Leap Motion settings dialog).The desired policy flags must be set every time an application runs.
Arguments
- int policy - Policy. One of the POLICY_*values.
const Vector< Ptr<Image> > & getImages()
Returns the list of the most recent images from the infrared stereo cameras of the device. Images are in the Image::FORMAT_R8. The images can be used for:- Head-mounted display video pass-through
- Augmented reality
- Computer vision
Return value
Vector, containing images from the cameras.int getNumHands()
Returns the number of currently tracked hands.Return value
Number of currently tracked hands.const Map< int, LeapMotion::Hand > & getHands()
Returns the list of currently tracked hands.Return value
List of currently tracked hands.int POLICY_DEFAULT
Description
Default policy flag. Enables default policy settings.int POLICY_BACKGROUND_FRAMES
Description
Background frames policy flag. Determines whether an application receives frames of tracking data while in the background.By default, the Leap Motion software only sends tracking data to the foreground application. Only applications that need this ability should request the background frames policy. The “Allow Background Apps” checkbox must be enabled in the Leap Motion Control Panel or this policy will be denied.
int POLICY_IMAGES
Description
Images policy flag. Enables your application to receive images from the device cameras.The “Allow Images” checkbox must be enabled in the Leap Motion Control Panel or this policy will be denied.
int POLICY_OPTIMIZE_HMD
Description
HMD optimization policy flag. Enables tracking optimization for head-mounted tracking mode.This policy improves tracking in situations where the Leap Motion hardware is attached to a head-mounted display. This policy is not granted for devices that cannot be mounted to an HMD, such as Leap Motion controllers embedded in a laptop or keyboard.
int POLICY_ALLOW_PAUSE_RESUME
Description
Pause resume policy flag. Determines is the application will be allowed to pause and unpause the Leap Motion service.int POLICY_RAW_IMAGES
Description
Images policy flag. Enables your application to receive raw images from the device cameras.Last update: 26.04.2018
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter