全新Quixel Megascans合集现已免费放出

VR Controls

GodeffroyValet - 4月 27, 2021

This plugin provides VR controls, including teleportation, thumbstick motion and VR pointers to remotely grab or interact with objects. It also provides fully compatible mouse and keyboard controls.

  • 支持的平台
  • 支持的引擎版本
    4.26
  • 下载类型
    引擎插件
    此产品包含一款代码插件,含有预编译的二进制文件以及与虚幻引擎集成的所有源代码,能够安装到您选择的引擎版本中,并根据每个项目的需求启动。

This plugin allows you to add VR controls to any existing project while maintaining the ability to use keyboard and mouse controls. Both controls are fully compatible with each other and can even be active at the same time.


Demo video

Tutorial


With minimal configuration, you will be able to :


1. walk around in VR, see your motion controllers, and see a red dot where you point your right pointer and a green dot where you point your left pointer.

2. rotate your VR space with the thumbstick on your left controller, and move it with the thumbstick on your right controller. These motions are discontinuous to reduce motion sickness.

3. teleport to pointed location.

4. grab or release the object pointed by your Motion Controller.

5. interact with the object pointed by your Motion Controller. The object needs to implement "InteractableInterface" provided by this plugin for this to do anything.

6. use your keyboard and mouse, or other non-VR controllers, to rotate, move, interact, etc using the same functions as for the VR mode.


The same internal functions are used for thumbstick incremental rotation/movement and for keyboard/mouse rotation/movement. Moreover, both types of controls interact with objects using the same interface, so that a click event will typically have the same effect on an interactable object than a Motion Controller action such as a pulling the trigger while pointing toward the object.

技术细节

Features:

* A VrSpace pawn class (C++) makes sure that the VR headset and motion controllers are always defined in the same frame and behave coherently. It provides Move and Rotate functions that you can directly bind to input events.

* A simple InteractableInterface, that other classes can implement in Blueprint or C++, handles interaction events. These events can be triggered by the VR controls provided by this plugin, keyboard and mouse controls, or any Blueprint or C++ code that implement the InteractorInterface.

* A VrPointerComponent class (C++) keeps track of what object it is pointing to and handles grabbing, interaction with interactable objects, teleporting things to the pointed location (such as the player or other objects).

* A BP_VrSpace pawn class (Blueprint) links input events (both from motion controllers and from mouse/keyboard) to the above classes, so that all the above features are ready to use immediately.

* BP_VrPlayerController and BP_VrGameMode blueprints.

* A M_LaserDot material.


Code Modules:

* VrControls (Runtime)

* InteractableInterface (Runtime)


Number of Blueprints: 3

Number of C++ Classes: 4

Network Replicated: Not tested

Supported Development Platforms: Windows 10 (Should also work for other platforms)

Supported Target Build Platforms: Windows 10 (Should also work for other platforms)

Tested Hardware: Valve Index, Oculus Quest 2 (Should also work for other platforms)

Documentation: In your UE installation directory, open "Engine/Plugin/Marketplace/VrControls/Docs/README.md". See also the tutorial link above.


Example Project: https://drive.google.com/file/d/1YaEjqDqDeQ0TfEuJ98Amz_zexk0Hl-2m/view?usp=sharing