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 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; } }