protected override void Awake() { VuforiaAbstractConfiguration.DigitalEyewearConfiguration digitalEyewear = VuforiaAbstractConfiguration.Instance.DigitalEyewear; this.mCameraOffset = digitalEyewear.CameraOffset; this.mDistortionRenderingMode = digitalEyewear.DistortionRenderingMode; this.mDistortionRenderingLayer = digitalEyewear.DistortionRenderingLayer; this.mEyewearType = digitalEyewear.EyewearType; this.mStereoFramework = digitalEyewear.StereoFramework; this.mSeeThroughConfiguration = digitalEyewear.SeeThroughConfiguration; this.mViewerName = digitalEyewear.ViewerName; this.mViewerManufacturer = digitalEyewear.ViewerManufacturer; this.mUseCustomViewer = digitalEyewear.UseCustomViewer; this.mCustomViewer = digitalEyewear.CustomViewer; if (this.mEyewearType == DigitalEyewearARController.EyewearType.VideoSeeThrough && this.mStereoFramework != DigitalEyewearARController.StereoFramework.Vuforia) { this.mCentralAnchorPoint = base.VuforiaBehaviour.CentralAnchorPoint; this.mParentAnchorPoint = base.VuforiaBehaviour.ParentAnchorPoint; this.mPrimaryCamera = base.VuforiaBehaviour.PrimaryCamera; this.mSecondaryCamera = base.VuforiaBehaviour.SecondaryCamera; } if (this.mEyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough && this.mSeeThroughConfiguration == DigitalEyewearARController.SeeThroughConfiguration.HoloLens) { this.mCentralAnchorPoint = base.VuforiaBehaviour.CentralAnchorPoint; } this.mVuforiaBehaviour = VuforiaARController.Instance; this.mVuforiaBehaviour.RegisterVuforiaInitializedCallback(new Action(this.OnVuforiaInitialized)); this.mVuforiaBehaviour.RegisterVuforiaStartedCallback(new Action(this.OnVuforiaStarted)); if (VuforiaRuntimeUtilities.IsPlayMode() && this.mEyewearType == DigitalEyewearARController.EyewearType.OpticalSeeThrough) { Device.SetPlayModeEyewearDevice(); return; } Device.UnsetDevice(); }
public void ConfigureForDifferentStereoFramework(DigitalEyewearARController.StereoFramework stereoFramework, Transform centralAnchorPoint, Camera leftCamera, Camera RightCamera) { this.mFrameWorkHasBeenSetExternally = true; this.mStereoFramework = stereoFramework; this.mCentralAnchorPoint = centralAnchorPoint; this.mLeftCameraOfExternalSDK = leftCamera; this.mRightCameraOfExternalSDK = RightCamera; }
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; } }
public void SetStereoCameraConfiguration(DigitalEyewearARController.StereoFramework config) { this.mStereoFramework = config; }