All CVar definitions can be found in the module cpp files. They are generally defined as close to their main use case as possible. To see an overview of all variables, simply enter “tobii.” in the editor output window, and auto completion will show you the full set. The CVars are divided into categories to make it easier to navigate to the particular functionality you want to modify.
To persist your CVar settings, you can use UE4’s .ini file system. The SDK provides a simple API to help you with this if you don’t want to do it yourself:
//Use these functions to get and set CVars in runtime. UFUNCTION(BlueprintPure, Category = "Tobii Utils") static int32 GetTobiiInt(FString CVarName); UFUNCTION(BlueprintCallable, Category = "Tobii Utils") static void SetTobiiInt(FString CVarName, const int32 NewValue); UFUNCTION(BlueprintPure, Category = "Tobii Utils") static float GetTobiiFloat(FString CVarName); UFUNCTION(BlueprintCallable, Category = "Tobii Utils") static void SetTobiiFloat(FString CVarName, const float NewValue); //If you are persisting your custom CVar values, you should call this function when you start your application. UFUNCTION(BlueprintCallable, Category = "Tobii Utils") static void LoadTobiiSettings(); //If you want to persist a CVar to .ini, use this function. UFUNCTION(BlueprintCallable, Category = "Tobii Utils") static void SaveTobiiSetting(FString CVarSettingToSave);
Some CVars will be more useful than others. These are the ones that we use the most, and we believe you will benefit a lot from knowing by heart.
|tobii.EnableEyetracking||0 – Eyetracking is disabled.|
1 – Eyetracking is enabled.
Turning off eyetracking can be useful for testing that something works for users that don’t have one, or what happens if the eyetracker stops working for whatever reason. This is the easiest way to do it.
|tobii.FocusTraceChannel||This is the trace channel that will be used in all eye tracking queries. This includes GTOM as well as world space gaze queries. Depending on your application, you might have to change this to get your desired behavior.|
|tobii.MaximumTraceDistance||This is how far in front of the player we can detect objects. This could impact game play so be careful. Shorter range can also positively impact performance. At some point in your project, you should take some time to determine what to set this value to.|
|tobii.EnableCleanUI||0 – CleanUI is disabled.|
1 – CleanUI is enabled.
CleanUI can be extremely distracting during certain game events, like canned animations. You can turn it off globally using this variable.
|tobii.debug||0 – Eyetracking debug visualizations are disabled.|
1 – Eyetracking debug visualizations are enabled.
This is extremely useful when trying to figure out why something eyetracking related isn’t working.
|tobii.debug.DisplayGTOMVisibilityRays||1 means we visualize the rays from GTOM.|
If you have a problem with the GTOM, this should be the first thing you try to verify that the GTOM system can see your primitives.
|tobii.debug.DisplayG2OMCandidateSet||1 will visualize all bounds calculated in G2OM.|
This is useful to test for math errors. If you have a problem with the GTOM, this should be the second thing you try to verify that the GTOM system correctly interprets your primitives’ bounds.
|tobii.emulation.EnableEyetrackingEmulation||0 – Don’t emulate eye tracking.|
1 – Emulate eye tracking.
If you happen to be without an eyetracker, or if you want to test something very specific, the built-in eyetracking emulator is extremely useful. By default, it will direct a ray in the direction of the HMD, but you can change this direction using the arrow keys.
|tobii.FreezeGazeData||0 – Eyetracking data is not frozen.|
1 – Eyetracking data is frozen.
This is really useful for visualizing gaze and debugging.