Ejemplo n.º 1
0
        static IEnumerator RefreshOrientationData()
        {
            while (true)
            {
                yield return(new WaitForEndOfFrame());

                if (HeadRotEvent != null)
                {
                    _hmd_quaternion = ThreeGlassesInterfaces.GetCameraOrientation();
                    if (_hmd_quaternion.x.Equals(float.NaN) ||
                        _hmd_quaternion.y.Equals(float.NaN) ||
                        _hmd_quaternion.z.Equals(float.NaN) ||
                        _hmd_quaternion.w.Equals(float.NaN))
                    {
                        _hmd_quaternion = Quaternion.identity;
                    }
                    HeadRotEvent(_hmd_quaternion);
                }

                if (HeadPosEvent == null)
                {
                    continue;
                }
                _hmd_position = ThreeGlassesInterfaces.GetCameraPosition();
                HeadPosEvent(_hmd_position);
            }
            // ReSharper disable once IteratorNeverReturns
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Control Rotate
        /// </summary>
        private void RotateControl()
        {
            Vector3 pos = this.transform.position;

            if (Input.GetKeyDown("up"))
            {
                transform.Rotate(Vector3.left, 5, Space.Self);
                ThreeGlassesInterfaces.ChairCenterMove(transform.localPosition * _rotateSpeed, transform.up);
            }

            if (Input.GetKeyDown("down"))
            {
                transform.Rotate(Vector3.left, -5, Space.Self);
                ThreeGlassesInterfaces.ChairCenterMove(transform.localPosition * _rotateSpeed, transform.up);
            }

            if (Input.GetKeyDown("right"))
            {
                transform.Rotate(Vector3.forward, -5, Space.Self);
                ThreeGlassesInterfaces.ChairCenterMove(transform.localPosition * _rotateSpeed, transform.up);
            }

            if (Input.GetKeyDown("left"))
            {
                transform.Rotate(Vector3.forward, 5, Space.Self);
                ThreeGlassesInterfaces.ChairCenterMove(transform.localPosition * _rotateSpeed, transform.up);
            }
            if (Input.GetKeyDown("w"))
            {
                pos.y += _smooth;
                this.transform.position = pos;
                ThreeGlassesInterfaces.ChairCenterMove(transform.localPosition * _rotateSpeed, transform.up);
            }
            if (Input.GetKeyDown("s"))
            {
                pos.y -= _smooth;
                this.transform.position = pos;
                ThreeGlassesInterfaces.ChairCenterMove(transform.localPosition * _rotateSpeed, transform.up);
            }
            //Set chair to zero
            if (Input.GetKeyDown("r"))
            {
                ThreeGlassesInterfaces.ChairToZero();
                transform.localPosition = Vector3.zero;
                transform.localRotation = Quaternion.identity;
            }
            // Set chair to middle
            if (Input.GetKeyDown("m"))
            {
                ThreeGlassesInterfaces.ChairToMiddle();
                transform.localPosition = new Vector3(transform.localPosition.x, _middlePosition, transform.localPosition.z);
            }
        }
Ejemplo n.º 3
0
        static void GetWandPosAndRotd(ref ThreeGlassesInterfaces.LeftOrRight lr, ref System.Action <Quaternion, Vector3> callback)
        {
            ThreeGlassesInterfaces.GetWandPosAndRot(lr, ref _wand_position, ref _wand_quaternion, out _wand_button_event);

            if (callback != null)
            {
                callback(_wand_quaternion, _wand_position);
            }
            if (WandButtonEvent != null)
            {
                WandButtonEvent(_wand_button_event);
            }
        }
Ejemplo n.º 4
0
        void Start()
        {
#if !UNITY_EDITOR
            if (EnablePayment && !ThreeGlassesInterfaces.PayApp(AppKey))
            {
                if (EnableQuit)
                {
                    Application.Quit();
                }
                else
                {
                    PayFailedEvent.Invoke();
                }
            }
#endif
        }
Ejemplo n.º 5
0
 void Start()
 {
     ThreeGlassesInterfaces.IntChair();
 }