Leap Motion已經支持VR, 但是官方沒有支持HTC Vive的例子。
按照官方的文檔, 其實是有問題的:
https://developer.leapmotion.com/documentation/unity/unity/Unity_Custom_Rig.html
Add the LeapVRTemporalWarping script component to the LeapSpace component you just created. Double check that the Head Transform property has been set to your MainCamera and that TrackingAnchor has been set to the TrackingAnchor game object you created a few steps earlier. Apply the following settings to the script: Set Tween Rotational Warping to 1. Set Sync Mode to LOW_LATENCY.
問題在於這句話:“Head Transform property has been set to your MainCamera”
如果你按照官方這樣設置, 兩只手的模型, 永遠都會在你腦袋上方, 而不是在你前方。
正確的是什么呢?
是這樣的:
因為對steamVR來說, 有點特別, head 是一個Camera, eye也是一個Camera, 而實際上,這里Head tranform用Camera(head)才是正確的。
對應的, Tracking Anchor就是Camera(head)的父對象了。