Ejemplo n.º 1
0
    void Start()
    {
        var caps = Fove.ClientCapabilities.EyeTorsion
                   | Fove.ClientCapabilities.EyeballRadius
                   | Fove.ClientCapabilities.IrisRadius
                   | Fove.ClientCapabilities.PupilRadius
                   | Fove.ClientCapabilities.UserIOD
                   | Fove.ClientCapabilities.UserIPD;

        FoveManager.RegisterCapabilities(caps);
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        FoveManager.RegisterCapabilities(Fove.ClientCapabilities.EyesImage | Fove.ClientCapabilities.EyeShape);

        for (var i = 0; i < EyeShape.OutlinePointCount; ++i)
        {
            eyePointsLeft[i]  = (GameObject)Instantiate(eyePointPrefab, eyePointRootLeft, false);
            eyePointsRight[i] = (GameObject)Instantiate(eyePointPrefab, eyePointRootRight, false);

            var size = 7f;
            eyePointsLeft[i].transform.localScale  = size * new Vector3(1, -1, 1);
            eyePointsRight[i].transform.localScale = size * new Vector3(1, -1, 1);

            eyePointsLeft[i].GetComponentInChildren <Text>().text  = i.ToString();
            eyePointsRight[i].GetComponentInChildren <Text>().text = i.ToString();
        }
    }
Ejemplo n.º 3
0
    // Use this for initialization
    void Start()
    {
        FoveManager.RegisterCapabilities(Fove.ClientCapabilities.GazedObjectDetection);

        if (gazedReference == null)
        {
            gazedReference = gameObject;
        }

        var renderer = GetComponent <Renderer>();

        if (renderer != null)
        {
            mat = GetComponent <Renderer>().material;
        }
        else
        {
            mat = GetComponent <Image>().material;
        }
    }
Ejemplo n.º 4
0
    private Stopwatch stopwatch = new Stopwatch(); // Unity Time.time can't be use outside of main thread.

    // Use this for initialization.
    void Start()
    {
        stopwatch.Start();
        if (!Stopwatch.IsHighResolution)
        {
            Debug.LogWarning("High precision stopwatch is not supported on this machine. Recorded frame times may not be highly accurate.");
        }

        // Check to make sure that the FOVE interface variable is assigned. This prevents a ton of errors
        // from filling your log if you forget to assign the interface through the inspector.
        if (fove == null)
        {
            Debug.LogWarning("Forgot to assign a Fove interface to the FOVERecorder object.");
            enabled = false;
            return;
        }

        var caps = ClientCapabilities.EyeTracking;

        if (exportFields.GazeDepth)
        {
            caps |= ClientCapabilities.GazeDepth;
        }
        if (exportFields.PupilsRadius)
        {
            caps |= ClientCapabilities.PupilRadius;
        }
        if (exportFields.GazedObject)
        {
            caps |= ClientCapabilities.GazedObjectDetection;
        }
        if (exportFields.EyeTorsion)
        {
            caps |= ClientCapabilities.EyeTorsion;
        }
        if (exportFields.UserPresence)
        {
            caps |= ClientCapabilities.UserPresence;
        }
        if (exportFields.UserAttentionShift)
        {
            caps |= ClientCapabilities.UserAttentionShift;
        }
        if (exportFields.IPD)
        {
            caps |= ClientCapabilities.UserIPD;
        }
        if (exportFields.IOD)
        {
            caps |= ClientCapabilities.UserIOD;
        }
        if (exportFields.EyeballRadius)
        {
            caps |= ClientCapabilities.EyeballRadius;
        }
        if (exportFields.EyeShape)
        {
            caps |= ClientCapabilities.EyeShape;
        }
        if (exportFields.PupilShape)
        {
            caps |= ClientCapabilities.PupilShape;
        }

        FoveManager.RegisterCapabilities(caps);

        // We set the initial data slice capacity to the expected size + 1 so that we never waste time reallocating and
        // copying data under the hood. If the system ever requires more than a single extra entry, there is likely
        // a severe problem causing delays which should be addressed.
        dataSlice = new AggregatedData(writeAtDataCount + 1);

        // If overwrite is not set, then we need to make sure our selected file name is valid before proceeding.
        if (!Directory.Exists(OutputFolder))
        {
            Directory.CreateDirectory(OutputFolder);
        }
        {
            string testFileName = Path.Combine(OutputFolder, outputFileName + ".csv");
            if (!overwriteExistingFile)
            {
                int counter = 1;
                while (File.Exists(testFileName))
                {
                    testFileName = Path.Combine(OutputFolder, outputFileName + "_" + (counter++) + ".csv"); // e.g., "results_12.csv"
                }
            }
            outputFileName = testFileName;

            Debug.Log("Writing data to " + outputFileName);
        }

        dataToWrite.Enqueue(new DataHeaderSerializer(exportFields));

        // Create the write thread to call "WriteThreadFunc", and then start it.
        writeThread = new Thread(WriteThreadFunc);
        writeThread.Start();

        StartCoroutine(JobsSpawnerCoroutine());
    }
Ejemplo n.º 5
0
    void Start()
    {
        var caps = Fove.ClientCapabilities.EyesImage | Fove.ClientCapabilities.PositionImage;

        FoveManager.RegisterCapabilities(caps);
    }