Search Unity

ALPSVR Camera Fly Rotation When Rolling / Tilting

Discussion in 'AR/VR (XR) Discussion' started by Quazar_100, Jun 12, 2015.

  1. Quazar_100

    Quazar_100

    Joined:
    Jun 12, 2015
    Posts:
    7
    Hello all,

    I'm struggling, so hopefully someone with more experience can help me out.
    I'm currently using ALPSVR & I have modified the ALPSNavigation Update code to get a simple forward movement on the head VR camera which works great.

    Code (CSharp):
    1.     /// <summary>
    2.     /// Updates navigation state.
    3.     /// </summary>
    4.     public void FixedUpdate () {
    5.  
    6.         if (!moving){
    7.             moving = true;
    8.         }
    9.  
    10.         pitch = head.transform.eulerAngles.x;
    11.         print ("Pitch : " + pitch);
    12.      
    13.         yaw = head.transform.eulerAngles.y;
    14.         print ("Yaw : " + yaw);
    15.  
    16.         //roll += Input.GetAxis("Roll");
    17.         roll += head.transform.eulerAngles.z;
    18.         print ("Roll : " + roll);
    19.  
    20.         head.transform.Translate(Vector3.forward * Time.deltaTime * speed);
    21.  
    22.     }
    What I want when flying, is to get the camera tilt/roll behaving as yawing in a certain limit, so that I won't need to rotate my body with the VR Homido Headset.

    I suspect I need to modify or use the ALPSGyro class & use some quaternions in the ALPSNavigation code.

    Just for info & if you also have been playing with the DK2, the idea I want to achieve is the same as found in "AirDrift DK2" simulation, where you can stay seated & fly in the map.



    Thanks a lot for any help, I appreciate !
     
    Last edited: Jun 12, 2015