Exemple #1
0
        void ReceiveGaze(GazeData gazeData)
        {
            unityTime = timeSync.ConvertToUnityTime(gazeData.PupilTimestamp);

            if (gazeData.MappingContext != GazeData.GazeMappingContext.Binocular)
            {
                isBinocular = false;
            }
            else
            {
                isBinocular = true;
            }

            gazeConfidence = gazeData.Confidence;

            if (gazeData.IsEyeDataAvailable(0))
            {
                gazeNormalLeft = gazeData.GazeNormal0;
            }

            if (gazeData.IsEyeDataAvailable(1))
            {
                gazeNormalRight = gazeData.GazeNormal1;
            }
        }
 void Forward3dGaze(GazeData data)
 {
     if (OnReceive3dGaze != null)
     {
         OnReceive3dGaze(data);
     }
 }
 void ReceiveGaze(GazeData gazeData)
 {
     if (gazeData.Confidence >= confidenceThreshold)
     {
         localGazeDirection = gazeData.GazeDirection;
         gazeDistance       = gazeData.GazeDistance;
     }
 }
Exemple #4
0
 void ReceiveGaze(GazeData gazeData)
 {
     if (filterByConfidence && gazeData.Confidence >= confidenceThreshold)
     {
         localGazePosition = gazeData.GazePoint3d;
         worldGazePosition = cameraTransform.localToWorldMatrix.MultiplyPoint(gazeData.GazePoint3d);
     }
 }
Exemple #5
0
        void Receive3DGaze(string topic, Dictionary <string, object> dictionary, byte[] thirdFrame = null)
        {
            GazeData gazeData = new GazeData(topic, dictionary, requestCtrl.UnityToPupilTimeOffset);

            if (OnReceive3dGaze != null)
            {
                OnReceive3dGaze(gazeData);
            }
        }
        void Receive3DGaze(string topic, Dictionary <string, object> dictionary, byte[] thirdFrame = null)
        {
            GazeData gazeData = new GazeData(topic, dictionary);

            if (OnReceive3dGaze != null)
            {
                OnReceive3dGaze(gazeData);
            }
        }
Exemple #7
0
        void ReceiveGaze(GazeData gazeData)
        {
            if (binocularOnly && gazeData.MappingContext != GazeData.GazeMappingContext.Binocular)
            {
                return;
            }

            lastConfidence = gazeData.Confidence;

            if (gazeData.Confidence < confidenceThreshold)
            {
                return;
            }

            localGazeDirection = gazeData.GazeDirection;
            gazeDistance       = gazeData.GazeDistance;
        }
Exemple #8
0
        void ReceiveGaze(GazeData gazeData)
        {
            if (gazeData.MappingContext != GazeData.GazeMappingContext.Binocular)
            {
                isBinocular = false;
            }
            else
            {
                isBinocular = true;
            }

            gazeConfidence = gazeData.Confidence;

            if (gazeData.IsEyeDataAvailable(0))
            {
                gazeNormalLeft = gazeData.GazeNormal0;
            }

            if (gazeData.IsEyeDataAvailable(1))
            {
                gazeNormalRight = gazeData.GazeNormal1;
            }
        }
        void ReceiveGaze(GazeData gazeData)
        {
            if (startWriting)
            {
                plConfidence = float.NaN;
                plTimeStamp  = float.NaN;
                plEIH2_xyz   = new Vector3(float.NaN, float.NaN, float.NaN);

                plEIH0_xyz = new Vector3(float.NaN, float.NaN, float.NaN);
                plEIH1_xyz = new Vector3(float.NaN, float.NaN, float.NaN);

                plEyeCenter0_xyz = new Vector3(float.NaN, float.NaN, float.NaN);
                plEyeCenter1_xyz = new Vector3(float.NaN, float.NaN, float.NaN);

                mode = "none";

                if (startWriting && gazeData.MappingContext == GazeData.GazeMappingContext.Binocular)
                {
                    plConfidence = gazeData.Confidence;
                    plTimeStamp  = gazeData.Timestamp;
                    plEIH2_xyz   = gazeData.GazeDirection;

                    plEIH0_xyz = gazeData.GazeNormal0;
                    plEIH1_xyz = gazeData.GazeNormal1;

                    plEyeCenter0_xyz = gazeData.EyeCenter0;
                    plEyeCenter1_xyz = gazeData.EyeCenter1;

                    mode = "binocular";

                    WriteFile();
                }

                //if (startWriting)
                //{

                //    switch (gazeData.MappingContext)
                //    {
                //        case GazeData.GazeMappingContext.Binocular:

                //            plConfidence = gazeData.Confidence;
                //            plTimeStamp = gazeData.Timestamp;
                //            plEIH2_xyz = gazeData.GazeDirection;

                //            plEIH0_xyz = gazeData.GazeNormal0;
                //            plEIH1_xyz = gazeData.GazeNormal1;

                //            plEyeCenter0_xyz = gazeData.EyeCenter0;
                //            plEyeCenter1_xyz = gazeData.EyeCenter1;

                //            mode = "binocular";
                //            break;

                //        case GazeData.GazeMappingContext.Monocular_0:

                //            plConfidence = gazeData.Confidence;
                //            plTimeStamp = gazeData.Timestamp;
                //            plEIH2_xyz = gazeData.GazeDirection;

                //            plEIH0_xyz = gazeData.GazeNormal0;
                //            plEyeCenter0_xyz = gazeData.EyeCenter0;

                //            plEIH1_xyz = new Vector3(float.NaN, float.NaN, float.NaN);
                //            plEyeCenter1_xyz = new Vector3(float.NaN, float.NaN, float.NaN);

                //            mode = "monocular_0";
                //            break;

                //        case GazeData.GazeMappingContext.Monocular_1:

                //            plConfidence = gazeData.Confidence;
                //            plTimeStamp = gazeData.Timestamp;
                //            plEIH2_xyz = gazeData.GazeDirection;

                //            plEIH0_xyz = new Vector3(float.NaN, float.NaN, float.NaN);
                //            plEyeCenter0_xyz = new Vector3(float.NaN, float.NaN, float.NaN);

                //            plEIH1_xyz = gazeData.GazeNormal0;
                //            plEyeCenter1_xyz = gazeData.EyeCenter0;

                //            mode = "monocular_1";
                //            break;

                //    }
                //}
            }
        }