ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.1k stars 1.28k forks source link

disable position tracking #1745

Open HolyShitKillingMachine opened 1 year ago

HolyShitKillingMachine commented 1 year ago

hello guys. i have been working on a project to build a vr experience,now the project is in unity with vrtk to develop. In a scene,i need to bind the camera to my cinema camera,so you can experience like a train travelling in the scene. So i want to disable the position tracking,and bind my camera to the cinema camera,enable rotation tracking. have tried a lot of ways to solve it.but it always failed. In old version of vrtk,we can self enable or diasble the tracking,but now there no api for this. i tried to force the camera rig to be position to be Vector3.zero. Or use the VR_tracked_object.cs to bind the camera to its parent,and not update the position but the rotation as it was HMD type.

It all fails.

hope you guys could help.

Rectus commented 1 year ago

I don't know how Unity is set up, but generally a solution would be to get the position of the head, and move the player object instead (or the object the camera is parented to), offsetting for the head position relative to the player.

Disabling position tracking is generally a bad solution though, and will cause motion sickness from not being able to rotate your head from the natural pivot point. A better option would be to limit the movement of the players head to certain volume, and either fade out the view outside it, or clamping the head position with the same movement method above.

HolyShitKillingMachine commented 1 year ago

@Rectus i have tried not to update the position of the head,but it doesn't work.Just like you play a vr roller coaster game,you need to bind the camera to the roller coaster camera but tracking the rotation,so you can turn around to see what else,not a vr video,but in a true 3d scene.

Rectus commented 1 year ago

The idea I'm suggesting is that you keep the the position updating enabled, and instead add an offset to the player to keep the head at a fixed point or bounding volume.