当前位置:网站首页>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是事件系统,交互方面的
边栏推荐
- C-动态内存管理
- Manufacturer Push Platform-Huawei Access
- Here is a memorial
- 开发公众号授权遇到的redirect_uri参数错误
- 解决AttributeError: ‘NoneType‘ object has no attribute ‘val‘ if left.val!=right.val:Line 17 问题
- The role of the port
- IndexError: index 9 is out of bounds for axis 0 with size 9;数组下标溢出问题
- Certificate of SearchGuard configuration
- 深度学习Matlab工具箱代码注释
- 127.0.0.1 已拒绝连接
猜你喜欢
Thesis unscramble TransFG: A Transformer Architecture for Fine - grained Recognition
将一个excel文件中多个sheet页“拆分“成多个“独立“excel文件
C语言-6月8日-求两个数的最小公倍数和最大公因数;判断一个数是否为完数,且打印出它的因子
Day 80
C-自定义类型(结构体、枚举、联合)
127.0.0.1 已拒绝连接
Use the adb command to manage applications
无效的修订:3.18.1-g262b901-dirty
连接数据库时出现WARN: Establishing SSL connection without server‘s identity verification is not recommended.
C语言-7月22日- NULL和nullptr的深入了解以及VScode对nullptr语句报错问题的解决
随机推荐
2022DASCTF X SU 三月春季挑战赛 checkin ROPgadget进阶使用
Scene-driven feature calculation method OpenMLDB, efficient implementation of "calculate first use"
[Meetup] OpenMLDBxDolphinScheduler engineering and scheduling link link characteristics, building the end-to-end MLOps workflow
Invalid revision: 3.18.1-g262b901-dirty
Interpretation of the paper: Cross-Modality Fusion Transformer for Multispectral Object Detection
Building a data ecology for feature engineering - Embrace the open source ecology, OpenMLDB fully opens up the MLOps ecological tool chain
OpenMLDB v0.5.0 released | Performance, cost, flexibility reach new heights
OpenMLDB: Consistent production-level feature computing platform online and offline
C-8月1日-递归与动态内存管理
【LeetCode-205】同构字符串
轻松理解进程与线程
The whole process of Tinker access --- Compilation
mk文件介绍
Tinker接入全流程---配置篇
解决npm warn config global `--global`, `--local` are deprecated. use `--location=global` instead.
Jetpack's dataBinding
JVM学习四:垃圾收集器与内存回收策略
OpenMLDB + Jupyter Notebook: Quickly Build Machine Learning Applications
Here is a memorial
将一个excel文件中多个sheet页“拆分“成多个“独立“excel文件