示例#1
0
        private void ApplySettings()
        {
            RotationalDeviceTracker tracker = TrackerManager.Instance.GetTracker <RotationalDeviceTracker>();

            if (tracker != null)
            {
                tracker.SetPosePrediction(this.mPosePrediction);
                tracker.SetModelCorrectionMode(this.mModelCorrectionMode);
                if (this.mModelTransformEnabled)
                {
                    tracker.SetModelCorrectionModeWithTransform(this.mModelCorrectionMode, this.mModelTransform);
                }
            }
        }
示例#2
0
        private void StartDeviceTracker(bool videoBackground, RotationalDeviceTracker.MODEL_CORRECTION_MODE mode)
        {
            RotationalDeviceTracker rotationalDeviceTracker = TrackerManager.Instance.GetTracker <RotationalDeviceTracker>();

            if (this.mStereoFramework != DigitalEyewearARController.StereoFramework.Vuforia)
            {
                if (rotationalDeviceTracker != null && rotationalDeviceTracker.IsActive)
                {
                    rotationalDeviceTracker.Stop();
                    return;
                }
            }
            else
            {
                CameraDevice.CameraDirection  cameraDirection;
                CameraDevice.CameraDeviceMode mode2;
                if (rotationalDeviceTracker == null && CameraDevice.Instance.GetSelectedCameraDirection(out cameraDirection) && CameraDevice.Instance.GetSelectedVideoMode(out mode2))
                {
                    bool expr_54 = CameraDevice.Instance.IsActive();
                    if (expr_54)
                    {
                        CameraDevice.Instance.Stop();
                    }
                    CameraDevice.Instance.Deinit();
                    rotationalDeviceTracker = TrackerManager.Instance.InitTracker <RotationalDeviceTracker>();
                    CameraDevice.Instance.Init(cameraDirection);
                    CameraDevice.Instance.SelectVideoMode(mode2);
                    if (expr_54)
                    {
                        CameraDevice.Instance.Start();
                    }
                }
                if (rotationalDeviceTracker != null)
                {
                    rotationalDeviceTracker.SetPosePrediction(!videoBackground);
                    rotationalDeviceTracker.SetModelCorrectionMode(mode);
                    if (!rotationalDeviceTracker.IsActive)
                    {
                        rotationalDeviceTracker.Start();
                    }
                }
            }
        }