Home Forums Unity SDK GazeRay hit location to vector3 coordinates [Unity]

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #8762
    Matt Smith
    Participant

    Hi,

    I am developing using the VR integration for Unity using the Tobii XR SDK. I am fiddling around trying to get to grips with the SDK and I am trying to create a script that will replicate the MoveToClickPoint Unity Script (below) by moving the object to Gaze.

     // MoveToClickPoint.cs
        using UnityEngine;
        using UnityEngine.AI;
        
        public class MoveToClickPoint : MonoBehaviour {
            NavMeshAgent agent;
            
            void Start() {
                agent = GetComponent<NavMeshAgent>();
            }
            
            void Update() {
                if (Input.GetMouseButtonDown(0)) {
                    RaycastHit hit;
                    
                    if (Physics.Raycast(Camera.main.ScreenPointToRay(Input.mousePosition), out hit, 100)) {
                        agent.destination = hit.point;
                    }
                }
            }
        }
    

    Any direction how I can get a Vector3 for the hit point of the users Gaze would be really helpful.

    Thanks

    Matt

    #8768
    Grant [Tobii]
    Keymaster

    Hi @mattsmith2, could you kindly confirm which hardware you are using for this setup? If indeed you already own a Tobii Pro Device, then it is recommended you reach to Tobii Pro support directly who can provide you a dedicated service.
    You can reach them @ http://www.tobiipro.com/contact/contact-support/

    Alternatively, please provide the details of your setup, and we will endeavour to assist you promptly. Thanks.

    #8769
    Matt Smith
    Participant

    Hi Grant,

    I am using the Tobii Pro Vive HMD, I have actually solved the issue now. I have been using the TobiiXR SDK for unity rather than the Tobii Pro one. What’s the difference between the two and would you recommend one over the other ?

    #8786
    Grant [Tobii]
    Keymaster

    Hi @mattsmith2, apologies for the delay in reply.. both the Tobii Pro SDK and XR SDK belong to different business so getting a comparison took longer than expected.

    So, the principal difference between the two SDK’s is the XR SDK is aimed at usage within Interaction Applications only whilst the Pro SDK permits usage for analysis and research use. Any intention to use the XR SDK for analysis requires the purchase of a special licence to do so.

    In addition, the Pro SDK can create and handle custom calibration routines, the XR SDK relies on the Tobii Core Software integrated Calibration Program to operate.

    Otherwise, the differences are slight so it really depends on your project intentions.
    Please let us know if we can be of any further assistance.

    #11318

    I’ve moved from Tobii retrofit Vive to a Vive Pro Eye and also from Tobii Pro SDK to XR SDK for Unity and from what I’ve seen you can’t subscribe to gaze events in XR compared to Pro which is a shame.

    #11319
    Alex [Tobii]
    Participant

    Hi @theodore !

    Could you please elaborate why you want to have events for gaze points (or you are talking about fixations?)

    You can always poll the gaze data in your Update() function using TobiiXR.EyeTrackingData.CombinedRay

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