Ejemplo n.º 1
0
 public TrackIRTracker()
 {
     Debug.Log("[KerbTrack] Initialising TrackIR...");
     trackIRclient = new TrackIRUnity.TrackIRClient();
     string status;
     if (trackIRclient == null)
         status = "Failed to start.";
     else
         status = trackIRclient.TrackIR_Enhanced_Init();
     Debug.Log("[KerbTrack] TrackIR status: " + status);
 }
Ejemplo n.º 2
0
    public TrackIRTracker()
    {
        Debug.Log("[KerbTrack] Initialising TrackIR...");

        // TrackIRUnity's init throws a NullRef if the DLL location isn't found.
        // Check this before starting.
        bool        keyFound    = false;
        RegistryKey registryKey = Registry.CurrentUser.OpenSubKey("Software\\NaturalPoint\\NATURALPOINT\\NPClient Location", false);

        if (registryKey != null && registryKey.GetValue("Path") != null)
        {
            keyFound = true;
        }
        registryKey.Close();

        string status;

        if (keyFound)
        {
            trackIRclient = new TrackIRUnity.TrackIRClient();
            if (trackIRclient == null)
            {
                status = "Failed to start.";
            }
            else
            {
                status = trackIRclient.TrackIR_Enhanced_Init();
            }
        }
        else
        {
            status = "TrackIR not installed";
        }

        Debug.Log("[KerbTrack] TrackIR status: " + status);
    }
Ejemplo n.º 3
0
        /// <summary>
        /// Get the trackIR client
        /// </summary>
        /// <returns></returns>
        private TrackIRClient GetTrackIR()
        {
            TrackIRClient trackIR = new TrackIRClient();

            return(trackIR);
        }
Ejemplo n.º 4
0
 public TrackIRWrapper()
 {
     _trackIR = GetTrackIR();
 }