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
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine::VR Class

Header: #include <UnigineVR.h>

The base class for managing virtual reality in UNIGINE.Базовый класс для управления виртуальной реальностью в UNIGINE.

VR Initialization
Инициализация виртуальной реальности
#

By default, VR is not initialized. To run the engine with VR, you need to specify the -vr_app command-line option on the application start-up.По умолчанию VR не инициализирован. Чтобы запустить движок с помощью VR, вам необходимо указать параметр командной строки -vr_app при запуске приложения.

Примечание
You cannot launch the deprecated VR plugins (OpenVR, Varjo, Oculus) when the built-in VR is initialized, as it overrides the plugin's functionality. If you try to add a VR plugin after VR initialization, you will get an error message.Вы не можете запустить устаревшие плагины виртуальной реальности ( OpenVR, Varjo, Oculus) при инициализации встроенного VR, поскольку это переопределяет функциональность плагина. Если вы попытаетесь добавить VR-плагин после инициализации VR, вы получите сообщение об ошибке.

Supported Graphics APIs
Поддерживаемые графические API
#

The following graphics APIs are supported out of the box:Следующие графические API поддерживаются "из коробки":

  • DirectX 11DirectX 11
  • DirectX 12DirectX 12
  • VulkanVulkan
Примечание
For OpenGL API support, use the corresponding VR plugins (deprecated).Для поддержки OpenGL API используйте соответствующие плагины VR (устарели).

VR Class

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

API#

ИмяОписание
API_NULL = 0VR API is not initialized.VR API не инициализирован.
API_VARJO = 1Varjo API.API Varjo.
API_OPENVR = 2OpenVR API.OpenVR API.

VIEWPORT_TYPE#

ИмяОписание
VIEWPORT_TYPE_CONTEXT = 0Context (low-res) viewport.Контекстный экран просмотра (с низким разрешением).
VIEWPORT_TYPE_FOCUS = 1Focus (high-res) viewport.Видовой экран с фокусом (высоким разрешением).
VIEWPORT_TYPE_NUM = 2Number of viewport types.Количество типов видовых экранов.

EYE_TYPE#

ИмяОписание
EYE_TYPE_LEFT = 0Left eye.Левый глаз.
EYE_TYPE_RIGHT = 1Right eye.Правый глаз.
EYE_TYPE_NUM = 2Number of eye types.Количество типов глаз.

MIRROR_MODE#

ИмяОписание
MIRROR_MODE_BEGIN = 0The first element to be used for iteration.Первый элемент, который будет использоваться для итерации.
MIRROR_MODE_BLACK_SCREEN = 0No image (black screen).Нет изображения (черный экран).
MIRROR_MODE_MONO_LEFT = 1Mono image for the left eye.Монофоническое изображение для левого глаза.
MIRROR_MODE_MONO_RIGHT = 2Mono image for the right eye.Монофоническое изображение для правого глаза.
MIRROR_MODE_STEREO = 3Stereo image (left and right eyes).Стереоизображение (левый и правый глаза).
MIRROR_MODE_END = 3The last element to be used for iteration.Последний элемент, который будет использоваться для итерации.

WINDOW_MODE#

ИмяОписание
WINDOW_MODE_BEGIN = 0The first element to be used for iteration.Первый элемент, который будет использоваться для итерации.
WINDOW_MODE_DISABLED = 0Showing the mirrored image is disabled.Отображение зеркального изображения отключено.
WINDOW_MODE_MAIN = 1The main window shows the mirrored image.В главном окне отображается зеркальное изображение.
WINDOW_MODE_END = 1The last element to be used for iteration.Последний элемент, который будет использоваться для итерации.

TRACKING_SPACE#

