Exemplo n.º 1
0
    /// <summary>
    /// Draw a GUI.Box at the user's gaze point.
    /// </summary>
    public void OnGUI()
    {
#if UNITY_EDITOR
        if (_oldGazePointMode != gazePointMode)
        {
            _gazePointProvider.Stop();
            _oldGazePointMode  = gazePointMode;
            _gazePointProvider = _eyeXHost.GetGazePointDataProvider(gazePointMode);
            _gazePointProvider.Start();
        }
#endif
        var gazePoint = _gazePointProvider.Last;
        //filter nan values.
        if (!System.Single.IsNaN(gazePoint.Screen.x))
        {
            //update
            if (trackObserver_eye != null)
            {
                trackObserver_eye.updateEyeTrack(gazePoint);
                ScenedataCapt.storeTrackPoint(gazePoint);
                DrawGUI(gazePoint, pointSize, pointColor);
            }
            if (trackObserver_eyemouse != null)
            {
                trackObserver_eyemouse.updateEyeTrack(gazePoint);
                ScenedataCapt.storeTrackPoint(gazePoint);
                DrawGUI(gazePoint, pointSize, pointColor);
            }
        }
    }
        /// <summary>
        /// Gets a gaze point data stream.
        /// </summary>
        /// <param name="mode">Specifies the kind of data processing to be applied by the EyeX Engine.</param>
        /// <returns>The data stream.</returns>
        public GazePointDataStream CreateGazePointDataStream(GazePointDataMode mode)
        {
            var dataStream = new GazePointDataStream(mode);

            RegisterDataStreamObserver(dataStream);
            return(dataStream);
        }
Exemplo n.º 3
0
    public void Awake()
    {
        _eyeXHost          = EyeXHost.GetInstance();
        _gazePointProvider = _eyeXHost.GetGazePointDataProvider(gazePointMode);

#if UNITY_EDITOR
        _oldGazePointMode = gazePointMode;
#endif
    }
Exemplo n.º 4
0
    public void Awake()
    {
        _eyeXHost = EyeXHost.GetInstance();
        _gazePointProvider = _eyeXHost.GetGazePointDataProvider(gazePointMode);

#if UNITY_EDITOR
        _oldGazePointMode = gazePointMode;
#endif
    }
    public void Awake()
    {
        ScenedataCapt = new sceneTrackdata();

        _eyeXHost          = EyeXHost.GetInstance();
        _gazePointProvider = _eyeXHost.GetGazePointDataProvider(gazePointMode);

#if UNITY_EDITOR
        _oldGazePointMode = gazePointMode;
#endif
    }
Exemplo n.º 6
0
    /// <summary>
    /// Draw a GUI.Box at the user's gaze point.
    /// </summary>
    public void OnGUI()
    {
#if UNITY_EDITOR
        if (_oldGazePointMode != gazePointMode)
        {
            _gazePointProvider.Stop();
            _oldGazePointMode  = gazePointMode;
            _gazePointProvider = _eyeXHost.GetGazePointDataProvider(gazePointMode);
            _gazePointProvider.Start();
        }
#endif

        var gazePoint = _gazePointProvider.Last;
        DrawGUI(gazePoint, pointSize, pointColor, string.Empty);
    }
Exemplo n.º 7
0
    /// <summary>
    /// Draw a GUI.Box at the user's gaze point.
    /// </summary>
    public void OnGUI()
    {
#if UNITY_EDITOR
        if (_oldGazePointMode != gazePointMode)
        {
            _gazePointProvider.Stop();
            _oldGazePointMode = gazePointMode;
            _gazePointProvider = _eyeXHost.GetGazePointDataProvider(gazePointMode);
            _gazePointProvider.Start();
        }
#endif

        var gazePoint = _gazePointProvider.Last;
        DrawGUI(gazePoint, pointSize, pointColor, string.Empty);
    }
