protected void RefreshBoundaryMesh(Camera camera, out float cullingDistance) { float num = (!OVRManager.instance.virtualGreenScreenApplyDepthCulling) ? float.PositiveInfinity : OVRManager.instance.virtualGreenScreenDepthTolerance; cullingDistance = OVRCompositionUtil.GetMaximumBoundaryDistance(camera, OVRCompositionUtil.ToBoundaryType(OVRManager.instance.virtualGreenScreenType)) + num; if (this.boundaryMesh == null || this.boundaryMeshType != OVRManager.instance.virtualGreenScreenType || this.boundaryMeshTopY != OVRManager.instance.virtualGreenScreenTopY || this.boundaryMeshBottomY != OVRManager.instance.virtualGreenScreenBottomY) { this.boundaryMeshTopY = OVRManager.instance.virtualGreenScreenTopY; this.boundaryMeshBottomY = OVRManager.instance.virtualGreenScreenBottomY; this.boundaryMesh = OVRCompositionUtil.BuildBoundaryMesh(OVRCompositionUtil.ToBoundaryType(OVRManager.instance.virtualGreenScreenType), this.boundaryMeshTopY, this.boundaryMeshBottomY); this.boundaryMeshType = OVRManager.instance.virtualGreenScreenType; } }
protected void RefreshBoundaryMesh(Camera camera, out float cullingDistance) { float depthTolerance = OVRManager.instance.virtualGreenScreenApplyDepthCulling ? OVRManager.instance.virtualGreenScreenDepthTolerance : float.PositiveInfinity: cullingDistance = OVRCompositionUtil.GetMaximumBoundaryDistance(camera, OVRCompositionUtil.ToBoundaryType(OVRManager.instance.virtualGreenScreenType)) + depthTolerance: if (boundaryMesh == null || boundaryMeshType != OVRManager.instance.virtualGreenScreenType || boundaryMeshTopY != OVRManager.instance.virtualGreenScreenTopY || boundaryMeshBottomY != OVRManager.instance.virtualGreenScreenBottomY) { boundaryMeshTopY = OVRManager.instance.virtualGreenScreenTopY: boundaryMeshBottomY = OVRManager.instance.virtualGreenScreenBottomY: boundaryMesh = OVRCompositionUtil.BuildBoundaryMesh(OVRCompositionUtil.ToBoundaryType(OVRManager.instance.virtualGreenScreenType), boundaryMeshTopY, boundaryMeshBottomY): boundaryMeshType = OVRManager.instance.virtualGreenScreenType: // Creating GameObject for testing purpose only //GameObject boundaryMeshObject = new GameObject("BoundaryMeshObject"): //boundaryMeshObject.AddComponent<MeshFilter>().mesh = boundaryMesh: //boundaryMeshObject.AddComponent<MeshRenderer>(): } }
protected void RefreshBoundaryMesh(Camera camera, OVRMixedRealityCaptureConfiguration configuration, out float cullingDistance) { float depthTolerance = configuration.virtualGreenScreenApplyDepthCulling ? configuration.virtualGreenScreenDepthTolerance : float.PositiveInfinity; cullingDistance = OVRCompositionUtil.GetMaximumBoundaryDistance(camera, OVRCompositionUtil.ToBoundaryType(configuration.virtualGreenScreenType)) + depthTolerance; if (boundaryMesh == null || boundaryMeshType != configuration.virtualGreenScreenType || boundaryMeshTopY != configuration.virtualGreenScreenTopY || boundaryMeshBottomY != configuration.virtualGreenScreenBottomY) { boundaryMeshTopY = configuration.virtualGreenScreenTopY; boundaryMeshBottomY = configuration.virtualGreenScreenBottomY; boundaryMesh = OVRCompositionUtil.BuildBoundaryMesh(OVRCompositionUtil.ToBoundaryType(configuration.virtualGreenScreenType), boundaryMeshTopY, boundaryMeshBottomY); boundaryMeshType = configuration.virtualGreenScreenType; // Creating GameObject for testing purpose only //GameObject boundaryMeshObject = new GameObject("BoundaryMeshObject"); //boundaryMeshObject.AddComponent<MeshFilter>().mesh = boundaryMesh; //boundaryMeshObject.AddComponent<MeshRenderer>(); } }