Oculus开发笔记

1 篇文章 0 订阅
1 篇文章 0 订阅

adb shell am force-stop com.gmf.test

Single Pass Stereo rendering (also known as Multiview rendering on OpenGL/Vulkan

VR Interactions

  • Interactivity with objects: hover over, select, grab, throw and rotate.
  • Ability to interact with UI elements using your VR hands.
  • VR locomotion: teleportation, snap turning.
  • VR rigs for stationary and room-scale experiences.
  • Haptic feedback through the controllers.
  • Cross-platform XR controller input.

1.安装ODH(Oculus Developer Hub)
Unity项目设置:
  Platform -> select Android -> Set Texture Compression to ASTC.
  packagename, version, bundle version code
  Minimum API Level, Android 6.0 Marshmallow (API level 23) for Oculus Quest and Oculus Quest 2.
  勾选 Enable Virtual Reality (VR) Support
  

1.配置Untiy项目Fox XR :  Edit -> Project Settings -> XR Plug-in Management, install

   安装完后,在左侧栏选Quest

  2.设置跟踪,GameObject > XR > Add XR Rig.
  //注:build in VR与XR plug-in 系统不兼容的,

 //注:反勾选插件,不会卸载包,要通过pakcage manager界面移除

 

对象选择和操纵;这使用户可以将激光指向物体,然后选择它们,然后直接或从远处抓住物体。抓住物体后,用户可以旋转或扔出物体。此行为是可配置的。
  UI交互;用于对象选择的激光指示器也可以用于UI交互。这意味着开发人员已经可以在VR中使用内置的Unity UI系统。
  移动方式设计和转弯;这使开发人员可以快速为他们的应用程序添加远距传输和快速转向。虽然没有内置“平稳”运动,但是对于开发人员而言,添加起来要容易得多。
  Direct Interactor, Ray Interactor, Socket Interactor, Grab Interactor

 

XR Interaction Toolkit : The core of this system is a set of base Interactor and Interactable components, and an Interaction Manager that ties these two types of components together. It also contains helper components that you can use to extend functionality for drawing visuals and hooking in your own interaction events.

   包含一系列组件来支持以下交互任务:

  • Cross-platform XR controller input
  • Basic object hover, select and grab
  • Haptic feedback through XR controllers
  • Visual feedback (tint/line rendering) to indicate possible and active interactions
  • Basic canvas UI interaction with XR controllers
  • A VR camera rig for handling stationary and room-scale VR experiences

用到的术语:

TermMeaning
Controller(XR控制器的组件)A component that turns XR controller input such as a button press into interaction events like hover, or select. Also provides a way to show controller models and send haptic feedback to the controller.
ObjectAnything that the user sees or interacts with in the virtual world.
Interactor(交互器)An object in a Scene that can select or move another object in that Scene.
Interactable(可交互对象)An object in a Scene that the user can interact with (for example, grab it, press it, or throw it).
Hover(状态,记录交互器的)The state where an Interactor is in a valid state to interact with an object. This differs between Ray and Direct interaction.
Select(状态)The state where an Interactor is currently interacting with an object.
Interaction ManagerA manager component that handles interaction between a set of Interactors and Interactables in a scene.
GestureSequences of movements that translate into an action that manipulates an interactable.
AnnotationA piece of content placed above (or next to) an AR object to give users information and context.
Haptic(感觉或视觉刺激)Sensory or visual stimuli that is sent to the user to give feedback for interaction.

Locomotion: 组运动原语,这些原语提供了在XR体验期间在场景中移动的方式。这些组件是:

  • 代表玩家的XR装备
  • 运动系统
  • 传送系统
  • 急转弯系统
  • An XR Rig that represents the player
  • A Locomotion System (运动系统)
  • A Teleportation System (传送系统)
  • A Snap Turn System 

This documentation outlines how to use and extend these systems.


UI交互设置:GameObject -> XR  
  UI Canvas:World Space,且挂一个TrackedDeviceGraphicRaycaster.cs
  UI EventSystem : 挂XRUIInputModule.cs

 //Only one Input Module can be active at one time


XR Interaction Manager : 空GO下挂一个XRInteractionManager.cs
Locomotion System : 空GO下挂3个脚本:LocomotionSystem.cs 、TeleportationProvider.cs和SnapTurnProvider.cs
 

XR_Rig
  CameraOffset
     MainCamera
     LeftHand
        LeftBaseController    :XRController.cs + XRRayInteractor.cs
            ModelPt
        LeftTeleportController
            ModelPt
     RightHand
        RightBaseController
            ModelPt
        RightTeleportController
            ModelPt

 

Interaction Manager : 每个场景至少一个Interaction Manager,用于连接Interactors和Interactables.
  如果没有指定,默认使用第一个Interaction Manager

Controller / Interactor :控制器/交互器(组件),用于控制GameObject怎么和场景中的其他对象交互,常用的有:
                         XRController
                         Ray Interactor(使用投射射线的方式寻找场景中的Interables可交互对象)

       控制器和交互器对触觉反馈的支持有限。要为XR控制器(基于动作)启用触觉反馈,请指定Haptic Device Action触觉设备动作)以及到活动控件的绑定路径,例如<XRController>{LeftHand}/*。要为XR控制器(基于设备)启用触觉反馈,请指定支持触觉反馈的Controller节点,例如Left Hand。然后,交互器可以指定触觉反馈的强度和持续时间,以在选择和悬停时播放。

Interactable : 可交互(组件),定义用户如何与场景中的对象进行交互,支持的交互方式有:grabbing, moving, dropping(放下), and throwing(投掷); 
   设置对象可交互的需要添加2个组件 :[XR Grab ]Interactable和A convex(凸型)[Mesh[] Collider

Action-based vs Deviced-based :基于动作和基于设备的行为
  一些behaviors,如 Snap Turn Provider有两个变体:an Action-based behavior and a Device-based behavior。
   Action-based behaviors : 使用Actions从一个或多个control间接读取输入
   Device-based behaviors : 使用InputDevice.TryGetFeatureValue直接从一个(在指定 control的)输入设备(由一个指定)上读取输入。
  建议使用Action-based变体的形式,因为某些特征,如 XR Device Simulator,只支持使用 Action。

交互层蒙版 ,InteractionLayerMask 是一种用于过滤哪些交互器可以作用于哪些可交互对象的机制

 States :Interaction system has three common states: Hover, Select, and Activate

Locomotion Providers : 有Teleportation Provider, the Snap Turn Provider, the Continuous Turn Provider, and the Continuous Move Provider,都是实现抽象类LocomotionProvider
  CanBeginLocomotion()
  BeginLocomotion() ,  事件 startLocomotion
  EndLocomotion()  ,  事件 endLocomotion

Room-Scale : Floor-relative tracking mode. When the Scene starts, the origin is the floor.
Stationary : Deviced-relative tracking mode. When the Scene starts, the origin is the device, and the Camera moves to the height set by Camera Offset.

relinquish  vt. 放弃;放手

 

 


https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@1.0/manual/index.html

https://docs.unity3d.com/cn/2019.4/Manual/configuring-project-for-xr.html

https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@1.0/manual/locomotion.html

 

 

 



  
  locomotion 运动 移动 
  snap turning(对齐/快速转向),continuous turning, continuous movement, and teleportation(瞬间移动,远距传动)
  interactor 交互器
  interactable 可交互的(GO)
  haptic  触觉的

 relinquish  vt. 放弃;放手

 

Shared Depth Buffer是一个用来测算Dash UI 和 空间中物体的深度信息的

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值