public void OnTick(object sender, EventArgs e)
{
if (_shutDownRequestFlag) return;
_debugGazeVisualization.Move(new Vector2(UI.WIDTH * 0.5f + _tobiiTracker.GazeX * UI.WIDTH * 0.5f, UI.HEIGHT * 0.5f + _tobiiTracker.GazeY * UI.HEIGHT * 0.5f));
_controllerEmulation.Enabled = !Game.IsPaused;
_mouseEmulation.Enabled = !Game.IsPaused && !_menuPool.IsAnyMenuOpen() &&_isWindowForeground;
//CheckFreelookDevice();
SaveSettingsOnMenuClosed();
Game.Player.Character.CanBeKnockedOffBike = _settings.DontFallFromBikesEnabled; //Bug in Script hook
if (Game.IsPaused) return;
if (!_settings.UserAgreementAccepted)
{
_introScreen.OpenMenu();
}
RecordGameSessionStarted();
Vector3 shootCoord;
Vector3 shootCoordSnap;
Vector3 shootMissileCoord;
Ped ped;
Entity missileTarget;
var controllerState = _controllerEmulation.ControllerState;
const float joystickRadius = 0.1f;
var joystickDelta = new Vector2(controllerState.Gamepad.RightThumbX, -controllerState.Gamepad.RightThumbY) *
(1.0f / 32768.0f) * joystickRadius;
_gameState.Update();
_gazeProjector.FindGazeProjection(
new Vector2(_tobiiTracker.GazeX,_tobiiTracker.GazeY),
joystickDelta,
out shootCoord,
out shootCoordSnap,
out shootMissileCoord,
out ped,
out missileTarget);
_controlsProcessor.Update(_lastTickTime, shootCoord, shootCoordSnap, shootMissileCoord, ped, missileTarget);
//_aiming.TurnHead(ped, shootCoord);
_menuPool.ProcessMenus();
_animationHelper.Process();
if (_debugOutput.Visible)
{
_debugGazeVisualization.Render();
}
_debugOutput.Process();
_mouseEmulation.ProcessInput();
_lastTickTime = DateTime.UtcNow;
if (_shutDownRequestFlag)
{
_shutDownRequestedEvent.Set();
}
}