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
Учебные материалы

Обзор классов и компонентов

When you open your project based on the VR Sample for the first time and see a lot of different classes, you might get confused a bit. But let's take a quick look at each of them to see what they actually do and how they are connected. Когда вы впервые открываете свой проект на основе VR Sample и видите много разных классов, вы можете немного запутаться. Но давайте кратко рассмотрим каждый из них и посмотрим, что они на самом деле делают и как связаны друг с другом.

VRInteractable ClassКласс VRInteractable#

This is a base class for all objects, that you can interact with. It defines a basic set of interactions, in other words: here you define what can a user do with your object. You can add your own type of interaction here. Это базовый класс для всех объектов, с которыми вы можете взаимодействовать. Другими словами, он определяет базовый набор взаимодействий: здесь вы определяете, что пользователь может делать с вашим объектом. Здесь вы можете добавить свой тип взаимодействия .

The following component classes are inherited from the VRInteractable: Следующие классы компонентов унаследованы от VRInteractable:

ObjMovableThis component type can be used for all objects, that can be grabbed, held and thrown (it can be a ball, a pistol, whatever you can take, carry and drop). Этот тип компонента можно использовать для всех объектов, которые можно схватить, удерживать и бросить (это может быть мяч, пистолет, все, что вы можете взять, нести и бросить).
ObjHandleThis component type can be used for all objects, that can be turned or moved while being held (various handles, levers, valves, etc.). Этот тип компонента можно использовать для всех объектов, которые можно поворачивать или перемещать при удерживании (различные ручки, рычаги, клапаны и т. д.).
ObjSwitchThis component type can be used for all objects, that can be switched by grabbing (all sorts of buttons and on-off switches, including rotary ones). Этот тип компонента можно использовать для всех объектов, которые можно переключать захватом (всевозможные кнопки и переключатели, включая поворотные).
ObjButtonThis component type demonstrates animated text, when grabbed, and can be used in combination with the ObjSwitch component to provide additional effects. Этот тип компонента демонстрирует анимированный текст при захвате и может использоваться в сочетании с компонентом ObjSwitch для обеспечения дополнительных эффектов.
ObjLaserPointerThis component enables casting a laser ray by the object.
Примечание
The laser pointer object in the VR Sample world has ObjMovable and ObjLaserPointer components attached.The laser pointer object in the VR Sample world has ObjMovable and ObjLaserPointer components attached.
The laser pointer object in the VR Sample world has ObjMovable and ObjLaserPointer components attached.
Этот компонент позволяет направить на объект лазерный луч.
Примечание
The laser pointer object in the VR Sample world has ObjMovable and ObjLaserPointer components attached. К объекту лазерной указки в мире VR Sample прикреплены компоненты ObjMovable и ObjLaserPointer.

VRPlayer ClassVRPlayer Класс#

This is a base class for all players. It contains declaration of baseline controls, common basic player operations, callback management etc. Это базовый класс для всех игроков. Он содержит объявление базовых элементов управления, общих основных операций проигрывателя, управления обратным вызовом и т.д.

Примечание
You can check out baseline controls for VR Controllers (Vive, Oculus, XBox) here. Базовые элементы управления для контроллеров VR (Vive, Oculus, XBox) можно найти здесь .

The following component classes are inherited from the VRPlayer: Следующие классы компонентов унаследованы от VRPlayer:

VRPlayerPCThis component implements a player with standard PC input devices (keyboard + mouse or Xbox360 controller) for VR emulation and contains all related settings and methods. Этот компонент реализует проигрыватель со стандартными устройствами ввода ПК (клавиатура + мышь или контроллер Xbox360) для эмуляции виртуальной реальности и содержит все связанные настройки и методы.
VRPlayerVR This is a base class implementing common functionality for supported VR devices and contains their common parameters. The following classes are inherited from VRPlayerVR:
  • VRPlayerOcculus - implements basic operations and bindings for Oculus Rift deviceVRPlayerOcculus - implements basic operations and bindings for Oculus Rift device
  • VRPlayerVive - implements basic operations and bindings for HTC Vive deviceVRPlayerVive - implements basic operations and bindings for HTC Vive device
