Unreal Engine plugin world space location
I'm not quite sure what the GetEyeGaze_inWorldSpace function returns. It seems like the vector's components are between 0.0f and 1.0f, but I'm not sure exactly what that corresponds to. I want to get the coordinates in 3D world space to use for ray tracing. It wasn't too hard to do with the Tobii EyeX Unreal Engine plugin, but I'm not sure how to do it with FOVE.
Thanks.
-
The function you're referring to is returning a unit vector with an origin at the specified eye's origin point (likely where your eye camera originates). I believe the value is also an HMD-relative vector (meaning it won't change just because you rotate your head), but I'll talk to the guy who worked on that most recently for verification for you.
-
I did figure out how to get the FOVE plugin to work. I think it would be possible to calculate where the player is looking in the world space, but it seems very complicated and I'm not very familiar with the math it would take to do it. So it would be helpful if there was a function like the one in the Tobii EyeX SDK. And maybe adding more of the features of the EyeX SDK to FOVE would make it more attractive to developers. Thanks.
-
Hi Philip,
To get the gaze vectors in world space on the latest version of the plugin, you can query "FoveHMD::GetGazeVector" (C++) or "Fove->Get Gaze Vector" (Blueprints) then rotate it by the camera's rotation, which you can get from the player camera manager.
If you then add that to the camera's position, you can use that as the location of an indicator, eg a sphere, to visualize the gaze on screen.
-
You need to include the FoveHMD and FoveVR modules in your dependencies, then the header should be available. See:
-
I think I did that. That line in my .Build.cs file is:
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "HeadMountedDisplay", "FoveHMD", "FoveVR" });
Is that what you mean?
If I use FFoveHMD instead, it gets past the error in my last post, but gives a linker error:
2>foveTestCharacter.cpp.obj : error LNK2019: unresolved external symbol "public: bool __cdecl FFoveHMD::GetGazeVector(bool,struct FVector *,struct FVector *)const " (?GetGazeVector@FFoveHMD@@QEBA_N_NPEAUFVector@@1@Z) referenced in function "public: virtual void __cdecl AfoveTestCharacter::Tick(float)" (?Tick@AfoveTestCharacter@@UEAAXM@Z)
I'm calling the function like this:
FVector *leftEye = new FVector(), *rightEye = new FVector();
FFoveHMD::Get()->GetGazeVector(true, leftEye, rightEye);
Thanks for your help!
-
Strange. The module itself is FoveHMD, not FFoveHMD. FFoveHMD is only the class name. So I'm surprised that improved the situation at all. The linker error means the headers were found but the module's compiled binary wasn't linked, so something is clearly up.
Out of curiousity, are you able to use the FoveVR functions from blueprints?
That said, your original version looks roughly the same as my test setup. Sorry it's not working for you yet, I'm going to do some poking around and see if I can find what's up.
-
Actually, I think the file was too big so attaching it to the ticket didn't work. So here's a link to the project: https://drive.google.com/file/d/0BzI4oc2Jl6EKcWNmRlFkTUZrZ0U/view?usp=sharing
-
Hi Philip,
Sorry for the delays. I figured out the issue with the help of your test project.
First, in your test project, you need to include FoveHMD.h at the top of foveTestCharacter2.cpp, and change "FoveHMD::" to "FFoveHMD::". That gets it compiling.
A link error then occurs saying that it can't find the functions you're calling on FFoveMD. This problem is on our end. The FFoveHMD class need to be declared as exported. I will fix this for the next version, but in the mean time you just need to change
"class FFoveHMD" to "class FOVEHMD_API FFoveHMD" in FoveHMD.h
That should fix the link error.
Let me know if that works out for you!
-
Thanks. I tried it, but I'm still getting a linker error.
Creating library D:\My Documents\Unreal Engine Projects\foveTest2\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-foveTest2.lib and object D:\My Documents\Unreal Engine Projects\foveTest2\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-foveTest2.exp
2>foveTest2Character.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class FFoveHMD * __cdecl FFoveHMD::Get(void)" (__imp_?Get@FFoveHMD@@SAPEAV1@XZ) referenced in function "public: virtual void __cdecl AfoveTest2Character::Tick(float)" (?Tick@AfoveTest2Character@@UEAAXM@Z)
2>foveTest2Character.cpp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: bool __cdecl FFoveHMD::GetGazeVector(bool,struct FVector *,struct FVector *)const " (__imp_?GetGazeVector@FFoveHMD@@QEBA_N_NPEAUFVector@@1@Z) referenced in function "public: virtual void __cdecl AfoveTest2Character::Tick(float)" (?Tick@AfoveTest2Character@@UEAAXM@Z)
2>D:\My Documents\Unreal Engine Projects\foveTest2\Binaries\Win64\UE4Editor-foveTest2.dll : fatal error LNK1120: 2 unresolved externals
2>ERROR : UBT error : Failed to produce item: D:\My Documents\Unreal Engine Projects\foveTest2\Binaries\Win64\UE4Editor-foveTest2.dllAny other ideas? Thanks.
Please sign in to leave a comment.
Comments
19 comments