This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Физика
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine.Plugins.LeapMotion Class

Notice
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:

Source code (UnigineScript)
#ifdef HAS_LEAP_MOTION
	// engine.leap_motion functions
#endif

LeapMotion Class

Перечисления (Enums)

POLICY#

ИмяОписание
DEFAULT = 0Default policy flag. Enables default policy settings.
BACKGROUND_FRAMES = 1 << 0Background frames policy flag. Determines whether an application receives frames of tracking data while in the background.
Notice
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.
IMAGES = 1 << 1Images policy flag. Enables your application to receive images from the device cameras.
Notice
The "Allow Images" checkbox must be enabled in the Leap Motion Control Panel or this policy will be denied.
OPTIMIZE_HMD = 1 << 2HMD optimization policy flag. Enables tracking optimization for head-mounted tracking mode.
Notice
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.
ALLOW_PAUSE_RESUME = 1 << 3Pause resume policy flag. Determines if the application is allowed to pause and unpause the Leap Motion service.
RAW_IMAGES = 1 << 6Images policy flag. Enables your application to receive raw images from the device cameras.

Properties

bool IsLoaded#

The true if the LeapMotion plugin is loaded; otherwise, false.

bool IsConnected#

The true if the LeapMotion device is connected; otherwise, false.

bool IsServiceConnected#

The true if your application has a connection to the Leap Motion daemon/service; otherwise, false.

bool IsSmudged#

The true if a possible smudge on the translucent cover over the Leap Motion cameras was detected; otherwise, false.

bool IsLightingBad#

The true if the excessive IR illumination was detected; otherwise, false.

bool Paused#

The true if the Leap Motion service is currently paused; otherwise, false.

float HorizontalViewAngle#

The Angle of view along the X axis of the Leap Motion device, in degrees.

float VerticalViewAngle#

The Angle of view along the Z axis of the Leap Motion device, in degrees.

float Range#

The Maximum reliable tracking range from the center of this device, in meters.

float Baseline#

The Distance between the center points of the stereo cameras of the Leap Motion device, in meters.

float FPS#

The Current framerate.

Members


bool HasFocus ( ) #

Returns a value indicating if the application is the focused (foreground) application.
Notice
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

true if the application is the focused (foreground) application; otherwise, false.

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).
Notice
The desired policy flags must be set every time an application runs.

Arguments

  • int policy - Policy. One of the POLICY values.

bool 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

true if the specified policy is set; otherwise, false.

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).
Notice
The required policy flags must be set every time an application runs.

Arguments

  • int policy - Policy. One of the POLICY values.

float GetDistanceToBoundary ( 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

  • 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 GetNumImages ( ) #

Returns the number of images stored in the list of the most recent images from the infrared stereo cameras of the device. Images are in the Image::FORMAT_R8.

Return value

Number of images stored in the array.

Ptr<Image> & GetImage ( int num ) #

Returns the selected image from the list of the most recent images from the infrared stereo cameras of the device. Images are in the Image::FORMAT_R8.

Arguments

  • int num - Index number of the image in the array.

Return value

Selected image from the cameras.
Last update: 19.04.2024
Build: ()