Skip to content

Commit

Permalink
Remove IsViveProEye to init
Browse files Browse the repository at this point in the history
  • Loading branch information
benaclejames committed Mar 23, 2023
1 parent b77b8e4 commit 014f0b1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions SRanipalExtTrackingModule/SRanipalTrackingInterface.cs
Expand Up @@ -18,7 +18,7 @@ public class SRanipalExtTrackingInterface : ExtTrackingModule
{
LipData_v2 lipData = default;
EyeData_v2 eyeData = default;
private static bool eyeEnabled = false, lipEnabled = false;
private static bool eyeEnabled = false, lipEnabled = false, isViveProEye = false;

private static CancellationTokenSource _cancellationToken;

Expand All @@ -41,6 +41,8 @@ public override (bool eyeSuccess, bool expressionSuccess) Initialize(bool eyeAva

if (eyeEnabled && Utils.HasAdmin)
{
isViveProEye = SRanipal_Eye_API.IsViveProEye();

var found = false;
int tries = 0;
while (!found && tries < 15)
Expand Down Expand Up @@ -263,7 +265,7 @@ private void UpdateEyeParameters(ref UnifiedEyeData data, VerboseData external)
if (external.right.GetValidity(SingleEyeDataValidity.SINGLE_EYE_DATA_PUPIL_DIAMETER_VALIDITY))
data.Right.PupilDiameter_MM = external.right.pupil_diameter_mm;

if (SRanipal_Eye_API.IsViveProEye())
if (isViveProEye)
{
if (external.left.GetValidity(SingleEyeDataValidity.SINGLE_EYE_DATA_GAZE_DIRECTION_VALIDITY))
data.Left.Gaze = external.left.gaze_direction_normalized.FlipXCoordinates();
Expand Down

0 comments on commit 014f0b1

Please sign in to comment.