public static int EnableDepthProcess(bool active) { //Todo : Check module link status. //int result = ViveSR_Framework.ChangeModuleLinkStatus(ViveSR_Framework.MODULE_ID_SEETHROUGH, ViveSR_Framework.MODULE_ID_DEPTH, active ? (int)WorkLinkMethod.ACTIVE : (int)WorkLinkMethod.NONE); //if (result == (int)Error.WORK) DepthProcessing = active; //return result; int result = (int)Error.FAILED; if (active) { SRWorkModule_API.SetSkipVGAProcess(false); result = SRWorkModule_API.LinkModule((int)ModuleType.SEETHROUGH, (int)ModuleType.DEPTH); if (result == (int)Error.WORK) { result = SRWorkModule_API.TurnOnUndistortDataToDepth(); DepthProcessing = true; } else { DepthProcessing = false; } } else { result = SRWorkModule_API.UnlinkModule((int)ModuleType.SEETHROUGH, (int)ModuleType.DEPTH); if (result == (int)Error.WORK) { result = SRWorkModule_API.TurnOffUndistortDataToDepth(); DepthProcessing = false; } } return(result); }