Exemple #1
0
        private bool TryGetLastGazePoints(out IEnumerable <GazePoint> gazePoints)
        {
            if (!IsInitialized)
            {
                gazePoints = new List <GazePoint>();
                return(false);
            }

            if (_useMouseEmulation)
            {
                var host = EyeTrackingHost.GetInstance() as EyeTrackingHost;
                if (host)
                {
                    var gazePoint = new GazePoint(Input.mousePosition, (double)Time.time / 1000.0f, Time.time);
                    gazePoints = new List <GazePoint>()
                    {
                        gazePoint
                    };
                    return(true);
                }
            }

            gazePoints = _gazePointDataProvider.GetDataPointsSince(_lastHandledGazePoint);
            UpdateLastHandledGazePoint(gazePoints);

            return(gazePoints.Any());
        }
Exemple #2
0
        private bool TryGetGazePoint(out GazePoint gazePoint)
        {
            if (!IsInitialized)
            {
                gazePoint = GazePoint.Invalid;
                return(false);
            }

            if (_useMouseEmulation)
            {
                var host = EyeTrackingHost.GetInstance() as EyeTrackingHost;
                if (host)
                {
                    gazePoint = new GazePoint(Input.mousePosition, (double)Time.time / 1000.0f, Time.time);
                    return(true);
                }
            }

            gazePoint = GetLastGazePoint();
            return(gazePoint.IsWithinScreenBounds);
        }
Exemple #3
0
        }                                                           // TODO: make internal?

        //---------------------------------------------------------------------
        // Private methods
        //---------------------------------------------------------------------

        private void Initialize()
        {
            if (_gazePointDataProvider == null)
            {
                ReloadSettings();
                _gazePointDataProvider = EyeTrackingHost.GetInstance().GetGazePointDataProvider();
                _gazePointDataProvider.Start(_identifier.GetInstanceID());
            }

            if (Scorer == null)
            {
                //Scorer = new SingleRayCastNoScore();
                Scorer = new SingleRaycastHistoricHitScore();
                //Scorer = new MultiRaycastHistoricHitScore();
            }
            if (_multiScorer == null)
            {
                _multiScorer = new MultiRaycastHistoricHitScore();
            }

            _isInitialized = true;
        }
Exemple #4
0
 private IRegisterGazeFocusable GazeFocusHandler()
 {
     return((IRegisterGazeFocusable)EyeTrackingHost.GetInstance().GazeFocus);
 }