Exemplo n.º 8
0
 public Record(bool filteered, string filenameWithoutExtention, bool takeScreenshot)
 {
     this.takeScreenshot           = takeScreenshot;
     this.filenameWithoutExtention = filenameWithoutExtention;
     //Directory.CreateDirectory(filenameWithoutExtention + "_screenshots");
     eyeXHost.Start();
     if (filtered)
     {
         lightlyFilteredGazeDataStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.LightlyFiltered);
         gpdm = GazePointDataMode.LightlyFiltered;
     }
     else
     {
         gpdm = GazePointDataMode.Unfiltered;
         lightlyFilteredGazeDataStream = eyeXHost.CreateGazePointDataStream(GazePointDataMode.Unfiltered);
     }
     eyePosStream = eyeXHost.CreateEyePositionDataStream();
 }
Exemplo n.º 9
0
        /// <summary>
        /// Gets a provider of gaze point data.
        /// See <see cref="IDataProvider{T}"/>.
        /// </summary>
        /// <param name="mode">Specifies the kind of data processing to be applied by Tobii Engine.</param>
        /// <returns>The data provider.</returns>
        private IDataProvider <GazePoint> GetGazePointDataProvider(GazePointDataMode mode)
        {
            var dataStream = new GazePointDataProvider(mode);

            return(GetDataProviderForDataStream <GazePoint>(dataStream));
        }
Exemplo n.º 10
0
    /// <summary>
    /// Gets a provider of gaze point data.
    /// See <see cref="IEyeXDataProvider{T}"/>.
    /// </summary>
    /// <param name="mode">Specifies the kind of data processing to be applied by the EyeX Engine.</param>
    /// <returns>The data provider.</returns>
    public IEyeXDataProvider <EyeXGazePoint> GetGazePointDataProvider(GazePointDataMode mode)
    {
        var dataStream = new EyeXGazePointDataStream(mode);

        return(GetDataProviderForDataStream <EyeXGazePoint>(dataStream));
    }
Exemplo n.º 11
0
 /// <summary>
 /// Gets a gaze point data stream.
 /// </summary>
 /// <param name="mode">Specifies the kind of data processing to be applied by the EyeX Engine.</param>
 /// <returns>The data stream.</returns>
 public GazePointDataStream CreateGazePointDataStream(GazePointDataMode mode)
 {
     var dataStream = new GazePointDataStream(mode);
     RegisterDataStreamObserver(dataStream);
     return dataStream;
 }
Exemplo n.º 12
0
 /// <summary>
 /// Sets the GazePointData behavior on the global interactor and specifies the data mode 
 /// to be used.
 /// <param name="interactor">Interactor object to be fitted with the interaction behavior.</param>
 /// <param name="gazePointDataMode">Which gaze point data mode to use.</param>
 /// </summary>
 private static void AddGazePointDataBehavior(Interactor interactor, GazePointDataMode gazePointDataMode)
 {
     var behavior = interactor.CreateBehavior(InteractionBehaviorType.GazePointData);
     var behaviorParams = new GazePointDataParams() { GazePointDataMode = gazePointDataMode };
     behavior.SetGazePointDataParams(ref behaviorParams);
 }
Exemplo n.º 13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GazePointDataStream"/> class.
 /// </summary>
 /// <param name="mode">Specifies the kind of processing applied to the eye-gaze data.</param>
 public GazePointDataStream(GazePointDataMode mode)
 {
     Mode = mode;
 }
Exemplo n.º 14
0
 /// <summary>
 /// Creates a new instance.
 /// Note: don't create instances of this class directly. Use the <see cref="EyeXHost.GetGazePointDataProvider"/> method instead.
 /// </summary>
 /// <param name="mode">Data mode.</param>
 public EyeXGazePointDataStream(GazePointDataMode mode)
 {
     _mode = mode;
     Last  = EyeXGazePoint.Invalid;
 }
Exemplo n.º 15
0
 /// <summary>
 /// Creates a new instance.
 /// Note: don't create instances of this class directly. Use the <see cref="EyeTrackingHost.GetGazePointDataProvider"/> method instead.
 /// </summary>
 /// <param name="mode">Data mode.</param>
 public GazePointDataProvider(GazePointDataMode mode)
 {
     _mode = mode;
     Last  = GazePoint.Invalid;
 }