Ejemplo n.º 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
            });
        }
    }
Ejemplo n.º 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
            });
        }
    }
Ejemplo n.º 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;
        }
    }
Ejemplo n.º 4
0
 public void Update()
 {
     if (PSMoveOffset != oldPSMoveOffset)
     {
         PSMoveWorker.GetWorkerInstance().WorkerSettings.PSMoveOffset = this.PSMoveOffset;
     }
     oldPSMoveOffset = PSMoveOffset;
 }
Ejemplo n.º 5
0
    public static void StartWorkerThread(PSMoveWorkerSettings workerSettings)
    {
        if (WorkerInstance == null)
        {
            WorkerInstance = new PSMoveWorker(workerSettings);
        }

        WorkerInstance.Start();
    }
Ejemplo n.º 6
0
    public static PSMoveWorker GetWorkerInstance()
    {
        if (WorkerInstance == null)
        {
            WorkerInstance = new PSMoveWorker();
        }

        return(WorkerInstance);
    }
Ejemplo n.º 7
0
    public void OnApplicationQuit()
    {
        if (ManagerInstance != null)
        {
            PSMoveWorker.GetWorkerInstance().OnGameEnded();

            ManagerInstance = null;
        }
    }
Ejemplo n.º 8
0
 // 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
         });
     }
 }
Ejemplo n.º 9
0
    public static void StartWorkerThread(PSMoveWorkerSettings workerSettings)
    {
        if (WorkerInstance == null)
        {
            WorkerInstance = new PSMoveWorker(workerSettings);
        }

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

        return WorkerInstance; 
    }
Ejemplo n.º 15
0
 public void OnGameEnded()
 {
     WorkerTeardown();
     WorkerInstance = null;
 }