public void Update() { TobiiGameIntegrationApi.Update(); { var gazePoints = TobiiGameIntegrationApi.GetGazePoints(); if (gazePoints.Count > 0) { GazeX = (Math.Min(Math.Max(gazePoints.Last().X, -1.0f), 1.0f)); GazeY = -(Math.Min(Math.Max(gazePoints.Last().Y, -1.0f), 1.0f)); } var headPoses = TobiiGameIntegrationApi.GetHeadPoses(); if (headPoses.Count > 0) { Yaw = -headPoses.Last().Rotation.Yaw; Pitch = headPoses.Last().Rotation.Pitch; Roll = headPoses.Last().Rotation.Roll; X = headPoses.Last().Position.X; Y = headPoses.Last().Position.Y; Z = headPoses.Last().Position.Z; TimeStampMicroSeconds = headPoses.Last().TimeStampMicroSeconds; } } _frame++; if (_frame > 60) { _frame = 0; AspectRatio = GetDisplayAspectratio(); } }
protected override void UpdateData() { var gazePoints = TobiiGameIntegrationApi.GetGazePoints(); foreach (var gazePoint in gazePoints) { OnGazePoint(gazePoint); } }