void logVP() /// logs name of vps in vpl to text box { for (int i = 0; i < vpl.Size(); i++) { tmpText.text += "\n" + vpl.Get(i).GetName(); } }
private void ResolveMembers() { if (this.mVuforiaBehaviour == null) { this.mVuforiaBehaviour = VuforiaARController.Instance; } if (this.mDigitalEyewearBehaviour == null) { this.mDigitalEyewearBehaviour = DigitalEyewearARController.Instance; } if (this.mDigitalEyewearBehaviour.GetEyewearType() == DigitalEyewearARController.EyewearType.VideoSeeThrough) { if (!this.mFrameWorkHasBeenSetExternally) { this.mStereoFramework = this.mDigitalEyewearBehaviour.GetStereoCameraConfig(); if (!this.mViewerHasBeenSetExternally) { this.mViewerParameters = Device.Instance.GetSelectedViewer(); } if (this.mStereoFramework != DigitalEyewearARController.StereoFramework.Vuforia) { this.mCentralAnchorPoint = this.mDigitalEyewearBehaviour.CentralAnchorPoint; this.mLeftCameraOfExternalSDK = this.mDigitalEyewearBehaviour.PrimaryCamera; this.mRightCameraOfExternalSDK = this.mDigitalEyewearBehaviour.SecondaryCamera; } } } else if (!this.mFrameWorkHasBeenSetExternally) { this.mStereoFramework = DigitalEyewearARController.StereoFramework.Vuforia; this.mDigitalEyewearBehaviour.SetCameraOffset(0.06f); this.mDigitalEyewearBehaviour.SetDistortionRendering(DistortionRenderingMode.SingleTexture); if (!this.mViewerHasBeenSetExternally) { this.mViewerParameters = null; } } if (this.mViewerParameters == null) { IViewerParametersList viewerList = Device.Instance.GetViewerList(); if (viewerList != null) { this.mViewerParameters = viewerList.Get(0); } } if (this.mVideoBackgroundManager == null) { this.mVideoBackgroundManager = VideoBackgroundManager.Instance; } }
private void OnVuforiaInitialized() { this.CorrectCameraConfiguration(); VuforiaManager.Instance.CentralAnchorPoint = this.mCentralAnchorPoint; VuforiaManager.Instance.ParentAnchorPoint = this.mParentAnchorPoint; if (!VuforiaRuntimeUtilities.IsVuforiaEnabled()) { return; } if (this.mEyewearType == DigitalEyewearARController.EyewearType.None || this.mEyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough) { Device.Instance.SetViewerActive(false); } else if (this.mEyewearType == DigitalEyewearARController.EyewearType.VideoSeeThrough) { Device.Instance.SetViewerActive(false); if (this.mStereoFramework == DigitalEyewearARController.StereoFramework.Vuforia) { if (this.mUseCustomViewer) { CustomViewerParameters customViewerParameters = new CustomViewerParameters(this.mCustomViewer.Version, this.mCustomViewer.Name, this.mCustomViewer.Manufacturer); customViewerParameters.SetButtonType(this.mCustomViewer.ButtonType); customViewerParameters.SetScreenToLensDistance(this.mCustomViewer.ScreenToLensDistance); customViewerParameters.SetInterLensDistance(this.mCustomViewer.InterLensDistance); customViewerParameters.SetTrayAlignment(this.mCustomViewer.TrayAlignment); customViewerParameters.SetLensCentreToTrayDistance(this.mCustomViewer.LensCenterToTrayDistance); customViewerParameters.AddDistortionCoefficient(this.mCustomViewer.DistortionCoefficients[0]); customViewerParameters.AddDistortionCoefficient(this.mCustomViewer.DistortionCoefficients[1]); customViewerParameters.SetFieldOfView(this.mCustomViewer.FieldOfView); customViewerParameters.SetContainsMagnet(this.mCustomViewer.ContainsMagnet); Device.Instance.SelectViewer(customViewerParameters); } else { IViewerParametersList viewerList = Device.Instance.GetViewerList(); if (viewerList != null) { IViewerParameters vp = viewerList.Get(this.mViewerName, this.mViewerManufacturer); if (!Device.Instance.SelectViewer(vp)) { Debug.LogWarning("Couldn't select viewer " + this.mViewerName); } } else { Debug.LogWarning("Couldn't select viewer " + this.mViewerName + "(no viewer available)"); } } } else { string text = ""; if (this.mStereoFramework == DigitalEyewearARController.StereoFramework.GearVR) { text = "GEARVR"; } else if (this.mStereoFramework == DigitalEyewearARController.StereoFramework.Cardboard) { text = "CARDBOARD"; } IViewerParametersList viewerList2 = Device.Instance.GetViewerList(); if (viewerList2 != null) { viewerList2.SetSDKFilter(text); if (viewerList2.Size() > 0) { Device.Instance.SelectViewer(viewerList2.Get(0)); } else { Debug.LogWarning(text + " is not supported"); } } } Device.Instance.SetViewerActive(true); } StateManagerImpl stateManagerImpl = (StateManagerImpl)TrackerManager.Instance.GetStateManager(); if (this.mEyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough && this.mSeeThroughConfiguration == DigitalEyewearARController.SeeThroughConfiguration.HoloLens) { stateManagerImpl.SetExtendedTrackingManager(new HoloLensExtendedTrackingManager()); if (Screen.orientation != ScreenOrientation.Landscape) { Screen.autorotateToPortrait = false; Screen.autorotateToPortraitUpsideDown = false; Screen.autorotateToLandscapeLeft = false; Screen.autorotateToLandscapeRight = false; Screen.orientation = ScreenOrientation.Landscape; return; } } else { stateManagerImpl.SetExtendedTrackingManager(new VuforiaExtendedTrackingManager()); this.mSetFocusPlaneAutomatically = false; } }