Oculus开发入门

老是访问官网搭建unity环境太麻烦了,自己记录一下,在国内看。

官网教程连接 Getting Started with Interaction SDK | Oculus Developers

Adjust Camera Rig

Once you’ve completed the tutorial listed above, you can find Interaction SDK in Unity under the Assets/Oculus/Interaction folder.

  1. Open the Unity scene you created in Create Your First VR App on Meta Quest Headset.
  2. Under Hierarchy, select OVRCameraRig.
  3. Under Inspector, in the OVR Manager component, set the Tracking Origin Type property to Floor Level.

 

Add OVRInteraction Prefab

OVRInteraction is the base prefab for hands and controller components, which source data from OVRPlugin via OVRCameraRig

  1. Under Project, search for OVRInteraction, then drag the OVRInteraction prefab (以前的插件版本中叫inputOVR,如果别人的例子中是inputOVR那说明是以前的,我们用OVRInteraction代替它即可) from the search results onto OVRCameraRig.

    Note

    You can check OVRPlugin.GetHandTrackingEnabled() to find out when the user has switched from controllers to hands.

    Add OVRHands Prefab

    OVRHands is the base for the hands input device. It controls the appearance of the hands, their position relative to the camera, and the interactors each hand can use.

  2. Under Project, search for OVRHands, then drag the OVRHands prefab from the search results onto OVRInteraction.

  3. To test hands, put on the headset.
  4. In the headset, go to Settings > Device > Hands & Controllers, and turn on Hand Tracking. Leave the Auto Switch Between Hands And Controllers selected to let you use hands when you put the controllers down.
  5. From Unity, build and run the app in the headset.
  6. After the app launches in the headset, put the controllers down and raise your hands
  7. Set Up Hands

  8. Configure Camera Rig for Hands

    OVRCameraRig syncs the camera with the movement of the headset and contains some hand settings.Under Hierarchy, select OVRCameraRig.Under Inspector, in OVR Manager, set these properties to the following values:

    • Hand Tracking Support: Either Controllers and Hands or Hands Only
    • Hand Tracking Frequency: HIGH (optional)
    • Hand Tracking Version: V2
    • Under Project, search for OVRHandPrefab, then drag OVRHandPrefab onto OVRCameraRig > TrackingSpace > LeftHandAnchor.
    • Under Hierarchy, select OVRHandPrefab.
    • Under Inspector, disable all scripts except for OVR Hand and OVR Skeleton by unselecting the checkbox for each script.

    • In the OVR Skeleton component, select the Enable Physics Capsules checkbox.
    • Copy the OVRHandPrefab, right-click on RightHandAnchor, and select Paste as Child.
    • Select RightHandAnchor > OVRHandPrefab.
    • Under Inspector, in the OVR Hand component, set the Hand Type property to Hand Right.
    • In the OVR Skeleton component, set the Skeleton Type property to Hand Right.

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值