軟件:Unity?2022.3.51f1c1、vscode、Meta XR All in One SDK V72
硬件:Meta Quest3
最終效果:能像meta的操作室沉浸場景一樣根據頭盔移動來推斷用戶姿勢,實現走路、蹲下、手勢匹配等功能
需要借助UnityMovement這個包
GitHub - oculus-samples/Unity-Movement: Body, Eye and Face Tracking code sample.
一、導入包
這里官方給了三種方式
Then, bring this package into the project.
然后,將此軟件包帶入項目。
- In Package Manager, click on the add button below the window title and select?Add package from git URL…, using this URL:?GitHub - oculus-samples/Unity-Movement: Body, Eye and Face Tracking code sample.
在軟件包管理器中,單擊窗口標題下方的“添加”按鈕,然后使用此URL從Git URL中選擇添加程序包:?https://github.com/oculus-samples/unity-movement.git- To grab a specific version of the package, append the version number with a # to the git URL (i.e.?GitHub - oculus-samples/Unity-Movement: Body, Eye and Face Tracking code sample.)
要獲取軟件包的特定版本,請用#將版本編號附加到git URL(即https://github.com/oculus-samples/unity-movement.git#1.2.0?)- Alternatively, in package manager, click on the add button below the window title and select?Add package from disk..., using the package.json located after unzipping one of the releases here:?Releases · oculus-samples/Unity-Movement · GitHub
或者,在軟件包管理器中,單擊窗口標題下方的“添加”按鈕,然后使用package.json從disk ...中選擇添加軟件包。?/Unity-Movement/ReleasesThe sample scenes are located under the?Samples/Scenes?folder.
示例場景位于樣本/場景文件夾下方。
- 通過gitURL來導入安裝(國內好像不行...)
- 在release下tar.gz格式然后用add package from tarball(依舊不行)
? ? ? ?Release v72.0.0 · oculus-samples/Unity-Movement · GitHub
- 在release下zip格式,然后找到里面的Package.json文件導入(成功)
后面兩種都屬于本地導入安裝的形式,就是unity直接讀取的你自己下載在本地的一些資源,最好把文件和工程存一個目錄里,不然版本管理或者以后遷移工程時,忘記把本地包一起遷移就會出麻煩。
把示例文件也導進來
二、 找到ArmatureSkinningUpdateRetarget這個預制體
拖到場景中使它成為場景中OVRCameraRig的子物體,位置reset為0?
這時候Project Setup Tool會提示你哪里哪里要修復,無腦apply all就行了。
重點檢查OVRManager里這四個設置
三、運行場景
點擊運行后就會發現能全身追蹤啦,是不是很簡單?手勢追蹤和手柄都可以用哦
ps.實際測試時記得先讓頭盔保持亮屏狀態再運行哈,不然會出現沒有匹配成功的情況
當然我們不可能一直用默認模型,因此下面要講怎么替換成自己的模型,以及怎么關掉原本的模型顯示。
我的項目暫時用不著,等到我要用的時候再更~