//called immediately after construction public virtual void Initialize() { #if CVR_STEAMVR CognitiveVR_Manager.PoseEvent += CognitiveVR_Manager_OnPoseEvent; //1.2 #endif #if CVR_OCULUS OVRManager.HMDMounted += OVRManager_HMDMounted; OVRManager.HMDUnmounted += OVRManager_HMDUnmounted; #endif string hmdname = "none"; #if CVR_FOVE hmdname = "fove"; #elif CVR_ARKIT hmdname = "arkit"; #elif CVR_ARCORE hmdname = "arcore"; #elif CVR_META hmdname = "meta"; #elif UNITY_2017_2_OR_NEWER string rawHMDName = UnityEngine.XR.XRDevice.model.ToLower(); #else string rawHMDName = UnityEngine.VR.VRDevice.model.ToLower(); #endif hmdname = CognitiveVR.Util.GetSimpleHMDName(rawHMDName); #if CVR_TOBIIVR _eyeTracker = Tobii.Research.Unity.VREyeTracker.Instance; #endif GazeCore.SetHMDType(hmdname); cameraRoot = CameraTransform.root; }
void Start() { t.position = CognitiveVR_Manager.HMD.position + GetLookDirection() * Distance; _eyeTracker = Tobii.Research.Unity.VREyeTracker.Instance; if (CognitiveVR_Manager.HMD == null) { return; } }
void Start() { t.position = GameplayReferences.HMD.position + GetLookDirection() * Distance; _eyeTracker = Tobii.Research.Unity.VREyeTracker.Instance; if (GameplayReferences.HMD == null) { return; } }
public void Initialize() { if (FocusSizeFromCenter == null) { Reset(); } #if UNITY_EDITOR || DEVELOPMENT_BUILD VISFixationEnds.Add("discard", new List <Fixation>()); VISFixationEnds.Add("out of range", new List <Fixation>()); VISFixationEnds.Add("microsleep", new List <Fixation>()); VISFixationEnds.Add("off transform", new List <Fixation>()); var viewer = FindObjectOfType <FixationVisualizer>(); if (viewer != null) { viewer.SetTarget(this); } var saccade = FindObjectOfType <SaccadeDrawer>(); if (saccade != null) { saccade.SetTarget(this); } //gameObject.AddComponent<FixationVisualizer>().SetTarget(this); if (DebugMaterial != null) { lastEyeTrackingPointer = GameObject.CreatePrimitive(PrimitiveType.Sphere); lastEyeTrackingPointer.transform.localScale = Vector3.one * 0.2f; lastEyeTrackingPointer.GetComponent <MeshRenderer>().material = DebugMaterial; Destroy(lastEyeTrackingPointer.GetComponent <SphereCollider>()); } #endif ActiveFixation = new Fixation(); for (int i = 0; i < CachedEyeCaptures; i++) { EyeCaptures[i] = new EyeCapture() { Discard = true }; } #if CVR_FOVE fovebase = FindObjectOfType <FoveInterfaceBase>(); #elif CVR_TOBIIVR if (EyeTracker == null) { EyeTracker = FindObjectOfType <Tobii.Research.Unity.VREyeTracker>(); } #elif CVR_AH ah_calibrator = Calibrator.Instance; eyetracker = EyeTracker.Instance; #endif }
private IEnumerator Start() { if (EyeTracker == null) { EyeTracker = FindObjectOfType <Tobii.Research.Unity.VREyeTracker>(); } while (true) { tobiiStartTimestamp = EyeTracker.LatestGazeData.TimeStamp; if (tobiiStartTimestamp > 0) { System.TimeSpan span = System.DateTime.UtcNow - epoch; epochtobiistart = span.TotalSeconds; break; } yield return(null); } }