FOVE SUPPORT CENTER

Unreal Engine plugin world space location

Comments

19 comments

  • Avatar
    Scott Harper

    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.

    0
    Comment actions Permalink
  • Avatar
    Philip Weiss

    Is there some example code you could provide to help me and other Unreal developers get started? That would be very helpful. Thanks.

    0
    Comment actions Permalink
  • Avatar
    Lochlainn Wilson

    Hi Philip,

    Just to clarify, is our Unreal plugin insufficient for this?

    1
    Comment actions Permalink
  • Avatar
    Philip Weiss

    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.

    1
    Comment actions Permalink
  • Avatar
    Philip Weiss

    I'm still not sure how to get the eye gaze vectors and starting positions in world space. Can anyone help with this please? Thanks.

    0
    Comment actions Permalink
  • Avatar
    Jeff

    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.

    0
    Comment actions Permalink
  • Avatar
    Philip Weiss

    I'm getting the error

    2>D:\My Documents\Unreal Engine Projects\foveTest\Source\foveTest\foveTestCharacter.cpp(311): error C2653: 'FoveHMD': is not a class or namespace name

    I'm not exactly sure why that's happening. I included FoveHMD.h in the header file for foveTestCharacter.

    0
    Comment actions Permalink
  • Avatar
    Jeff

    You need to include the FoveHMD and FoveVR modules in your dependencies, then the header should be available. See:

    https://support.getfove.com/hc/en-us/community/posts/115007895668-How-to-Access-Gaze-Convergence-Data-with-Unreal-Engine-/comments/115000644274

    0
    Comment actions Permalink
  • Avatar
    Philip Weiss

    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!

    0
    Comment actions Permalink
  • Avatar
    Jeff

    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.

    0
    Comment actions Permalink
  • Avatar
    Philip Weiss

    I'm not very familiar with Blueprints because I only learned how to do everything with C++.

    Thanks for looking into it more. Would it help if I sent you my project files?

    0
    Comment actions Permalink
  • Avatar
    Jeff

    Yeah, if that's not a problem, that would help me out. Either your project or a minimized version of it that's not working on your end. If you submit via ticket you should be able to attach documents.

    0
    Comment actions Permalink
  • Avatar
    Philip Weiss

    Ok, I just submitted the ticket with my project. Please let me know if you find the problem. Thanks!

    Also, it might be helpful for myself and others if you posted your test project so there's at least some kind of example to use to get started.

    0
    Comment actions Permalink
  • Avatar
    Philip Weiss

    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

    0
    Comment actions Permalink
  • Avatar
    Philip Weiss

    Hi. Were you (or anyone else) able to look at my code to see what's wrong? I'd really appreciate any help. Thanks!

    0
    Comment actions Permalink
  • Avatar
    Jeff

    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!

    0
    Comment actions Permalink
  • Avatar
    Philip Weiss

    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.dll

    Any other ideas? Thanks.

    0
    Comment actions Permalink
  • Avatar
    Philip Weiss

    Does anyone have any other ideas? Thanks. Also, this question is marked as answered, but I'm still having problems.

    0
    Comment actions Permalink
  • Avatar
    jeremy

    Dear Philip,

    I have removed the <answered> tag. Hopefully we can solicit an answer for you soon.

    Cheers

    0
    Comment actions Permalink

Please sign in to leave a comment.