Esempio n. 1
0
 public RadialMenu(ControllerEmulation controllerEmulation, ITobiiTracker tobiiTracker)
 {
     _controllerEmulation = controllerEmulation;
     _tobiiTracker = tobiiTracker;
     _lastRadialMenuRegion = -1;
     _newRadialMenuRegionStopwatch = new Stopwatch();
 }
Esempio n. 2
0
        public ExtendedView(Settings settings,
            GameState gameState,
			ITobiiTracker tobiiTracker,
            Aiming aiming,
            DebugOutput debugOutput
            )
        {
            _settings = settings;
            _gameState = gameState;
            _aiming = aiming;
            _debugOutput = debugOutput;
            _tobiiTracker = tobiiTracker;

            _aimTransitionState = 1;

            _extendedViewCamera = World.CreateCamera(new Vector3(), Vector3.Zero, 60f);
            _forwardCamera = World.CreateCamera(new Vector3(), Vector3.Zero, 60f);
        }
Esempio n. 3
0
        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 TobiiInteractionEngineTracker();

            //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, _tobiiTracker, _aiming, _debugOutput);
            _radialMenu = new RadialMenu(_controllerEmulation, _tobiiTracker);

            //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;
            Debug.Log("End Initialize");
        }
Esempio n. 4
0
        private void ShutDown()
        {
            _shutDownRequestFlag = true;
            KeyDown -= OnKeyDown;
            Tick -= OnTick;

            _shutDownRequestedEvent.WaitOne(100);
            Debug.Log("Begin ShutDown");
            _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");
        }