public GazeDelta Next(GazeData data)
        {
            if (data == null)
            {
                return(null);
            }
            var result =
                new GazeDelta
            {
                IsFixated    = data.IsFixated,
                TimeStamp    = data.TimeStamp,
                Presence     = (data.State & GazeData.STATE_TRACKING_PRESENCE) != 0,
                Gaze         = (data.State & GazeData.STATE_TRACKING_PRESENCE) != 0,
                Failed       = (data.State & GazeData.STATE_TRACKING_FAIL) != 0,
                LostTracking = (data.State & GazeData.STATE_TRACKING_LOST) != 0,
                Eyes         = (data.State & GazeData.STATE_TRACKING_EYES) != 0,

                LeftEye  = data.LeftEye,
                RightEye = data.RightEye,

                RawCoordinates      = data.RawCoordinates,
                SmoothedCoordinates = data.SmoothedCoordinates,

                Head = data.HeadPosition(),

                IsUsable = true,
                Last     = this
            };

            Last = null;
            return(result);
        }
Пример #2
0
 public void OnGazeUpdate(GazeData gazeData)
 {
     if (_gazeInfo == null)
     {
         _gazeInfo = new GazeDelta();
     }
     _gazeInfo = _gazeInfo.Next(gazeData);
 }