Check manually if an object is in focus

Home Forums XR Discussions Check manually if an object is in focus

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #9139
    Eduardo Garcia
    Participant

    Hi,
    I’m doing some simulation with VR and Tobii eyetracking. I want to check if an object is in focus at a particular time. I have only found in the examples how to check when the gaze has changed with

    public void GazeFocusChanged(bool hasFocus)

    from IGazeFocusable interface. But this is only triggered when there is a change in the state of the object gaze. How can I check if the object is in focus whenever I want (like in the Update() of the object’s script).

    Thanks in advance

    #9163
    Henke Andersson
    Participant

    Hi.
    If you want to know if the object has gaze focus at any time, you can just store the hasFocus in a field every time its changed, like:

    public void GazeFocusChanged(bool hasFocus)
    {
    _hasFocus = hasFocus;
    }

    void Update()
    {
    if(_hasFocus)……
    }
    Hope it helps.
    /H

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