Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Using Oculus HMD and/or Oculus Touch for POV in Cinemachine

Discussion in 'Cinemachine' started by Dirrogate, Jun 28, 2020.

  1. Dirrogate

    Dirrogate

    Joined:
    Feb 18, 2014
    Posts:
    157
    Hi,
    With the introduction of the new Input manager, and thankfully the update to support it in Cinemachine 2.6, all works well for using the mouse to "look around" with the POV option in cinemachine camera systems.

    Now, as in the attached pic below, I've got a working Oculus Quest based camera tracking "rig" which allows me to use UnityRecorder to record live, either an in-game cinematic camera move as a video or, record the actual values as a .anim file to later tweak (all this done via UnityRecoder)...

    This setup is already working properly when using an oculus OVR prefab and attaching a child camera as the recording camera.

    Oculus Cinematic Rig.jpg

    Help needed:
    What I'd like to do is:
    - Use this Oculus Headset rig via the new input manger (input manager has an XR input option)
    - if the Oculus HMD itself can't be tracked via the Input Manager, then perhaps the left/right controller itself being tracked in space.

    This would allow me to pan the view smoother than using the Mouse in POV in cinemachine.

    Could anyone help in the setup with an action map for the input manager that works with Cinemachine Input
    Provider
    component?
    CinemachineInputProvider.JPG

    I'm not a coder, so can't script any logic to do so.
    @Gregoryl would you help with the above, please?

    Suggestion:
    Cinemachine, how about an "XR Camera Tracker" add-on script to the Cinemachine ecosystem that adds this functionality so that any Oculus/Vive HMD or Oculus Touch/ Vive Controller can be used as input to drive functions such as POV in Cinemachine?
    This would make Cinemachine a true cinematic camera system.
     
    Last edited: Jun 28, 2020
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    It feels a little strange to be wanting to do this via input. It might be hard to get a 1:1 movement. I'm not sure, however, and as I don't have an XR headset in my home office, it might be difficult for me to be of much help.

    Why not instead use a normal XR rig, but disable the XR's Camera component and replace it with a passive vcam component (CinemachineVirtualCamera component with DoNoting in Aim and Body). Then that vcam will be 100% controlled by the XR headset, position and rotation. When that vcam is active the main camera (with the CM brain) will track it exactly.

    Alternatively, have a separate vcam with Transposer in Body and SameAsFollowTarget in Aim track the invisible GameObject controlled by the XR headset. Then, you can add damping if you want it.
     
  3. Dirrogate

    Dirrogate

    Joined:
    Feb 18, 2014
    Posts:
    157
    That's an interesting perspective, @Gregoryl .
    I'm currently using a plain Unity camera as a child of the Oculus XR rig (Ovr Player prefab)
    I'll use instead, a Cinemachine Vcam.

    In wanting to include custom 'input controls' within Cinemachine, I was looking at an integrated approach that aids in making realtime "Virtual Production" more intuitive within the Cinemachine ecosystem (less hassle and steps involved than creating XR rigs, swapping cameras out etc)