Beispiel #1
0
    // Private methods
    private void Setup()
    {
        if (ManagerInstance == null)
        {
#if LOAD_DLL_MANUALLY
            if (IntPtr.Size == 8)
            {
                psmoveapiHandle        = LoadLib("Assets/Plugins/x86_64/psmoveapi.dll");
                psmoveapiTrackerHandle = LoadLib("Assets/Plugins/x86_64/psmoveapi_tracker.dll");
            }
            else
            {
                psmoveapiHandle        = LoadLib("Assets/Plugins/x86/psmoveapi.dll");
                psmoveapiTrackerHandle = LoadLib("Assets/Plugins/x86/psmoveapi_tracker.dll");
            }
#endif

            ManagerInstance = this;
            PSMoveHitchWatchdog.EmitHitchLogging = this.EmitHitchLogging;
            PSMoveWorker.StartWorkerThread(
                new PSMoveWorkerSettings()
            {
                Multithreaded        = this.UseMultithreading,
                UseManualExposure    = this.UseManualExposure,
                ManualExposureValue  = this.ManualExposureValue,
                InitialTrackingColor = this.InitialTrackingColor,
                PSMoveOffset         = this.PSMoveOffset,
                Filter3DType         = this.Filter3DType,
                DisableTracking      = this.DisableTracking,
                ApplicationDataPath  = Application.dataPath
            });
        }
    }
Beispiel #2
0
    // Private methods
    private void Setup()
    {
        if (ManagerInstance == null)
        {
#if LOAD_DLL_MANUALLY
            if (IntPtr.Size == 8)
            {
                cleyeHandle            = IntPtr.Zero;
                psmoveapiHandle        = LoadLib("Assets/Plugins/x86_64/psmoveapi.dll");
                psmoveapiTrackerHandle = LoadLib("Assets/Plugins/x86_64/psmoveapi_tracker.dll");
            }
            else
            {
                cleyeHandle            = LoadLib("c:/Windows/SysWOW64/CLEyeMulticam.dll");
                psmoveapiHandle        = LoadLib("Assets/Plugins/x86/psmoveapi.dll");
                psmoveapiTrackerHandle = LoadLib("Assets/Plugins/x86/psmoveapi_tracker.dll");
            }
#endif

            ManagerInstance = this;
            PSMoveHitchWatchdog.EmitHitchLogging = this.EmitHitchLogging;
            PSMoveWorker.StartWorkerThread(
                new PSMoveWorkerSettings()
            {
                CameraAPI            = this.CameraAPI,
                Multithreaded        = this.UseMultithreading,
                UseManualExposure    = this.UseManualExposure,
                ManualExposureValue  = this.ManualExposureValue,
                InitialTrackingColor = this.InitialTrackingColor,
                DisableTracking      = this.DisableTracking,
                ApplicationDataPath  = Application.dataPath
            });
        }
    }
Beispiel #3
0
    private void Shutdown()
    {
        if (ManagerInstance != null)
        {
            PSMoveWorker.StopWorkerThread();

            //Free any manually loaded DLLs
            if (psmoveapiTrackerHandle != IntPtr.Zero)
            {
                FreeLibrary(psmoveapiTrackerHandle);
            }

            if (psmoveapiHandle != IntPtr.Zero)
            {
                FreeLibrary(psmoveapiHandle);
            }

            if (cleyeHandle != IntPtr.Zero)
            {
                FreeLibrary(cleyeHandle);
            }

            ManagerInstance = null;
        }
    }
 public void Update()
 {
     if (PSMoveOffset != oldPSMoveOffset)
     {
         PSMoveWorker.GetWorkerInstance().WorkerSettings.PSMoveOffset = this.PSMoveOffset;
     }
     oldPSMoveOffset = PSMoveOffset;
 }
Beispiel #5
0
    public static void StartWorkerThread(PSMoveWorkerSettings workerSettings)
    {
        if (WorkerInstance == null)
        {
            WorkerInstance = new PSMoveWorker(workerSettings);
        }

        WorkerInstance.Start();
    }
    public static PSMoveWorker GetWorkerInstance()
    {
        if (WorkerInstance == null)
        {
            WorkerInstance = new PSMoveWorker();
        }

        return(WorkerInstance);
    }
    public void OnApplicationQuit()
    {
        if (ManagerInstance != null)
        {
            PSMoveWorker.GetWorkerInstance().OnGameEnded();

            ManagerInstance = null;
        }
    }
 // Unity Callbacks
 public void Awake()
 {
     if (ManagerInstance == null)
     {
         ManagerInstance = this;
         PSMoveHitchWatchdog.EmitHitchLogging = this.EmitHitchLogging;
         PSMoveWorker.GetWorkerInstance().OnGameStarted(
             new PSMoveWorkerSettings()
         {
             bUseManualExposure   = this.UseManualExposure,
             ManualExposureValue  = this.ManualExposureValue,
             InitialTrackingColor = this.InitialTrackingColor,
             PSMoveOffset         = this.PSMoveOffset,
             Filter3DType         = this.Filter3DType,
             bTrackerEnabled      = this.TrackerEnabled,
             ApplicationDataPath  = Application.dataPath
         });
     }
 }
    public static void StartWorkerThread(PSMoveWorkerSettings workerSettings)
    {
        if (WorkerInstance == null)
        {
            WorkerInstance = new PSMoveWorker(workerSettings);
        }

        WorkerInstance.Start();
    }
Beispiel #10
0
 public void ReleasePSMove(PSMoveDataContext DataContext)
 {
     PSMoveWorker.GetWorkerThreadInstance().ReleasePSMove(DataContext);
 }
Beispiel #11
0
 public PSMoveDataContext AcquirePSMove(int PSMoveID)
 {
     return(PSMoveWorker.GetWorkerThreadInstance().AcquirePSMove(PSMoveID));
 }
Beispiel #12
0
 void Update()
 {
     PSMoveWorker.UpdateWorker();
 }
 public void OnGameEnded()
 {
     WorkerTeardown();
     WorkerInstance = null;
 }
    public static PSMoveWorker GetWorkerInstance()
    {
        if (WorkerInstance == null)
        {
            WorkerInstance = new PSMoveWorker();
        }

        return WorkerInstance; 
    }
 public void OnGameEnded()
 {
     WorkerTeardown();
     WorkerInstance = null;
 }