This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
Tutorials

类和组件概述

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 ClassVRInteractable类#

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世界中的激光指示器对象具有附加的ObjMovableObjLaserPointer组件。

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.您可以在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.该组件使用标准的PC输入设备(键盘+鼠标或Xbox360控制器)实现一个播放器,以进行VR仿真,并包含所有相关的设置和方法。
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 ClassVRPlayerSpawner类别#

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插件,并创建相应类型(VRPlayerOcculusVRPlayerVive)的播放器。它还启用并显示必要的控制器。

注意
In case if no VR plugin was loaded, a VRPlayerPC is spawned.如果未加载任何VR插件,则会生成VRPlayerPC

OculusProxy and ViveProxy ClassesOculusProxy和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 ClassGuiSample类#

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.该组件只能附加到 GUI对象

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 .框架包括实现组件核心功能的 Component System 和一组用于播放声音,辅助数学和3d数学函数,回调系统实现的实用程序类和函数。

Triggers ClassTriggers类#

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播放器的房间障碍物(例如,房间墙壁,物体等),并在途中有障碍物时发出警告(随着播放器靠近障碍物,控制器'振动会变得更加强烈。)

注意
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",以便正确转换为相应的触发量。
最新更新: 2022-08-08
Build: ()