ИмяОписание
TRACKING_SPACE_BEGIN = 0The first element to be used for iteration.Первый элемент, который будет использоваться для итерации.
TRACKING_SPACE_UNKNOWN = 0Poses are provided in the coordinate system defined by the tracker driver.Позы задаются в системе координат, определенной драйвером трекера.
TRACKING_SPACE_SEATED = 1Poses are provided relative to the seated zero pose.Позы указаны относительно нулевой позы сидя.
TRACKING_SPACE_STANDING = 2Poses are provided relative to the safe bounds specified by the user.Позы предоставляются относительно безопасных границ, указанных пользователем.
TRACKING_SPACE_END = 2The last element to be used for iteration.Последний элемент, который будет использоваться для итерации.

Члены класса

void setRenderEnabled ( bool enabled ) #

Console: vr_render_enabled
Устанавливает value indicating if rendering into the head-mounted display is enabled.значение, указывающее, включен ли рендеринг на дисплей, установленный на голове. Этот параметр находится в следующем файле конфигурации: *.boot.

Аргументы

  • bool enabled - Set true to enable рендеринг в HMD; false - to disable it. Значение по умолчанию false.

bool isRenderEnabled() const#

Console: vr_render_enabled
Возвращает value indicating if rendering into the head-mounted display is enabled.значение, указывающее, включен ли рендеринг на дисплей, установленный на голове. Этот параметр находится в следующем файле конфигурации: *.boot.

Возвращаемое значение

true if рендеринг в HMD is enabled; otherwise false. Значение по умолчанию false.

void setPeripheralRenderingModeEnabled ( bool enabled ) #

Console: vr_peripheral_rendering_mode_enabled
Устанавливает value indicating if the peripheral rendering mode is enabled. In this mode, the HMD has two context (peripheral) and two focus displays. You can disable two additional viewports to improve peformance.
Примечание
This feature is available for the Varjo devices only.This feature is available for the Varjo devices only.
This feature is available for the Varjo devices only.
значение, указывающее, включен ли режим периферийного отображения. В этом режиме HMD имеет два контекстных (периферийных) и два фокусных дисплея. Вы можете отключить два дополнительных видовых экрана для улучшения производительности.
Примечание
This feature is available for the Varjo devices only.Эта функция доступна только для устройств Varjo.
Этот параметр находится в следующем файле конфигурации: *.boot.

Аргументы

  • bool enabled - Set true to enable режим периферийного рендеринга; false - to disable it. Значение по умолчанию false.

bool isPeripheralRenderingModeEnabled() const#

Console: vr_peripheral_rendering_mode_enabled
Возвращает value indicating if the peripheral rendering mode is enabled. In this mode, the HMD has two context (peripheral) and two focus displays. You can disable two additional viewports to improve peformance.
Примечание
This feature is available for the Varjo devices only.This feature is available for the Varjo devices only.
This feature is available for the Varjo devices only.
значение, указывающее, включен ли режим периферийного отображения. В этом режиме HMD имеет два контекстных (периферийных) и два фокусных дисплея. Вы можете отключить два дополнительных видовых экрана для улучшения производительности.
Примечание
This feature is available for the Varjo devices only.Эта функция доступна только для устройств Varjo.
Этот параметр находится в следующем файле конфигурации: *.boot.

Возвращаемое значение

true if режим периферийного рендеринга is enabled; otherwise false. Значение по умолчанию false.

void setMirrorMode ( VR::MIRROR_MODE mode ) #

Console: vr_mirror_mode
Устанавливает mirror mode that defines how the mirrored image (i.e. VR image) will be displayed in the target window.зеркальный режим, который определяет, как зеркальное изображение (т.е. изображение виртуальной реальности) будет отображаться в целевом окне. Этот параметр находится в следующем файле конфигурации: *.boot.

Аргументы

  • VR::MIRROR_MODE mode - Одно из следующих значений:
    • 0 - черный экран (изображение не отображается).
    • 1 - изображение, отрисованное для левого глаза.
    • 2 - изображение, отрисованное для правого глаза.
    • 3 - стереоизображение (как для левого, так и для правого глаза). (по умолчанию)

VR::MIRROR_MODE getMirrorMode() const#

