Exemplo n.º 1
0
        public GazeListener(SubscriptionsController subsCtrl)
        {
            this.subsCtrl    = subsCtrl;
            this.requestCtrl = subsCtrl.requestCtrl;

            requestCtrl.OnConnected     += Enable;
            requestCtrl.OnDisconnecting += Disable;

            if (requestCtrl.IsConnected)
            {
                Enable();
            }
        }
Exemplo n.º 2
0
        public Publisher(RequestController requestController)
        {
            this.requestController = requestController;

            if (requestController.IsConnected)
            {
                Setup();
            }
            else
            {
                waitingOnConnection            = true;
                requestController.OnConnected += DelayedSetup;
            }
        }
Exemplo n.º 3
0
        public void StartCalibration(CalibrationSettings settings, SubscriptionsController subsCtrl)
        {
            this.settings    = settings;
            this.subsCtrl    = subsCtrl;
            this.requestCtrl = subsCtrl.requestCtrl;


            requestCtrl.SetPupilTimestamp(Time.time);

            if (OnCalibrationStarted != null)
            {
                OnCalibrationStarted();
            }

            IsCalibrating = true;

            subsCtrl.SubscribeTo("notify.calibration.successful", ReceiveSuccess);
            subsCtrl.SubscribeTo("notify.calibration.failed", ReceiveFailure);

            requestCtrl.StartPlugin(settings.PluginName);

            UpdateEyesTranslation();

            requestCtrl.Send(new Dictionary <string, object> {
                { "subject", "calibration.should_start" },
                {
                    "hmd_video_frame_size",
                    new float[] {
                        1000,
                        1000
                    }
                },
                {
                    "outlier_threshold",
                    35
                },
                {
                    "translation_eye0",
                    rightEyeTranslation
                },
                {
                    "translation_eye1",
                    leftEyeTranslation
                }
            });

            Debug.Log("Calibration Started");

            calibrationData.Clear();
        }
Exemplo n.º 4
0
        public void StartCalibration(CalibrationSettings settings, SubscriptionsController subsCtrl)
        {
            this.settings    = settings;
            this.subsCtrl    = subsCtrl;
            this.requestCtrl = subsCtrl.requestCtrl;

            if (OnCalibrationStarted != null)
            {
                OnCalibrationStarted();
            }

            IsCalibrating = true;

            subsCtrl.SubscribeTo("notify.calibration.successful", ReceiveSuccess);
            subsCtrl.SubscribeTo("notify.calibration.failed", ReceiveFailure);

            requestCtrl.StartPlugin(settings.PluginName);
            publisher = new Publisher(requestCtrl);

            UpdateEyesTranslation();

            requestCtrl.Send(new Dictionary <string, object> {
                { "subject", "calibration.should_start" },
                {
                    "translation_eye0",
                    rightEyeTranslation
                },
                {
                    "translation_eye1",
                    leftEyeTranslation
                },
                {
                    "record",
                    true
                }
            });

            Debug.Log("Calibration Started");

            calibrationData.Clear();
        }
Exemplo n.º 5
0
 public static void MonitorConnection(RequestController connection)
 {
     connections.Add(connection);
 }
Exemplo n.º 6
0
 // 書き足し
 private void Start()
 {
     requestCtrl = FindObjectOfType <RequestController>();
 }