AndersMalmgren / FreePIE

Programmable Input Emulator
633 stars 145 forks source link

Tobii Eye Tracker 5 and FreePie Pitch #200

Open BlueSkyDefender opened 3 years ago

BlueSkyDefender commented 3 years ago

So when looking up and finding out that pitch was not supported on Tobii Eye tracker c4 this comment is understandable. https://github.com/AndersMalmgren/FreePIE/blob/4e51cae1816e3eee915a9629503cb7c188579550/FreePIE.Core.Plugins/TobiiEyeXPlugin.cs#L27

But, now that the Tobii Eye Tracker v5 is out and is said to support pitch now. https://help.tobii.com/hc/en-us/articles/213473765-Head-tracking-specifications

My question is can I just copy all the function "public float Roll { get; private set; }" and replace it with Pitch?

//in   public class TobiiEyeXPlugin : Plugin
private float targetPitch;

public float Pitch { get; private set; }
//in private void EyeDataStreamOnNext(object sender, EyePositionEventArgs eyePositionEventArgs)
//Pitch: Have no idea if this is correct since I don't have a information for this.
targetPitch = (float)Math.Atan2(-eyeOffsetMm.Z, sqrt(eyeOffsetMm.Y*eyeOffsetMm.Y + eyeOffsetMm.X*eyeOffsetMm.X));

Pitch = Lerp(Pitch, targetPitch, 0.6f);

//public class TobiiEyeXGlobal : UpdateblePluginGlobal<TobiiEyeXPlugin>
public float pitch { get { return plugin.Pitch; } }

If not who can I contact to help me get this added/fixed?

AndersMalmgren commented 3 years ago

I don't have access to a tobii eye tracker anymore so can't test. It if you update the sdk and add pitch like you describe it should work

DrunkenTee commented 4 days ago

Did this work for you? I got a Tobii 5 arriving here soon and I wanted to use it for the game Squad as well, which requires FreePIE to make use of Head Trackers.