Console: vr_mirror_mode
Возвращает mirror mode that defines how the mirrored image (i.e. VR image) will be displayed in the target window.зеркальный режим, который определяет, как зеркальное изображение (т.е. изображение виртуальной реальности) будет отображаться в целевом окне. Этот параметр находится в следующем файле конфигурации: *.boot.

Возвращаемое значение

Одно из следующих значений:
  • 0 - черный экран (изображение не отображается).
  • 1 - изображение, отрисованное для левого глаза.
  • 2 - изображение, отрисованное для правого глаза.
  • 3 - стереоизображение (как для левого, так и для правого глаза). (по умолчанию)

void setWindowMode ( VR::WINDOW_MODE mode ) #

Console: vr_window_mode
Устанавливает window mode that defines which window will display the mirrored image (i.e. VR image).режим окна, определяющий, в каком окне будет отображаться зеркальное изображение (т.е. изображение виртуальной реальности). Этот параметр находится в следующем файле конфигурации: *.boot.

Аргументы

  • VR::WINDOW_MODE mode - Одно из следующих значений:
    • 0 - зеркальное отображение отключено.
    • 1 - в главном окне отображается зеркальное изображение. (по умолчанию)

VR::WINDOW_MODE getWindowMode() const#

Console: vr_window_mode
Возвращает window mode that defines which window will display the mirrored image (i.e. VR image).режим окна, определяющий, в каком окне будет отображаться зеркальное изображение (т.е. изображение виртуальной реальности). Этот параметр находится в следующем файле конфигурации: *.boot.

Возвращаемое значение

Одно из следующих значений:
  • 0 - зеркальное отображение отключено.
  • 1 - в главном окне отображается зеркальное изображение. (по умолчанию)

void setTrackingSpace ( VR::TRACKING_SPACE space ) #

Console: vr_tracking_space
Устанавливает zero pose of the tracking origin.нулевая позиция источника отслеживания. Этот параметр находится в следующем файле конфигурации: *.boot.

Аргументы

  • VR::TRACKING_SPACE space - Одно из следующих значений:
    • 0 - сидящий.
    • 1 - стоящий. (по умолчанию)
    • 2 - необработанный (некалиброванный).

VR::TRACKING_SPACE getTrackingSpace() const#

Console: vr_tracking_space
Возвращает zero pose of the tracking origin.нулевая позиция источника отслеживания. Этот параметр находится в следующем файле конфигурации: *.boot.

Возвращаемое значение

Одно из следующих значений:
  • 0 - сидящий.
  • 1 - стоящий. (по умолчанию)
  • 2 - необработанный (некалиброванный).

void setMotionPrediction ( bool prediction ) #

Console: vr_motion_prediction
Устанавливает value indicating if motion prediction in the Varjo headsets is enabled. When enabled, the engine submits the velocity value from the GBuffer to the Varjo Composer.значение, указывающее, включено ли предсказание движения в гарнитурах Varjo. При включении движок отправляет значение скорости из GBuffer в Varjo Composer. Этот параметр находится в следующем файле конфигурации: *.boot.

Аргументы

  • bool prediction - Set true to enable предсказание движения; false - to disable it. Значение по умолчанию false.

bool isMotionPrediction() const#

Console: vr_motion_prediction
Возвращает value indicating if motion prediction in the Varjo headsets is enabled. When enabled, the engine submits the velocity value from the GBuffer to the Varjo Composer.значение, указывающее, включено ли предсказание движения в гарнитурах Varjo. При включении движок отправляет значение скорости из GBuffer в Varjo Composer. Этот параметр находится в следующем файле конфигурации: *.boot.

Возвращаемое значение

true if предсказание движения is enabled; otherwise false. Значение по умолчанию false.

void setMotionPredictionVelocityPrecision ( ) #

