Exemple #1
0
        public FocusedObject GetFocusedObject(IEnumerable <GazePoint> lastGazePoints, Camera camera)
        {
            var objectsInGaze = FindObjectsInGaze(lastGazePoints, camera);

            UpdateFocusConfidenceScore(objectsInGaze);
            var focusChallenger = FindFocusChallenger();

            if (focusChallenger.GetScore()
                > _focusedObject.GetScore() + Threshold)
            {
                _focusedObject = focusChallenger;
            }

            return(FocusedGameObject);
        }
Exemple #2
0
        public FocusedObject GetFocusedObject(IEnumerable <GazePoint> lastGazePoints, Camera camera)
        {
            var gazePoints = lastGazePoints.Where(gazePoint => gazePoint.IsWithinScreenBounds);

            foreach (var gazePoint in gazePoints)
            {
                var objectsInGaze = FindObjectsInGaze(gazePoint.Screen, camera);
                UpdateFocusConfidenceScore(objectsInGaze);
            }

            var focusChallenger = FindFocusChallenger();

            if (focusChallenger.GetScore() > _focusedObject.GetScore() + Threshold)
            {
                _focusedObject = focusChallenger;
            }

            return(FocusedGameObject);
        }
Exemple #3
0
        private ScoredObject FindFocusChallenger()
        {
            ScoredObject topFocusChallenger = ScoredObject.Empty();
            float        topScore           = 0.0f;

            foreach (var key in _scoredObjects.Keys)
            {
                ScoredObject scoredObject = _scoredObjects[key];

                var score = scoredObject.GetScore(Time.time - LoseGazeDwellTime, Time.time - GainGazeDwellTime);

                if (score > topScore)
                {
                    topScore           = score;
                    topFocusChallenger = scoredObject;
                }
            }

            return(topFocusChallenger);
        }