Ejemplo n.º 1
0
        protected virtual int ViveSR_InitialFramework()
        {
            int result = (int)Error.FAILED;

            result = ViveSR_Framework.Initial();
            if (result != (int)Error.WORK)
            {
                Debug.Log("[ViveSR] ViveSR_Framework.Initial() Error " + result);
            }

            result = ViveSR_Framework.SetLogLevel(10);
            if (result != (int)Error.WORK)
            {
                Debug.Log("[ViveSR] ViveSR_Framework.SetLogLevel() Error " + result);
            }

            if (EnableSeeThroughModule)
            {
                result = ViveSR_Framework.CreateModule((int)ModuleType.ENGINE_SEETHROUGH, ref ViveSR_Framework.MODULE_ID_SEETHROUGH);
                if (result != (int)Error.WORK)
                {
                    Debug.LogWarning("[ViveSR] SEETHROUGH CreateModule Error " + result); return(result);
                }
                else
                {
                    EnableUnitySeeThrough = EnableSeeThroughModule;
                }
                if (EnableDepthModule)
                {
                    result = ViveSR_Framework.CreateModule((int)ModuleType.ENGINE_DEPTH, ref ViveSR_Framework.MODULE_ID_DEPTH);
                    if (result != (int)Error.WORK)
                    {
                        Debug.LogWarning("[ViveSR] DEPTH CreateModule Error " + result); return(result);
                    }
                    else
                    {
                        EnableUnityDepth = EnableDepthModule;
                    }
                    if (EnableReconstructionModule)
                    {
                        if (EnableAIModule)
                        {
                            result = ViveSR_Framework.CreateModule((int)ModuleType.ENGINE_AI_VISION, ref ViveSR_Framework.MODULE_ID_AI_VISION);
                            if (result != (int)Error.WORK)
                            {
                                Debug.LogWarning("[ViveSR] AI_SCENE CreateModule Error " + result); return(result);
                            }
                            else
                            {
                                EnableUnityAI = EnableAIModule;
                            }
                        }
                        else
                        {
                            Debug.Log("[ViveSR][Warning] Disable EnableAIModule");
                        }

                        result = ViveSR_Framework.CreateModule((int)ModuleType.ENGINE_RIGID_RECONSTRUCTION, ref ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION);
                        if (result != (int)Error.WORK)
                        {
                            Debug.LogWarning("[ViveSR] RIGID_RECONSTRUCTION CreateModule Error " + result); return(result);
                        }
                        else
                        {
                            EnableUnityReconstruction = EnableReconstructionModule;
                        }
                    }
                    else
                    {
                        Debug.Log("[ViveSR][Warning] Disable ReconstructionModule, EnableAIModule");
                    }
                }
                else
                {
                    Debug.Log("[ViveSR][Warning] Disable DepthModule, ReconstructionModule, EnableAIModule");
                }
            }
            else
            {
                Debug.Log("[ViveSR][Warning] Disable EnableSeeThroughModule, DepthModule, ReconstructionModule, EnableAIModule");
            }

            return(result);
        }