Console: vr_motion_prediction_velocity_precision
Устанавливает factor of velocity scale before packing a floating point value into a 2x8 bit unsigned integer (uint).
Примечание
This feature is available for the Varjo devices only.This feature is available for the Varjo devices only.
This feature is available for the Varjo devices only.
коэффициент шкалы скоростей перед упаковкой значения с плавающей запятой в целое число без знака размером 2x8 бит (uint).
Примечание
This feature is available for the Varjo devices only.Эта функция доступна только для устройств Varjo.
Этот параметр находится в следующем файле конфигурации: *.boot.

Аргументы

  • precision -
    Диапазон значений: [eps, inf]. Значение по умолчанию : 32.0f.

getMotionPredictionVelocityPrecision() const#

Console: vr_motion_prediction_velocity_precision
Возвращает factor of velocity scale before packing a floating point value into a 2x8 bit unsigned integer (uint).
Примечание
This feature is available for the Varjo devices only.This feature is available for the Varjo devices only.
This feature is available for the Varjo devices only.
коэффициент шкалы скоростей перед упаковкой значения с плавающей запятой в целое число без знака размером 2x8 бит (uint).
Примечание
This feature is available for the Varjo devices only.Эта функция доступна только для устройств Varjo.
Этот параметр находится в следующем файле конфигурации: *.boot.

Возвращаемое значение


Диапазон значений: [eps, inf]. Значение по умолчанию : 32.0f.

void setMotionPredictionVelocityTimeDelta ( ) #

Console: vr_motion_prediction_velocity_time_delta
Устанавливает factor for optimizing between fast and slow-moving objects. A smaller number works better for fast-moving objects, and vice versa.
Примечание
This feature is available for the Varjo devices only.This feature is available for the Varjo devices only.
This feature is available for the Varjo devices only.
коэффициент для оптимизации между быстро и медленно движущимися объектами. Меньшее число лучше подходит для быстро движущихся объектов, и наоборот.
Примечание
This feature is available for the Varjo devices only.Эта функция доступна только для устройств Varjo.
Этот параметр находится в следующем файле конфигурации: *.boot.

Аргументы

  • delta -
    Диапазон значений: [eps, inf]. Значение по умолчанию : 1.0f / 60.0f.

getMotionPredictionVelocityTimeDelta() const#

Console: vr_motion_prediction_velocity_time_delta
Возвращает factor for optimizing between fast and slow-moving objects. A smaller number works better for fast-moving objects, and vice versa.
Примечание
This feature is available for the Varjo devices only.This feature is available for the Varjo devices only.
This feature is available for the Varjo devices only.
коэффициент для оптимизации между быстро и медленно движущимися объектами. Меньшее число лучше подходит для быстро движущихся объектов, и наоборот.
Примечание
This feature is available for the Varjo devices only.Эта функция доступна только для устройств Varjo.
Этот параметр находится в следующем файле конфигурации: *.boot.

Возвращаемое значение


Диапазон значений: [eps, inf]. Значение по умолчанию : 1.0f / 60.0f.

void setFoveatedRenderingEnabled ( bool enabled ) #

Console: vr_foveated_rendering_enabled
Устанавливает value indicating if foveated rendering is enabled. Foveated rendering makes use of the eye tracking functionality in the Varjo headsets to improve performance by reducing the image quality in peripheral areas where the user is not looking. Foveation allows applications to render fewer pixels and achieve a better VR experience.
Примечание
This feature is available for the Varjo devices only.This feature is available for the Varjo devices only.
This feature is available for the Varjo devices only.
значение, указывающее, включен ли рендеринг с расширением. Рендеринг с расширением использует функцию отслеживания взгляда в гарнитурах Varjo для повышения производительности за счет снижения качества изображения в периферийных областях, куда пользователь не смотрит. Функция Foveation позволяет приложениям отображать меньше пикселей и получать лучшие впечатления от виртуальной реальности.
Примечание
This feature is available for the Varjo devices only.Эта функция доступна только для устройств Varjo.
Этот параметр находится в следующем файле конфигурации: *.boot.

