/// <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); }
private int iV_GetSample(ref SDKSampleStruct rawDataSample) { return Unmanaged_GetSample(ref rawDataSample); }
private static extern int Unmanaged_GetSample(ref SDKSampleStruct rawDataSample);
/// <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; } }
private int iV_GetSample(ref SDKSampleStruct rawDataSample) { return(Unmanaged_GetSample(ref rawDataSample)); }