Search Unity

Question How to make the controller 3DoF with oculus quest

Discussion in 'VR' started by vaioj10jp, Sep 24, 2021.

  1. vaioj10jp

    vaioj10jp

    Joined:
    Aug 23, 2021
    Posts:
    6
    Hello
    I am replacing from oculus go to oculus quest.
    I want to make the controller compatible with 3DoF, but I don't know.
    Is there a script that switches the controller of oculus quest to 3DoF?
    thank you

    environment:
    ・ Oculus integration v29
    ・ Unity 2020.3.16
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    No. But your code could ignore its position and only look at its rotation if you want. (It'll make a lousy Quest game, but you could do it.)
     
    hippocoder likes this.
  3. vaioj10jp

    vaioj10jp

    Joined:
    Aug 23, 2021
    Posts:
    6
    @JoeStrout
    >But your code could ignore its position and only look at if you want.

    I want to ignore the position of the controller and fix it, what should I do?
    (I tried commenting OVRCamerarig.cs, but there is no change.)
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Sounds like you're starting with some plug-in or asset. In that case, I don't know — I always just track the position and rotation of the hardware directly, without using any drop-in asset for it.
     
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Please don't make 3DOF even for a port. And I am not sure oculus would accept it as last I checked that wouldn't pass it's guidelines. You could sidequest store, but I really do think you're best off going with 6DOF.
     
    vaioj10jp and JoeStrout like this.
  6. vaioj10jp

    vaioj10jp

    Joined:
    Aug 23, 2021
    Posts:
    6
    After that, I checked the source and found that it was controlled by the GetLocalControllerPosition function of OVRInput.cs. When the source is modified as follows, the z-axis movement of the controller is fixed and it is converted to 3DoF, so I would like to implement it with this.
    Code (CSharp):
    1.  
    2. if(!OVRManager.instance.usePositionTracking)
    3. {
    4.     Vector3 Vec = OVRPlugin.GetNodePose(OVRPlugin.Node.HandLeft, stepType).ToOVRPose().position;
    5.     Vec.z = OVRPlugin.GetNodePose(OVRPlugin.Node.HandLeft, stepType).ToOVRPose().position.z - Vec.z + 0.25f;
    6.     //Debug.Log("OVRInput.cs" + Vec);
    7.     return Vec;
    8. }
    9. else
    10.     return OVRPlugin.GetNodePose(OVRPlugin.Node.HandLeft, stepType).ToOVRPose().position;
    11.  
     
    DungDajHjep likes this.