Аргументы

  • bool enabled - Set true to enable точечный рендеринг; false - to disable it. Значение по умолчанию true.

bool isFoveatedRenderingEnabled() const#

Console: vr_foveated_rendering_enabled
Возвращает value indicating if foveated rendering is enabled. Foveated rendering makes use of the eye tracking functionality in the Varjo headsets to improve performance by reducing the image quality in peripheral areas where the user is not looking. Foveation allows applications to render fewer pixels and achieve a better VR experience.
Примечание
This feature is available for the Varjo devices only.This feature is available for the Varjo devices only.
This feature is available for the Varjo devices only.
значение, указывающее, включен ли рендеринг с расширением. Рендеринг с расширением использует функцию отслеживания взгляда в гарнитурах Varjo для повышения производительности за счет снижения качества изображения в периферийных областях, куда пользователь не смотрит. Функция Foveation позволяет приложениям отображать меньше пикселей и получать лучшие впечатления от виртуальной реальности.
Примечание
This feature is available for the Varjo devices only.Эта функция доступна только для устройств Varjo.
Этот параметр находится в следующем файле конфигурации: *.boot.

Возвращаемое значение

true if точечный рендеринг is enabled; otherwise false. Значение по умолчанию true.

const char * getApiName() const#

Возвращает name of the VR API.название VR API.

Возвращаемое значение

название VR API.

VR::API getApiType() const#

Возвращает type of the VR API.тип VR API.

Возвращаемое значение

тип VR API.

getHMDRefreshRate() const#

Возвращает refresh rate of the head-mounted display.частота обновления дисплея, установленного на голове.

Возвращаемое значение

частота обновления HMD.

Math::Vec3 getHandtrackingOffset() const#

Возвращает hand tracking offset (for the Ultraleap device only).смещение отслеживания руки (только для устройства Ultraleap).

Возвращаемое значение

смещение отслеживания руки.

bool isPeripheralRenderingModeUsed() const#

Возвращает value indicating if the peripheral rendering is used.значение, указывающее, используется ли периферийный рендеринг.

Возвращаемое значение

true if используется периферийный рендеринг; otherwise false.

bool isHMDConnected() const#

Возвращает value indicating if the head-mounted display is connected.значение, указывающее, подключен ли дисплей, установленный на голове.

Возвращаемое значение

true if HMD подключен; otherwise false.

bool isUsingFoveatedRendering() const#

Возвращает value indicating if the foveated rendering is used.значение, указывающее, используется ли точечный рендеринг.

Возвращаемое значение

true if используется точечный рендеринг; otherwise false.

Ptr<Viewport> getViewport() const#

Возвращает viewport. It can be useful when implementing extra VR logic.окно просмотра. Это может быть полезно при реализации дополнительной логики виртуальной реальности.

Возвращаемое значение

видовой экран.

bool isSteamVRRendersControllers() const#

Возвращает value indicating if the SteamVR controllers are rendered. When you access the SteamVR menu during the application runtime, the SteamVR controllers start to be rendered along with the application controllers. You can use this function to check the state of the SteamVR controllers and disable the application controllers to avoid performance drops caused by the simultaneous rendering of both controllers.значение, указывающее, отображаются ли контроллеры SteamVR. Когда вы получаете доступ к меню SteamVR во время выполнения приложения, контроллеры SteamVR начинают отображаться вместе с контроллерами приложения. Вы можете использовать эту функцию для проверки состояния контроллеров SteamVR и отключения контроллеров приложений, чтобы избежать снижения производительности, вызванного одновременным отображением обоих контроллеров.

Возвращаемое значение

true if отображаются контроллеры SteamVR; otherwise false.

static Event<bool> getEventRenderModelsVisibility() const#

