Esempio n. 1
0
            private void EnsureStarted()
            {
                if (!_dllFixed)
                {
                    DLLSearchPathFixer.fix();
                    _dllFixed = true;
                }

                if (_contextObject == null)
                {
                    if (0 == AppID.Length)
                    {
                        Debug.LogError("[OSVR-Unity] ClientKit instance needs AppID set to a reverse-order DNS name! Using dummy name...");
                        AppID = "com.osvr.osvr-unity.dummy";
                    }
                    Debug.Log("[OSVR-Unity] Starting with app ID: " + AppID);
                    _contextObject = new OSVR.ClientKit.ClientContext(AppID, 0);
                }

                //check if the server is running
                if (!_contextObject.CheckStatus())
                {
                    if (!_osvrServerError)
                    {
                        _osvrServerError = true;
                        Debug.LogError("[OSVR-Unity] OSVR Server not detected. Start OSVR Server and restart the application.");
                    }
                }
                else if (_osvrServerError)
                {
                    Debug.Log("[OSVR-Unity] OSVR Server connection established. You can ignore previous errors about the server not being detected.");
                    _osvrServerError = false;
                }
            }
 //Shutdown RenderManager and Dispose of the ClientContext we created for it
 public void ExitRenderManager()
 {
     ShutdownRenderManager();
     if (null != _renderManagerClientContext)
     {
         _renderManagerClientContext.Dispose();
         _renderManagerClientContext = null;
     }
 }
Esempio n. 3
0
 void Stop()
 {
     if (null != _contextObject)
     {
         Debug.Log("Shutting down OSVR.");
         _contextObject.Dispose();
         _contextObject = null;
     }
 }
Esempio n. 4
0
 public VRHead(GraphicsDeviceManager graphicsDeviceManager,
               OSVR.ClientKit.ClientContext context,
               OSVR.ClientKit.IInterface <XnaPose> pose)
 {
     this.pose = pose;
     this.graphicsDeviceManager = graphicsDeviceManager;
     this.context = context;
     // TODO: Provide a way to pass in an explicit json value?
     GetDeviceDescription();
 }
            private bool _linkDebug = false; //causes crash on exit if true, only enable for debugging

            //Initialize use of RenderManager via CreateRenderManager call
            public int InitRenderManager()
            {
                if (_linkDebug)
                {
                    //this will cause a crash when exiting the Unity editor or an application
                    //only use for debugging purposes, do not leave on for release.
                    LinkDebug(functionPointer); // Hook our c++ plugin into Unity's console log.
                }
                //create a client context for RenderManager. This context should not be updated from Unity.
                _renderManagerClientContext = new OSVR.ClientKit.ClientContext("com.sensics.rendermanagercontext", 0);
                return(CreateRenderManager(_renderManagerClientContext));
            }
 private void EnsureStarted()
 {
     if (contextObject == null)
     {
         if (0 == AppID.Length)
         {
             Debug.LogError("OSVR ClientKit instance needs AppID set to a reverse-order DNS name! Using dummy name...");
             AppID = "com.osvr.osvr-unity.dummy";
         }
         Debug.Log("[OSVR] Starting with app ID: " + AppID);
         contextObject = new OSVR.ClientKit.ClientContext(AppID, 0);
     }
 }
Esempio n. 7
0
 private void EnsureStarted()
 {
     if (_contextObject == null)
     {
         if (0 == AppID.Length)
         {
             Debug.LogError("OSVR ClientKit instance needs AppID set to a reverse-order DNS name! Using dummy name...");
             AppID = "com.osvr.osvr-unity.dummy";
         }
         Debug.Log("[OSVR] Starting with app ID: " + AppID);
         _contextObject = new OSVR.ClientKit.ClientContext(AppID, 0);
     }
 }
Esempio n. 8
0
 void Stop()
 {
     // Only stop the main instance, since it is the only one that
     // ever actually starts-up.
     if (this == instance)
     {
         if (null != _contextObject)
         {
             Debug.Log("[OSVR-Unity] Shutting down OSVR.");
             _contextObject.Dispose();
             _contextObject = null;
         }
     }
 }
Esempio n. 9
0
            //Call the Unity Rendering Plugin to initialize the RenderManager
            public int CreateRenderManager(OSVR.ClientKit.ClientContext clientContext)
            {
                int result;

                try
                {
                    result = CreateRenderManagerFromUnity(clientContext.ContextHandle);
                }
                catch (DllNotFoundException e)
                {
                    result = -1;
                    Debug.LogError("[OSVR-Unity] Could not load " + e.Message +
                                   "\nosvrUnityRenderingPlugin.dll, or one of its dependencies, is missing from the project " +
                                   "or architecture doesn't match.\n");
                }
                return(result);
            }
Esempio n. 10
0
            private void EnsureStarted()
            {
                if (_contextObject == null)
                {
                    if (0 == AppID.Length)
                    {
                        Debug.LogError("OSVR ClientKit instance needs AppID set to a reverse-order DNS name! Using dummy name...");
                        AppID = "com.osvr.osvr-unity.dummy";
                    }
                    Debug.Log("[OSVR] Starting with app ID: " + AppID);
                    _contextObject = new OSVR.ClientKit.ClientContext(AppID, 0);
                }

                //check if the server is running
                if (!_contextObject.CheckStatus())
                {
                    Debug.LogError("OSVR Server not detected. Start OSVR Server and restart the application.");
                }
            }
