Пример #1
0
    public void StartCalibrationDebugView()
    {
        if (DebugViewVariables.DebugEyeMesh != null)
        {
            var a = (from tr in OffsetTransforms
                     where tr.name == "Debug View Origin Matrix"
                     select tr).FirstOrDefault() as DebugView._Transform;
            if (a.GO != null)
            {
                a.GO.SetActive(true);
            }

            if (pupilGazeTracker.OnCalibDebug == null)
            {
                pupilGazeTracker.OnCalibDebug += DrawCalibrationDebugView;
            }
            //			OnCalibDebug -= DrawCalibrationDebugView;
            pupilGazeTracker.OnUpdate -= CalibrationDebugInteraction;
            pupilGazeTracker.OnUpdate += CalibrationDebugInteraction;

            PupilTools.StartFramePublishing();
        }
        else
        {
            UnityEngine.Debug.LogWarning("Please assign a Debug Eye Mesh under the Settings Debug View Variables. Accessable in Developer Mode!");
            PupilSettings.Instance.debugView.active = false;
        }
    }
Пример #2
0
    public static void Instantiate()
    {
        _texture = new Texture2D(1, 6);
        _texture.SetPixel(0, 0, new Color(1, 1, 1, .6f));
        _texture.SetPixel(0, 1, new Color(1, 1, 1, .5f));
        _texture.SetPixel(0, 2, new Color(1, 1, 1, .4f));
        _texture.SetPixel(0, 3, new Color(1, 1, 1, .3f));
        _texture.SetPixel(0, 4, new Color(1, 1, 1, .2f));
        _texture.SetPixel(0, 5, new Color(1, 1, 1, .1f));
        _texture.Apply();

        GameObject _camGO = new GameObject();

        _camGO.name = "Operator Camera";
        OperatorMonitor _opscript = _camGO.AddComponent <OperatorMonitor> ();
        Camera          _cam      = _camGO.GetComponent <Camera> ();

        pupilTracker = PupilGazeTracker.Instance;

        Operator.properties.Properties = pupilTracker.OperatorMonitorProperties;

        Operator.properties.Properties [0].OperatorCamera = _cam;
        _cam.stereoTargetEye = StereoTargetEyeMask.None;
//		_cam.backgroundColor = Color.gray;
        _cam.transform.parent           = PupilTools.Settings.currentCamera.transform;
        _cam.transform.localPosition    = Vector3.zero;
        _cam.transform.localEulerAngles = Vector3.zero;
        _cam.fieldOfView = PupilTools.Settings.currentCamera.fieldOfView;
        _cam.clearFlags  = CameraClearFlags.Depth;

        _opscript.MainCameraTargetDisplay = PupilTools.Settings.currentCamera.targetDisplay;
        //		PupilTools.Settings.currentCamera.targetDisplay = 1;


        Operator.properties.Properties [0].confidenceList.Capacity = Operator.properties.Properties [0].graphLength + 1;
        Operator.properties.Properties [1].confidenceList.Capacity = Operator.properties.Properties [1].graphLength + 1;

        _offsetMatrix = new Matrix4x4();

        PupilTools.SubscribeTo("pupil.");

        PupilTools.StartFramePublishing();
    }
Пример #3
0
    public static void Initialize()
    {
        window = (OperatorWindow)EditorWindow.GetWindow(typeof(OperatorWindow));
        window.Show();

        _texture = new Texture2D(1, 6);
        _texture.SetPixel(0, 0, new Color(1, 1, 1, .6f));
        _texture.SetPixel(0, 1, new Color(1, 1, 1, .5f));
        _texture.SetPixel(0, 2, new Color(1, 1, 1, .4f));
        _texture.SetPixel(0, 3, new Color(1, 1, 1, .3f));
        _texture.SetPixel(0, 4, new Color(1, 1, 1, .2f));
        _texture.SetPixel(0, 5, new Color(1, 1, 1, .1f));
        _texture.Apply();

//		GameObject _camGO = new GameObject ();
//		_camGO.name = "Operator Camera";
//		OperatorMonitor _opscript = _camGO.AddComponent<OperatorMonitor> ();
//		Camera _cam = _camGO.GetComponent<Camera> ();
        pupilTracker = PupilGazeTracker.Instance;

        Operator.properties.Properties = pupilTracker.OperatorMonitorProperties;

//		Operator.properties.Properties [0].OperatorCamera = _cam;
//		_cam.stereoTargetEye = StereoTargetEyeMask.None;
//		//		_cam.backgroundColor = Color.gray;
//		_cam.transform.parent = Camera.main.transform;
//		_cam.fieldOfView = Camera.main.fieldOfView;
//		_cam.clearFlags = CameraClearFlags.Depth;

//		_opscript.MainCameraTargetDisplay = Camera.main.targetDisplay;
        //		Camera.main.targetDisplay = 1;


        Operator.properties.Properties [0].confidenceList.Capacity = Operator.properties.Properties [0].graphLength + 1;
        Operator.properties.Properties [1].confidenceList.Capacity = Operator.properties.Properties [1].graphLength + 1;

        _offsetMatrix = new Matrix4x4();

        PupilTools.SubscribeTo("pupil.");

        PupilTools.StartFramePublishing();
    }