/// <summary> /// Constructs the calibration parameters object. /// No calibration data is guaranteed until the DLL which supplies the data does. /// </summary> private void ConstructNodeLoader(MetaFactoryPackage package) { NodeLoaderModule pars = new NodeLoaderModule(new NodeLoaderApiProcessor()); package.MetaContext.Add(pars); package.EventReceivers.Add(pars); }
private void ImportCameraModel() { NodeLoaderModule pars = metaContext.Get <NodeLoaderModule>(); if (pars.Profiles.ContainsKey(_key)) //check if the dict has the key for the calibration you're after. { Plugin.CalibrationProfile profile = pars.Profiles[_key]; //get the calibration _cameraModel = profile.CameraModel; UpdateParameters(); } }
/// <summary> /// Register when Calibration parameters are ready /// </summary> private void Start() { _poseMatrix = Matrix4x4.identity; //Get the module from the metaContext NodeLoaderModule pars = metaContext.Get <NodeLoaderModule>(); if (pars != null) //the metaContext may not have the module if it was not loaded correctly. { //Will be called when the parameters have been loaded. pars.OnParametersReady += CalibratePose; } }
/// <summary> /// Accesses the context and registers the parameter fetching delegate. /// </summary> private void Start() { SetOpenGLMatrix(); //Get the module from the metaContext NodeLoaderModule pars = metaContext.Get <NodeLoaderModule>(); if (pars != null) //the metaContext may not have the module if it was not loaded correctly. { //Will be called when the parameters have been loaded. pars.OnParametersReady += ImportCameraModel; } }
/// <summary> /// Import the Pose from Calibration Parameters /// </summary> public void CalibratePose() { NodeLoaderModule pars = metaContext.Get <NodeLoaderModule>(); // Remove from event pars.OnParametersReady -= CalibratePose; if (pars.Profiles.ContainsKey(_key)) //check if the dict has the key for the calibration you're after. { Plugin.CalibrationProfile profile = pars.Profiles[_key]; //get the calibration _poseMatrix = profile.RelativePose; UpdatePose(); } }