Search Unity

Other Difference between OVRPlugin and OVRManager

Discussion in 'VR' started by DevDunk, Jan 12, 2022.

  1. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    I am developing for the Quest 2 and always thought OVRManager is from Oculus Integration and OVRPlugin from Oculus XR Plugin. I noticed both are only working when installing Oculus Integration, so what is the difference?
     
    hhoffren and ChristopherKerr like this.
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    Bump?
     
  3. Dark-Table

    Dark-Table

    Joined:
    Nov 25, 2008
    Posts:
    315
    This is just speculation from spending ages working with the Oculus Integration, but OVRManager is a singleton that Oculus intends for you to use to access most of the OVRPlugin's functionality in a "friendly" way. The OVRPlugin.cs is the wrapper directly around the native OVRPlugin.dll and usually has a less friendly, more direct, interface to the systems you may want to use.

    Like, if you want to detect if the HMD is mounted/unmounted you could directly poll the OVRPlugin.userPresent property every frame, or you could use OVRManager's HMDMounted/HMDUnmounted events.

    It can get confusing because there are often enums in OVRPlugin and OVRManager that appear to be identical, but my rule of thumb is you probably shouldn't be using the OVRPlugin one.
     
    DevDunk likes this.
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,043
    Thanks a lot!