Exemplo n.º 1
0
        private IEnumerator WaitForInit()
        {
            EyeTrackingHost.GetInstance().Initialize();
            yield return(new WaitForSeconds(1.1f));

            com.flavienm.engine.input.InputFactory.Create();
        }
Exemplo n.º 2
0
    private void WriteCalibrationProfilesIntoProfileSelection()
    {
        IStateValue <string[]> profiles        = EyeTrackingHost.GetInstance().UserProfileNames;
        IStateValue <string>   selectedProfile = EyeTrackingHost.GetInstance().UserProfileName;

        if (profiles.IsValid && _isLoaded == false)
        {
            DropdownProfileSelection.options.Clear();
            _names = new string[profiles.Value.Length];

            for (int i = 0; i < profiles.Value.Length; i++)
            {
                _names[i] = profiles.Value[i];

                Dropdown.OptionData option = new Dropdown.OptionData(_names[i]);
                DropdownProfileSelection.options.Add(option);

                if (_names[i].Equals(selectedProfile.Value))
                {
                    DropdownProfileSelection.value = i;
                }
            }

            _isLoaded = true;
        }
    }
Exemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        _gazePointProvider = EyeTrackingHost.GetInstance().GetGazePointDataProvider();
        gazePointTracker   = GameObject.FindWithTag("gazepoint");
        gazeawareObject    = GameObject.FindWithTag("gazeaware");
        canvas             = GameObject.Find("Canvas");
        timer    = GameObject.Find("Timer").GetComponent <Text>();
        myCamera = GameObject.FindWithTag("MainCamera").GetComponent <Camera>();
        EyeTracking.SetCurrentUserViewPointCamera(myCamera);
        logger.contWrite = false;

        Debug.Log("Gaze aware object " + gazeawareObject.name);
    }
Exemplo n.º 4
0
    void Update()
    {
        switch (EyeTrackingHost.GetInstance().GazeTracking.Status)
        {
        case GazeTrackingStatus.GazeNotTracked:     // no gaze point data is streaming, inform the user why nothing is happening
            ShowGraphic(true);
            break;

        case GazeTrackingStatus.GazeTracked:        // gaze point data is streaming, no need to show this message
        case GazeTrackingStatus.NotSupported:       // the status is not available on older Tobii Engines, do not show message
        case GazeTrackingStatus.Unknown:            // we don't know what is happening, so let's not say anything :)
        default:
            ShowGraphic(false);
            break;
        }
    }
Exemplo n.º 5
0
    public static HeadPose GetHeadPose()
    {
        var headPose = new HeadPose();

        headPose.Rotation       = new HeadRotation();
        headPose.Rotation.Yaw   = EyeTrackingHost.GetInstance().Yaw;
        headPose.Rotation.Pitch = EyeTrackingHost.GetInstance().Pitch;
        headPose.Rotation.Roll  = EyeTrackingHost.GetInstance().Roll;

        headPose.Position   = new HeadPosition();
        headPose.Position.X = EyeTrackingHost.GetInstance().X;
        headPose.Position.Y = EyeTrackingHost.GetInstance().Y;
        headPose.Position.Z = EyeTrackingHost.GetInstance().Z;

        headPose.TimeStampMicroSeconds = EyeTrackingHost.GetInstance().TimeStampMicroSeconds;
        return(headPose);
    }
Exemplo n.º 6
0
 public static Vector2 GetGazePoint()
 {
     return(new Vector2((EyeTrackingHost.GetInstance().GazeX + 1) * 0.5f,
                        (EyeTrackingHost.GetInstance().GazeY + 1) * 0.5f));
 }
Exemplo n.º 7
0
 /// <summary>
 /// Print the Eye Tracking Device Status
 /// </summary>
 private void UpdateDeviceStatus()
 {
     TextViewDeviceStatus.text = EyeTrackingHost.GetInstance().EyeTrackingDeviceStatus.ToString();
 }
Exemplo n.º 8
0
 public void SetCalibrationProfile(int profile)
 {
     EyeTrackingHost.GetInstance().SetCurrentProfile(_names[profile]);
 }