VRPlayerOcculus - implements basic operations and bindings for Oculus Rift deviceVRPlayerVive - implements basic operations and bindings for HTC Vive device
Это базовый класс, реализующий общие функции для поддерживаемых устройств VR и содержащий их общие параметры. Следующие классы унаследованы от VRPlayerVR:
  • VRPlayerOcculus - implements basic operations and bindings for Oculus Rift device VRPlayerOcculus - реализует базовые операции и привязки для устройства Oculus Rift
  • VRPlayerVive - implements basic operations and bindings for HTC Vive device VRPlayerVive - реализует базовые операции и привязки для устройства HTC Vive

VRPlayerSpawner ClassКласс VRPlayerSpawner#

This class registers all VRPlayer components in the Component System, checks which VR plugin is loaded and creates a player of the corresponding type (VRPlayerOcculus or VRPlayerVive). It also enables and shows necessary controllers. Этот класс регистрирует все компоненты VRPlayer в системе компонентов, проверяет, какой плагин VR загружен, и создает проигрыватель соответствующего типа (VRPlayerOcculus или VRPlayerVive). Он также включает и показывает необходимые контроллеры.

Примечание
In case if no VR plugin was loaded, a VRPlayerPC is spawned. В случае, если плагин VR не был загружен, создается VRPlayerPC.

OculusProxy and ViveProxy ClassesКлассы OculusProxy и ViveProxy#

Both plugins implementing HMD support (Oculus and Vive) have UnigineScript interface. So, in order to use them in our C++ project we need a proxy class (sort of API "translator") for each of them, wrapping UnigineScript methods in C++. Оба плагина, реализующие поддержку HMD ( Oculus и Vive ), имеют интерфейс UnigineScript. Итак, чтобы использовать их в нашем проекте C ++, нам нужен прокси-класс (своего рода «переводчик» API) для каждого из них, оборачивающий методы UnigineScript в C++.

GuiSample ClassКласс GuiSample#

This component type is used to create various graphic user interfaces (GUI). Here you can add widgets (labels, buttons, etc.) and implement event handlers for them. Этот тип компонента используется для создания различных графических пользовательских интерфейсов (GUI). Здесь вы можете добавить виджеты (метки, кнопки и т.д.) И реализовать для них обработчики событий.

Примечание
This component can be attached to GUI objects only. Этот компонент может быть прикреплен только к объектам графического интерфейса .

FrameworkФреймворк#

Framework includes the Component System which implements the core functionality of components and a set of utility classes and functions used for playing sounds, auxiliary math and 3d math functions, callback system implementation . Framework включает Component System , которая реализует основные функции компонентов и набор служебных классов и функций, используемых для воспроизведения звуков, вспомогательных математических и трехмерных математических функций, реализации системы обратного вызова.

Triggers ClassКласс Triggers#

Triggers is a framework class used to mark room obstacles for the VR Player (e.g. room walls, objects, etc.) and give a warning if there is an obstacle on the way (as the player gets closer to an obstacle, controllers' vibration becomes more intense). Triggers - это базовый класс, используемый для обозначения препятствий в комнате для VR Player (например, стены комнаты, объекты и т. д.) и выдачи предупреждения, если на пути есть препятствие (когда игрок приближается к препятствию, контроллеры 'вибрация становится более интенсивной).

Примечание
Obstacles are not available for VRPlayerPC. Препятствия недоступны для VRPlayerPC.

You can simply create primitives for walls and objects in your room and add them as children to the node dummy named Obstacles, which is a child of the VR dummy node (see the hierarchy in the Editor below). Вы можете просто создать примитивы для стен и объектов в своей комнате и добавить их в качестве дочерних к фиктивному узлу с именем Obstacles, который является дочерним элементом VR dummy node (см. иерархию в редакторе ниже).

All children of the Obstacles node will be automatically switched to invisible mode and will be used only to inform the player and prevent collisions with objects in the real room. Все дочерние элементы узла Obstacles будут автоматически переключены в невидимый режим и будут использоваться только для информирования игрока и предотвращения столкновений с объектами в реальной комнате.

Примечание
Primitives used to mark obstacles must have their first surface (the one with 0-index) named as "box", "sphere", "capsule" or "cylinder" in order to be properly converted into corresponding trigger volumes. Примитивы, используемые для обозначения препятствий, должны иметь свою первую поверхность (с индексом 0) с именем "box", "sphere", "capsule" или "cylinder", чтобы их можно было правильно преобразовать в соответствующие триггерные объемы.
Последнее обновление: 19.06.2023
Build: ()