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>(); } }
public virtual void AddUnityVRTrackingSystem(QuickUnityVR unityVR) { _unityVR = unityVR; Animator animator = _unityVR.GetComponent <Animator>(); SetAnimatorSource(animator); SetAnimatorTarget(animator); }
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); }
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); } }
//protected OVRProjectConfig _projectConfig = null; #endregion #region CREATION AND DESTRUCTION protected virtual void Awake() { _target = (QuickUnityVR)target; //_projectConfig = OVRProjectConfig.GetProjectConfig(); UpdateHandTrackingSupport(); }
protected virtual void ActionSourceAnimatorSet(Animator animator) { _unityVR = animator.GetComponent <QuickUnityVR>(); }
public override void Init() { _hTracking = _gameManager.GetPlayer().GetComponent <QuickUnityVR>(); base.Init(); }