1. Cross-platform packaging to VR glasses (Oculus, Pico, vive, etc.): set ordinary 3D scenes to VR scenes through OpenXR and XRTK
①Source Files:
ProjectSetting → XR Plugin Management → OpenXR → Interaction Profiles
→ Choice Divices And Profile
②Interaction toolkit:
PackageManager → OpenXR Plugin + XR Plugin Management
+ XR Interaction Toolkit(导入Samples)
③Samples Folder (configuration file): Add to the preset Preset
Defult Continuous Move/turn
Defult Left/right controller
Defult Snap turn
Defult Input Action
Settings can be viewed in Preset Manager
④In the Hierarchy panel
Right-click XR basic components:
XR Origin (Action-based) (Compared with Orgin, there are more handles, etc.) → Generate XR Interaction Manager
→ Mount the Input Action Manager script under the XR Interaction Manager, and drag the XRI Default Input Action to the script Element
XR Origin contents
Offset → Main Camera + LeftHand Controller + RightHand Controller → You can see all scripts mounted under this controller and all its References
Move method:
LocalMotion System
Teleportation: Contains LocalMotion System, Teleportatation Provider, Snap Turn Provider scripts
Continuous movement: including LocalMotion System, Continuous Move Provider, Continuous Turn Provider
Need to pay attention to modifying Left/Right Hand Move Action in Continuous Move/Snap Provider
Mobile area:
Teleportation Area component/Ground mount Teleportation Area script
⑤Interaction
Add Grab Interactable script, automatically add rigid body collider, modify Righdbody to Continuous Dynamic
Check the Smooth Rotation and Smooth Position in the Grab Interactable script
2. Debug and package VR and SteamVR 2.X on PC
OpenVR is a set of Sdk and Api developed by Valve, which is a set of VR/AR open standards
SteamVR is a virtual reality experience solution based on Open Vr, connected in series with OpenVR underlying drivers
Receive user input, hand it over to OpenVR for processing, and perform basic VR environment settings (hardware devices, controller pairing, etc.)
SteamVR Unity Plugin is a development tool based on SteamVR
①Unity obtains SteamVR Plugin import
In the #SteamVR_UnitySettingsWindow script, the Show method (119) of SplashScreen can be changed to false
②The core of Input System is Action, and the core of SteamVR Plugin is Input System
SteamVR action type: Boolean, Single (similar to Float), Vector2, Vector3, Pose (position, rotation), Skeleton
Window → SteamVR input
③Use of Hand and Player in Interaction System
Drag the Player in the prefab directly into the panel
④The difference between Camera Rig and Player
Camera Rig only contains the camera, left and right hand controllers
Player包含SteamVRObject、FollowHead、InputModule、DebugUI、Snapturn
The SteamVRObject contains colliders, left and right hands and cameras
FollowHead is head bump and sound input
InputModuel is an event system, interactive