示例#1
0
        public Gta5EyeTracking()
        {
            _aspectRatio = 1;
            _host        = new EyeXHost();
            _host.Start();
            _lightlyFilteredGazePointDataProvider       = _host.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
            _lightlyFilteredGazePointDataProvider.Next += NewGazePoint;

            _menuPool = new MenuPool();

            LoadSettings();
            _settingsMenu = new SettingsMenu(_menuPool, _settings);
            _settingsMenu.DeadzoneMenu.OnItemSelect += (m, item, indx) =>
            {
                if (indx == 0)
                {
                    _isDrawingDeadzone = true;
                }
                else
                {
                    _settings.Deadzones.RemoveAt(indx - 1);
                    _settingsMenu.DeadzoneMenu.RemoveItemAt(indx);
                    _settingsMenu.DeadzoneMenu.RefreshIndex();
                }
            };

            _gazeVisualization = new GazeVisualization();
            _debugOutput       = new DebugOutput();

            _aiming = new Aiming(_settings);

            _mouseEmulation      = new MouseEmulation();
            _controllerEmulation = new ControllerEmulation();
            _controllerEmulation.OnModifyState += OnModifyControllerState;
            _freelook = new Freelook(_controllerEmulation, _mouseEmulation, _settings);
            _pedestrianInteraction = new PedestrianInteraction();
            _radialMenu            = new RadialMenu(_controllerEmulation);

            _gazeStopwatch = new Stopwatch();
            _gazeStopwatch.Restart();

            _tickStopwatch = new Stopwatch();

            _foregroundWindowWatcher = new ForegroundWindowWatcher();
            _foregroundWindowWatcher.ForegroundWindowChanged += ForegroundWindowWatcherOnForegroundWindowChanged;
            _isWindowForeground = _foregroundWindowWatcher.IsWindowForeground();

            View.MenuTransitions = true;

            KeyDown += OnKeyDown;

            Tick += OnTick;
        }
示例#2
0
        public Gta5EyeTracking()
        {
            Util.Log("Begin Initialize");
            _shutDownRequestedEvent = new ManualResetEvent(false);
            _aspectRatio = 1;
            _host = new EyeXHost();
            _host.Start();
            _lightlyFilteredGazePointDataProvider = _host.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
            _lightlyFilteredGazePointDataProvider.Next += NewGazePoint;

            _menuPool = new MenuPool();

            LoadSettings();
            _settingsMenu = new SettingsMenu(_menuPool, _settings);
            _deadzoneEditor = new DeadzoneEditor(_settings,_settingsMenu);

            _settingsMenu.ShutDownRequested += SettingsMenuOnShutDownRequested;

            _gazeVisualization = new GazeVisualization();
            _debugOutput = new DebugOutput();

            _aiming = new Aiming(_settings);

            _mouseEmulation = new MouseEmulation();
            _controllerEmulation = new ControllerEmulation();
            _controllerEmulation.OnModifyState += OnModifyControllerState;
            _freelook = new Freelook(_controllerEmulation, _mouseEmulation, _settings);
            _pedestrianInteraction = new PedestrianInteraction();
            _radialMenu = new RadialMenu(_controllerEmulation);

            _gazeStopwatch = new Stopwatch();
            _gazeStopwatch.Restart();

            _tickStopwatch = new Stopwatch();

            _foregroundWindowWatcher = new ForegroundWindowWatcher();
            _foregroundWindowWatcher.ForegroundWindowChanged += ForegroundWindowWatcherOnForegroundWindowChanged;
            _isWindowForeground = _foregroundWindowWatcher.IsWindowForeground();

            KeyDown += OnKeyDown;

            Tick += OnTick;
            Util.Log("End Initialize");
        }
示例#3
-1
        public Gta5EyeTracking()
        {
            _aspectRatio = 1;
            _host = new EyeXHost();
            _host.Start();
            _lightlyFilteredGazePointDataProvider = _host.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
            _lightlyFilteredGazePointDataProvider.Next += NewGazePoint;

            _menuPool = new MenuPool();

            LoadSettings();
            _settingsMenu = new SettingsMenu(_menuPool, _settings);
            _settingsMenu.DeadzoneMenu.OnItemSelect += (m, item, indx) =>
            {
                if (indx == 0)
                {
                    _isDrawingDeadzone = true;
                }
                else
                {
                    _settings.Deadzones.RemoveAt(indx - 1);
                    _settingsMenu.DeadzoneMenu.RemoveItemAt(indx);
                    _settingsMenu.DeadzoneMenu.RefreshIndex();
                }
            };

            _gazeVisualization = new GazeVisualization();
            _debugOutput = new DebugOutput();

            _aiming = new Aiming(_settings);

            _mouseEmulation = new MouseEmulation();
            _controllerEmulation = new ControllerEmulation();
            _controllerEmulation.OnModifyState += OnModifyControllerState;
            _freelook = new Freelook(_controllerEmulation, _mouseEmulation, _settings);
            _pedestrianInteraction = new PedestrianInteraction();
            _radialMenu = new RadialMenu(_controllerEmulation);

            _gazeStopwatch = new Stopwatch();
            _gazeStopwatch.Restart();

            _tickStopwatch = new Stopwatch();

            _foregroundWindowWatcher = new ForegroundWindowWatcher();
            _foregroundWindowWatcher.ForegroundWindowChanged += ForegroundWindowWatcherOnForegroundWindowChanged;
            _isWindowForeground = _foregroundWindowWatcher.IsWindowForeground();

            View.MenuTransitions = true;

            KeyDown += OnKeyDown;

            Tick += OnTick;
        }