VrgHmd.cs class public API

  • You can access additional functionality of the VrgHmd class in your custom scripts through the VrgHmd component
    • If your script is attached to the same game object as the VrgHmd component, you can just use the GetComponent method to initialize your VrgHmd variable, and then you can access any of the public properties and methods mentioned below
    • VrgHmd hmd = GetComponent<VrgHmd>();
  • public properties:
    • bool IsTracked = true;
      • this property can be used to get or set the tracking status during runtime
      • when set to false, the camera/view will not move according to the headset movement, but it will stay at static position in the scene
    • GameObject TrackedExternalObject;
      • this object will be used to track the rotation and position of the headset when the tracking option in XTAL tray icon is set to ‘External’
  • public methods:
    • void Calibrate()
      • use this method to calibrate the tracking sensor (reset default position and rotation)
      • the same method is also called when pressing the predefined ‘Calibration Key’
    • Quaternion GetInternalQuaternion()
      • use this method to get the current headset rotation in a Quaternion format
    • void RunAutoInterpupillaryDistance()
      • use this method to start the Auto IPD process, which will measure the distance between users’ eyes and set the lenses to appropriate positions
      • this also prepares a simple eye tracking calibration
      • the AutoIPD process can also be started through the XTAL tray icon menu
    • void EyeTrackingCalibrate()
      • use this method to start the advanced eye tracking calibration
      • the advanced eye tracking calibration can also be started on the Eyes page of the XTAL runtime settings menu
    • void EnableEyeTracking(bool enabled)
      • use this method to enable or disable the eye tracking functionality
      • eye tracking first needs to be calibrated by calling the EyeTrackingCalibrate or RunAutoInterpupillaryDistance methods
      • eye tracking can also be enabled or disabled on the Eyes page of the XTAL runtime settings menu
    • void GetEyeTrackingRays(out VRgEyeTrackingResult leftEye, out VRgEyeTrackingResult rightEye)
      • use this method to get current eye tracking results for left and right eye
      • eye tracking should first be enabled by the EnableEyeTracking method
      • the output format for the eye tracking results is the VRgEyeTrackingResult structure
        • public struct VRgEyeTrackingResult{public Vector2 ImageUV; public Vector3 EyePosition; public Vector3 EyeRay; public float Area; public double TimeS;}
        • ImageUV
          • currently unused, will always return (0,0) vector
        • EyePosition
          • position of the middle of the eye relative to the main camera
          • the EyePosition is measured according to the headsets’ optical system and current IPD settings
        • EyeRay
          • normalized gaze ray vector, contains current eye gaze ray position one meter from the eye
        • Area
          • currently unused, will always return 0
        • TimeS
          • time passed in seconds, since the level has been loaded

This page was last modified on March 21st, 2023 at 12:04

< PreviousNext >