Example #1
0
    // Update is called once per frame
    void Update()
    {
        if (m_Init == true)
        {
            m_Tracker.SetX(0.0f);
            m_Tracker.SetY(0.0f);
            m_Tracker.SetZ(0.0f);

            float yaw   = 0.0f;
            float pitch = MiddleVR.RadToDeg(Mathf.Asin(Mathf.Clamp(m_Wiimote.GetValue(2), -1, 1)));
            float roll  = MiddleVR.RadToDeg(Mathf.Asin(Mathf.Clamp(m_Wiimote.GetValue(1), -1, 1)));

            m_Tracker.SetYaw(yaw);
            m_Tracker.SetPitch(pitch);
            m_Tracker.SetRoll(roll);
        }
    }