Exemple #1
0
        protected virtual IEnumerator CoUpdate()
        {
            //Wait for the node of the head to be created.
            QuickUnityVR hTracking = GetComponent <QuickUnityVR>();
            QuickVRNode  nodeHead  = null;

            while (nodeHead == null)
            {
                nodeHead = _vrPlayArea.GetVRNode(HumanBodyBones.Head);
                yield return(null);
            }
            _trackedObject = nodeHead.GetTrackedObject();

            while (true)
            {
                //Debug.Log("disp = " + disp.ToString("f3"));

                CoUpdateTrackedNode();

                //Wait for a new sample
                yield return(StartCoroutine(CoUpdateSample()));

                CoUpdateTargetLinearVelocity();

                //Check the real displacement of the user in the room. If it is big enough, the contribution
                //of the WiP is ignored.
                Vector3 disp = Vector3.Scale(_headTracking.GetDisplacement(), Vector3.forward + Vector3.right);

                if (disp.magnitude > 0.005f)
                {
                    _rigidBody.velocity = Vector3.Scale(_rigidBody.velocity, Vector3.up);
                    Init();
                }
            }
        }
 protected virtual void StartPlayer()
 {
     if (_player)
     {
         _hTracking = _player.GetOrCreateComponent <QuickUnityVR>();
     }
 }
Exemple #3
0
        public virtual void AddUnityVRTrackingSystem(QuickUnityVR unityVR)
        {
            _unityVR = unityVR;

            Animator animator = _unityVR.GetComponent <Animator>();

            SetAnimatorSource(animator);
            SetAnimatorTarget(animator);
        }
Exemple #4
0
        protected override void Start()
        {
            base.Start();

            _headTracking = GetComponent <QuickUnityVR>();
            QuickIKManager ikManager = GetComponent <QuickIKManager>();
            //ikManager._ikHintMaskUpdate &= ~(1 << (int)IKLimbBones.LeftFoot);
            //ikManager._ikHintMaskUpdate &= ~(1 << (int)IKLimbBones.RightFoot);
        }
Exemple #5
0
        protected virtual void CoUpdateTrackedNode()
        {
            QuickUnityVR hTracking = GetComponent <QuickUnityVR>();
            QuickVRNode  hipsNode  = _vrPlayArea.GetVRNode(HumanBodyBones.Hips);

            if (hipsNode)
            {
                QuickTrackedObject tObject = hipsNode.IsTracked()? hipsNode.GetTrackedObject() : _vrPlayArea.GetVRNode(HumanBodyBones.Head).GetTrackedObject();
                if (tObject != _trackedObject)
                {
                    _trackedObject = tObject;

                    Init();
                }
            }
        }
 protected virtual void AwakePlayer()
 {
     if (_playerFemale)
     {
         _playerFemale.gameObject.SetActive(false);
     }
     if (_playerMale)
     {
         _playerMale.gameObject.SetActive(false);
     }
     _player = (SettingsBase.GetGender() == SettingsBase.Genders.Female) ? _playerFemale : _playerMale;
     if (!_player)
     {
         QuickUnityVR hTracking = FindObjectOfType <QuickUnityVR>();
         if (hTracking)
         {
             _player = hTracking.transform;
         }
     }
     if (_player)
     {
         _player.gameObject.SetActive(true);
     }
 }
Exemple #7
0
        //protected OVRProjectConfig _projectConfig = null;

        #endregion

        #region CREATION AND DESTRUCTION

        protected virtual void Awake()
        {
            _target = (QuickUnityVR)target;
            //_projectConfig = OVRProjectConfig.GetProjectConfig();
            UpdateHandTrackingSupport();
        }
Exemple #8
0
 protected virtual void ActionSourceAnimatorSet(Animator animator)
 {
     _unityVR = animator.GetComponent <QuickUnityVR>();
 }
Exemple #9
0
        public override void Init()
        {
            _hTracking = _gameManager.GetPlayer().GetComponent <QuickUnityVR>();

            base.Init();
        }