private IEnumerator WaitForInit() { EyeTrackingHost.GetInstance().Initialize(); yield return(new WaitForSeconds(1.1f)); com.flavienm.engine.input.InputFactory.Create(); }
private void WriteCalibrationProfilesIntoProfileSelection() { IStateValue <string[]> profiles = EyeTrackingHost.GetInstance().UserProfileNames; IStateValue <string> selectedProfile = EyeTrackingHost.GetInstance().UserProfileName; if (profiles.IsValid && _isLoaded == false) { DropdownProfileSelection.options.Clear(); _names = new string[profiles.Value.Length]; for (int i = 0; i < profiles.Value.Length; i++) { _names[i] = profiles.Value[i]; Dropdown.OptionData option = new Dropdown.OptionData(_names[i]); DropdownProfileSelection.options.Add(option); if (_names[i].Equals(selectedProfile.Value)) { DropdownProfileSelection.value = i; } } _isLoaded = true; } }
public Gta5EyeTracking() { Debug.Log("Begin Initialize"); //Disposing _shutDownRequestedEvent = new ManualResetEvent(false); //Settings _settingsStorage = new SettingsStorage(); _settings = _settingsStorage.LoadSettings(); //Statistics var version = Assembly.GetExecutingAssembly().GetName().Version; var versionString = version.Major + "." + version.Minor + "." + version.Build; _googleAnalyticsApi = new GoogleAnalyticsApi("UA-68420530-1", _settings.UserGuid, "GTA V Eye Tracking Mod", "gta5eyetracking", versionString); //Gaze _tobiiTracker = new EyeTrackingHost(); //Menu _menuPool = new MenuPool(); _settingsMenu = new SettingsMenu(_menuPool, _settings); _introScreen = new IntroScreen(_menuPool, _settings); //Debug _debugGazeVisualization = new DefaultCrosshair(Color.FromArgb(220, 255, 0, 0), Color.FromArgb(220, 0, 255, 255)); _debugOutput = new DebugOutput(); //Hids _mouseEmulation = new MouseEmulation(); _controllerEmulation = new ControllerEmulation(); //Features _gameState = new GameState(_controllerEmulation, _menuPool); _animationHelper = new AnimationHelper(); _aiming = new Aiming(_settings, _animationHelper, _gameState); _extendedView = new ExtendedView(_settings, _gameState, _aiming, _debugOutput); _radialMenu = new RadialMenu(_controllerEmulation); //Window _foregroundWindowWatcher = new ForegroundWindowWatcher(); _foregroundWindowWatcher.ForegroundWindowChanged += ForegroundWindowWatcherOnForegroundWindowChanged; _isWindowForeground = _foregroundWindowWatcher.IsWindowForeground(); //General _gazeProjector = new GazeProjector(_settings); _controlsProcessor = new ControlsProcessor(_settings, _controllerEmulation, _aiming, _extendedView, _radialMenu, _settingsMenu, _gameState, _debugOutput); KeyDown += OnKeyDown; Tick += OnTick; Aborted += OnAborted; AppDomain.CurrentDomain.ProcessExit += AppDomainOnProcessExit; AppDomain.CurrentDomain.DomainUnload += AppDomainOnProcessExit; Debug.Log("End Initialize"); }
public EyeTrackingHost() { _instance = this; Debug.Log("TobiiGameIntegrationApi.TrackWindow() before"); TobiiGameIntegrationApi.TrackWindow(Process.GetCurrentProcess().MainWindowHandle); Debug.Log("TobiiGameIntegrationApi.TrackWindow() after"); AspectRatio = 16f / 9f; }
// Use this for initialization void Start() { _gazePointProvider = EyeTrackingHost.GetInstance().GetGazePointDataProvider(); gazePointTracker = GameObject.FindWithTag("gazepoint"); gazeawareObject = GameObject.FindWithTag("gazeaware"); canvas = GameObject.Find("Canvas"); timer = GameObject.Find("Timer").GetComponent <Text>(); myCamera = GameObject.FindWithTag("MainCamera").GetComponent <Camera>(); EyeTracking.SetCurrentUserViewPointCamera(myCamera); logger.contWrite = false; Debug.Log("Gaze aware object " + gazeawareObject.name); }
void Update() { switch (EyeTrackingHost.GetInstance().GazeTracking.Status) { case GazeTrackingStatus.GazeNotTracked: // no gaze point data is streaming, inform the user why nothing is happening ShowGraphic(true); break; case GazeTrackingStatus.GazeTracked: // gaze point data is streaming, no need to show this message case GazeTrackingStatus.NotSupported: // the status is not available on older Tobii Engines, do not show message case GazeTrackingStatus.Unknown: // we don't know what is happening, so let's not say anything :) default: ShowGraphic(false); break; } }
public static HeadPose GetHeadPose() { var headPose = new HeadPose(); headPose.Rotation = new HeadRotation(); headPose.Rotation.Yaw = EyeTrackingHost.GetInstance().Yaw; headPose.Rotation.Pitch = EyeTrackingHost.GetInstance().Pitch; headPose.Rotation.Roll = EyeTrackingHost.GetInstance().Roll; headPose.Position = new HeadPosition(); headPose.Position.X = EyeTrackingHost.GetInstance().X; headPose.Position.Y = EyeTrackingHost.GetInstance().Y; headPose.Position.Z = EyeTrackingHost.GetInstance().Z; headPose.TimeStampMicroSeconds = EyeTrackingHost.GetInstance().TimeStampMicroSeconds; return(headPose); }
private void ShutDown() { Debug.Log("Begin ShutDown"); _shutDownRequestFlag = true; KeyDown -= OnKeyDown; Tick -= OnTick; Aborted -= OnAborted; AppDomain.CurrentDomain.ProcessExit -= AppDomainOnProcessExit; _shutDownRequestedEvent.WaitOne(100); _settingsStorage.SaveSettings(_settings); //General RecordGameSessionEnded(); if (_controlsProcessor != null) { _controlsProcessor.Dispose(); _controlsProcessor = null; } //Window if (_foregroundWindowWatcher != null) { _foregroundWindowWatcher.Dispose(); _foregroundWindowWatcher = null; } //Menu if (_settingsMenu != null) { _settingsMenu = null; } //Features if (_aiming != null) { _aiming.Dispose(); _aiming = null; } if (_extendedView != null) { _extendedView.Dispose(); _extendedView = null; } //Hids if (_controllerEmulation != null) { _controllerEmulation.Enabled = false; _controllerEmulation.RemoveHooks(); _controllerEmulation = null; } if (_tobiiTracker != null) { _tobiiTracker.Dispose(); _tobiiTracker = null; } Debug.Log("End ShutDown"); }
public static Vector2 GetGazePoint() { return(new Vector2((EyeTrackingHost.GetInstance().GazeX + 1) * 0.5f, (EyeTrackingHost.GetInstance().GazeY + 1) * 0.5f)); }
/// <summary> /// Print the Eye Tracking Device Status /// </summary> private void UpdateDeviceStatus() { TextViewDeviceStatus.text = EyeTrackingHost.GetInstance().EyeTrackingDeviceStatus.ToString(); }
public void SetCalibrationProfile(int profile) { EyeTrackingHost.GetInstance().SetCurrentProfile(_names[profile]); }