private bool UpdateRuntimeParameter()
        {
            bool result = true;
            int  ret    = (int)Error.FAILED;

            // check live mesh display mode
            if (ViveSR_SceneUnderstanding.IsEnabledSceneUnderstandingView || ViveSR_RigidReconstruction.IsDuringScannedMeshPreview)
            {
                LiveMeshDisplayMode = ReconstructionDisplayMode.ADAPTIVE_MESH; //support only in this mode
            }
            // update live mesh display mode
            if ((int)LiveMeshDisplayMode != LastLiveMeshDisplayMode)
            {
                HideAllLiveMeshes();
                result = SetMeshDisplayMode(LiveMeshDisplayMode) && result;
                LastLiveMeshDisplayMode = (int)LiveMeshDisplayMode;
                // refresh rate
                SRWorkModule_API.SetReconstructionParameterInt((int)ReconstructionParam.MESH_REFRESH_INTERVAL, RefreshIntervalMS);

                // full scene quality
                if (LiveMeshDisplayMode == ReconstructionDisplayMode.FULL_SCENE)
                {
                    ret = SRWorkModule_API.SetReconstructionParameterInt((int)(ReconstructionParam.CONFIG_QUALITY), (int)FullSceneQuality);
                    LiveMeshMaterial.SetFloat("_PointSizeScaler", (FullSceneQuality == ReconstructionQuality.LOW) ? 1.2f : 0.8f);
                    result = result && (ret == (int)Error.WORK);
                }
                // update live adaptive param
                if (LiveMeshDisplayMode == ReconstructionDisplayMode.ADAPTIVE_MESH)
                {
                    ret    = SRWorkModule_API.SetReconstructionParameterFloat((int)ReconstructionParam.ADAPTIVE_MAX_GRID, ViveSR_RigidReconstruction.LiveAdaptiveMaxGridSize * 0.01f); // cm to m
                    result = result && (ret == (int)Error.WORK);
                    ret    = SRWorkModule_API.SetReconstructionParameterFloat((int)ReconstructionParam.ADAPTIVE_MIN_GRID, ViveSR_RigidReconstruction.LiveAdaptiveMinGridSize * 0.01f);
                    result = result && (ret == (int)Error.WORK);
                    ret    = SRWorkModule_API.SetReconstructionParameterFloat((int)ReconstructionParam.ADAPTIVE_ERROR_THRES, ViveSR_RigidReconstruction.LiveAdaptiveErrorThres);
                    result = result && (ret == (int)Error.WORK);
                }
            }

            if (EnableSector != LastEnableSector)
            {
                HideAllLiveMeshes();
                SRWorkModule_API.SetReconstructionParameterBool((int)(ReconstructionParam.ENABLE_FRUSTUM_CULLING), EnableSector);
                SRWorkModule_API.SetReconstructionParameterBool((int)(ReconstructionParam.ENABLE_SECTOR_GROUPER), EnableSector);
                SRWorkModule_API.SetReconstructionParameterFloat((int)(ReconstructionParam.SECTOR_SIZE), SectorSizeInMeter);
                LastEnableSector = EnableSector;
            }

            if (SetWireFrameOpaque != LastSetWireFrameOpaque)
            {
                WireframeMaterial.SetFloat("_Opaque", SetWireFrameOpaque ? 1.0f : 0.0f);
                LastSetWireFrameOpaque = SetWireFrameOpaque;
            }
            return(result);
        }
        // set self-setting to the static param
        public override bool RightBeforeStartModule()
        {
            bool result = ViveSR_RigidReconstruction.InitRigidReconstructionParamFromFile(ConfigFilePath);

            if (!result)
            {
                Debug.Log("[ViveSR] [RigidReconstruction] Set Config By Config File");
            }
            else
            {
                Debug.Log("[ViveSR] [RigidReconstruction] Config File Not Found, Set Config From GameObject");
                SRWorkModule_API.SetReconstructionParameterInt((int)ReconstructionParam.CONFIG_QUALITY, (int)FullSceneQuality);
                //ViveSR_RigidReconstruction.InitRigidReconstructionParam();
            }

            WireframeMaterial.SetFloat("_Opaque", SetWireFrameOpaque ? 1.0f : 0.0f);
            return(true);
        }
 public static void SetLiveMeshExtractionMode(ReconstructionLiveMeshExtractMode mode)
 {
     SRWorkModule_API.SetReconstructionParameterInt((int)(ReconstructionCmd.EXTRACT_VERTEX_NORMAL), (int)mode);
 }