Home Forums Unity SDK Can’t get terrain focus in Unity

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #20323
    Jesús
    Participant

    Hello, I am using HTC VIVE PRO EYE and I am trying to get when the users look at the ground in my game so, I added a script to my terrain with the IGazeFocusable but it never detects the focus. The terrain has a Terrain Collider so I suppose that maybe the gaze ray is not hitting with terrain colliders. Any help?

    I am using the HTC VIVE PRO EYE hardware, SRanipal SDK 1.3.2.0 and TobiiXRSDK 2.1.1.177

    Thanks!

    #20325
    Jesús
    Participant

    After some research I reached the conclusion that the terrain is beeing discarded because in the function called “UpdateListOfFocusedCandidates” in “G2OM.cs” the score of my terrain is 0 so here: if (candidate.score <= Mathf.Epsilon) break; the candidate is discarded. I don’t know where this score comes from but it seems to be my problem.

    #20355
    Grant [Tobii]
    Keymaster

    Hi @moreno, thanks for reaching out and providing us an update. As you may now be aware, Terrain Colliders are not supported in G2OM so you will need to add an actual collider to the objects you wish to investigate focus upon. Hopefully that makes sense, do let us know how you get on. Best Wishes.

    #20356
    Jesús
    Participant

    But the terrain is being detected. The problem is that the score given to the terrain is 0. Is it 0 because of the terrain collider?

    #20386
    Jesús
    Participant

    UPDATE: I found the function that check the colliders and I modified it so it also detects TerrainCollider. Now the problem is inside a dll function called “G2OM_Process”. That’s the function that is returning score 0 although now TerrainCollider is being detected. I can’t access to that .dll so I suppose that I can’t reach a solution to this problem.

    #20395
    Grant [Tobii]
    Keymaster

    Thanks for the update Jesus. Yes, as terrain colliders work different to regular colliders, I’m afraid that the G20M Process does not support this type. Depending on your design, you could replace with a regular object of appropriate size, but if you let us know what you are trying to do, we would be pleased to try and find a solution for your needs.

    #20400
    Jesús
    Participant

    What I am trying to do this to detect when the user looks at the ground. I can’t use box collider due to the terrain orography but I am trying to generate a mesh with the terrain data so I can use mesh collider.

    Thanks for the help.

    #20410
    Grant [Tobii]
    Keymaster

    OK, shame you can’t use a box collider as unfortunately that seemed that the best workaround we can propose. Any colliders you create on other geometries such as sphere, capsule or mesh will be converted by G20M as a box. Apologies we cannot offer a better solution, best wishes.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.