Event triggered when the render models visibility is changed. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).
Примечание
For more details see the Event Handling article.For more details see the Event Handling article.
For more details see the Event Handling article.
Событие запускается при изменении видимости рендер моделей. Вы можете подписаться на события через connect()   и отказаться от подписки через disconnect(). Вы также можете использовать EventConnection   и EventConnections  классы для удобства (см. примеры ниже).
Примечание
For more details see the Event Handling article.Для получения более подробной информации смотрите статью Обработка событий.
The event handler signature is as follows: myhandler(visible)

Usage Example

Исходный код (C++)
// implement the RenderModelsVisibility event handler
void rendermodelsvisibility_event_handler(visible)
{
	Log::message("\Handling RenderModelsVisibility event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections rendermodelsvisibility_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
VR::getEventRenderModelsVisibility().connect(rendermodelsvisibility_event_connections, rendermodelsvisibility_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
VR::getEventRenderModelsVisibility().connect(rendermodelsvisibility_event_connections, [](visible) { 
		Log::message("\Handling RenderModelsVisibility event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
rendermodelsvisibility_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection rendermodelsvisibility_event_connection;

// subscribe to the RenderModelsVisibility event with a handler function keeping the connection
VR::getEventRenderModelsVisibility().connect(rendermodelsvisibility_event_connection, rendermodelsvisibility_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
rendermodelsvisibility_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
rendermodelsvisibility_event_connection.setEnabled(true);

// ...

// remove subscription to the RenderModelsVisibility event via the connection
rendermodelsvisibility_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A RenderModelsVisibility event handler implemented as a class member
	void event_handler(visible)
	{
		Log::message("\Handling RenderModelsVisibility event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
VR::getEventRenderModelsVisibility().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe to the RenderModelsVisibility event with a handler function
VR::getEventRenderModelsVisibility().connect(rendermodelsvisibility_event_handler);


// remove subscription to the RenderModelsVisibility event later by the handler function
VR::getEventRenderModelsVisibility().disconnect(rendermodelsvisibility_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId rendermodelsvisibility_handler_id;

// subscribe to the RenderModelsVisibility event with a lambda handler function and keeping connection ID
rendermodelsvisibility_handler_id = VR::getEventRenderModelsVisibility().connect([](visible) { 
		Log::message("\Handling RenderModelsVisibility event (lambda).\n");
	}
);

// remove the subscription later using the ID
VR::getEventRenderModelsVisibility().disconnect(rendermodelsvisibility_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all RenderModelsVisibility events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
VR::getEventRenderModelsVisibility().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
VR::getEventRenderModelsVisibility().setEnabled(true);

Возвращаемое значение

Event reference.

static Event<> getEventAudioSettingsChanged() const#

Event triggered when the audio settings changed. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).
Примечание
For more details see the Event Handling article.For more details see the Event Handling article.
For more details see the Event Handling article.
Событие запускается при изменении настроек аудио. Вы можете подписаться на события через connect()   и отказаться от подписки через disconnect(). Вы также можете использовать EventConnection   и EventConnections  классы для удобства (см. примеры ниже).
Примечание
For more details see the Event Handling article.Для получения более подробной информации смотрите статью Обработка событий.
The event handler signature is as follows: myhandler()

Usage Example

Исходный код (C++)
// implement the AudioSettingsChanged event handler
void audiosettingschanged_event_handler()
{
	Log::message("\Handling AudioSettingsChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections audiosettingschanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
VR::getEventAudioSettingsChanged().connect(audiosettingschanged_event_connections, audiosettingschanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
VR::getEventAudioSettingsChanged().connect(audiosettingschanged_event_connections, []() { 
		Log::message("\Handling AudioSettingsChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
audiosettingschanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection audiosettingschanged_event_connection;

// subscribe to the AudioSettingsChanged event with a handler function keeping the connection
VR::getEventAudioSettingsChanged().connect(audiosettingschanged_event_connection, audiosettingschanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
audiosettingschanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
audiosettingschanged_event_connection.setEnabled(true);

// ...

// remove subscription to the AudioSettingsChanged event via the connection
audiosettingschanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A AudioSettingsChanged event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling AudioSettingsChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
VR::getEventAudioSettingsChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe to the AudioSettingsChanged event with a handler function
VR::getEventAudioSettingsChanged().connect(audiosettingschanged_event_handler);


// remove subscription to the AudioSettingsChanged event later by the handler function
VR::getEventAudioSettingsChanged().disconnect(audiosettingschanged_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId audiosettingschanged_handler_id;

// subscribe to the AudioSettingsChanged event with a lambda handler function and keeping connection ID
audiosettingschanged_handler_id = VR::getEventAudioSettingsChanged().connect([]() { 
		Log::message("\Handling AudioSettingsChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
VR::getEventAudioSettingsChanged().disconnect(audiosettingschanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all AudioSettingsChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
VR::getEventAudioSettingsChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
VR::getEventAudioSettingsChanged().setEnabled(true);

Возвращаемое значение

Event reference.

static Event<int> getEventDeviceRenderModelChanged() const#

Event triggered when the render model of the VR device is changed. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).
Примечание
For more details see the Event Handling article.For more details see the Event Handling article.
For more details see the Event Handling article.
Событие запускается при при изменении рендер модели VR устройства. Вы можете подписаться на события через connect()   и отказаться от подписки через disconnect(). Вы также можете использовать EventConnection   и EventConnections  классы для удобства (см. примеры ниже).
Примечание
For more details see the Event Handling article.Для получения более подробной информации смотрите статью Обработка событий.
The event handler signature is as follows: myhandler(vr_device_number)

Usage Example

Исходный код (C++)
// implement the DeviceRenderModelChanged event handler
void devicerendermodelchanged_event_handler(vr_device_number)
{
	Log::message("\Handling DeviceRenderModelChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections devicerendermodelchanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
VR::getEventDeviceRenderModelChanged().connect(devicerendermodelchanged_event_connections, devicerendermodelchanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
VR::getEventDeviceRenderModelChanged().connect(devicerendermodelchanged_event_connections, [](vr_device_number) { 
		Log::message("\Handling DeviceRenderModelChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
devicerendermodelchanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection devicerendermodelchanged_event_connection;

// subscribe to the DeviceRenderModelChanged event with a handler function keeping the connection
VR::getEventDeviceRenderModelChanged().connect(devicerendermodelchanged_event_connection, devicerendermodelchanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
devicerendermodelchanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
devicerendermodelchanged_event_connection.setEnabled(true);

// ...

// remove subscription to the DeviceRenderModelChanged event via the connection
devicerendermodelchanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A DeviceRenderModelChanged event handler implemented as a class member
	void event_handler(vr_device_number)
	{
		Log::message("\Handling DeviceRenderModelChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
VR::getEventDeviceRenderModelChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe to the DeviceRenderModelChanged event with a handler function
VR::getEventDeviceRenderModelChanged().connect(devicerendermodelchanged_event_handler);


// remove subscription to the DeviceRenderModelChanged event later by the handler function
VR::getEventDeviceRenderModelChanged().disconnect(devicerendermodelchanged_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId devicerendermodelchanged_handler_id;

// subscribe to the DeviceRenderModelChanged event with a lambda handler function and keeping connection ID
devicerendermodelchanged_handler_id = VR::getEventDeviceRenderModelChanged().connect([](vr_device_number) { 
		Log::message("\Handling DeviceRenderModelChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
VR::getEventDeviceRenderModelChanged().disconnect(devicerendermodelchanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all DeviceRenderModelChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
VR::getEventDeviceRenderModelChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
VR::getEventDeviceRenderModelChanged().setEnabled(true);

Возвращаемое значение

Event reference.

Math::ivec2 getHMDResolution ( VR::VIEWPORT_TYPE viewport_type = Enum.VR.VIEWPORT_TYPE.CONTEXT ) const#

Returns the current resolution of the head-mounted display. For HMDs having context (peripheral) and focus displays, you should specify the viewport type.Возвращает текущее разрешение дисплея, установленного на голове. Для HMDS, имеющих контекстные (периферийные) и фокусные дисплеи, следует указать тип видового экрана.

Аргументы

  • VR::VIEWPORT_TYPE viewport_type - Type of the viewport (for HMDs having context (peripheral) and focus displays).Тип видового экрана (для HMDS, имеющих контекстные (периферийные) и фокусные дисплеи).

Возвращаемое значение

HMD resolution.Разрешение HMD.

bool hasFeatureMixedReality ( ) const#

Returns a value indicating if the mixed reality mode is available. Mixed reality enables you to combine real-world view from front-facing cameras mounted on the headset with the VR image rendered. This feature is available for the Varjo devices only.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, доступен ли режим смешанной реальности. Режим смешанной реальности позволяет комбинировать изображение реального мира с фронтальных камер, установленных на гарнитуре, с отображаемым изображением виртуальной реальности. Эта функция доступна только для устройств Varjo.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

bool hasFeatureEyeTracking ( ) const#

Returns a value indicating if eye tracking is available. This feature is available for the Varjo devices only.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, доступно ли отслеживание движения глаз. Эта функция доступна только для устройств Varjo.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

bool hasFeatureTrackingSpaceRaw ( ) const#

Returns a value indicating if poses can be provided in the coordinate system defined by the tracker driver.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, могут ли быть заданы позы в системе координат, определенной драйвером трекера.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

bool hasFeatureMotionPrediction ( ) const#

Returns a value indicating if motion prediction is available. This feature is available for the Varjo devices only. It allows the engine to submit the velocity from the GBuffer to the Varjo Composer.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, доступно ли предсказание движения. Эта функция доступна только для устройств Varjo. Она позволяет движку передавать скорость из GBuffer в Varjo Composer.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

bool hasFeatureFoveatedRendering ( ) const#

Returns a value indicating if foveated rendering is available. This feature is available for the Varjo devices only. Foveated rendering enhances performance by using the eye tracking functionality in Varjo headsets: it decreases the image quality in the peripheral areas where the user is not looking. Foveation allows applications to render fewer pixels and achieve a better VR experience.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, доступен ли рендеринг с расширением. Эта функция доступна только для устройств Varjo. Рендеринг с использованием Foveation повышает производительность за счет использования функции отслеживания взгляда в гарнитурах Varjo: это снижает качество изображения в периферийных областях, куда пользователь не смотрит. Функция Foveation позволяет приложениям отображать меньше пикселей и получать лучшие впечатления от виртуальной реальности.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

bool hasFeatureReportProximitySensor ( ) const#

Returns a value indicating if proximity sensor reporting is available.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, доступны ли отчеты датчика приближения.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

bool hasFeatureSupportForTreadmill ( ) const#

Returns a value indicating if the user treadmill support is available.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, доступна ли поддержка пользовательской беговой дорожки.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

bool hasFeatureSupportForBaseStations ( ) const#

Returns a value indicating if the base stations support is available.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, доступна ли поддержка базовых станций.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

bool hasFeatureSupportForTrackers ( ) const#

Returns a value indicating if support for trackers is available.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, доступна ли поддержка трекеров.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

bool hasFeatureSupportForRenderModelComponents ( ) const#

Returns a value indicating if support for render model components is available.
Примечание
If VR is not initialized, the function will return false.If VR is not initialized, the function will return false.
If VR is not initialized, the function will return false.
Возвращает значение, указывающее, доступна ли поддержка компонентов модели рендеринга.
Примечание
If VR is not initialized, the function will return false.Если VR не инициализирован, функция вернет false.

Возвращаемое значение

true if the feature is available; otherwise, false.true, если функция доступна; в противном случае - false.

void resetZeroPose ( ) const#

Sets the zero pose to the current tracker position.Устанавливает нулевую позицию в текущее положение трекера.
Последнее обновление: 19.04.2024
Build: ()