Exemplo n.º 1
0
 /// <summary>
 /// Write the SampleData into the gazeModel
 /// </summary>
 /// <param name="sampleData"></param>
 private void GetSampleCallbackFunction(SDKSampleStruct sampleData)
 {
     //Update the Samples in the model
     gazeModel.WriteEyeSamplesInGazeModel(sampleData);
 }
Exemplo n.º 2
0
 private int iV_GetSample(ref SDKSampleStruct rawDataSample)
 {
     return Unmanaged_GetSample(ref rawDataSample);
 }
Exemplo n.º 3
0
 private static extern int Unmanaged_GetSample(ref SDKSampleStruct rawDataSample);
Exemplo n.º 4
0
    /// <summary>
    /// Write the Data into the gazeModel
    /// </summary>
    /// <param name="leftEye"></param>
    /// <param name="rightEye"></param>
    /// <returns></returns>
    public bool WriteEyeSamplesInGazeModel(SDKSampleStruct dataSample)
    {
        try
            {
                Vector2 leftEyeGaze = new Vector2((float)dataSample.leftEye.gazeX, (float)dataSample.leftEye.gazeY);
                Vector3 leftEyePosition = new Vector3((float)dataSample.leftEye.eyePositionX, (float)dataSample.leftEye.eyePositionY, (float)dataSample.leftEye.eyePositionZ);

                Vector2 rightEyeGaze = new Vector2((float)dataSample.rightEye.gazeX, (float)dataSample.rightEye.gazeY);
                Vector3 rightEyePosition = new Vector3((float)dataSample.rightEye.eyePositionX, (float)dataSample.rightEye.eyePositionY, (float)dataSample.rightEye.eyePositionZ);

        #if UNITY_EDITOR

                //Remove the Offset from the Topbar of the Editor
                leftEyeGaze.y -= 110f;
                rightEyeGaze.y -= 110f;
        #endif
                EyeSample leftEye = new EyeSample(leftEyeGaze, leftEyePosition, dataSample.leftEye.diam);
                EyeSample rightEye = new EyeSample(rightEyeGaze, rightEyePosition, dataSample.rightEye.diam);

                this.dataSample = new SampleData(leftEye, rightEye, dataSample.timestamp);

                return true;
            }
            catch (System.Exception e)
            {
                UnityEngine.Debug.LogException(e);
                return false;
            }
    }
Exemplo n.º 5
0
 private int iV_GetSample(ref SDKSampleStruct rawDataSample)
 {
     return(Unmanaged_GetSample(ref rawDataSample));
 }
Exemplo n.º 6
0
 private static extern int Unmanaged_GetSample(ref SDKSampleStruct rawDataSample);
Exemplo n.º 7
0
 /// <summary>
 /// Write the SampleData into the gazeModel
 /// </summary>
 /// <param name="sampleData"></param>
 private void GetSampleCallbackFunction(SDKSampleStruct sampleData)
 {
     //Update the Samples in the model
     gazeModel.WriteEyeSamplesInGazeModel(sampleData);
 }