/// <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); }
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 }
/// <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); }
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(); }
/// <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)); }
/// <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)); }
/// <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; }
/// <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); }
/// <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; }
/// <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; }
/// <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; }