Oculus Interaction SDKを使う設定を備忘録としてまとめておきます。
Oculus Integration V46の設定となります。
また、Unityプロジェクト作成の詳細は、本題ではないので省きます。
XR Plug-in Managementがインストール済みで、Quest向けの設定をしてあることが前提となります
Oculus Integrationの導入
- Oculus Integrationのインポート
全てのパッケージをインポートします
- インポート中の選択肢
- OculusProjectConfigのHandTrackingSupportをControllers And Handsに変更します
シーンの準備
掴む側
- Main Cameraを削除して、OVRCameraRigを追加します
- OVRHandPrefabをLeftHandAnchorとRightHandAnchorに配置します
- RightHandAnchorに配置したOVRHandPrefabを右手用に修正します
- LeftHandAnchorとRightHandAnchorに追加したOVRHandPrefabから以下のコンポーネントを削除します
- OVRControllerPrefabをLeftControllerAnchorとRightControllerAnchorに配置します
- 追加したOVRControllerPrefabのControllerの左右をそれぞれL Touch、R Touchに設定します
- OVRInteractionを追加します
- OVRInteractionにOVRCameraRigを設定します
手の設定
- OVRInteractionにOVRHandsを追加します
- OVRHandsのLeftHand、RightHandの配下にあるHandFeatuersにOVRInteractionを設定します
- OVRHandsのLeftHand、RightHandの配下にあるOVRHandDataSourceにOVRInteractionとOVRHmdを設定します
- OVRHandsのLeftHand、RightHandの配下にあるHandInteractorsLeft、HandInteractorsRightにHandGrabInteractorを追加します
- OVRHandsのLeftHand、RightHandの配下にあるHandGrabInteractorにそれぞれ、LeftHand、RightHandを設定します
- OVRHandsのLeftHand、RightHandの配下にあるHandInteractorsLeft、HandInteractorsRightにそれぞれのHandGrabInteractorを設定します
コントローラーの設定
- OVRInteractionにOVRControllersを追加します
- OVRControllersのLeftController、RightControllerの配下にあるOVRControllerDataSourceにOVRInteractionとOVRHmdを設定します
- OVRControllersのLeftController、RightControllerの配下にあるControllerInteractorsにControllerGrabInteractorを追加します
- OVRControllersのLeftController、RightControllerの配下にあるControllerGrabInteractorにそれぞれ、LeftController、RightControllerを設定します
- OVRControllersのLeftController、RightControllerの配下にあるControllerInteractorsにそれぞれのControllerGrabInteractorを設定します
掴まれる側
これで、掴むことができるようになりました。