类和组件概述
When you first open your project based on the VR Template and see a lot of different classes and components, you might get confused a bit. So, let's learn a bit more about the template structure. All components that implement the basic VR functionality are assigned to the corresponding nodes organized in the hierarchy with the vr_layer root node (see the picture below):当您第一次打开基于VR Template的项目并看到很多不同的类和组件时,您可能会感到困惑。 因此,让我们更多地了解模板结构。 实现基本VR功能的所有组件都被分配到具有vr_layer根节点的层次结构中组织的相应节点(见下图):
VRPlayer ComponentVRPlayer组件#
A player is represented by the hierarchy of nodes with the vr_player node in the root (a Player Dummy camera), to which the VRPlayer component is assigned. The component implements the player's logic. The child nodes of vr_player represent models of HMDs and controllers, to which all necessary components are assigned to configure interactions and main parameters.玩家由根节点(Player Dummy摄像机)中具有vr_player节点的节点层次结构表示,该节点分配了VRPlayer组件。 组件实现玩家的逻辑。 vr_player的子节点表示HMD和控制器的模型,所有必要的组件都被分配给它们来配置交互和主要参数。
InputSystem ComponentInputSystem组件#
InputSystem is the main component that implements operations on user input, it includes all available devices, controllers, controls (controllers + common ones), event handlers, an so on. Input parameters for devices, functionality for polling the status of controls, etc. are implemented in the corresponding classes (PCInput, VRInput).InputSystem是实现对用户输入操作的主要组件,它包括所有可用的设备、控制器、控件(控制器+通用输入设备)、事件处理程序等等。 设备的输入参数、轮询控件状态的功能等都在相应的类(PCInput,VRInput)中实现。
HeadController and HandController ComponentsHeadController和HandController组件#
Functionality of the devices is implemented in the components inhertied from the HeadController (for HMDs) and HandController (for controllers) base components:设备的功能是在从HeadController(用于HMD)和HandController(用于控制器)基础组件继承的组件中实现的:
- VRHeadController and VRHandController components for the VR mode.VR模式的VRHeadController和VRHandController组件。
- PCHeadController and PCHandController components for the VR-emulation mode with keyboard control.具有键盘控制的VR仿真模式的PCHeadController和PCHandController组件。
VRMovementManager ComponentVRMovementManager组件#
The VRMovementManager component is used for movement management. Different types of movements (rotating, walking, teleporting) are implemented in the components inherited from the base VRBaseMovement component (TurnMovement, WalkMovement, TeleportationMovement + implementation of movements for the VR-emulation mode with keyboard control).VRMovementManager组件用于移动管理。不同类型的运动(旋转、行走、传送)在从基础VRBaseMovement组件继承的组件(TurnMovement,WalkMovement,TeleportationMovement+使用键盘控制的VR模拟模式的运动实现)中实现。
VRInteractionManager ComponentVRInteractionManager组件#
The VRInteractionManager component is used for interactions management. Different types of interactions are implemented in the components inherited from the base VRBaseInteraction component:VRInteractionManager组件用于交互管理。 在从基VRBaseInteraction组件继承的组件中实现了不同类型的交互:
- VRHandMenuInteraction - interaction with the menu using controllersVRHandMenuInteraction使用控制器与菜单的交互
- VRHandShapeInteraction - interaction with objects using controllers and the keyboardVRHandShapeInteraction使用控制器和键盘与对象的交互
- VRPCHeadMenuInteraction - interaction with the menu for the VR-emulation mode with keyboard controlVRPCHeadMenuInteraction通过键盘控制与VR仿真模式的菜单交互
VRBaseInteractable ComponentVRBaseInteractable组件#
VRBaseInteractable is a base component for all interactive objects (objects you can interact with). It defines the main interactions: here you specify the available actions with the object. You can also add your own interaction type.VRBaseInteractable是所有交互对象(您可以与之交互的对象)的基本组件。 它定义了主要的交互:在这里您指定了与对象的可用操作。 您还可以添加自己的交互类型。
The following components are inherited from VRBaseInteractable:以下组件继承自VRBaseInteractable:
VRTransformMovableObject | This 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).这种组件类型可用于所有可以抓住,握住和投掷的物体(它可以是球,手枪,任何您可以拿,携带和放下的东西)。 |
---|---|
VRKinematicMovableObject | This component type can be used for physical objects that can be grabbed, held, and thrown (it can be a ball, a pistol, whatever you can take, carry and drop).这种组件类型可用于可以抓住,握住和投掷的物理物体(它可以是球,手枪,任何您可以拿,携带和放下的东西)。 |
VRPhysicMovableObject | This component type can be used for physical objects with rigid bodies (Rigid Body) that can be grabbed, held, and thrown (it can be a ball, a pistol, whatever you can take, carry and drop).这种组件类型可用于具有刚体(Rigid Body)的物理对象,这些物体可以被抓住,握住和投掷(它可以是球,手枪,任何您可以拿,携带和放下的东西)。 |
VRObjectHandle | This component type can be used for all objects that can be turned or moved while being held (various handles, levers, valves, etc.).这种组件类型可用于所有物体,在保持时可以转动或移动(各种手柄、操纵杆、阀门等)。 |
VRObjectSwitch | This 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). It can be used in combination with the VRNodeSwitchEnableByGrab component for additional effects.这种组件类型可用于所有可以通过抓取来切换的对象(各种按钮和开关,包括旋转开关)。 它可以与VRNodeSwitchEnableByGrab组件结合使用以获得额外的效果。 |
VRNodeSwitchEnableByGrab | This component type is used to control enabling/disabling of one or more nodes when grabbed.此组件类型用于控制在抓取时启用/禁用一个或多个节点。 |
VRLaserPointer | This component enables casting a laser ray by the object. The laser pointer node has 2 components assigned: VRTransformMovableObject and VRLaserPointer.这个组件使物体能够投射激光射线. 激光指示器节点具有分配的2个组件:VRTransformMovableObject和VRLaserPointer。 |
本页面上的信息适用于 UNIGINE 2.19.1 SDK.