Home Forums Eye Tracking Devices Eye tracker 4C- Can I get the eye tracker name in Unity using C#?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #8942
    Supriya Raul
    Participant

    Hello,

    I need to get the eye tracker details to create a Unity C# wrapper file so that if I use multiple eye-trackers I can run the same code and fetch the same details. Please suggest how can I find the eye tracker name and version?

    Thanks in advance.

    #8943
    Alex [Tobii]
    Participant

    Hi @supriya !
    Unfortunately, there’s no such a feature in the public API of Tobii Unity SDK.
    Underlying code will use the tracker that tracks a monitor, which game window is currently on.
    There’s some undocumented code in the underlying API though, but it’s subject to change, so use it on your own risk.
    Please look at
    \Assets\Tobii\Framework\Internal\TobiiHost.cs

    
    private void TrackWindow()
    ...
    TobiiGameIntegrationApi.TrackWindow(_gameViewBoundsProvider.Hwnd);
    

    This one tells which window to track. You can also track certain rectangle or tracker by url
    and

    
    public DisplayInfo DisplayInfo
    ...
    var trackerInfo = TobiiGameIntegrationApi.GetTrackerInfo();
    

    This one provides info about current tracker

    To enumerate all connected trackers:

    
    TobiiGameIntegrationApi.UpdateTrackerInfos();
    List<TrackerInfo> trackerInfos;
    var timeout = Stopwatch.StartNew();
    while ((trackerInfos = TobiiGameIntegrationApi.GetTrackerInfos()).IsNull())
    {
        if (timeout.ElapsedMilliseconds > 10000)
        {
             throw new Exception("TGI error. Could not enumerate trackers.");
        }
    }
    
    #8945
    Supriya Raul
    Participant

    Thank you for this suggestion Alex. However, TobiiGameIntegrationApi.GetTrackerInfo() is giving the firmware version and generation details which is not that useful.
    Do you mean to say that it is possible to fetch the eye tracker name and hardware version details from any other language or SDK?
    If even that is possible, I can fetch those details from there and create a DLL to pass those details to my Unity C# script.
    I would really appreciate some more help here.

    #8946
    Alex [Tobii]
    Participant
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.