Esempio n. 11
0
            private void EnsureStarted()
            {
                if (_contextObject == null)
                {
                    if (0 == AppID.Length)
                    {
                        Debug.LogError("OSVR ClientKit instance needs AppID set to a reverse-order DNS name! Using dummy name...");
                        AppID = "com.osvr.osvr-unity.dummy";
                    }
                    Debug.Log("[OSVR] Starting with app ID: " + AppID);
                    _contextObject = new OSVR.ClientKit.ClientContext(AppID, 0);
                }

                //check if the server is running
                if (!_contextObject.CheckStatus())
                {
                    Debug.LogError("OSVR Server not detected. Start OSVR Server and restart the application.");
                }
            }
Esempio n. 12
0
            void Stop()
            {
                // Only stop the main instance, since it is the only one that
                // ever actually starts-up.
                if (this == instance)
                {
                    if (null != _contextObject)
                    {
                        Debug.Log("[OSVR-Unity] Shutting down OSVR.");
                        _contextObject.Dispose();
                        _contextObject = null;
#if UNITY_STANDALONE_WIN || UNITY_ANDROID
                        if (_serverAutoStarter != null)
                        {
                            _serverAutoStarter.Dispose();
                            _serverAutoStarter = null;
                        }
#endif
                    }
                }
            }
Esempio n. 13
0
            private void EnsureStarted()
            {
                if (!enabled)
                    return;

                if (contextObject == null)
                {
                    if (0 == AppID.Length)
                    {
                        Debug.LogError("OSVR ClientKit instance needs AppID set to a reverse-order DNS name! Using dummy name...");
                        AppID = "org.opengoggles.osvr-unity.dummy";
                    }
					Debug.Log("[OSVR] Starting with app ID: " + AppID + " and hostName: " + hostName);

					if (hostName != "")
					{
						Debug.Log("[OSVR] Starting with app ID: " + AppID + " and hostName2: " + hostName);
						contextObject = new OSVR.ClientKit.ClientContext(AppID, hostName, 0);
					}
					else
	                    contextObject = new OSVR.ClientKit.ClientContext(AppID, 0);
                }
            }
Esempio n. 14
0
 void Stop()
 {
     if (null != _contextObject)
     {
         Debug.Log("Shutting down OSVR.");
         _contextObject.Dispose();
         _contextObject = null;
     }
 }
Esempio n. 15
0
 void Stop()
 {
     // Only stop the main instance, since it is the only one that
     // ever actually starts-up.
     if (this == instance)
     {
         if (null != _contextObject)
         {
             Debug.Log("[OSVR-Unity] Shutting down OSVR.");
             _contextObject.Dispose();
             _contextObject = null;
         }
     }
 }
Esempio n. 16
0
 //Shutdown RenderManager and Dispose of the ClientContext we created for it
 public void ExitRenderManager()
 {
     ShutdownRenderManager();
     if (null != _renderManagerClientContext)
     {
         _renderManagerClientContext.Dispose();
         _renderManagerClientContext = null;
     }
 }
Esempio n. 17
0
            private bool _linkDebug = false; //causes crash on exit if true, only enable for debugging

            //Initialize use of RenderManager via CreateRenderManager call
            public int InitRenderManager()
            {
                if (_linkDebug)
                {
                    //this will cause a crash when exiting the Unity editor or an application
                    //only use for debugging purposes, do not leave on for release.
                    LinkDebug(functionPointer); // Hook our c++ plugin into Unity's console log.
                }
                //create a client context for RenderManager. This context should not be updated from Unity.
                _renderManagerClientContext = new OSVR.ClientKit.ClientContext("com.sensics.rendermanagercontext", 0);
                return CreateRenderManager(_renderManagerClientContext);
            }
Esempio n. 18
0
            void Stop()
			{
				if (_RunningThread != null)
				{
					Debug.Log("Stopping thread.");
					_RunningThread.Abort();
					_RunningThread.Join();
					Debug.Log("Thread is dead.");
					_RunningThread = null;
				}

                if (null != contextObject)
                {
                    Debug.Log("Shutting down OSVR.");
                    contextObject.Dispose();
                    contextObject = null;
                }
            }
 //Call the Unity Rendering Plugin to initialize the RenderManager
 public int CreateRenderManager(OSVR.ClientKit.ClientContext clientContext)
 {
     return(CreateRenderManagerFromUnity(clientContext.ContextHandle));
 }
Esempio n. 20
0
            private void EnsureStarted()
            {
                if (!_dllFixed)
                {
                    DLLSearchPathFixer.fix();
                    _dllFixed = true;
                }

                if (_contextObject == null)
                {
                    if (0 == AppID.Length)
                    {
                        Debug.LogError("[OSVR-Unity] ClientKit instance needs AppID set to a reverse-order DNS name! Using dummy name...");
                        AppID = "com.osvr.osvr-unity.dummy";
                    }
                    Debug.Log("[OSVR-Unity] Starting with app ID: " + AppID);
                    _contextObject = new OSVR.ClientKit.ClientContext(AppID, 0);
                }

                //check if the server is running
                if (!_contextObject.CheckStatus())
                {
                    if(!_osvrServerError)
                    {
                        _osvrServerError = true;
                        Debug.LogError("[OSVR-Unity] OSVR Server not detected. Start OSVR Server and restart the application.");
                    }
                }
                else if(_osvrServerError)
                {
                    Debug.Log("[OSVR-Unity] OSVR Server connection established. You can ignore previous errors about the server not being detected.");
                    _osvrServerError = false;
                }
            }