Ejemplo n.º 1
0
        public static void EnableSceneUnderstanding(bool enable)
        {
            int result;

            result = ViveSR_Framework.SetParameterBool(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.SCENE_UNDERSTANDING_ENABLE, enable);
            if (result == (int)Error.WORK)
            {
                IsEnabledSceneUnderstanding = enable;
            }
            else
            {
                Debug.Log("[ViveSR] [Scene Understanding] Activation/Deactivation failed");
            }

            if (IsEnabledSceneUnderstanding)
            {
                result = ViveSR_Framework.RegisterCallback(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionCallback.SCENE_UNDERSTANDING_PROGRESS, Marshal.GetFunctionPointerForDelegate((ExportProgressCallback)UpdateSceneUnderstandingProgress));
                if (result != (int)Error.WORK)
                {
                    Debug.Log("[ViveSR] [Scene Understanding] Progress listener failed to register");
                }
            }
            else
            {
                EnableSceneUnderstandingView(false);
            }
        }
Ejemplo n.º 2
0
        public static void ExportModel(string filename)
        {
            ExportStage      = 0;
            ExportPercentage = 0;
            IsExportingMesh  = true;

            ViveSR_Framework.SetParameterBool(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.EXPORT_ADAPTIVE_MODEL, ExportAdaptiveMesh);
            if (ExportAdaptiveMesh)
            {
                ViveSR_Framework.SetParameterFloat(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.ADAPTIVE_MAX_GRID, ExportAdaptiveMaxGridSize * 0.01f);   // cm to m
                ViveSR_Framework.SetParameterFloat(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.ADAPTIVE_MIN_GRID, ExportAdaptiveMinGridSize * 0.01f);
                ViveSR_Framework.SetParameterFloat(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.ADAPTIVE_ERROR_THRES, ExportAdaptiveErrorThres);
            }
            ViveSR_Framework.RegisterCallback(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionCallback.EXPORT_PROGRESS, Marshal.GetFunctionPointerForDelegate((ExportProgressCallback)UpdateExportProgress));
            ViveSR_Framework.SetCommandString(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)(ReconstructionCmd.EXPORT_MODEL_FOR_UNITY), filename);
        }
Ejemplo n.º 3
0
 public static int RegisterReconstructionCallback()
 {
     UsingCallback = true;
     return(ViveSR_Framework.RegisterCallback(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionCallback.BASIC, Marshal.GetFunctionPointerForDelegate((ViveSR_Framework.CallbackBasic)ReconstructionDataCallback)));
 }
Ejemplo n.º 4
0
        public static int RegisterDepthCallback()
        {
            int result = ViveSR_Framework.RegisterCallback(ViveSR_Framework.MODULE_ID_DEPTH, (int)DepthCallback.BASIC, Marshal.GetFunctionPointerForDelegate((ViveSR_Framework.CallbackBasic)DepthDataCallback));

            return(result);
        }
Ejemplo n.º 5
0
        public static int RegisterUndistortedCallback()
        {
            int result = ViveSR_Framework.RegisterCallback(ViveSR_Framework.MODULE_ID_SEETHROUGH, (int)SeeThroughCallback.BASIC, Marshal.GetFunctionPointerForDelegate((ViveSR_Framework.CallbackBasic)UndistortedDataCallback));

            return(result);
        }