当前位置:网站首页>Unity两种VR环境配置方法
Unity两种VR环境配置方法
2022-08-11 05:30:00 【黑白leo】
方法一、通过OpenXR、XRTK设定普通3D场景到VR场景
21版的VR template就是通过以下方式实现
①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(配置文件):添加到预设Preset
Defult Continuous Move/turn
Defult Left/right controller
Defult Snap turn
Defult Input Action
设置可在Preset Manager中查看
④Hierarchy面板中
右键XR基本组件:
XR Origin(Action-based)(相比Orgin多了手柄等) → 生成XR Interaction Manager
→ XR Interaction Manager下挂载Input Action Manager脚本,将XRI Default Input Action拖拽到脚本Element处
XR Origin内容
Offset → Main Camera + LeftHand Controller + RightHand Controller → 可以看到所有挂载在该控制器下的脚本以及它所有的Reference
移动方法:
LocalMotion System
瞬移:包含LocalMotion System、Teleportatation Provider、Snap Turn Provider脚本
连续移动:包含LocalMotion System、Continuous Move Provider、Continuous Turn Provider
需要注意在Continuous Move/Snap Privider中修改Left/Right Hand Move Action
移动区域:
Teleportation Area组件/Ground挂载Teleportation Area脚本
⑤交互
添加Grab Interactable脚本,自动添加刚体碰撞体,修改Righdbody为Continous Dynamic
将Grab Interactable脚本中的Smooth Rotation 和 Smooth Position 勾选
方法二、SteamVR 2.X
OpenVR是Valve开发的一套Sdk和Api,是一套VR/AR开放标准
SteamVR是基于Open Vr的虚拟现实体验方案,串联OpenVR底层驱动
接收用户输入,交由OpenVR处理,进行基本的VR环境设置(硬件设备、控制器配对等)
SteamVR Unity Plugin是基于SteamVR的开发工具
①Unity获取SteamVR Plugin导入
#SteamVR_UnitySettingsWindow脚本中SplashScreen的Show方法(119)改为false即可
②Input System核心是Action,SteamVR Plugin核心是Input System
SteamVR动作类型:Boolean、Single(类似Float)、Vector2、Vector3、Pose(位置,旋转)、Skeleton
Window → SteamVR input
③Interaction System中的Hand和Player 的使用
将预制体中的Player直接拖入面板
④Camera Rig 和 Player 区别
Camera Rig只包含相机,左右手控制器
Player包含SteamVRObject、FollowHead、InputModule、DebugUI、Snapturn
SteamVRObject中又包含碰撞体,左右手和相机
FollowHead是头部碰撞和声音输入
InputModuel是事件系统,交互方面的
边栏推荐
- 127.0.0.1 connection refused
- C语言实现三子棋(代码详解)
- JVM学习四:垃圾收集器与内存回收策略
- Day 76
- 【LeetCode-162】寻找峰值
- The official website of OpenMLDB is upgraded, and the mysterious contributor map will take you to advance quickly
- js learning advanced (event senior pink teacher teaching notes)
- Regular expression replacement for batch quick modification code
- 【LeetCode-34】在排序数组中查找元素的第一个和最后一个位置
- C-自定义类型(结构体、枚举、联合)
猜你喜欢

C-动态内存管理

C语言-7月19日-指针的学习

Vscode remote connection server terminal zsh+Oh-my-zsh + Powerlevel10 + Autosuggestions + Autojump + Syntax-highlighting

JS小技巧,让你编码效率杠杠的,快乐摸鱼

js学习进阶BOM部分(pink老师笔记)

The official website of OpenMLDB is upgraded, and the mysterious contributor map will take you to advance quickly

Jetpack使用异常问题集锦

The whole process of Tinker access --- configuration

JVM tuning and finishing

gerrit configure SSH Key and account, email information
随机推荐
JS案例练习(pink老师经典案例)
欧拉法解微分方程
IndexError: index 9 is out of bounds for axis 0 with size 9;数组下标溢出问题
【LeetCode-34】在排序数组中查找元素的第一个和最后一个位置
PyQt5中调用.ui转换的.py文件代码解释
微信小程序云开发项目wx-store代码详解
本地服务配置内网穿透实现微信公众号整合
Use c language to implement tic-tac-toe chess (with source code, you can run it directly)
Jetpack使用异常问题集锦
Vscode remote connection server terminal zsh+Oh-my-zsh + Powerlevel10 + Autosuggestions + Autojump + Syntax-highlighting
自己动手写RISC-V的C编译器-02语法描述方法和递归下降解析
【无标题】
The whole process of Tinker access --- configuration
Asis2016 books null off by one
星盟-pwn-babyfmt
8-byte standard request parsing during USB enumeration
ARM assembly instruction ADR and LDR
USB in NRZI to encode the data
JS事件循环机制
C语言-7月18日-二维数组的学习